forked from metrics-lab/SLCN_challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
|
||
docker build -t slcn_algorithm "$SCRIPTPATH" --rm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
./build.sh | ||
|
||
docker save slcn_algorithm | gzip -c > SLCN_algorithm.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
|
||
./build.sh | ||
|
||
VOLUME_SUFFIX=$(dd if=/dev/urandom bs=32 count=1 | md5sum | cut --delimiter=' ' --fields=1) | ||
MEM_LIMIT="16g" # Maximum is currently 30g, configurable in your algorithm image settings on grand challenge | ||
|
||
docker volume create slcn_algorithm-output-$VOLUME_SUFFIX | ||
|
||
# Do not change any of the parameters to docker run, these are fixed | ||
docker run --rm \ | ||
--memory="${MEM_LIMIT}" \ | ||
--memory-swap="${MEM_LIMIT}" \ | ||
--gpus 0 \ | ||
--network="none" \ | ||
--cap-drop="ALL" \ | ||
--security-opt="no-new-privileges" \ | ||
--shm-size="128m" \ | ||
--pids-limit="256" \ | ||
-v $SCRIPTPATH/test/:/input/images/cortical-surface-mesh/ \ | ||
-v slcn_algorithm-output-$VOLUME_SUFFIX:/output/ \ | ||
slcn_algorithm | ||
|
||
docker run --rm \ | ||
-v slcn_algorithm-output-$VOLUME_SUFFIX:/output/ \ | ||
python:3.9-slim cat /output/birth-age.json | python -m json.tool | ||
|
||
docker run --rm \ | ||
-v slcn_algorithm-output-$VOLUME_SUFFIX:/output/ \ | ||
-v $SCRIPTPATH/test/:/input/images/cortical-surface-mesh/ \ | ||
python:3.9-slim python -c "import json, sys; f1 = json.load(open('/output/birth-age.json')); f2 = json.load(open('/input/images/cortical-surface-mesh/expected_output.json')); sys.exit(f1 != f2);" | ||
|
||
if [ $? -eq 0 ]; then | ||
echo "Tests successfully passed..." | ||
else | ||
echo "Expected output was not found..." | ||
fi | ||
|
||
docker volume rm slcn_algorithm-output-$VOLUME_SUFFIX |