Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
mgramin committed Dec 25, 2024
1 parent 509d292 commit fd5062b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
2 changes: 1 addition & 1 deletion postgres/docker-compose-input-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ version: '3.5'
services:
input_db:
volumes:
- ./pagila-clear-data.sql:/docker-entrypoint-initdb.d/2.sql
- /root/src/tdk-demo/postgres/pagila-clear-data.sql:/docker-entrypoint-initdb.d/2.sql
12 changes: 8 additions & 4 deletions postgres/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,14 @@ services:
-Dspring.main.banner-mode=CONSOLE
-Dspring.banner.location=file:/app/banner.txt
volumes:
- ./${CONFIG_FILE}:/app/config.yaml
- ../banner.txt:/app/banner.txt
- ../logback-lite-executor.xml:/app/logback-lite-executor.xml
- ../film_rating_distributions.csv:/app/film_rating_distributions.csv
# - ./${CONFIG_FILE}:/app/config.yaml
# - ../banner.txt:/app/banner.txt
# - ../logback-lite-executor.xml:/app/logback-lite-executor.xml
# - ../film_rating_distributions.csv:/app/film_rating_distributions.csv
- /root/src/tdk-demo/postgres/config_generation_from_scratch.tdk.yaml:/app/config.yaml
- /root/src/tdk-demo/banner.txt:/app/banner.txt
- /root/src/tdk-demo/logback-lite-executor.xml:/app/logback-lite-executor.xml
- /root/src/tdk-demo/film_rating_distributions.csv:/app/film_rating_distributions.csv
depends_on:
databases:
condition: service_completed_successfully
Expand Down
41 changes: 41 additions & 0 deletions postgres/record_demo_new.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

. /var/tmp/demo-magic.sh -n
DEMO_PROMPT="${GREEN}${CYAN}\W ${COLOR_RESET}"
PROMPT_TIMEOUT=0


export CONFIG_FILE=config_generation_from_scratch.tdk.yaml

cd /var/tmp/tdk-demo/postgres

# Spin up the databases
docker compose \
-f /var/tmp/tdk-demo/postgres/docker-compose.yaml \
-f /var/tmp/tdk-demo/postgres/docker-compose-input-db.yaml \
run databases &> /dev/null

# clear




# Test the input database before the transformation
pe "usql -q pg://postgres:postgres@localhost:6000/postgres -f control_query.sql"

# Run the TDK transformation
pe "docker compose run --rm tdk &> /dev/null"

# Test the output database after the transformation
pe "usql -q pg://postgres:postgres@localhost:6001/postgres -f control_query.sql"



# Shut down the databases
docker \
compose -f /var/tmp/tdk-demo/postgres/docker-compose.yaml \
down &> /dev/null



# docker run --rm -it -u $(id -u):$(id -g) -v $PWD:/data agg generation_from_scratch.cast generation_from_scratch.gif --font-size 26 --no-loop

0 comments on commit fd5062b

Please sign in to comment.