Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Comment on lines +62 to +70

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot simply add a profile to the service as it is defined right now, since the python-rest-api service will also get that profile (due to extends) but the other dependencies of the python-rest-api (e.g., php-api) will not have that profile (and should not have the profile, since we don't want to start them).

I think this is perfectly fine, we are probably defining too many profiles in the first place. But if we do want to keep using profiles even for single services, then we could work around that with yaml anchoring, e.g.

 python-api-light:
      profiles: ["rest-api-light"]
  -   image: openml/rest-api:0.0.1-alpha
  +   image: &python-api-image openml/rest-api:0.0.1-alpha    # define anchor

and then

   python-api:
      profiles: ["all", "rest-api"]            # only its own profiles, not merged
  -   extends: python-api-light
  +   image: *python-api-image                 # copied from python-api-light


## Known issues
See the Github Issue list for the known issues.
Expand Down
35 changes: 24 additions & 11 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines -102 to -103

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure whether to keep the nginx around for the 'light' version. For now, I figured to keep it truly minimal. It's easy enough to specify docker compose up python-api-light nginx if you do want the routing to be available.

volumes:
- ./config/python-server/config.toml:/python-api/src/config.toml
healthcheck:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down