Skip to content

Commit

Permalink
Add build script for testing continuous tests with manylinux2014 tool…
Browse files Browse the repository at this point in the history
…chain

and create bazel rbe configs for manylinux2014

PiperOrigin-RevId: 427595682
Change-Id: Ic63c11c054889c50d684199e429f0aed0762addd
  • Loading branch information
nitins17 authored and tensorflower-gardener committed Feb 10, 2022
1 parent 796fc24 commit 7979df6
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@
# rbe_linux: General RBE options used on all linux builds.
# rbe_win: General RBE options used on all windows builds.
#
# rbe_cpu_linux: RBE options to build with only CPU support.
# rbe_linux_cuda_nvcc_py*: RBE options to build with GPU support using nvcc.
# rbe_cpu_linux: RBE options to build with only CPU support.
# rbe_cpu_linux_ml2014: RBE options to build with only CPU support (manylinux2014 compatible).
# rbe_linux_cuda_nvcc_py*: RBE options to build with GPU support using nvcc.
#
# rbe_linux_py3: Linux Python 3 RBE config
# rbe_linux_py3: Linux Python 3 RBE config
# rbe_linux_py3_ml2014: Linux Python 3 RBE config (manylinux2014 compatible)
#
# rbe_win_py37: Windows Python 3.7 RBE config
# rbe_win_py38: Windows Python 3.8 RBE config
Expand Down Expand Up @@ -446,6 +448,15 @@ build:rbe_cpu_linux_base --platforms="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-c
build:rbe_cpu_linux --config=rbe_linux
build:rbe_cpu_linux --config=rbe_cpu_linux_base

# rbe config option that uses the manylinux2014 toolchain
build:rbe_cpu_linux_ml2014 --config=rbe_linux
build:rbe_cpu_linux_ml2014 --host_crosstool_top="@ubuntu18.04-gcc8_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain"
build:rbe_cpu_linux_ml2014 --crosstool_top="@ubuntu18.04-gcc8_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain"
build:rbe_cpu_linux_ml2014 --extra_toolchains="@ubuntu18.04-gcc8_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain-linux-x86_64"
build:rbe_cpu_linux_ml2014 --extra_execution_platforms="@ubuntu18.04-gcc8_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform"
build:rbe_cpu_linux_ml2014 --host_platform="@ubuntu18.04-gcc8_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform"
build:rbe_cpu_linux_ml2014 --platforms="@ubuntu18.04-gcc8_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform"

build:rbe_lite_linux --config=rbe_linux_base
build:rbe_lite_linux --config=rbe_cpu_linux_base
build:rbe_lite_linux --config=rbe_linux_py3_base
Expand Down Expand Up @@ -525,6 +536,10 @@ build:rbe_linux_py3 --config=rbe_linux_py3_base
build:rbe_linux_py3_base --python_path="/usr/local/bin/python3.9"
build:rbe_linux_py3_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.9"

# rbe_linux_py3 with manylinux2014 toolchain
build:rbe_linux_py3_ml2014 --config=rbe_linux_py3
build:rbe_linux_py3_ml2014 --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc8_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.9"

build:rbe_win --config=rbe
build:rbe_win --crosstool_top="@tf_toolchains//toolchains/win/tf_win_02082022:toolchain"
build:rbe_win --extra_toolchains="@tf_toolchains//toolchains/win/tf_win_02082022:cc-toolchain-x64_windows"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/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

# Error if we somehow forget to set the path to bazel_wrapper.py
set -u
BAZEL_WRAPPER_PATH=$1
set +u

# From this point on, logs can be publicly available
set -x

source tensorflow/tools/ci_build/release/common.sh
install_bazelisk
which bazel

# Get the default test targets for bazel.
source tensorflow/tools/ci_build/build_scripts/DEFAULT_TEST_TARGETS.sh

tag_filters="-no_oss,-oss_serial,-gpu,-tpu,-benchmark-test""$(maybe_skip_v1)"

# Run bazel test command.
"${BAZEL_WRAPPER_PATH}" \
test \
--profile="${KOKORO_ARTIFACTS_DIR}/profile.json.gz" \
--config=rbe_cpu_linux_ml2014 \
--config=rbe_linux_py3_ml2014 \
--python_path="/usr/bin/python3.9" \
--config=tensorflow_testing_rbe_linux \
--test_tag_filters="${tag_filters}" \
--build_tag_filters="${tag_filters}" \
--test_lang_filters=cc,py \
-- \
${DEFAULT_BAZEL_TARGETS} -//tensorflow/lite/...

# Print build time statistics, including critical path.
bazel analyze-profile "${KOKORO_ARTIFACTS_DIR}/profile.json.gz"

# Copy log to output to be available to GitHub
ls -la "$(bazel info output_base)/java.log"
cp "$(bazel info output_base)/java.log" "${KOKORO_ARTIFACTS_DIR}/"

0 comments on commit 7979df6

Please sign in to comment.