-
-
Notifications
You must be signed in to change notification settings - Fork 5
Split up Python API in light and full service #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
PGijsbers
wants to merge
3
commits into
main
Choose a base branch
from
update-python-api-service
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+33
−11
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| 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: | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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-apiservice will also get that profile (due toextends) but the other dependencies of thepython-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.
and then