From bdfd0061d6ac57f67c0d3946e0dd2c55f32578b1 Mon Sep 17 00:00:00 2001 From: Chris van Run Date: Tue, 29 Oct 2024 16:21:43 +0100 Subject: [PATCH 1/2] Fix some pointers to resources --- grand_challenge_forge/partials/algorithm-template/.gitattributes | 1 - 1 file changed, 1 deletion(-) diff --git a/grand_challenge_forge/partials/algorithm-template/.gitattributes b/grand_challenge_forge/partials/algorithm-template/.gitattributes index ed14e03..c5ae1ed 100644 --- a/grand_challenge_forge/partials/algorithm-template/.gitattributes +++ b/grand_challenge_forge/partials/algorithm-template/.gitattributes @@ -1,4 +1,3 @@ # sh (and their template counter parts) should always be lf their line endings *.sh text=lf eol=lf *.sh.j2 text=lf eol=lf -resources/* filter=lfs diff=lfs merge=lfs -text From f8f54a1b9c68359300265b0ccd43382ee53d4ff6 Mon Sep 17 00:00:00 2001 From: Chris van Run Date: Tue, 29 Oct 2024 16:22:09 +0100 Subject: [PATCH 2/2] Fix permissions setting on test_runs #59 --- .../docker-bash-scripts/do_test_run.sh.j2 | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/grand_challenge_forge/partials/docker-bash-scripts/do_test_run.sh.j2 b/grand_challenge_forge/partials/docker-bash-scripts/do_test_run.sh.j2 index 09c0bc9..1557d79 100755 --- a/grand_challenge_forge/partials/docker-bash-scripts/do_test_run.sh.j2 +++ b/grand_challenge_forge/partials/docker-bash-scripts/do_test_run.sh.j2 @@ -16,6 +16,21 @@ DOCKER_NOOP_VOLUME="${DOCKER_IMAGE_TAG}-volume" INPUT_DIR="${SCRIPT_DIR}/test/input" OUTPUT_DIR="${SCRIPT_DIR}/test/output" +echo "=+= (Re)build the container" +source "${SCRIPT_DIR}/do_build.sh" "$DOCKER_IMAGE_TAG" + +cleanup() { + echo "=+= Cleaning permissions ..." + # Ensure permissions are set correctly on the output + # This allows the host user (e.g. you) to access and handle these files + docker run --rm \ + --quiet \ + --volume "$OUTPUT_DIR":/output \ + --entrypoint /bin/sh \ + $DOCKER_IMAGE_TAG \ + -c "chmod -R -f o+rwX /output/* || true" +} + echo "=+= Cleaning up any earlier output" if [ -d "$OUTPUT_DIR" ]; then @@ -27,10 +42,7 @@ else mkdir -m o+rwx "$OUTPUT_DIR" fi - -echo "=+= (Re)build the container" -source "${SCRIPT_DIR}/do_build.sh" "$DOCKER_IMAGE_TAG" - +trap cleanup EXIT echo "=+= Doing a forward pass" ## Note the extra arguments that are passed here: