From 3ab94ef0f3a2a16d5904426c729d484c7380a621 Mon Sep 17 00:00:00 2001 From: Yifei Feng Date: Wed, 22 Jan 2020 17:29:57 -0800 Subject: [PATCH] Add release builds to custom op docker files so that it matches up with TF release. Also remove cuda 10.0 from release as now head supports 10.1. PiperOrigin-RevId: 291067152 Change-Id: I98fe5411d5aa5378919cfd43ad20a05b5d918c30 --- tensorflow/opensource_only.files | 1 + .../ci_build/Dockerfile.custom_op_ubuntu_16 | 5 ++ .../Dockerfile.custom_op_ubuntu_16_cuda10.0 | 5 ++ .../Dockerfile.custom_op_ubuntu_16_cuda10.1 | 5 ++ .../release/ubuntu_16/custom_op/nightly.sh | 7 +-- .../release/ubuntu_16/custom_op/release.sh | 47 +++++++++++++++++++ 6 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 tensorflow/tools/ci_build/release/ubuntu_16/custom_op/release.sh diff --git a/tensorflow/opensource_only.files b/tensorflow/opensource_only.files index 67a8a3b2943..8944546e70f 100644 --- a/tensorflow/opensource_only.files +++ b/tensorflow/opensource_only.files @@ -328,6 +328,7 @@ tensorflow/tools/ci_build/release/ubuntu_16/cpu_py38_full/nightly_release.sh tensorflow/tools/ci_build/release/ubuntu_16/cpu_py38_full/nonpip.sh tensorflow/tools/ci_build/release/ubuntu_16/cpu_py38_full/pip.sh tensorflow/tools/ci_build/release/ubuntu_16/custom_op/nightly.sh +tensorflow/tools/ci_build/release/ubuntu_16/custom_op/release.sh tensorflow/tools/ci_build/release/ubuntu_16/gpu_pip_on_cpu/build.sh tensorflow/tools/ci_build/release/ubuntu_16/gpu_py2_full/nightly_release.sh tensorflow/tools/ci_build/release/ubuntu_16/gpu_py2_full/nonpip.sh diff --git a/tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16 b/tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16 index f3a6142d1d7..3f72aea8862 100644 --- a/tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16 +++ b/tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16 @@ -69,6 +69,11 @@ RUN wget https://bootstrap.pypa.io/get-pip.py && python3.5 get-pip.py && rm get- RUN /install/install_pip_packages.sh RUN /install/install_auditwheel.sh +# Install given tensorflow or tf-nightly version, if not specified, install the # latest official release +ARG TF_PACKAGE=tensorflow +ARG TF_PACKAGE_VERSION= +RUN pip install ${TF_PACKAGE}${TF_PACKAGE_VERSION:+==${TF_PACKAGE_VERSION}} + # TODO(klimek): Figure out a better way to get the right include paths # forwarded when we install new packages. RUN ln -s "/usr/include/x86_64-linux-gnu/python2.7" "/dt7/usr/include/x86_64-linux-gnu/python2.7" diff --git a/tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16_cuda10.0 b/tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16_cuda10.0 index 2732cefc380..38f867ae3e9 100644 --- a/tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16_cuda10.0 +++ b/tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16_cuda10.0 @@ -69,6 +69,11 @@ RUN wget https://bootstrap.pypa.io/get-pip.py && python3.5 get-pip.py && rm get- RUN /install/install_pip_packages.sh RUN /install/install_auditwheel.sh +# Install given tensorflow or tf-nightly version, if not specified, install the # latest official release +ARG TF_PACKAGE=tensorflow +ARG TF_PACKAGE_VERSION= +RUN pip install ${TF_PACKAGE}${TF_PACKAGE_VERSION:+==${TF_PACKAGE_VERSION}} + # TODO(klimek): Figure out a better way to get the right include paths # forwarded when we install new packages. RUN ln -s "/usr/include/x86_64-linux-gnu/python3.6m" "/dt7/usr/include/x86_64-linux-gnu/python3.6m" diff --git a/tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16_cuda10.1 b/tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16_cuda10.1 index 30775210dd7..885b1b16886 100644 --- a/tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16_cuda10.1 +++ b/tensorflow/tools/ci_build/Dockerfile.custom_op_ubuntu_16_cuda10.1 @@ -71,6 +71,11 @@ RUN wget https://bootstrap.pypa.io/get-pip.py && python3.5 get-pip.py && rm get- RUN /install/install_pip_packages.sh RUN /install/install_auditwheel.sh +# Install given tensorflow or tf-nightly version, if not specified, install the # latest official release +ARG TF_PACKAGE=tensorflow +ARG TF_PACKAGE_VERSION= +RUN pip install ${TF_PACKAGE}${TF_PACKAGE_VERSION:+==${TF_PACKAGE_VERSION}} + # TODO(klimek): Figure out a better way to get the right include paths # forwarded when we install new packages. RUN ln -s "/usr/include/x86_64-linux-gnu/python3.6m" "/dt7/usr/include/x86_64-linux-gnu/python3.6m" diff --git a/tensorflow/tools/ci_build/release/ubuntu_16/custom_op/nightly.sh b/tensorflow/tools/ci_build/release/ubuntu_16/custom_op/nightly.sh index 84ae1150395..900bbd938d6 100644 --- a/tensorflow/tools/ci_build/release/ubuntu_16/custom_op/nightly.sh +++ b/tensorflow/tools/ci_build/release/ubuntu_16/custom_op/nightly.sh @@ -17,20 +17,17 @@ set -e # 1. Build the test server UBUNTU16_CPU_IMAGE="tensorflow/tensorflow:nightly-custom-op-ubuntu16" -UBUNTU16_GPU_CUDA10P0_IMAGE="tensorflow/tensorflow:nightly-custom-op-gpu-ubuntu16-cuda10.0" UBUNTU16_GPU_IMAGE="tensorflow/tensorflow:nightly-custom-op-gpu-ubuntu16" # Build the docker image cd tensorflow/tools/ci_build -docker build --no-cache -t "${UBUNTU16_CPU_IMAGE}" -f Dockerfile.custom_op_ubuntu_16 . -docker build --no-cache -t "${UBUNTU16_GPU_IMAGE}" -f Dockerfile.custom_op_ubuntu_16_cuda10.1 . -docker build --no-cache -t "${UBUNTU16_GPU_CUDA10P0_IMAGE}" -f Dockerfile.custom_op_ubuntu_16_cuda10.0 . +docker build --build-arg TF_PACKAGE=tf-nightly --no-cache -t "${UBUNTU16_CPU_IMAGE}" -f Dockerfile.custom_op_ubuntu_16 . +docker build --build-arg TF_PACKAGE=tf-nightly --no-cache -t "${UBUNTU16_GPU_IMAGE}" -f Dockerfile.custom_op_ubuntu_16_cuda10.1 . # Log into docker hub, push the image and log out docker login -u "${TF_DOCKER_USERNAME}" -p "${TF_DOCKER_PASSWORD}" docker push "${UBUNTU16_CPU_IMAGE}" docker push "${UBUNTU16_GPU_IMAGE}" -docker push "${UBUNTU16_GPU_CUDA10P0_IMAGE}" docker logout#!/bin/bash diff --git a/tensorflow/tools/ci_build/release/ubuntu_16/custom_op/release.sh b/tensorflow/tools/ci_build/release/ubuntu_16/custom_op/release.sh new file mode 100644 index 00000000000..5d167caeb52 --- /dev/null +++ b/tensorflow/tools/ci_build/release/ubuntu_16/custom_op/release.sh @@ -0,0 +1,47 @@ +!/bin/bash +# Copyright 2019 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== +set -e +set -x + +if [[ -z "${TF_VERSION}" ]]; then + echo "TF_VERSION needs to be set, for example 2.1.0rc0." + exit +fi + +UBUNTU16_CPU_IMAGE="tensorflow/tensorflow:custom-op-ubuntu16" +UBUNTU16_GPU_IMAGE="tensorflow/tensorflow:custom-op-gpu-ubuntu16" +VERSIONED_UBUNTU16_CPU_IMAGE="tensorflow/tensorflow:${TF_VERSION}-custom-op-ubuntu16" +VERSIONED_UBUNTU16_GPU_IMAGE="tensorflow/tensorflow:${TF_VERSION}-custom-op-gpu-ubuntu16" + +# Build the docker image +cd tensorflow/tools/ci_build +docker build --build-arg TF_PACKAGE_VERSION=${TF_VERSION} --no-cache -t "${VERSIONED_UBUNTU16_CPU_IMAGE}" -f Dockerfile.custom_op_ubuntu_16 . +docker build --build-arg TF_PACKAGE_VERSION=${TF_VERSION} --no-cache -t "${VERSIONED_UBUNTU16_GPU_IMAGE}" -f Dockerfile.custom_op_ubuntu_16_cuda10.1 . + +# Log into docker hub, push the image and log out +docker login -u "${TF_DOCKER_USERNAME}" -p "${TF_DOCKER_PASSWORD}" + +docker push "${VERSIONED_UBUNTU16_CPU_IMAGE}" +docker push "${VERSIONED_UBUNTU16_GPU_IMAGE}" + +# Tag and push the default images +docker tag "${VERSIONED_UBUNTU16_CPU_IMAGE}" "${UBUNTU16_CPU_IMAGE}" +docker push "${UBUNTU16_CPU_IMAGE}" + +docker tag "${VERSIONED_UBUNTU16_GPU_IMAGE}" "${UBUNTU16_GPU_IMAGE}" +docker push "${UBUNTU16_GPU_IMAGE}" + +docker logout#!/bin/bash