aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/dist_test
diff options
context:
space:
mode:
authorGravatar Amit Patankar <amitpatankar@google.com>2018-02-05 16:08:16 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-02-05 16:11:59 -0800
commit0375ffcf83e16c3d6818fa67c9c13de810c1dacf (patch)
treec34454409056cd1dfc1ca8f356b99fc12b641b83 /tensorflow/tools/dist_test
parentaea9333d5bee349f1daff0c551a38b8bf73beffa (diff)
Add filepaths to test_local support.
PiperOrigin-RevId: 184602010
Diffstat (limited to 'tensorflow/tools/dist_test')
-rwxr-xr-xtensorflow/tools/dist_test/local_test.sh33
1 files changed, 19 insertions, 14 deletions
diff --git a/tensorflow/tools/dist_test/local_test.sh b/tensorflow/tools/dist_test/local_test.sh
index 7d7f92d246..435f9d0dc9 100755
--- a/tensorflow/tools/dist_test/local_test.sh
+++ b/tensorflow/tools/dist_test/local_test.sh
@@ -24,19 +24,20 @@
# 3) Call a script to launch a k8s TensorFlow GRPC cluster inside the container
# and run the distributed test suite.
#
-# Usage: local_test.sh <whl_url>
+# Usage: local_test.sh <whl_file_location>
# [--leave_container_running]
# [--model_name <MODEL_NAME>]
# [--num_workers <NUM_WORKERS>]
# [--num_parameter_servers <NUM_PARAMETER_SERVERS>]
# [--sync_replicas]
#
-# E.g., local_test.sh <whl_url> --model_name CENSUS_WIDENDEEP
-# local_test.sh <whl_url> --num_workers 3 --num_parameter_servers 3
+# E.g., local_test.sh <whl_file_location> --model_name CENSUS_WIDENDEEP
+# local_test.sh <whl_file_location> --num_workers 3 --num_parameter_servers 3
#
# Arguments:
-# <whl_url>
-# Specify custom TensorFlow whl file URL to install in the test Docker image.
+# whl_file_location: URL from which the TensorFlow whl file will be acquired.
+# E.g.: https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-0.11.0rc1-cp27-none-linux_x86_64.whl
+# E.g.: /path/to/folder/tensorflow-0.11.0rc1-cp27-none-linux_x86_64.whl
#
# --leave_container_running: Do not stop the docker-in-docker container after
# the termination of the tests, e.g., for debugging
@@ -81,9 +82,9 @@ NUM_WORKERS=2
NUM_PARAMETER_SERVERS=2
SYNC_REPLICAS_FLAG=""
-WHL_URL=${1}
-if [[ -z "${WHL_URL}" ]]; then
- die "whl file URL is not specified"
+WHL_FILE_LOCATION=${1}
+if [[ -z "${WHL_FILE_LOCATION}" ]]; then
+ die "whl file location is not specified"
fi
while true; do
@@ -98,8 +99,8 @@ while true; do
NUM_PARAMETER_SERVERS=$2
elif [[ $1 == "--sync_replicas" ]]; then
SYNC_REPLICAS_FLAG="--sync_replicas"
- elif [[ $1 == "--whl_url" ]]; then
- WHL_URL=$2
+ elif [[ $1 == "--WHL_FILE_LOCATION" ]]; then
+ WHL_FILE_LOCATION=$2
fi
shift
@@ -130,15 +131,19 @@ fi
# Create docker build context directory.
BUILD_DIR=$(mktemp -d)
echo ""
-echo "Using whl file URL: ${WHL_URL}"
+echo "Using whl file location: ${WHL_FILE_LOCATION}"
echo "Building in temporary directory: ${BUILD_DIR}"
cp -r ${DIR}/* "${BUILD_DIR}"/ || \
die "Failed to copy files to ${BUILD_DIR}"
-# Download whl file into the build context directory.
-wget -P "${BUILD_DIR}" ${WHL_URL} || \
- die "Failed to download tensorflow whl file from URL: ${WHL_URL}"
+if [[ $WHL_FILE_LOCATION =~ 'http://' || $WHL_FILE_LOCATION =~ 'https://' ]]; then
+ # Download whl file into the build context directory.
+ wget -P "${BUILD_DIR}" "${WHL_FILE_LOCATION}" || \
+ die "Failed to download tensorflow whl file from URL: ${WHL_FILE_LOCATION}"
+else
+ cp "${WHL_FILE_LOCATION}" "${BUILD_DIR}"
+fi
# Build docker image for test.
docker build ${NO_CACHE_FLAG} -t ${DOCKER_IMG_NAME} \