-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·38 lines (29 loc) · 1.31 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/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="4g" # Maximum is currently 30g, configurable in your algorithm image settings on grand challenge
docker volume create 3DTeethSeg-output
# Do not change any of the parameters to docker run, these are fixed
docker run --rm \
--memory="${MEM_LIMIT}" \
--memory-swap="${MEM_LIMIT}" \
--network="none" \
--cap-drop="ALL" \
--security-opt="no-new-privileges" \
--shm-size="128m" \
--pids-limit="256" \
-v $SCRIPTPATH/test:/input/ \
-v 3DTeethSeg-output:/output/ \
3dteethseg_processing
#docker run --rm -v 3DTeethSeg-output:/output/ python:3.7-slim cat /output/dental-labels.json | python3 -m json.tool
docker run --rm \
-v 3DTeethSeg-output:/output/ \
-v $SCRIPTPATH/test/:/input/ \
python:3.9-slim python3 -c "import json, sys; f1 = json.load(open('/output/dental-labels.json')); f2 = json.load(open('/input/expected_output.json')); sys.exit(f1 != f2);"
if [ $? -eq 0 ]; then
echo "Tests successfully passed..."
else
echo "Expected output do not correspond to output generated by the container..."
fi
docker volume rm 3DTeethSeg-output