From c73f4c0fd3b0a8751321c899d0d5a8701039ee87 Mon Sep 17 00:00:00 2001 From: terence tsao Date: Wed, 26 Sep 2018 17:08:00 -0700 Subject: [PATCH] Enable Remote Caching & Use Host GO Version (#578) * Revert "Add Skip Coverage Condition in Coverage.sh (#416)" This reverts commit 72a5dd1cf4c3942fb4dc04a27a08d8b0742abbae. * add coverage.sh back * remote cache * fixed formatting * Add support for cache reads and writes * trying to get this newline to not be escaped. please behave travis * last attempt at new line... --- .travis-bazelrc | 9 ++++++--- .travis.yml | 34 ++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.travis-bazelrc b/.travis-bazelrc index 2be706c5c1..349dc27b5c 100644 --- a/.travis-bazelrc +++ b/.travis-bazelrc @@ -1,9 +1,12 @@ startup --host_jvm_args=-Xmx500m --host_jvm_args=-Xms500m # Remote caching over Google Cloud Storage -# TODO(#282): Enable remote caching/execution -#build:remote --remote_http_cache=https://storage.googleapis.com/prysmatic-bazel-cache -#build:remote --google_credentials=/tmp/service-account.json +# Read-only +build:remote --remote_http_cache=https://storage.googleapis.com/prysmatic-bazel-cache +build:remote --remote_upload_local_results=false +# Read-write (prysmatic branches only) +build:remote-rw --remote_http_cache=https://storage.googleapis.com/prysmatic-bazel-cache +build:remote-rw --google_credentials=/tmp/service-account.json # Set some build options for travis container. build --local_resources=1536,1.5,0.5 diff --git a/.travis.yml b/.travis.yml index a876448d53..f3b6044517 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,8 @@ matrix: before_install: # Install Bazel - | + echo "" >> WORKSPACE + echo "go_register_toolchains(go_version = \"host\")" >> WORKSPACE if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then OS=darwin else @@ -39,12 +41,13 @@ matrix: ./install.sh --user rm -f install.sh # Decrypt service account (only works on prysmaticlabs branches) - # TODO(#282): enable remote caching / execution - #- if [[ $encrypted_64ca747eb448_iv ]]; then - # openssl aes-256-cbc -K $encrypted_64ca747eb448_key -iv $encrypted_64ca747eb448_iv - # -in service-account.json.enc -out /tmp/service-account.json -d; - # REMOTE_FLAGS=--config=remote; - # fi + - if [[ $encrypted_64ca747eb448_iv ]]; then + openssl aes-256-cbc -K $encrypted_64ca747eb448_key -iv $encrypted_64ca747eb448_iv + -in service-account.json.enc -out /tmp/service-account.json -d; + REMOTE_FLAGS=--config=remote-rw; + else + REMOTE_FLAGS=--config=remote; + fi install: true # Skip install go packages. @@ -54,7 +57,7 @@ matrix: bazel \ --bazelrc=.travis-bazelrc \ build \ - //... + //... $REMOTE_FLAGS # Run all tests. - | bazel \ @@ -75,6 +78,8 @@ matrix: before_install: # Install Bazel - | + echo "" >> WORKSPACE + echo "go_register_toolchains(go_version = \"host\")" >> WORKSPACE if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then OS=darwin else @@ -87,12 +92,13 @@ matrix: ./install.sh --user rm -f install.sh # Decrypt service account (only works on prysmaticlabs branches) - # TODO(#282): enable remote caching / execution - #- if [[ $encrypted_64ca747eb448_iv ]]; then - # openssl aes-256-cbc -K $encrypted_64ca747eb448_key -iv $encrypted_64ca747eb448_iv - # -in service-account.json.enc -out /tmp/service-account.json -d; - # REMOTE_FLAGS=--config=remote; - # fi + - if [[ $encrypted_64ca747eb448_iv ]]; then + openssl aes-256-cbc -K $encrypted_64ca747eb448_key -iv $encrypted_64ca747eb448_iv + -in service-account.json.enc -out /tmp/service-account.json -d; + REMOTE_FLAGS=--config=remote-rw; + else + REMOTE_FLAGS=--config=remote; + fi install: true # Skip install go packages. @@ -102,7 +108,7 @@ matrix: bazel \ --bazelrc=.travis-bazelrc \ build \ - //... + //... $REMOTE_FLAGS # Run all tests. - | bazel \