From 8053300cc72b896c62589c5608f65a076e954b24 Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Tue, 27 Feb 2018 11:16:30 -0800 Subject: [PATCH 1/6] Add asan script for remote builds. --- .../internal_ci/linux/grpc_asan_on_foundry.sh | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 tools/internal_ci/linux/grpc_asan_on_foundry.sh diff --git a/tools/internal_ci/linux/grpc_asan_on_foundry.sh b/tools/internal_ci/linux/grpc_asan_on_foundry.sh new file mode 100644 index 00000000000..0f255f02918 --- /dev/null +++ b/tools/internal_ci/linux/grpc_asan_on_foundry.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# Copyright 2017 gRPC authors. +# +# 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 -ex + +# A temporary solution to give Kokoro credentials. +# The file name 4321_grpc-testing-service needs to match auth_credential in +# the build config. +# TODO: Use keystore. +mkdir -p ${KOKORO_KEYSTORE_DIR} +cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service + +mkdir -p /tmpfs/tmp/bazel-canary +ln -f "${KOKORO_GFILE_DIR}/bazel-canary" /tmpfs/tmp/bazel-canary/bazel +chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" +export PATH="/tmpfs/tmp/bazel-canary:${PATH}" +# This should show /tmpfs/tmp/bazel-canary/bazel +which bazel +chmod +x "${KOKORO_GFILE_DIR}/bazel_wrapper.py" + +# change to grpc repo root +cd $(dirname $0)/../../.. + +source tools/internal_ci/helper_scripts/prepare_build_linux_rc + +"${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ + --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ + test --jobs="50" \ + --test_timeout="1500,1500,1500,3600" \ + --test_output=errors \ + --verbose_failures=true \ + --keep_going \ + --remote_accept_cached=true \ + --spawn_strategy=remote \ + --remote_local_fallback=false \ + --remote_timeout=3600 \ + --strategy=Javac=remote \ + --strategy=Closure=remote \ + --genrule_strategy=remote \ + --experimental_strict_action_env=true \ + --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/asci-toolchain/nosla-debian8-clang-fl@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ + --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain \ + --define GRPC_PORT_ISOLATED_RUNTIME=1 \ + --copt=-gmlt \ + --strip=never \ + --copt=-fsanitize=address \ + --linkopt=-fsanitize=address \ + --test_verbose_timeout_warnings \ + -- //test/... From 10e602b1274ed1db47764fbe12d2043378fafc7c Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Tue, 27 Feb 2018 11:21:18 -0800 Subject: [PATCH 2/6] Increased timeout. --- tools/internal_ci/linux/grpc_asan_on_foundry.sh | 2 +- tools/internal_ci/linux/grpc_tsan_on_foundry.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/internal_ci/linux/grpc_asan_on_foundry.sh b/tools/internal_ci/linux/grpc_asan_on_foundry.sh index 0f255f02918..03c4ba111bf 100644 --- a/tools/internal_ci/linux/grpc_asan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_asan_on_foundry.sh @@ -38,7 +38,7 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc "${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ test --jobs="50" \ - --test_timeout="1500,1500,1500,3600" \ + --test_timeout="3600,3600,3600,3600" \ --test_output=errors \ --verbose_failures=true \ --keep_going \ diff --git a/tools/internal_ci/linux/grpc_tsan_on_foundry.sh b/tools/internal_ci/linux/grpc_tsan_on_foundry.sh index 632ce387a03..710ebcedd85 100644 --- a/tools/internal_ci/linux/grpc_tsan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_tsan_on_foundry.sh @@ -38,7 +38,7 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc "${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ test --jobs="50" \ - --test_timeout="1500,1500,1500,3600" \ + --test_timeout="3600,3600,3600,3600" \ --test_output=errors \ --verbose_failures=true \ --keep_going \ From dfa20d88f14e6bfd272bdb011fda1d8b97c7a581 Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Tue, 27 Feb 2018 13:41:52 -0800 Subject: [PATCH 3/6] Pin a commit that comes with ubsan and msan. --- bazel/grpc_deps.bzl | 8 ++++---- tools/internal_ci/linux/grpc_asan_on_foundry.sh | 2 +- tools/internal_ci/linux/grpc_tsan_on_foundry.sh | 2 +- tools/internal_ci/linux/grpc_ubsan_on_foundry.sh | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index 56b528caec8..a441c3ff3d0 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -120,12 +120,12 @@ def grpc_deps(): if "com_github_bazelbuild_bazeltoolchains" not in native.existing_rules(): native.http_archive( name = "com_github_bazelbuild_bazeltoolchains", - strip_prefix = "bazel-toolchains-44200e0c026d86c53470d107b3697a3e46469c43", + strip_prefix = "bazel-toolchains-b850ccdf53fed1ccab7670f52d6b297d74348d1b", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/44200e0c026d86c53470d107b3697a3e46469c43.tar.gz", - "https://github.com/bazelbuild/bazel-toolchains/archive/44200e0c026d86c53470d107b3697a3e46469c43.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/b850ccdf53fed1ccab7670f52d6b297d74348d1b.tar.gz", + "https://github.com/bazelbuild/bazel-toolchains/archive/b850ccdf53fed1ccab7670f52d6b297d74348d1b.tar.gz", ], - sha256 = "699b55a6916c687f4b7dc092dbbf5f64672cde0dc965f79717735ec4e5416556", + sha256 = "d84d6b2fe88ef99963febf91ddce33503eed14c155ace922e2122271b483be64", ) # TODO: move some dependencies from "grpc_deps" here? diff --git a/tools/internal_ci/linux/grpc_asan_on_foundry.sh b/tools/internal_ci/linux/grpc_asan_on_foundry.sh index 03c4ba111bf..b95fe6399a9 100644 --- a/tools/internal_ci/linux/grpc_asan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_asan_on_foundry.sh @@ -50,7 +50,7 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc --strategy=Closure=remote \ --genrule_strategy=remote \ --experimental_strict_action_env=true \ - --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/asci-toolchain/nosla-debian8-clang-fl@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ + --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/cloud-marketplace/google/rbe-debian8@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain \ --define GRPC_PORT_ISOLATED_RUNTIME=1 \ --copt=-gmlt \ diff --git a/tools/internal_ci/linux/grpc_tsan_on_foundry.sh b/tools/internal_ci/linux/grpc_tsan_on_foundry.sh index 710ebcedd85..6d22c165cb7 100644 --- a/tools/internal_ci/linux/grpc_tsan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_tsan_on_foundry.sh @@ -50,7 +50,7 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc --strategy=Closure=remote \ --genrule_strategy=remote \ --experimental_strict_action_env=true \ - --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/asci-toolchain/nosla-debian8-clang-fl@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ + --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/cloud-marketplace/google/rbe-debian8@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain \ --define GRPC_PORT_ISOLATED_RUNTIME=1 \ --copt=-gmlt \ diff --git a/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh b/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh index ba4f8d3f7b1..90998eb0853 100644 --- a/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh @@ -38,7 +38,7 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc "${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ test --jobs="50" \ - --test_timeout="1500,1500,1500,3600" \ + --test_timeout="3600,3600,3600,3600" \ --test_output=errors \ --verbose_failures=true \ --keep_going \ @@ -50,7 +50,7 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc --strategy=Closure=remote \ --genrule_strategy=remote \ --experimental_strict_action_env=true \ - --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/asci-toolchain/nosla-debian8-clang-fl@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ + --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/cloud-marketplace/google/rbe-debian8@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/experimental/debian8_clang/0.3.0/bazel_0.10.0/ubsan:ubsan_experimental_toolchain \ --define GRPC_PORT_ISOLATED_RUNTIME=1 \ --copt=-gmlt \ From bf0126af4c2e658db4ffe6101ccd431b12422eca Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Tue, 27 Feb 2018 14:24:46 -0800 Subject: [PATCH 4/6] MSAN script --- .../internal_ci/linux/grpc_msan_on_foundry.sh | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 tools/internal_ci/linux/grpc_msan_on_foundry.sh diff --git a/tools/internal_ci/linux/grpc_msan_on_foundry.sh b/tools/internal_ci/linux/grpc_msan_on_foundry.sh new file mode 100644 index 00000000000..d580bdb0c17 --- /dev/null +++ b/tools/internal_ci/linux/grpc_msan_on_foundry.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +# Copyright 2017 gRPC authors. +# +# 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 -ex + +# A temporary solution to give Kokoro credentials. +# The file name 4321_grpc-testing-service needs to match auth_credential in +# the build config. +# TODO: Use keystore. +mkdir -p ${KOKORO_KEYSTORE_DIR} +cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service + +mkdir -p /tmpfs/tmp/bazel-canary +ln -f "${KOKORO_GFILE_DIR}/bazel-canary" /tmpfs/tmp/bazel-canary/bazel +chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" +export PATH="/tmpfs/tmp/bazel-canary:${PATH}" +# This should show /tmpfs/tmp/bazel-canary/bazel +which bazel +chmod +x "${KOKORO_GFILE_DIR}/bazel_wrapper.py" + +# change to grpc repo root +cd $(dirname $0)/../../.. + +source tools/internal_ci/helper_scripts/prepare_build_linux_rc + +"${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ + --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ + test --jobs="50" \ + --test_timeout="3600,3600,3600,3600" \ + --test_output=errors \ + --verbose_failures=true \ + --keep_going \ + --remote_accept_cached=true \ + --spawn_strategy=remote \ + --remote_local_fallback=false \ + --remote_timeout=3600 \ + --strategy=Javac=remote \ + --strategy=Closure=remote \ + --genrule_strategy=remote \ + --experimental_strict_action_env=true \ + --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/asci-toolchain/nosla-debian8-clang-msan@sha256:8f381d55c0456fb65821c90ada902c2584977e03a1eaca8fba8ce77e644c775b" }' \ + --define GRPC_PORT_ISOLATED_RUNTIME=1 \ + --copt=-gmlt \ + --strip=never \ + --test_verbose_timeout_warnings \ + --cxxopt=--stdlib=libc++ \ + --copt=-fsanitize=memory \ + --linkopt=-fsanitize=memory \ + --copt=-fsanitize-memory-track-origins \ + --action_env=LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH \ + --host_crosstool_top=@bazel_toolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain + --crosstool_top=@bazel_toolchains//configs/experimental/debian8_clang/0.3.0/bazel_0.10.0/msan:msan_experimental_toolchain + -- //test/... From 6a24d8a42f90a736efec371768e362661f64cf29 Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Tue, 27 Feb 2018 16:06:41 -0800 Subject: [PATCH 5/6] use mktemp to avoid hardcoding temp dir. --- tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh | 10 +++++----- tools/internal_ci/linux/grpc_tsan_on_foundry.sh | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh index 92a90ae46a6..0cfc36ce60b 100644 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh @@ -21,11 +21,11 @@ set -ex mkdir -p ${KOKORO_KEYSTORE_DIR} cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service -mkdir -p /tmpfs/tmp/bazel-canary -ln -f "${KOKORO_GFILE_DIR}/bazel-canary" /tmpfs/tmp/bazel-canary/bazel +temp_dir=`mktemp -d` +ln -f "${KOKORO_GFILE_DIR}/bazel-canary" ${temp_dir}/bazel chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" -export PATH="/tmpfs/tmp/bazel-canary:${PATH}" -# This should show /tmpfs/tmp/bazel-canary/bazel +export PATH="${temp_dir}:${PATH}" +# This should show ${temp_dir}/bazel which bazel chmod +x "${KOKORO_GFILE_DIR}/bazel_wrapper.py" @@ -50,7 +50,7 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc --strategy=Closure=remote \ --genrule_strategy=remote \ --experimental_strict_action_env=true \ - --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/asci-toolchain/nosla-debian8-clang-fl@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ + --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/cloud-marketplace/google/rbe-debian8@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain \ --define GRPC_PORT_ISOLATED_RUNTIME=1 \ -c opt \ diff --git a/tools/internal_ci/linux/grpc_tsan_on_foundry.sh b/tools/internal_ci/linux/grpc_tsan_on_foundry.sh index 6d22c165cb7..4f628d04fd9 100644 --- a/tools/internal_ci/linux/grpc_tsan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_tsan_on_foundry.sh @@ -22,11 +22,11 @@ set -ex mkdir -p ${KOKORO_KEYSTORE_DIR} cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service -mkdir -p /tmpfs/tmp/bazel-canary -ln -f "${KOKORO_GFILE_DIR}/bazel-canary" /tmpfs/tmp/bazel-canary/bazel +temp_dir = mktemp -d +ln -f "${KOKORO_GFILE_DIR}/bazel-canary" ${temp_dir}/bazel chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" -export PATH="/tmpfs/tmp/bazel-canary:${PATH}" -# This should show /tmpfs/tmp/bazel-canary/bazel +export PATH="${temp_dir}:${PATH}" +# This should show ${temp_dir}/bazel which bazel chmod +x "${KOKORO_GFILE_DIR}/bazel_wrapper.py" From a6e173eee48729298b6d90008999bdce4e7c8722 Mon Sep 17 00:00:00 2001 From: Adele Zhou Date: Tue, 27 Feb 2018 16:22:42 -0800 Subject: [PATCH 6/6] Refactor the scripts to remove redundant code. --- .../internal_ci/linux/grpc_asan_on_foundry.sh | 47 +-------------- .../linux/grpc_bazel_on_foundry_base.sh | 57 +++++++++++++++++++ .../linux/grpc_bazel_on_foundry_dbg.sh | 43 +------------- .../linux/grpc_bazel_on_foundry_opt.sh | 44 +------------- .../internal_ci/linux/grpc_msan_on_foundry.sh | 13 ++--- .../internal_ci/linux/grpc_tsan_on_foundry.sh | 47 +-------------- .../linux/grpc_ubsan_on_foundry.sh | 11 ++-- 7 files changed, 76 insertions(+), 186 deletions(-) create mode 100755 tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh diff --git a/tools/internal_ci/linux/grpc_asan_on_foundry.sh b/tools/internal_ci/linux/grpc_asan_on_foundry.sh index b95fe6399a9..2f9c8531a07 100644 --- a/tools/internal_ci/linux/grpc_asan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_asan_on_foundry.sh @@ -13,49 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -ex +EXTRA_FLAGS="--copt=-gmlt --strip=never --copt=-fsanitize=address --linkopt=-fsanitize=address" +github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}" -# A temporary solution to give Kokoro credentials. -# The file name 4321_grpc-testing-service needs to match auth_credential in -# the build config. -# TODO: Use keystore. -mkdir -p ${KOKORO_KEYSTORE_DIR} -cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service - -mkdir -p /tmpfs/tmp/bazel-canary -ln -f "${KOKORO_GFILE_DIR}/bazel-canary" /tmpfs/tmp/bazel-canary/bazel -chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" -export PATH="/tmpfs/tmp/bazel-canary:${PATH}" -# This should show /tmpfs/tmp/bazel-canary/bazel -which bazel -chmod +x "${KOKORO_GFILE_DIR}/bazel_wrapper.py" - -# change to grpc repo root -cd $(dirname $0)/../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -"${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ - --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ - test --jobs="50" \ - --test_timeout="3600,3600,3600,3600" \ - --test_output=errors \ - --verbose_failures=true \ - --keep_going \ - --remote_accept_cached=true \ - --spawn_strategy=remote \ - --remote_local_fallback=false \ - --remote_timeout=3600 \ - --strategy=Javac=remote \ - --strategy=Closure=remote \ - --genrule_strategy=remote \ - --experimental_strict_action_env=true \ - --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/cloud-marketplace/google/rbe-debian8@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ - --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain \ - --define GRPC_PORT_ISOLATED_RUNTIME=1 \ - --copt=-gmlt \ - --strip=never \ - --copt=-fsanitize=address \ - --linkopt=-fsanitize=address \ - --test_verbose_timeout_warnings \ - -- //test/... diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh new file mode 100755 index 00000000000..098d588e3b0 --- /dev/null +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +# Copyright 2017 gRPC authors. +# +# 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 -ex + +# A temporary solution to give Kokoro credentials. +# The file name 4321_grpc-testing-service needs to match auth_credential in +# the build config. +mkdir -p ${KOKORO_KEYSTORE_DIR} +cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service + +temp_dir=$(mktemp -d) +ln -f "${KOKORO_GFILE_DIR}/bazel-canary" ${temp_dir}/bazel +chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" +export PATH="${temp_dir}:${PATH}" +# This should show ${temp_dir}/bazel +which bazel +chmod +x "${KOKORO_GFILE_DIR}/bazel_wrapper.py" + +# change to grpc repo root +cd $(dirname $0)/../../.. + +source tools/internal_ci/helper_scripts/prepare_build_linux_rc + +# TODO(adelez): implement size for test targets and change test_timeout back +"${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ + --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ + test --jobs="50" \ + --test_timeout="3600,3600,3600,3600" \ + --test_output=errors \ + --verbose_failures=true \ + --keep_going \ + --remote_accept_cached=true \ + --spawn_strategy=remote \ + --remote_local_fallback=false \ + --remote_timeout=3600 \ + --strategy=Javac=remote \ + --strategy=Closure=remote \ + --genrule_strategy=remote \ + --experimental_strict_action_env=true \ + --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/cloud-marketplace/google/rbe-debian8@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ + --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain \ + --define GRPC_PORT_ISOLATED_RUNTIME=1 \ + $1 \ + -- //test/... diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh index ea63bdd0ad3..e5ffea62595 100644 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_dbg.sh @@ -13,45 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -ex +EXTRA_FLAGS="-c dbg" +github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}" -# A temporary solution to give Kokoro credentials. -# The file name 4321_grpc-testing-service needs to match auth_credential in -# the build config. -mkdir -p ${KOKORO_KEYSTORE_DIR} -cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service - -mkdir -p /tmpfs/tmp/bazel-canary -ln -f "${KOKORO_GFILE_DIR}/bazel-canary" /tmpfs/tmp/bazel-canary/bazel -chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" -export PATH="/tmpfs/tmp/bazel-canary:${PATH}" -# This should show /tmpfs/tmp/bazel-canary/bazel -which bazel -chmod +x "${KOKORO_GFILE_DIR}/bazel_wrapper.py" - -# change to grpc repo root -cd $(dirname $0)/../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -# TODO(adelez): implement size for test targets and change test_timeout back -"${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ - --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ - test --jobs="50" \ - --test_timeout="1200,1200,1200,3600" \ - --test_output=errors \ - --verbose_failures=true \ - --keep_going \ - --remote_accept_cached=true \ - --spawn_strategy=remote \ - --remote_local_fallback=false \ - --remote_timeout=3600 \ - --strategy=Javac=remote \ - --strategy=Closure=remote \ - --genrule_strategy=remote \ - --experimental_strict_action_env=true \ - --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/asci-toolchain/nosla-debian8-clang-fl@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ - --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain \ - --define GRPC_PORT_ISOLATED_RUNTIME=1 \ - -c dbg \ - -- //test/... diff --git a/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh b/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh index 0cfc36ce60b..6a769b9a7c3 100644 --- a/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh +++ b/tools/internal_ci/linux/grpc_bazel_on_foundry_opt.sh @@ -13,45 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -ex - -# A temporary solution to give Kokoro credentials. -# The file name 4321_grpc-testing-service needs to match auth_credential in -# the build config. -mkdir -p ${KOKORO_KEYSTORE_DIR} -cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service - -temp_dir=`mktemp -d` -ln -f "${KOKORO_GFILE_DIR}/bazel-canary" ${temp_dir}/bazel -chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" -export PATH="${temp_dir}:${PATH}" -# This should show ${temp_dir}/bazel -which bazel -chmod +x "${KOKORO_GFILE_DIR}/bazel_wrapper.py" - -# change to grpc repo root -cd $(dirname $0)/../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -# TODO(adelez): implement size for test targets and change test_timeout back -"${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ - --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ - test --jobs="50" \ - --test_timeout="1200,1200,1200,3600" \ - --test_output=errors \ - --verbose_failures=true \ - --keep_going \ - --remote_accept_cached=true \ - --spawn_strategy=remote \ - --remote_local_fallback=false \ - --remote_timeout=3600 \ - --strategy=Javac=remote \ - --strategy=Closure=remote \ - --genrule_strategy=remote \ - --experimental_strict_action_env=true \ - --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/cloud-marketplace/google/rbe-debian8@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ - --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain \ - --define GRPC_PORT_ISOLATED_RUNTIME=1 \ - -c opt \ - -- //test/... +EXTRA_FLAGS="-c opt" +github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}" diff --git a/tools/internal_ci/linux/grpc_msan_on_foundry.sh b/tools/internal_ci/linux/grpc_msan_on_foundry.sh index d580bdb0c17..2c64c7666b0 100644 --- a/tools/internal_ci/linux/grpc_msan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_msan_on_foundry.sh @@ -22,11 +22,11 @@ set -ex mkdir -p ${KOKORO_KEYSTORE_DIR} cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service -mkdir -p /tmpfs/tmp/bazel-canary -ln -f "${KOKORO_GFILE_DIR}/bazel-canary" /tmpfs/tmp/bazel-canary/bazel +temp_dir=$(mktemp -d) +ln -f "${KOKORO_GFILE_DIR}/bazel-canary" ${temp_dir}/bazel chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" -export PATH="/tmpfs/tmp/bazel-canary:${PATH}" -# This should show /tmpfs/tmp/bazel-canary/bazel +export PATH="${temp_dir}:${PATH}" +# This should show ${temp_dir}/bazel which bazel chmod +x "${KOKORO_GFILE_DIR}/bazel_wrapper.py" @@ -54,12 +54,11 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc --define GRPC_PORT_ISOLATED_RUNTIME=1 \ --copt=-gmlt \ --strip=never \ - --test_verbose_timeout_warnings \ --cxxopt=--stdlib=libc++ \ --copt=-fsanitize=memory \ --linkopt=-fsanitize=memory \ --copt=-fsanitize-memory-track-origins \ --action_env=LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH \ - --host_crosstool_top=@bazel_toolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain - --crosstool_top=@bazel_toolchains//configs/experimental/debian8_clang/0.3.0/bazel_0.10.0/msan:msan_experimental_toolchain + --host_crosstool_top=@bazel_toolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain \ + --crosstool_top=@bazel_toolchains//configs/experimental/debian8_clang/0.3.0/bazel_0.10.0/msan:msan_experimental_toolchain \ -- //test/... diff --git a/tools/internal_ci/linux/grpc_tsan_on_foundry.sh b/tools/internal_ci/linux/grpc_tsan_on_foundry.sh index 4f628d04fd9..f8e665ba8a4 100644 --- a/tools/internal_ci/linux/grpc_tsan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_tsan_on_foundry.sh @@ -13,49 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -ex +EXTRA_FLAGS="--copt=-gmlt --strip=never --copt=-fsanitize=thread --linkopt=-fsanitize=thread" +github/grpc/tools/internal_ci/linux/grpc_bazel_on_foundry_base.sh "${EXTRA_FLAGS}" -# A temporary solution to give Kokoro credentials. -# The file name 4321_grpc-testing-service needs to match auth_credential in -# the build config. -# TODO: Use keystore. -mkdir -p ${KOKORO_KEYSTORE_DIR} -cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service - -temp_dir = mktemp -d -ln -f "${KOKORO_GFILE_DIR}/bazel-canary" ${temp_dir}/bazel -chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" -export PATH="${temp_dir}:${PATH}" -# This should show ${temp_dir}/bazel -which bazel -chmod +x "${KOKORO_GFILE_DIR}/bazel_wrapper.py" - -# change to grpc repo root -cd $(dirname $0)/../../.. - -source tools/internal_ci/helper_scripts/prepare_build_linux_rc - -"${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ - --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ - test --jobs="50" \ - --test_timeout="3600,3600,3600,3600" \ - --test_output=errors \ - --verbose_failures=true \ - --keep_going \ - --remote_accept_cached=true \ - --spawn_strategy=remote \ - --remote_local_fallback=false \ - --remote_timeout=3600 \ - --strategy=Javac=remote \ - --strategy=Closure=remote \ - --genrule_strategy=remote \ - --experimental_strict_action_env=true \ - --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/cloud-marketplace/google/rbe-debian8@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ - --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/debian8_clang/0.3.0/bazel_0.10.0:toolchain \ - --define GRPC_PORT_ISOLATED_RUNTIME=1 \ - --copt=-gmlt \ - --strip=never \ - --copt=-fsanitize=thread \ - --linkopt=-fsanitize=thread \ - --test_verbose_timeout_warnings \ - -- //test/... diff --git a/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh b/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh index 90998eb0853..cd1a3404318 100644 --- a/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh +++ b/tools/internal_ci/linux/grpc_ubsan_on_foundry.sh @@ -22,11 +22,11 @@ set -ex mkdir -p ${KOKORO_KEYSTORE_DIR} cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service -mkdir -p /tmpfs/tmp/bazel-canary -ln -f "${KOKORO_GFILE_DIR}/bazel-canary" /tmpfs/tmp/bazel-canary/bazel +temp_dir=$(mktemp -d) +ln -f "${KOKORO_GFILE_DIR}/bazel-canary" ${temp_dir}/bazel chmod 755 "${KOKORO_GFILE_DIR}/bazel-canary" -export PATH="/tmpfs/tmp/bazel-canary:${PATH}" -# This should show /tmpfs/tmp/bazel-canary/bazel +export PATH="${temp_dir}:${PATH}" +# This should show ${temp_dir}/bazel which bazel chmod +x "${KOKORO_GFILE_DIR}/bazel_wrapper.py" @@ -51,11 +51,10 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_rc --genrule_strategy=remote \ --experimental_strict_action_env=true \ --experimental_remote_platform_override='properties:{name:"container-image" value:"docker://gcr.io/cloud-marketplace/google/rbe-debian8@sha256:b2d946c1ddc20af250fe85cf98bd648ac5519131659f7c36e64184b433175a33" }' \ - --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/experimental/debian8_clang/0.3.0/bazel_0.10.0/ubsan:ubsan_experimental_toolchain \ --define GRPC_PORT_ISOLATED_RUNTIME=1 \ --copt=-gmlt \ --strip=never \ --copt=-fsanitize=undefined \ --linkopt=-fsanitize=undefined \ - --test_verbose_timeout_warnings \ + --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/experimental/debian8_clang/0.3.0/bazel_0.10.0/ubsan:ubsan_experimental_toolchain \ -- //test/...