xref: /aosp_15_r20/external/tensorflow/tensorflow/tools/ci_build/release/ubuntu_16/tpu_py37_full/nonpip.sh (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1#!/bin/bash
2# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15# ==============================================================================
16set -e
17set -x
18
19source tensorflow/tools/ci_build/release/common.sh
20source tensorflow/tools/ci_build/ctpu/ctpu.sh
21
22install_ubuntu_16_python_pip_deps python3.9
23install_bazelisk
24install_ctpu pip3.9
25
26test_patterns=(//tensorflow/... -//tensorflow/compiler/... -//tensorflow/lite/...)
27tag_filters="tpu,-tpu_pod,-no_tpu,-notpu,-no_oss,-no_oss_py37"
28
29bazel_args=(
30  --config=release_cpu_linux \
31  --repo_env=PYTHON_BIN_PATH="$(which python3.9)" \
32  --build_tag_filters="${tag_filters}" \
33  --test_sharding_strategy=disabled \
34  --test_tag_filters="${tag_filters}" \
35  --test_output=errors --verbose_failures=true --keep_going \
36  --build_tests_only
37)
38
39bazel build "${bazel_args[@]}" -- "${test_patterns[@]}"
40
41ctpu_up -s v2-8 -p tensorflow-testing-tpu
42
43test_args=(
44  --test_timeout=120,600,-1,-1 \
45  --test_arg=--tpu="${TPU_NAME}" \
46  --test_arg=--zone="${TPU_ZONE}" \
47  --test_arg=--test_dir_base=gs://kokoro-tpu-testing/tempdir/ \
48  --local_test_jobs=1
49)
50
51set +e
52bazel test "${bazel_args[@]}" "${test_args[@]}" -- "${test_patterns[@]}"
53test_xml_summary_exit
54