Skip to content
Draft
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
2 changes: 1 addition & 1 deletion config/arff-to-pq-converter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ RUN apt update && apt upgrade -y
RUN apt -y install cron
RUN chmod +x /etc/cron.d/openml

RUN crontab -u unprivileged-user /etc/cron.d/openml
RUN crontab -u unprivileged-user /etc/cron.d/openml
2 changes: 1 addition & 1 deletion config/arff-to-pq-converter/config
Original file line number Diff line number Diff line change
@@ -1 +1 @@
server=http://nginx:80/api/v1/xml
server=http://nginx:8000/api/v1/xml
25 changes: 1 addition & 24 deletions config/database/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,7 @@
# Change the filepath of openml.file
# from "https://www.openml.org/data/download/1666876/phpFsFYVN"
# to "http://minio:9000/datasets/0000/0001/phpFsFYVN"
mysql -hdatabase -uroot -pok -e 'UPDATE openml.file SET filepath = CONCAT("http://minio:9000/datasets/0000/", LPAD(id, 4, "0"), "/", SUBSTRING_INDEX(filepath, "/", -1)) WHERE extension="arff";'
mysql -hdatabase -uroot -pok -e 'UPDATE openml.file SET filepath = CONCAT("http://localhost:8000/datasets/0000/", LPAD(id, 4, "0"), "/", SUBSTRING_INDEX(filepath, "/", -1)) WHERE extension="arff";'

# Update openml.expdb.dataset with the same url
mysql -hdatabase -uroot -pok -e 'UPDATE openml_expdb.dataset DS, openml.file FL SET DS.url = FL.filepath WHERE DS.did = FL.id;'

Copy link
Contributor Author

@PGijsbers PGijsbers Jan 30, 2026

Choose a reason for hiding this comment

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

These removed updates are now embedded in the state of the database on the new image





# Create the data_feature_description TABLE. TODO: can we make sure this table exists already?
mysql -hdatabase -uroot -pok -Dopenml_expdb -e 'CREATE TABLE IF NOT EXISTS `data_feature_description` (
`did` int unsigned NOT NULL,
`index` int unsigned NOT NULL,
`uploader` mediumint unsigned NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`description_type` enum("plain", "ontology") NOT NULL,
`value` varchar(256) NOT NULL,
KEY `did` (`did`,`index`),
CONSTRAINT `data_feature_description_ibfk_1` FOREIGN KEY (`did`, `index`) REFERENCES `data_feature` (`did`, `index`) ON DELETE CASCADE ON UPDATE CASCADE
)'

# SET dataset 1 to active (used in unittests java)
mysql -hdatabase -uroot -pok -Dopenml_expdb -e 'INSERT IGNORE INTO dataset_status VALUES (1, "active", "2024-01-01 00:00:00", 1)'
mysql -hdatabase -uroot -pok -Dopenml_expdb -e 'DELETE FROM dataset_status WHERE did = 2 AND status = "deactivated";'

# Temporary fix in case the database missed the kaggle table. The PHP Rest API expects the table to be there, while indexing.
mysql -hdatabase -uroot -pok -Dopenml_expdb -e 'CREATE TABLE IF NOT EXISTS `kaggle` (`dataset_id` int(11) DEFAULT NULL, `kaggle_link` varchar(500) DEFAULT NULL)'
4 changes: 2 additions & 2 deletions config/evaluation-engine/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG=api_key=AD000000000000000000000000000000;server=http://php-api:80/
CONFIG=api_key=abc;server=http://php-api:80/
JAVA=/usr/bin/java
JAR=/usr/local/lib/evaluation-engine.jar
LOG_DIR=/logs
LOG_DIR=/logs
12 changes: 11 additions & 1 deletion config/evaluation-engine/run-cron.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#!/bin/sh

# We need to remove the default 127.0.0.1 localhost map to
# ensure the remap to the static nginx ip address is respected.
# Updating /etc/hosts in place isn't always allowed ("Resource Busy"),
# directly overwriting it instead seems to bypass that protection.
cp /etc/hosts /etc/hosts.new
sed -i '/^127.0.0.1.*localhost/d' /etc/hosts.new
sed -i -E 's/^(::1\t)localhost (.*)$/\1\2/g' /etc/hosts.new
cat /etc/hosts.new > /etc/hosts
rm /etc/hosts.new

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For other containers updating /etc/hosts through configuration was sufficient.
For this one, the pre-existing /etc/hosts took precidence, so it needed to be updated.

printenv | grep -v HOME >> /etc/environment

touch /cron.log
/usr/sbin/crond -l 4 && tail -f /cron.log
/usr/sbin/crond -l 4 && tail -f /cron.log
4 changes: 2 additions & 2 deletions config/nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ FROM nginx:alpine
WORKDIR /etc/nginx
COPY ./nginx.conf ./conf.d/default.conf
COPY ./shared.conf ./shared.conf
EXPOSE 80
EXPOSE 8000
ENTRYPOINT [ "nginx" ]
CMD [ "-g", "daemon off;" ]
CMD [ "-g", "daemon off;" ]
4 changes: 2 additions & 2 deletions config/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


server {
listen 80;
listen 8000;
server_name localhost;
resolver 127.0.0.11;

Expand Down Expand Up @@ -48,4 +48,4 @@ server {
set $upstream_f http://frontend:5000;
proxy_pass $upstream_f/$1$is_args;
}
}
}
7 changes: 4 additions & 3 deletions config/php/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
API_KEY=AD000000000000000000000000000000
BASE_URL=http://php-api:80/
MINIO_URL=http://minio:9000/
BASE_URL=http://localhost:8000/
MINIO_URL=http://localhost:8000/minio/
DB_HOST_OPENML=database:3306
DB_HOST_EXPDB=database:3306
DB_USER_OPENML=root
Expand All @@ -10,4 +10,5 @@ DB_PASS_EXPDB_WRITE=ok
DB_USER_EXPDB_READ=root
DB_PASS_EXPDB_READ=ok
ES_URL=elasticsearch:9200
ES_PASSWORD=default
ES_PASSWORD=default
INDEX_ES_DURING_STARTUP=true
24 changes: 20 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
database:
image: "openml/test-database:20240105"
image: "openml/test-database:v0.1.20260129"
container_name: "openml-test-database"
environment:
MYSQL_ROOT_PASSWORD: ok
Expand Down Expand Up @@ -54,11 +54,15 @@ services:
context: config/nginx
container_name: openml-nginx
ports:
- "8000:80"
- "8000:8000"
networks:
default:
ipv4_address: 172.28.0.2
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the static ip address is required so that we can add entries to /etc/hosts file of other containers, so they contact nginx when they resolve localhost.



php-api:
profiles: ["all", "minio", "rest-api", "frontend", "evaluation-engine"]
image: openml/php-rest-api:v1.2.1
image: openml/php-rest-api:v1.2.4
container_name: "openml-php-rest-api"
ports:
- "8080:80" # also known as /api (nginx)
Expand All @@ -78,6 +82,8 @@ services:
start_interval: 5s
timeout: 3s
interval: 1m
extra_hosts:
- "localhost=172.28.0.2"

email-server:
profiles: ["all", "frontend"]
Expand Down Expand Up @@ -108,7 +114,7 @@ services:

minio:
profiles: ["all", "minio", "evaluation-engine"]
image: openml/test-minio:v0.1.20241110
image: openml/test-minio:v0.1.20260129
container_name: "openml-minio"
ports:
- "9000:9000" # also known as /data (nginx)
Expand All @@ -133,6 +139,8 @@ services:
depends_on:
php-api:
condition: service_healthy
extra_hosts:
- "localhost=172.28.0.2"

croissants:
profiles: ["all"]
Expand All @@ -157,7 +165,15 @@ services:
depends_on:
php-api:
condition: service_healthy
extra_hosts:
- "localhost=172.28.0.2"

networks:
default:
name: openml-services
ipam:
driver: default
config:
- subnet: 172.28.0.0/16
ip_range: 172.28.1.0/24