From af0c512a526f01bea5601de73d5b55fb90d5bfc4 Mon Sep 17 00:00:00 2001 From: PGijsbers Date: Fri, 6 Feb 2026 11:16:04 +0200 Subject: [PATCH 1/4] Add a service for Python based REST API --- config/python/config.toml | 21 +++++++++++++++++++++ docker-compose.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 config/python/config.toml diff --git a/config/python/config.toml b/config/python/config.toml new file mode 100644 index 0000000..9f0e97a --- /dev/null +++ b/config/python/config.toml @@ -0,0 +1,21 @@ +arff_base_url="http://localhost:8000" +minio_base_url="http://localhost:8000/minio" + +[fastapi] +root_path="" + +[databases.defaults] +host="openml-test-database" +port="3306" +# SQLAlchemy `dialect` and `driver`: https://docs.sqlalchemy.org/en/20/dialects/index.html +drivername="mysql" + +[databases.expdb] +database="openml_expdb" + +[databases.openml] +database="openml" + +[routing] +minio_url="http://localhost:8000/minio/" +server_url="http://localhost:8000/" diff --git a/docker-compose.yaml b/docker-compose.yaml index e4e9507..ec6625e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -79,6 +79,32 @@ services: timeout: 3s interval: 1m + python-api: + profiles: ["all", "rest-api"] + image: openml/rest-api:v0.0.0 + container_name: "openml-python-rest-api" + ports: + - "8082:8000" # currently not reachable through nginx + depends_on: + database-setup: + condition: service_completed_successfully + php-api: + condition: service_healthy # used for servering arff files + minio: + condition: service_started # used for servering parquet files + nginx: + condition: service_started # used for routing to MinIO and PHP REST API + volumes: + - ./config/python/config.toml:/python-api/src/config.toml + #- ${PHP_CODE_DIR:-./config/emptydir}:${PHP_CODE_VAR_WWW_OPENML:-/tmp/unused} + # - ./logs/python:/var/www/openml/logs + healthcheck: + test: curl 127.0.0.1:8000/datasets/1 | grep -e "anneal" + start_period: 1m + start_interval: 5s + timeout: 3s + interval: 1m + email-server: profiles: ["all", "frontend"] image: foxcpp/maddy:latest From 355657858cfb13bdb55af536776c949ebda0f60a Mon Sep 17 00:00:00 2001 From: PGijsbers Date: Fri, 6 Feb 2026 11:18:20 +0200 Subject: [PATCH 2/4] Add router for Python API --- config/nginx/nginx.conf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/nginx/nginx.conf b/config/nginx/nginx.conf index 5316b1f..0e31b4b 100644 --- a/config/nginx/nginx.conf +++ b/config/nginx/nginx.conf @@ -13,6 +13,12 @@ server { proxy_pass $upstream_es/$1$is_args; } + location ~ ^/py(?:\/(.*))?$ { + include /etc/nginx/shared.conf; + set $upstream_py http://python-api:8000; + proxy_pass $upstream_py/$1$is_args; + } + location ~ ^/api_splits/(.*)$ { include /etc/nginx/shared.conf; set $upstream_api http://php-api:80/api_splits; @@ -48,4 +54,4 @@ server { set $upstream_f http://frontend:5000; proxy_pass $upstream_f/$1$is_args; } -} \ No newline at end of file +} From 99fc1c3c396b1a6f2fce421bd77eca693228e3f5 Mon Sep 17 00:00:00 2001 From: PGijsbers Date: Fri, 6 Feb 2026 11:20:32 +0200 Subject: [PATCH 3/4] Update comments, bump release to v0.0.1-alpha --- docker-compose.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index ec6625e..22511ff 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -81,10 +81,10 @@ services: python-api: profiles: ["all", "rest-api"] - image: openml/rest-api:v0.0.0 + image: openml/rest-api:0.0.1-alpha container_name: "openml-python-rest-api" ports: - - "8082:8000" # currently not reachable through nginx + - "8082:8000" # or localhost:8000/py with nginx depends_on: database-setup: condition: service_completed_successfully @@ -96,8 +96,6 @@ services: condition: service_started # used for routing to MinIO and PHP REST API volumes: - ./config/python/config.toml:/python-api/src/config.toml - #- ${PHP_CODE_DIR:-./config/emptydir}:${PHP_CODE_VAR_WWW_OPENML:-/tmp/unused} - # - ./logs/python:/var/www/openml/logs healthcheck: test: curl 127.0.0.1:8000/datasets/1 | grep -e "anneal" start_period: 1m From 464638b949bbd49fd2abe076d2d65633ab8afd18 Mon Sep 17 00:00:00 2001 From: PGijsbers Date: Sun, 15 Feb 2026 19:08:32 +0100 Subject: [PATCH 4/4] Dedicated server config directory, fix minor typos --- config/{python => python-server}/config.toml | 0 docker-compose.yaml | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) rename config/{python => python-server}/config.toml (100%) diff --git a/config/python/config.toml b/config/python-server/config.toml similarity index 100% rename from config/python/config.toml rename to config/python-server/config.toml diff --git a/docker-compose.yaml b/docker-compose.yaml index 22511ff..ea50969 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -79,6 +79,7 @@ services: timeout: 3s interval: 1m + # This is the new REST API, which will later replace the PHP REST API python-api: profiles: ["all", "rest-api"] image: openml/rest-api:0.0.1-alpha @@ -89,13 +90,13 @@ services: database-setup: condition: service_completed_successfully php-api: - condition: service_healthy # used for servering arff files + condition: service_healthy # used for serving arff files minio: - condition: service_started # used for servering parquet files + condition: service_started # used for serving parquet files nginx: condition: service_started # used for routing to MinIO and PHP REST API volumes: - - ./config/python/config.toml:/python-api/src/config.toml + - ./config/python-server/config.toml:/python-api/src/config.toml healthcheck: test: curl 127.0.0.1:8000/datasets/1 | grep -e "anneal" start_period: 1m