diff options
Diffstat (limited to 'compile-and-run.sh')
-rwxr-xr-x | compile-and-run.sh | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/compile-and-run.sh b/compile-and-run.sh index 64bacb1..423206e 100755 --- a/compile-and-run.sh +++ b/compile-and-run.sh @@ -2,6 +2,8 @@ source ./functions.sh +unset DOCKER_HOST + if [ "$1" == "" ]; then echo "Parameter 1 is empty" exit 1 @@ -28,7 +30,8 @@ exec_path="$(realpath "$exec_path")" results_path="$(realpath "$results_path")" pushd containers/compiler > /dev/null -compiler_image=$(docker build -q .) || exit 1 +compiler_image="ic$runner_id" +docker build -q -t $compiler_image . || exit 1 catch compiler_stdout compiler_stderr docker run \ --rm \ --network none \ @@ -47,12 +50,13 @@ printf '%s' "$compiler_stdout" > $results_path/c.0 printf '%s' "$compiler_stderr" > $results_path/c.1 if [ $compiler_status -eq 0 ]; then - runner_image=$(\ - docker build \ - --build-arg "EXEC_DIR_HOST=$exec_path_relative" \ - -q \ - -f "containers/runner/Dockerfile" . - ) || exit 1 + runner_image="ir$runner_id" + docker build \ + --build-arg "EXEC_DIR_HOST=$exec_path_relative" \ + -q \ + -t "$runner_image" \ + -f "containers/runner/Dockerfile" . \ + || exit 1 catch runner_stdout runner_stderr timeout 60 docker run \ --rm \ -h "java-runner-$runner_id" \ @@ -60,7 +64,7 @@ if [ $compiler_status -eq 0 ]; then --cpus=0.25 \ --network none \ -e "APPLICATION_NAME=$application_name" \ - $runner_image + "$runner_image" runner_status=$? docker image rm -f $runner_image > /dev/null || exit 1 @@ -68,7 +72,3 @@ if [ $compiler_status -eq 0 ]; then printf '%s' "$runner_stdout" > $results_path/r.0 printf '%s' "$runner_stderr" > $results_path/r.1 fi - -php generate-status-object.php $runner_id - -rm -rf "$runner_dir" |