From 5284d5189daa2608cb69b8b6f436e7a85a76ffd5 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 6 Dec 2019 16:09:01 +0100 Subject: [PATCH 1/8] leaner C# build --- .../helper_scripts/prepare_build_macos_rc | 110 ++++++++++-------- .../macos/grpc_basictests_csharp.cfg | 2 +- .../macos/grpc_basictests_csharp.sh | 19 +++ .../pull_request/grpc_basictests_csharp.cfg | 2 +- 4 files changed, 82 insertions(+), 51 deletions(-) create mode 100755 tools/internal_ci/macos/grpc_basictests_csharp.sh diff --git a/tools/internal_ci/helper_scripts/prepare_build_macos_rc b/tools/internal_ci/helper_scripts/prepare_build_macos_rc index a13c29ea7f5..c497e33567f 100644 --- a/tools/internal_ci/helper_scripts/prepare_build_macos_rc +++ b/tools/internal_ci/helper_scripts/prepare_build_macos_rc @@ -27,62 +27,74 @@ if [ -n "$KOKORO_GITHUB_PULL_REQUEST_NUMBER" ]; then export RUN_TESTS_FLAGS="--filter_pr_tests --base_branch origin/$KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH $RUN_TESTS_FLAGS" fi -set +ex # rvm script is very verbose and exits with errorcode -# Advice from https://github.com/Homebrew/homebrew-cask/issues/8629#issuecomment-68641176 -brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup -rvm --debug requirements ruby-2.5.0 -source $HOME/.rvm/scripts/rvm -set -e # rvm commands are very verbose -time rvm install 2.5.0 -rvm use 2.5.0 --default -time gem install bundler -v 1.17.3 --no-ri --no-doc -time gem install cocoapods --version 1.3.1 --no-ri --no-doc -time gem install rake-compiler --no-ri --no-doc -rvm osx-ssl-certs status all -rvm osx-ssl-certs update all -set -ex - -# cocoapods -export LANG=en_US.UTF-8 -# pre-fetch cocoapods master repo's most recent commit only -mkdir -p ~/.cocoapods/repos -time git clone --depth 1 https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master +if [ "${PREPARE_BUILD_INSTALL_DEPS_RUBY}" == "true" ] +then + set +ex # rvm script is very verbose and exits with errorcode + # Advice from https://github.com/Homebrew/homebrew-cask/issues/8629#issuecomment-68641176 + brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup + rvm --debug requirements ruby-2.5.0 + source $HOME/.rvm/scripts/rvm + set -e # rvm commands are very verbose + time rvm install 2.5.0 + rvm use 2.5.0 --default + time gem install bundler -v 1.17.3 --no-ri --no-doc + time gem install cocoapods --version 1.3.1 --no-ri --no-doc + time gem install rake-compiler --no-ri --no-doc + rvm osx-ssl-certs status all + rvm osx-ssl-certs update all + set -ex +fi -# python -time pip install --user virtualenv -time pip install --user --upgrade Mako six tox setuptools twisted pyyaml pyjwt cryptography requests -export PYTHONPATH=/Library/Python/3.4/site-packages +if [ "${PREPARE_BUILD_INSTALL_DEPS_OBJC}" == "true" ] +then + # cocoapods + export LANG=en_US.UTF-8 + # pre-fetch cocoapods master repo's most recent commit only + mkdir -p ~/.cocoapods/repos + time git clone --depth 1 https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master -# Install Python 3.7 and Python 3.8 -time curl -O https://www.python.org/ftp/python/3.7.0/python-3.7.0-macosx10.9.pkg -time curl -O https://www.python.org/ftp/python/3.8.0/python-3.8.0-macosx10.9.pkg -echo "ae0717a02efea3b0eb34aadc680dc498 python-3.7.0-macosx10.9.pkg" > /tmp/python_installer_checksum.md5 -echo "f5f9ae9f416170c6355cab7256bb75b5 python-3.8.0-macosx10.9.pkg" >> /tmp/python_installer_checksum.md5 -md5sum -c /tmp/python_installer_checksum.md5 -time sudo installer -pkg ./python-3.7.0-macosx10.9.pkg -target / -time sudo installer -pkg ./python-3.8.0-macosx10.9.pkg -target / + # set xcode version for Obj-C tests + sudo xcode-select -switch /Applications/Xcode_9.2.app/Contents/Developer/ -# set xcode version for Obj-C tests -sudo xcode-select -switch /Applications/Xcode_9.2.app/Contents/Developer/ + # Store intermediate build files of ObjC tests into /tmpfs + # TODO(jtattermusch): why are we doing this? + mkdir /tmpfs/Build-ios-binary-size + ln -s /tmpfs/Build-ios-binary-size src/objective-c/examples/Sample/Build + mkdir -p /tmpfs/DerivedData + rm -rf ~/Library/Developer/Xcode/DerivedData + mkdir -p ~/Library/Developer/Xcode + ln -s /tmpfs/DerivedData ~/Library/Developer/Xcode/DerivedData +fi -# Disable some unwanted dotnet options -export NUGET_XMLDOC_MODE=skip -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true -export DOTNET_CLI_TELEMETRY_OPTOUT=true +if [ "${PREPARE_BUILD_INSTALL_DEPS_PYTHON}" == "true" ] +then + # python + time pip install --user virtualenv + time pip install --user --upgrade Mako six tox setuptools twisted pyyaml pyjwt cryptography requests + export PYTHONPATH=/Library/Python/3.4/site-packages -# TODO(jtattermusch): better debugging of clock skew, remove once not needed -date - -time git submodule update --init + # Install Python 3.7 and Python 3.8 + time curl -O https://www.python.org/ftp/python/3.7.0/python-3.7.0-macosx10.9.pkg + time curl -O https://www.python.org/ftp/python/3.8.0/python-3.8.0-macosx10.9.pkg + echo "ae0717a02efea3b0eb34aadc680dc498 python-3.7.0-macosx10.9.pkg" > /tmp/python_installer_checksum.md5 + echo "f5f9ae9f416170c6355cab7256bb75b5 python-3.8.0-macosx10.9.pkg" >> /tmp/python_installer_checksum.md5 + md5sum -c /tmp/python_installer_checksum.md5 + time sudo installer -pkg ./python-3.7.0-macosx10.9.pkg -target / + time sudo installer -pkg ./python-3.8.0-macosx10.9.pkg -target / +fi -# Store intermediate build files of ObjC tests into /tmpfs -mkdir /tmpfs/Build-ios-binary-size -ln -s /tmpfs/Build-ios-binary-size src/objective-c/examples/Sample/Build -mkdir -p /tmpfs/DerivedData -rm -rf ~/Library/Developer/Xcode/DerivedData -mkdir -p ~/Library/Developer/Xcode -ln -s /tmpfs/DerivedData ~/Library/Developer/Xcode/DerivedData +if [ "${PREPARE_BUILD_INSTALL_DEPS_CSHARP}" == "true" ] +then + # Disable some unwanted dotnet options + export NUGET_XMLDOC_MODE=skip + export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true + export DOTNET_CLI_TELEMETRY_OPTOUT=true +fi # PHP tests currently require using an older version of PHPUnit ln -sf /usr/local/bin/phpunit-5.7 /usr/local/bin/phpunit +# TODO(jtattermusch): better debugging of clock skew, remove once not needed +date + +time git submodule update --init diff --git a/tools/internal_ci/macos/grpc_basictests_csharp.cfg b/tools/internal_ci/macos/grpc_basictests_csharp.cfg index d3e04e71f71..6c48a5bcf1f 100644 --- a/tools/internal_ci/macos/grpc_basictests_csharp.cfg +++ b/tools/internal_ci/macos/grpc_basictests_csharp.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_basictests_csharp.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 60 action { diff --git a/tools/internal_ci/macos/grpc_basictests_csharp.sh b/tools/internal_ci/macos/grpc_basictests_csharp.sh new file mode 100755 index 00000000000..c66e5c7738f --- /dev/null +++ b/tools/internal_ci/macos/grpc_basictests_csharp.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Copyright 2019 The 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 + +export PREPARE_BUILD_INSTALL_DEPS_CSHARP=true +$(dirname $0)/grpc_run_tests_matrix.sh diff --git a/tools/internal_ci/macos/pull_request/grpc_basictests_csharp.cfg b/tools/internal_ci/macos/pull_request/grpc_basictests_csharp.cfg index c9c1403693c..5ee22e375d0 100644 --- a/tools/internal_ci/macos/pull_request/grpc_basictests_csharp.cfg +++ b/tools/internal_ci/macos/pull_request/grpc_basictests_csharp.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_basictests_csharp.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 60 action { From 9ed008152411175f6f5541c76d498904b88c933f Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 6 Dec 2019 17:24:04 +0100 Subject: [PATCH 2/8] remove no-longer-used cfg files --- .../internal_ci/macos/grpc_basictests_dbg.cfg | 31 ------------------- .../internal_ci/macos/grpc_basictests_opt.cfg | 31 ------------------- 2 files changed, 62 deletions(-) delete mode 100644 tools/internal_ci/macos/grpc_basictests_dbg.cfg delete mode 100644 tools/internal_ci/macos/grpc_basictests_opt.cfg diff --git a/tools/internal_ci/macos/grpc_basictests_dbg.cfg b/tools/internal_ci/macos/grpc_basictests_dbg.cfg deleted file mode 100644 index 1c7ed26d648..00000000000 --- a/tools/internal_ci/macos/grpc_basictests_dbg.cfg +++ /dev/null @@ -1,31 +0,0 @@ -# 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. - -# Config file for the internal CI (in protobuf text format) - -# Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" -gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" -timeout_mins: 240 -action { - define_artifacts { - regex: "**/*sponge_log.*" - regex: "github/grpc/reports/**" - } -} - -env_vars { - key: "RUN_TESTS_FLAGS" - value: "-f basictests macos dbg --exclude objc --internal_ci -j 1 --inner_jobs 4 --bq_result_table aggregate_results" -} diff --git a/tools/internal_ci/macos/grpc_basictests_opt.cfg b/tools/internal_ci/macos/grpc_basictests_opt.cfg deleted file mode 100644 index f46ebaa7866..00000000000 --- a/tools/internal_ci/macos/grpc_basictests_opt.cfg +++ /dev/null @@ -1,31 +0,0 @@ -# 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. - -# Config file for the internal CI (in protobuf text format) - -# Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" -gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" -timeout_mins: 240 -action { - define_artifacts { - regex: "**/*sponge_log.*" - regex: "github/grpc/reports/**" - } -} - -env_vars { - key: "RUN_TESTS_FLAGS" - value: "-f basictests macos opt --exclude objc --internal_ci -j 1 --inner_jobs 4 --bq_result_table aggregate_results" -} From 42f82ba16fa4d810b90dc9374aca4e7acd979a46 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 6 Dec 2019 17:25:44 +0100 Subject: [PATCH 3/8] leaner ruby tests --- .../macos/grpc_basictests_ruby.cfg | 2 +- .../internal_ci/macos/grpc_basictests_ruby.sh | 19 +++++++++++++++++++ .../pull_request/grpc_basictests_ruby.cfg | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 tools/internal_ci/macos/grpc_basictests_ruby.sh diff --git a/tools/internal_ci/macos/grpc_basictests_ruby.cfg b/tools/internal_ci/macos/grpc_basictests_ruby.cfg index 3a28f97a54b..51b4d87e0a4 100644 --- a/tools/internal_ci/macos/grpc_basictests_ruby.cfg +++ b/tools/internal_ci/macos/grpc_basictests_ruby.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_basictests_ruby.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 60 action { diff --git a/tools/internal_ci/macos/grpc_basictests_ruby.sh b/tools/internal_ci/macos/grpc_basictests_ruby.sh new file mode 100755 index 00000000000..d83cd1e61c0 --- /dev/null +++ b/tools/internal_ci/macos/grpc_basictests_ruby.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Copyright 2019 The 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 + +export PREPARE_BUILD_INSTALL_DEPS_RUBY=true +$(dirname $0)/grpc_run_tests_matrix.sh diff --git a/tools/internal_ci/macos/pull_request/grpc_basictests_ruby.cfg b/tools/internal_ci/macos/pull_request/grpc_basictests_ruby.cfg index 5729bf8f751..1b60ddef9b0 100644 --- a/tools/internal_ci/macos/pull_request/grpc_basictests_ruby.cfg +++ b/tools/internal_ci/macos/pull_request/grpc_basictests_ruby.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_basictests_ruby.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 60 action { From 0890bc94925a86757b67cac994a665af3c341d7c Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 6 Dec 2019 17:26:37 +0100 Subject: [PATCH 4/8] leaner python tests --- .../macos/grpc_basictests_python.cfg | 2 +- .../macos/grpc_basictests_python.sh | 19 +++++++++++++++++++ .../pull_request/grpc_basictests_python.cfg | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 tools/internal_ci/macos/grpc_basictests_python.sh diff --git a/tools/internal_ci/macos/grpc_basictests_python.cfg b/tools/internal_ci/macos/grpc_basictests_python.cfg index ae80ac317ff..77ae336803c 100644 --- a/tools/internal_ci/macos/grpc_basictests_python.cfg +++ b/tools/internal_ci/macos/grpc_basictests_python.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_basictests_python.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 60 action { diff --git a/tools/internal_ci/macos/grpc_basictests_python.sh b/tools/internal_ci/macos/grpc_basictests_python.sh new file mode 100755 index 00000000000..a0dabbd3c1e --- /dev/null +++ b/tools/internal_ci/macos/grpc_basictests_python.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Copyright 2019 The 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 + +export PREPARE_BUILD_INSTALL_DEPS_PYTHON=true +$(dirname $0)/grpc_run_tests_matrix.sh diff --git a/tools/internal_ci/macos/pull_request/grpc_basictests_python.cfg b/tools/internal_ci/macos/pull_request/grpc_basictests_python.cfg index c86871f80cb..4a084bf6a71 100644 --- a/tools/internal_ci/macos/pull_request/grpc_basictests_python.cfg +++ b/tools/internal_ci/macos/pull_request/grpc_basictests_python.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_basictests_python.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 60 action { From 7aaf57c6f742b0bed458ab60b9d600be9f0aa0e7 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 6 Dec 2019 17:33:03 +0100 Subject: [PATCH 5/8] fix artifact and distribtest --- tools/internal_ci/macos/grpc_build_artifacts.sh | 3 +++ tools/internal_ci/macos/grpc_distribtests.sh | 1 + 2 files changed, 4 insertions(+) diff --git a/tools/internal_ci/macos/grpc_build_artifacts.sh b/tools/internal_ci/macos/grpc_build_artifacts.sh index f4a7708e71e..9bf987c532e 100755 --- a/tools/internal_ci/macos/grpc_build_artifacts.sh +++ b/tools/internal_ci/macos/grpc_build_artifacts.sh @@ -18,6 +18,9 @@ set -ex # change to grpc repo root cd $(dirname $0)/../../.. +export PREPARE_BUILD_INSTALL_DEPS_CSHARP=true +export PREPARE_BUILD_INSTALL_DEPS_PYTHON=true +export PREPARE_BUILD_INSTALL_DEPS_RUBY=true source tools/internal_ci/helper_scripts/prepare_build_macos_rc # install cython for all python versions diff --git a/tools/internal_ci/macos/grpc_distribtests.sh b/tools/internal_ci/macos/grpc_distribtests.sh index eb256d92ee8..ec51a51e56c 100644 --- a/tools/internal_ci/macos/grpc_distribtests.sh +++ b/tools/internal_ci/macos/grpc_distribtests.sh @@ -18,6 +18,7 @@ set -ex # change to grpc repo root cd $(dirname $0)/../../.. +export PREPARE_BUILD_INSTALL_DEPS_CSHARP=true source tools/internal_ci/helper_scripts/prepare_build_macos_rc # Move packages generated by the previous step in the build chain. From b2ca1f476cd1b0f761d3c2ed2f97e9b1972765aa Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 6 Dec 2019 17:37:46 +0100 Subject: [PATCH 6/8] leaner grpc_ios_binary_size --- tools/internal_ci/macos/grpc_ios_binary_size.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/internal_ci/macos/grpc_ios_binary_size.sh b/tools/internal_ci/macos/grpc_ios_binary_size.sh index 17937a30d41..523e3ae8b7d 100755 --- a/tools/internal_ci/macos/grpc_ios_binary_size.sh +++ b/tools/internal_ci/macos/grpc_ios_binary_size.sh @@ -21,6 +21,7 @@ set -ex # Enter the gRPC repo root cd $(dirname $0)/../../.. +export PREPARE_BUILD_INSTALL_DEPS_OBJC=true source tools/internal_ci/helper_scripts/prepare_build_macos_rc tools/profiling/ios_bin/binary_size.py \ From e684a3a322b45c036117aea3ab33c2400d9f1ff7 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 6 Dec 2019 17:38:45 +0100 Subject: [PATCH 7/8] leaner objc tests --- .../macos/grpc_basictests_cpp_ios.cfg | 2 +- .../macos/grpc_basictests_objc_examples.cfg | 2 +- .../macos/grpc_basictests_objc_ios.cfg | 2 +- .../macos/grpc_basictests_objc_mac.cfg | 2 +- .../macos/grpc_basictests_objc_tvos.cfg | 2 +- .../macos/grpc_run_tests_matrix_objc.sh | 19 +++++++++++++++++++ .../pull_request/grpc_basictests_cpp_ios.cfg | 2 +- .../grpc_basictests_objc_examples.cfg | 2 +- .../pull_request/grpc_basictests_objc_ios.cfg | 2 +- .../pull_request/grpc_basictests_objc_mac.cfg | 2 +- .../grpc_basictests_objc_tvos.cfg | 2 +- 11 files changed, 29 insertions(+), 10 deletions(-) create mode 100755 tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh diff --git a/tools/internal_ci/macos/grpc_basictests_cpp_ios.cfg b/tools/internal_ci/macos/grpc_basictests_cpp_ios.cfg index 3c8e402d3fc..d3b81517da4 100644 --- a/tools/internal_ci/macos/grpc_basictests_cpp_ios.cfg +++ b/tools/internal_ci/macos/grpc_basictests_cpp_ios.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 120 action { diff --git a/tools/internal_ci/macos/grpc_basictests_objc_examples.cfg b/tools/internal_ci/macos/grpc_basictests_objc_examples.cfg index bdfd62c7937..309c4429d17 100644 --- a/tools/internal_ci/macos/grpc_basictests_objc_examples.cfg +++ b/tools/internal_ci/macos/grpc_basictests_objc_examples.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 120 action { diff --git a/tools/internal_ci/macos/grpc_basictests_objc_ios.cfg b/tools/internal_ci/macos/grpc_basictests_objc_ios.cfg index faef331cab5..dc9adbdc566 100644 --- a/tools/internal_ci/macos/grpc_basictests_objc_ios.cfg +++ b/tools/internal_ci/macos/grpc_basictests_objc_ios.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 120 action { diff --git a/tools/internal_ci/macos/grpc_basictests_objc_mac.cfg b/tools/internal_ci/macos/grpc_basictests_objc_mac.cfg index 19849c357f3..1087217217f 100644 --- a/tools/internal_ci/macos/grpc_basictests_objc_mac.cfg +++ b/tools/internal_ci/macos/grpc_basictests_objc_mac.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 120 action { diff --git a/tools/internal_ci/macos/grpc_basictests_objc_tvos.cfg b/tools/internal_ci/macos/grpc_basictests_objc_tvos.cfg index a3f3935b5d6..17940f48c36 100644 --- a/tools/internal_ci/macos/grpc_basictests_objc_tvos.cfg +++ b/tools/internal_ci/macos/grpc_basictests_objc_tvos.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 120 action { diff --git a/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh b/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh new file mode 100755 index 00000000000..72cd1954a48 --- /dev/null +++ b/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Copyright 2019 The 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 + +export PREPARE_BUILD_INSTALL_DEPS_OBJC=true +$(dirname $0)/grpc_run_tests_matrix.sh diff --git a/tools/internal_ci/macos/pull_request/grpc_basictests_cpp_ios.cfg b/tools/internal_ci/macos/pull_request/grpc_basictests_cpp_ios.cfg index f831aba3b94..a34b9aa9ff2 100644 --- a/tools/internal_ci/macos/pull_request/grpc_basictests_cpp_ios.cfg +++ b/tools/internal_ci/macos/pull_request/grpc_basictests_cpp_ios.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 120 action { diff --git a/tools/internal_ci/macos/pull_request/grpc_basictests_objc_examples.cfg b/tools/internal_ci/macos/pull_request/grpc_basictests_objc_examples.cfg index e2e55777ad1..79b4fef0c0e 100644 --- a/tools/internal_ci/macos/pull_request/grpc_basictests_objc_examples.cfg +++ b/tools/internal_ci/macos/pull_request/grpc_basictests_objc_examples.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 120 action { diff --git a/tools/internal_ci/macos/pull_request/grpc_basictests_objc_ios.cfg b/tools/internal_ci/macos/pull_request/grpc_basictests_objc_ios.cfg index 4a4539b2353..530dc1d41b9 100644 --- a/tools/internal_ci/macos/pull_request/grpc_basictests_objc_ios.cfg +++ b/tools/internal_ci/macos/pull_request/grpc_basictests_objc_ios.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 120 action { diff --git a/tools/internal_ci/macos/pull_request/grpc_basictests_objc_mac.cfg b/tools/internal_ci/macos/pull_request/grpc_basictests_objc_mac.cfg index 98cf9345280..66f98d4d0d3 100644 --- a/tools/internal_ci/macos/pull_request/grpc_basictests_objc_mac.cfg +++ b/tools/internal_ci/macos/pull_request/grpc_basictests_objc_mac.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 120 action { diff --git a/tools/internal_ci/macos/pull_request/grpc_basictests_objc_tvos.cfg b/tools/internal_ci/macos/pull_request/grpc_basictests_objc_tvos.cfg index ec776def565..64d67ee53a9 100644 --- a/tools/internal_ci/macos/pull_request/grpc_basictests_objc_tvos.cfg +++ b/tools/internal_ci/macos/pull_request/grpc_basictests_objc_tvos.cfg @@ -15,7 +15,7 @@ # Config file for the internal CI (in protobuf text format) # Location of the continuous shell script in repository. -build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix.sh" +build_file: "grpc/tools/internal_ci/macos/grpc_run_tests_matrix_objc.sh" gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json" timeout_mins: 120 action { From 96d2517d2ad6cf7dffbdd0f439aaa04ee81fdf10 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 9 Dec 2019 17:31:49 +0100 Subject: [PATCH 8/8] fixes in prepare_build_macos_rc --- .../helper_scripts/prepare_build_macos_rc | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/internal_ci/helper_scripts/prepare_build_macos_rc b/tools/internal_ci/helper_scripts/prepare_build_macos_rc index c497e33567f..af6ba65cc19 100644 --- a/tools/internal_ci/helper_scripts/prepare_build_macos_rc +++ b/tools/internal_ci/helper_scripts/prepare_build_macos_rc @@ -18,6 +18,13 @@ launchctl limit maxfiles ulimit -a +# WARNING: TRY TO KEEP THIS FILE AS LEAN AS POSSIBLE +# The rules: +# - think twice before adding installer that takes long time (builds are already slow) +# - do not add any steps that are flaky (builds will become flaky) +# - try adding a dependency under a language-specific section first (reduces latency and increases build stability) +# - only add stuff that you absolutely need for your builds to work (add comment to explain why its needed) + # Add GCP credentials for BQ access pip install --user google-api-python-client oauth2client export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json @@ -56,8 +63,13 @@ then # set xcode version for Obj-C tests sudo xcode-select -switch /Applications/Xcode_9.2.app/Contents/Developer/ + # Needed for ios-binary-size + time pip install --user pyyaml pyjwt cryptography requests + # Store intermediate build files of ObjC tests into /tmpfs - # TODO(jtattermusch): why are we doing this? + # TODO(jtattermusch): this has likely been done to avoid running + # out of disk space when running ios-binary-size tests, but + # it would be good to revisit. mkdir /tmpfs/Build-ios-binary-size ln -s /tmpfs/Build-ios-binary-size src/objective-c/examples/Sample/Build mkdir -p /tmpfs/DerivedData @@ -73,6 +85,9 @@ then time pip install --user --upgrade Mako six tox setuptools twisted pyyaml pyjwt cryptography requests export PYTHONPATH=/Library/Python/3.4/site-packages + # make sure md5sum is available (requires coreutils 8.31+) + brew upgrade coreutils + # Install Python 3.7 and Python 3.8 time curl -O https://www.python.org/ftp/python/3.7.0/python-3.7.0-macosx10.9.pkg time curl -O https://www.python.org/ftp/python/3.8.0/python-3.8.0-macosx10.9.pkg @@ -89,6 +104,9 @@ then export NUGET_XMLDOC_MODE=skip export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true export DOTNET_CLI_TELEMETRY_OPTOUT=true + + # Xcode 10+ doesn't support building for i386 architecture + sudo xcode-select -switch /Applications/Xcode_9.2.app/Contents/Developer/ fi # PHP tests currently require using an older version of PHPUnit