Sign inSign up

openml/php-rest-api

By openml

•Updated about 1 month ago

PHP rest api for OpenML.

Image
0

10K+

openml/php-rest-api repository overview

⁠Running apache php backend locally

In most cases, you probably want to run through docker compose. This file contains instructions for running it on its own.

docker run -p 8001:80 --rm -it openml/php-rest-api

Runs the PHP REST API server and exposes it to http://localhost:8001/. Some BASE_CONFIG.php variables can be overwritten with environment variables, these can be passed in the run command with the -e option, e.g.: -e BASE_URL=http://localhost/. See set_configuration.sh for the variables which can be overwritten out-of-the-box. Alternatively, mount your own BASE_CONFIG.php into the container at /var/www/openml/openml_OS/config/BASE_CONFIG.php. The set_configuration.sh script will only overwrite unset variables. To avoid overwriting altogether, also change the entrypoint: --entrypoint=apache2-foreground.

To connect to a separate container running a MySQL server, they need to be on the same docker network. For both, specify the network with --network NETWORK_NAME, which can be any network you create with docker network create NETWORK_NAME. Assuming a connection to the database can be established, to get a dataset description go to http://127.0.0.1:8001/api/v1/json/data/1. Note that the protocol is http not https.

⁠Build

docker build --tag openml/php-rest-api -f docker/Dockerfile .

⁠Configuration

The following environment variables can be set (see also set_configuration.sh):

NAMEDEFAULTFILENOTE
BASE_URLhttps://test.openml.org/BASE_CONFIG.phpsets BASE_URL
MINIO_URLhttps://openml1.win.tue.nl/BASE_CONFIG.phpsets MINIO_URL
OPENML_PATH/var/www/BASE_CONFIG.phpsets PATH
API_KEYFILL_IN_KEYBASE_CONFIG.phpsets API_KEY
DB_NAME_EXPDBopenml_expdbBASE_CONFIG.phpsets DB_NAME_EXPDB
DB_HOST_EXPDBopenml-test-database:3306BASE_CONFIG.phpsets DB_HOST_EXPDB
DB_USER_EXPDB_READrootBASE_CONFIG.phpsets DB_USER_EXPDB_READ
DB_PASS_EXPDB_READokBASE_CONFIG.phpsets DB_PASS_EXPDB_READ
DB_USER_EXPDB_WRITErootBASE_CONFIG.phpsets DB_USER_EXPDB_WRITE
DB_PASS_EXPDB_WRITEokBASE_CONFIG.phpsets DB_PASS_EXPDB_WRITE
DB_NAME_OPENMLopenmlBASE_CONFIG.phpsets DB_NAME_OPENML
DB_HOST_OPENMLopenml-test-database:3306BASE_CONFIG.phpsets DB_HOST_OPENML
DB_USER_OPENMLrootBASE_CONFIG.phpsets DB_USER_OPENML
DB_PASS_OPENMLokBASE_CONFIG.phpsets DB_PASS_OPENML
ES_URLelasticsearch:9200BASE_CONFIG.phpsets ES_URL
ES_USERNAMEelasticBASE_CONFIG.phpsets ES_USERNAME
ES_PASSWORDdefaultBASE_CONFIG.phpsets ES_PASSWORD
PHP_ENVIRONMENTproductionindex.phpsets the ENVIRONMENT constant
MYSQLND_NET_READ_TIMEOUT600php.inisets mysqlnd.net_read_timeout
INDEX_ES_DURING_STARTUPtrue—if true, deletes and rebuilds all Elasticsearch indices on startup

For information on what these variables do, reference the documentation of the respective files.

Tag summary

Content type

Image

Digest

sha256:434762e33…

Size

460 MB

Last updated

about 1 month ago

docker pull openml/php-rest-api