diff --git a/Dockerfile b/Dockerfile index f1238cf..17369b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,4 +55,4 @@ COPY tests/ . ENV PYTHONPATH /app -ENTRYPOINT ["cron", "-f"] +ENTRYPOINT ["/usr/local/bin/luigi"] diff --git a/Makefile b/Makefile index 3baf66f..2c6c263 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,20 @@ build: -t chess-pipeline \ . +setup-postgres: + docker stop postgres || true + docker rm postgres || true + docker volume rm chess-pipeline_postgres_data || true + docker compose up -d postgres + +integration-test: setup-postgres build + docker compose run --rm chess_pipeline \ + --module chess_pipeline \ + CopyGames \ + --player Zhigalko_Sergei \ + --perf-type bullet \ + --local-stockfish + shell: docker run --rm -it --entrypoint=/bin/bash chess-pipeline-dev diff --git a/db/initdb/setup_postgresql.sql b/db/initdb/setup_postgresql.sql index b903550..36ba3eb 100644 --- a/db/initdb/setup_postgresql.sql +++ b/db/initdb/setup_postgresql.sql @@ -29,6 +29,7 @@ alter default privileges in schema public grant select, insert, update, delete, alter default privileges in schema public grant usage on sequences to luigi_user; grant select, insert, update, delete, truncate on all tables in schema public to luigi_user; grant usage on all sequences in schema public to luigi_user; +grant create on schema public to luigi_user; -- grant task history user privileges on task history db grant create, connect on database task_history_db to task_history_user; diff --git a/docker-compose.yml b/docker-compose.yml index 4d3d82b..8eb0443 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,9 +2,12 @@ version: "3" services: chess_pipeline: - image: ghcr.io/guidopetri/chess-pipeline:master + image: chess-pipeline container_name: chess_pipeline restart: no + depends_on: + - luigi_server + - postgres volumes: - chess_pipeline_logs:/logs - .luigi_env:/app/luigi.cfg @@ -13,6 +16,8 @@ services: image: ghcr.io/guidopetri/luigi-server:master container_name: luigi_server restart: always + depends_on: + - postgres ports: - "127.0.0.1:8082:8082" env_file: @@ -33,12 +38,4 @@ services: volumes: chess_pipeline_logs: - driver_opts: - type: none - device: ${HOME}/data/chess_pipeline/logs - o: bind postgres_data: - driver_opts: - type: none - device: ${HOME}/data/postgres - o: bind