Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.12-rc0 cherry-pick request: Add TF_BUILD_TEST_TIMEOUT to ci_parameterized_build.sh #22749

Merged
merged 1 commit into from
Oct 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 17 additions & 10 deletions tensorflow/tools/ci_build/ci_parameterized_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
# Use the specified configurations when building.
# When set, overrides TF_BUILD_IS_OPT and TF_BUILD_MAVX
# options, as this will replace the two.
# TF_BUILD_TEST_TIMEOUT:
# Sets the value of bazel --test_timeout, defaults to -1
# which uses the bazel defaults.
# TF_SKIP_CONTRIB_TESTS:
# If set to any non-empty or non-0 value, will skip running
# contrib tests.
Expand Down Expand Up @@ -125,14 +128,25 @@ NO_DOCKER_OPT_FLAG="--genrule_strategy=standalone"

DO_DOCKER=1

# Bazel uses defaults for all test sizes when given `-1`.
TF_BUILD_TEST_TIMEOUT=${TF_BUILD_TEST_TIMEOUT:--1}

# Helpful flags:
# --test_summary=detailed: Tell us more about which targets are being built
# --keep_going: Don't stop at the first failure; tell us all the failures
# --build_tests_only: Don't build targets depended on by tests if the test is
# disabled. Also saves some compilation time. Otherwise,
# tries to build everything.
BAZEL_TEST_FLAGS="--test_summary=detailed --build_tests_only --keep_going"
# --test_timeout: Test timeouts in the order short,moderate,long,eternal.
# --test_env: Environment variables to set when running bazel tests. These are
# especially important when using --run_under with
# parallel_gpu_execute.
BAZEL_TEST_FLAGS=""\
"--test_summary=detailed --build_tests_only --keep_going "\
"--test_timeout=${TF_BUILD_TEST_TIMEOUT} "\
"--test_env=TF_GPU_COUNT=${TF_GPU_COUNT} "\
"--test_env=TF_TESTS_PER_GPU=${TF_TESTS_PER_GPU} "\
"--test_env=TF_PER_DEVICE_MEMORY_LIMIT_MB=${TF_PER_DEVICE_MEMORY_LIMIT_MB}"
BAZEL_BUILD_FLAGS="--keep_going"

BAZEL_CMD="bazel test ${BAZEL_TEST_FLAGS}"
Expand All @@ -148,13 +162,6 @@ ANDROID_FULL_CMD="${CI_BUILD_DIR}/builds/android_full.sh"
TF_GPU_COUNT=${TF_GPU_COUNT:-4}
PARALLEL_GPU_TEST_CMD='//tensorflow/tools/ci_build/gpu_build:parallel_gpu_execute'

# Environment variables to set when running bazel tests. These are especially
# important when using --run_under with parallel_gpu_execute.
BAZEL_TEST_ENV=""\
"--test_env=TF_GPU_COUNT=${TF_GPU_COUNT} "\
"--test_env=TF_TESTS_PER_GPU=${TF_TESTS_PER_GPU} "\
"--test_env=TF_PER_DEVICE_MEMORY_LIMIT_MB=${TF_PER_DEVICE_MEMORY_LIMIT_MB} "

BENCHMARK_CMD="${CI_BUILD_DIR}/builds/benchmark.sh"

EXTRA_PARAMS=""
Expand Down Expand Up @@ -415,11 +422,11 @@ if [[ ${TF_BUILD_IS_PIP} == "no_pip" ]] ||
if [[ ${CTYPE} == cpu* ]] || \
[[ ${CTYPE} == "debian.jessie.cpu" ]]; then
# CPU only command, fully parallel.
NO_PIP_MAIN_CMD="${MAIN_CMD} ${BAZEL_CMD} ${BAZEL_TEST_ENV} ${OPT_FLAG} "\
NO_PIP_MAIN_CMD="${MAIN_CMD} ${BAZEL_CMD} ${OPT_FLAG} "\
"${EXTRA_ARGS} -- ${BAZEL_TARGET}"
elif [[ ${CTYPE} == gpu* ]]; then
# GPU only command, run as many jobs as the GPU count only.
NO_PIP_MAIN_CMD="${BAZEL_CMD} ${BAZEL_TEST_ENV} ${OPT_FLAG} "\
NO_PIP_MAIN_CMD="${BAZEL_CMD} ${OPT_FLAG} "\
"--local_test_jobs=${TF_GPU_COUNT} "\
"--run_under=${PARALLEL_GPU_TEST_CMD} "\
"${EXTRA_ARGS} -- ${BAZEL_TARGET}"
Expand Down