diff --git a/README.md b/README.md index a607142..2f165b4 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,15 @@ docker compose --profile frontend up -d # Frontend, rest-api, elasticsearch and ``` Use the same profile for your `down` command. +The Python REST API is also available in a 'light' mode that allows for database interactions +but does not allow for file uploads/downloads. It has to be started directly (as opposed to +through a profile): +```bash +docker compose up python-rest-api-light -d +docker compose down +``` +While it is up, the API is available under `http://localhost:8082`, e.g., `http://localhost:8082/datasets/1`. + ## Known issues See the Github Issue list for the known issues. diff --git a/docker-compose.yaml b/docker-compose.yaml index f2af39d..2ca78ce 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -85,22 +85,21 @@ services: extra_hosts: - "localhost=172.28.0.2" - # This is the new REST API, which will later replace the PHP REST API - python-api: - profiles: ["all", "rest-api"] + # The Python based REST API is set to replace the PHP based REST API + # The 'light' profile can be used to test most of the REST API + # (everything except file uploads/downloads), but is + # faster to start and requires fewer resources to run. + python-api-light: + # if no profile is set below, it starts on all `compose up` invocations, + # which leads to port conflict if `python-api` is also started. + profiles: ["rest-api-light"] image: openml/rest-api:0.0.1-alpha - container_name: "openml-python-rest-api" + container_name: "openml-python-rest-api-light" ports: - "8082:8000" # or localhost:8000/py with nginx depends_on: database-setup: condition: service_completed_successfully - php-api: - condition: service_healthy # used for serving arff files - minio: - condition: service_started # used for serving parquet files - nginx: - condition: service_started # used for routing to MinIO and PHP REST API volumes: - ./config/python-server/config.toml:/python-api/src/config.toml healthcheck: @@ -110,6 +109,20 @@ services: timeout: 3s interval: 1m + python-api: + profiles: ["all", "rest-api"] + container_name: "openml-python-rest-api" + extends: python-api-light + depends_on: + database-setup: + condition: service_completed_successfully + php-api: + condition: service_healthy # used for serving arff files + minio: + condition: service_started # used for serving parquet files + nginx: + condition: service_started # used for routing to MinIO and PHP REST API + email-server: profiles: ["all", "frontend"] image: foxcpp/maddy:latest @@ -138,7 +151,7 @@ services: condition: service_healthy minio: - profiles: ["all", "minio", "evaluation-engine"] + profiles: ["all", "minio", "rest-api", "evaluation-engine"] image: openml/test-minio:v0.1.20260204 container_name: "openml-minio" ports: