Skip to content

Commit

Permalink
get local dev loop working
Browse files Browse the repository at this point in the history
  • Loading branch information
guidopetri committed Apr 17, 2024
1 parent c0da8be commit 5e5813f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ COPY tests/ .

ENV PYTHONPATH /app

ENTRYPOINT ["cron", "-f"]
ENTRYPOINT ["/usr/local/bin/luigi"]
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions db/initdb/setup_postgresql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 6 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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

0 comments on commit 5e5813f

Please sign in to comment.