From 8fde889c8017576d60af1eb5eeec152eadf2d3cf Mon Sep 17 00:00:00 2001 From: Steve C Date: Sun, 5 Jan 2025 15:27:20 -0500 Subject: [PATCH] Docker tweaks --- automation/docker-compose.yml | 10 +++++++++- automation/run.sh | 16 +++++++++++----- automation/runner.sh | 8 -------- 3 files changed, 20 insertions(+), 14 deletions(-) delete mode 100755 automation/runner.sh diff --git a/automation/docker-compose.yml b/automation/docker-compose.yml index d873df8d..5faa3b46 100644 --- a/automation/docker-compose.yml +++ b/automation/docker-compose.yml @@ -7,4 +7,12 @@ services: - ${PWD}:/app mem_limit: 15g stop_signal: SIGINT - command: ['./runner.sh'] + command: > + sh -c " + rm -rf ./output && + mkdir ./output && + uv sync && + uv run grab_rounds.py && + uv run preprocessing.py && + uv run final.py + " diff --git a/automation/run.sh b/automation/run.sh index 10044baa..368ac78e 100755 --- a/automation/run.sh +++ b/automation/run.sh @@ -1,16 +1,22 @@ +# Get the directory of the current script +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +# Change to the script's directory +cd "$DIR" + # Build/run the docker container docker compose run --rm nfc_values # copy file from ./output/javascript.js to ../src/app/constants_logit.js -cp ./output/javascript.js ../src/app/constants_logit.js +cp "$DIR/output/javascript.js" "$DIR/../src/app/constants_logit.js" # stage the changes -git add ./output/ -git add ./raw_json/ -git add ../src/app/constants_logit.js +git add "$DIR/output/" +git add "$DIR/raw_json/" +git add "$DIR/../src/app/constants_logit.js" # check if the files exist before committing or pushing -if [ ! -f ./output/javascript.js ]; then +if [ ! -f "$DIR/output/javascript.js" ]; then exit 1 fi diff --git a/automation/runner.sh b/automation/runner.sh deleted file mode 100755 index a66f2f5b..00000000 --- a/automation/runner.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -e - -rm -rf ./output -mkdir ./output -uv sync -uv run grab_rounds.py -uv run preprocessing.py -uv run final.py