diff --git a/config/nginx/nginx.conf b/config/nginx/nginx.conf index 5316b1f..0e31b4b 100644 --- a/config/nginx/nginx.conf +++ b/config/nginx/nginx.conf @@ -13,6 +13,12 @@ server { proxy_pass $upstream_es/$1$is_args; } + location ~ ^/py(?:\/(.*))?$ { + include /etc/nginx/shared.conf; + set $upstream_py http://python-api:8000; + proxy_pass $upstream_py/$1$is_args; + } + location ~ ^/api_splits/(.*)$ { include /etc/nginx/shared.conf; set $upstream_api http://php-api:80/api_splits; @@ -48,4 +54,4 @@ server { set $upstream_f http://frontend:5000; proxy_pass $upstream_f/$1$is_args; } -} \ No newline at end of file +} diff --git a/config/python-server/config.toml b/config/python-server/config.toml new file mode 100644 index 0000000..9f0e97a --- /dev/null +++ b/config/python-server/config.toml @@ -0,0 +1,21 @@ +arff_base_url="http://localhost:8000" +minio_base_url="http://localhost:8000/minio" + +[fastapi] +root_path="" + +[databases.defaults] +host="openml-test-database" +port="3306" +# SQLAlchemy `dialect` and `driver`: https://docs.sqlalchemy.org/en/20/dialects/index.html +drivername="mysql" + +[databases.expdb] +database="openml_expdb" + +[databases.openml] +database="openml" + +[routing] +minio_url="http://localhost:8000/minio/" +server_url="http://localhost:8000/" diff --git a/docker-compose.yaml b/docker-compose.yaml index e4e9507..ea50969 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -79,6 +79,31 @@ services: timeout: 3s interval: 1m + # This is the new REST API, which will later replace the PHP REST API + python-api: + profiles: ["all", "rest-api"] + image: openml/rest-api:0.0.1-alpha + container_name: "openml-python-rest-api" + 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: + test: curl 127.0.0.1:8000/datasets/1 | grep -e "anneal" + start_period: 1m + start_interval: 5s + timeout: 3s + interval: 1m + email-server: profiles: ["all", "frontend"] image: foxcpp/maddy:latest