diff options
author | Andrew Harp <andrewharp@google.com> | 2016-12-08 20:05:49 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-12-08 20:21:45 -0800 |
commit | 1cb96893a64f59b7265f9def9968f7bed1e57662 (patch) | |
tree | 0e6d595a0806028f5f92e64c84342ae9659ca108 /tensorflow/tools/gcs_test | |
parent | 90b72f4b2f07a0126efb110d8d4cc96386fcc968 (diff) |
Merge changes from github.
Additionally:
- change single quotes to double quotes to make path rewriting easier
- guard windows lib reference with PLATFORM_WINDOWS
- fixed failing kmeans test
Change: 141515942
Diffstat (limited to 'tensorflow/tools/gcs_test')
-rw-r--r-- | tensorflow/tools/gcs_test/Dockerfile | 6 | ||||
-rwxr-xr-x | tensorflow/tools/gcs_test/gcs_smoke.sh | 33 |
2 files changed, 30 insertions, 9 deletions
diff --git a/tensorflow/tools/gcs_test/Dockerfile b/tensorflow/tools/gcs_test/Dockerfile index a9db7ce9b0..1df0069272 100644 --- a/tensorflow/tools/gcs_test/Dockerfile +++ b/tensorflow/tools/gcs_test/Dockerfile @@ -15,9 +15,9 @@ RUN curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/install_google_clou RUN chmod +x install_google_cloud_sdk.bash RUN ./install_google_cloud_sdk.bash --disable-prompts --install-dir=/var/gcloud -# Install nightly TensorFlow pip -RUN pip install \ - 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.0-cp27-none-linux_x86_64.whl +# Install TensorFlow pip from build context. +COPY tensorflow-*.whl / +RUN pip install /tensorflow-*.whl # Copy test files RUN mkdir -p /gcs-smoke/python diff --git a/tensorflow/tools/gcs_test/gcs_smoke.sh b/tensorflow/tools/gcs_test/gcs_smoke.sh index 6deff2e919..ec7ee4fbb0 100755 --- a/tensorflow/tools/gcs_test/gcs_smoke.sh +++ b/tensorflow/tools/gcs_test/gcs_smoke.sh @@ -17,9 +17,10 @@ # Driver script for TensorFlow-GCS smoke test. # # Usage: -# gcs_smoke.sh <GCLOUD_JSON_KEY_PATH> <GCS_BUCKET_URL> +# gcs_smoke.sh <WHL_URL> <GCLOUD_JSON_KEY_PATH> <GCS_BUCKET_URL> # # Input arguments: +# WHL_URL: URL to the TensorFlow wheel file to use in this test. # GCLOUD_KEY_JSON_PATH: Path to the Google Cloud JSON key file. # See https://cloud.google.com/storage/docs/authentication for details. # @@ -34,13 +35,13 @@ print_usage() { echo "" } - SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${SCRIPT_DIR}/../ci_build/builds/builds_common.sh" # Check input arguments -GCLOUD_JSON_KEY_PATH=$1 -GCS_BUCKET_URL=$2 +WHL_URL=$1 +GCLOUD_JSON_KEY_PATH=$2 +GCS_BUCKET_URL=$3 if [[ -z "${GCLOUD_JSON_KEY_PATH}" ]]; then print_usage die "ERROR: Command-line argument GCLOUD_JSON_KEY_PATH is not supplied" @@ -55,16 +56,36 @@ if [[ ! -f "${GCLOUD_JSON_KEY_PATH}" ]]; then "${GCLOUD_JSON_KEY_PATH}\"" fi -DOCKERFILE="${SCRIPT_DIR}/Dockerfile" +# Create temporary directory for docker build +BUILD_DIR=$(mktemp -d) +echo "" +echo "Using whl file URL: ${WHL_URL}" +echo "Building in temporary directory: ${BUILD_DIR}" + +cp -r ${SCRIPT_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}" + +DOCKERFILE="${BUILD_DIR}/Dockerfile" if [[ ! -f "${DOCKERFILE}" ]]; then die "ERROR: Cannot find Dockerfile at expected path ${DOCKERFILE}" fi +# 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}" + # Build the docker image for testing docker build --no-cache \ - -f "${DOCKERFILE}" -t "${DOCKER_IMG}" "${SCRIPT_DIR}" || \ + -f "${DOCKERFILE}" -t "${DOCKER_IMG}" "${BUILD_DIR}" || \ die "FAIL: Failed to build docker image for testing" +# Clean up docker build context directory. +rm -rf "${BUILD_DIR}" + # Run the docker image with the GCS key file mapped and the gcloud-required # environment variables set. docker run --rm \ |