Skip to content
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ You can use different profiles:
- `"elasticsearch"`: databases + nginx + elasticsearch
- `"rest-api"`: databases + nginx + elasticsearch + REST API
- `"frontend"`: databases + nginx + elasticsearch + REST API + frontend + email-server
- `"minio"`: databases + nginx + elasticsearch + REST APP + MinIO + parquet and croissant conversion
- `"evaluation-engine"`: databases + nginx + elastichsearc + REST API + MinIO + evaluation engine
- `"minio"`: databases + nginx + elasticsearch + REST APP + MinIO + parquet and croissant conversion
- `"evaluation-engine"`: databases + nginx + elasticsearch + REST API + MinIO + evaluation engine
- `"all"`: everything

Usage examples:
Expand All @@ -68,6 +68,11 @@ docker compose down
```
While it is up, the API is available under `http://localhost:8082`, e.g., `http://localhost:8082/datasets/1`.

Similarly, you can start the php-api directly without a profile to start it without elasticsearch:
```bash
docker compose up php-api -d
docker compose down
```

## Known issues
See the Github Issue list for the known issues.
Expand Down Expand Up @@ -128,10 +133,6 @@ To test if dataset processing works, we can then run:
```
where `DATASET_ID` is replaced by the identifier printed in the previous step.

It is also possible to run the php-api without elasticsearch, this is useful to avoid the considerable overhead of starting the elasticsearch container and creating indices.
First, ensure that `INDEX_ES_DURING_STARTUP=false` in `config/php/.env` otherwise it will try to connect to elasticsearch and fail.
Then explicitly specify the compose file so that the `docker-compose.override.yaml` file will be ignored: `docker compose -f docker-compose.yaml php-api -d`.

### PHP, Parquet and Croissant converter
If you want to do local development on containers that are part of the docker-compose, you want those containers to change based on your code. You should have the relevant code somewhere on your system. You will need to tell the docker-compose where to find it. You can do so by setting environment variables.

Expand Down
3 changes: 2 additions & 1 deletion config/php/.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ DB_USER_EXPDB_READ=root
DB_PASS_EXPDB_READ=ok
ES_URL=elasticsearch:9200
ES_PASSWORD=default
INDEX_ES_DURING_STARTUP=true
INDEX_ES=false
ES_ENABLED=false
Comment thread
PGijsbers marked this conversation as resolved.
10 changes: 0 additions & 10 deletions docker-compose.override.yaml

This file was deleted.

24 changes: 20 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
services:
x-php-image: &php-image
image: openml/php-rest-api:v1.3.1
env_file: config/php/.env

database:
image: "openml/test-database:v0.1.20260204"
container_name: "openml-test-database"
Expand Down Expand Up @@ -48,6 +52,19 @@ services:
cpus: '0.2'
memory: 250M

elasticsearch-indexer:
profiles: ["all", "minio", "rest-api", "frontend", "elasticsearch", "evaluation-engine"]
<<: *php-image
container_name: "openml-elasticsearch-indexer"
environment:
ES_ENABLED: true
INDEX_ES: true
depends_on:
elasticsearch:
condition: service_healthy
database-setup:
condition: service_completed_successfully

nginx:
profiles: ["all", "minio", "rest-api", "frontend", "elasticsearch", "evaluation-engine"]
build:
Expand All @@ -62,13 +79,10 @@ services:

php-api:
profiles: ["all", "minio", "rest-api", "frontend", "evaluation-engine"]
image: openml/php-rest-api:v1.2.10
<<: *php-image
container_name: "openml-php-rest-api"
ports:
- "8080:80" # also known as /api (nginx)
env_file: config/php/.env
environment:
ES_ENABLED: false
depends_on:
database-setup:
condition: service_completed_successfully
Expand Down Expand Up @@ -149,6 +163,8 @@ services:
depends_on:
php-api:
condition: service_healthy
elasticsearch-indexer:
condition: service_completed_successfully

minio:
profiles: ["all", "minio", "rest-api", "evaluation-engine"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/wait_for_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ELAPSED=0
while [ "$ELAPSED" -lt "$TIMEOUT" ]; do
RESPONSE=$(curl -sS "http://localhost:8000/api/v1/xml/run/${RUN_ID}")

if echo "$RESPONSE" | grep -q "area_under_roc_curve"; then

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.

See CI failure. It looks like there may have been a long response from the REST API so that grep exited before echo is finished (similar to this). The use of a here-string should alleviate this.

if grep -q "area_under_roc_curve" <<< "$RESPONSE"; then
echo "Run $RUN_ID has evaluations."
exit 0
fi
Expand Down
Loading