onnxruntime/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest-docker.sh
shahasad ab730cc58d
passed the OnnxRuntimeBuildDirectory to the docker for the dotnet linux test (#381)
* passed the OnnxRuntimeBuildDirectory to the docker

* removed the requirement for the docker host to set the env var

* set the env var to the path where the build dir is mounted in the container
2019-01-25 15:52:50 -08:00

44 lines
No EOL
1.2 KiB
Bash
Executable file

#!/bin/bash
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# build docker image for CPU
#TODO: Get this working, not tested yet
SOURCE_ROOT=$1
BUILD_DIR=$2
NUGET_REPO_DIRNAME=$3 # path relative to BUILD_DIR
IMAGE="ubuntu16.04"
PYTHON_VER=3.5
OldDir=$(pwd)
cd $SOURCE_ROOT/tools/ci_build/github/linux/docker
docker build -t "onnxruntime-$IMAGE" --build-arg OS_VERSION=16.04 --build-arg PYTHON_VERSION=${PYTHON_VER} -f Dockerfile.ubuntu .
docker rm -f "onnxruntime-cpu" || true
set +e
docker run -h $HOSTNAME \
--rm \
--name "onnxruntime-cpu" \
--volume "$SOURCE_ROOT:/onnxruntime_src" \
--volume "$BUILD_DIR:/home/onnxruntimedev" \
--volume "$HOME/.cache/onnxruntime:/home/onnxruntimedev/.cache/onnxruntime" \
"onnxruntime-$IMAGE" \
-e "OnnxRuntimeBuildDirectory=/home/onnxruntimedev" \
/bin/bash /onnxruntime_src/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh \
/home/onnxruntimedev/$NUGET_REPO_DIRNAME /onnxruntime_src /home/onnxruntimedev $TestDataUrl $TestDataChecksum &
wait -n
EXIT_CODE=$?
set -e
exit $EXIT_CODE
cd $OldDir