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

chore(NA): integrate build buddy with our bazel setup and remote cache for ci #90116

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b904e12
chore(NA): simple changes on bazelrc
mistic Feb 3, 2021
efb6a45
chore(NA): integrate bazel tools with BuildBuddy and remote cache ser…
mistic Feb 3, 2021
6cc51bd
chore(NA) fix bazelrc line config
mistic Feb 3, 2021
51bd510
chore(NA): move non auth settings out of bazelrc.auth
mistic Feb 3, 2021
64a800a
chore(NA): output home dir
mistic Feb 3, 2021
d35c51b
chore(NA): load .bazelrc-ci.auth from /Users/tiagocosta dir
mistic Feb 3, 2021
2212d31
chore(NA): remove bazelrc auth file and append directly into home baz…
mistic Feb 3, 2021
e1d799a
Merge branch 'master' into integrate-build-buddy-with-our-bazel-setup
kibanamachine Feb 3, 2021
faaec4e
Merge branch 'master' into integrate-build-buddy-with-our-bazel-setup
kibanamachine Feb 3, 2021
5e381c9
Merge branch 'master' into integrate-build-buddy-with-our-bazel-setup
kibanamachine Feb 3, 2021
4571570
Merge branch 'master' into integrate-build-buddy-with-our-bazel-setup
kibanamachine Feb 4, 2021
f415c2c
Merge branch 'master' into integrate-build-buddy-with-our-bazel-setup
kibanamachine Feb 4, 2021
2a6b691
Merge branch 'master' into integrate-build-buddy-with-our-bazel-setup
kibanamachine Feb 4, 2021
347fc13
chore(NA): comment announce option
mistic Feb 4, 2021
56ad7c5
chore(NA): integrate build buddy metadata
mistic Feb 4, 2021
1dc7faf
chore(NA): update src/dev/ci_setup/.bazelrc-ci
mistic Feb 4, 2021
12e7c10
chore(NA): move build metadata integation to common confdig
mistic Feb 4, 2021
b1bc6c1
chore(NA): merge and solve conflicts with master
mistic Feb 4, 2021
5a280f0
chore(NA): fix problem on bazel file location
mistic Feb 4, 2021
71a9214
chore(NA): correct sh file permissions
mistic Feb 4, 2021
f831fbe
chore(NA): only get host on CI
mistic Feb 4, 2021
889340d
chore(NA): add cores into host info on CI
mistic Feb 4, 2021
c5cd6ca
Merge branch 'master' into integrate-build-buddy-with-our-bazel-setup
kibanamachine Feb 4, 2021
2c467cd
chore(NA): sync with last settings to setup bazelisk tools on ci
mistic Feb 4, 2021
4267ea0
chore(NA): sync last changes on ci setup env
mistic Feb 4, 2021
cc503f8
chore(NA): sync settings on ci setup with the other PR
mistic Feb 5, 2021
f8a2e67
Merge remote-tracking branch 'upstream/master' into integrate-build-b…
mistic Feb 5, 2021
f55f27c
chore(NA): merge and solve conflicts with master
mistic Feb 5, 2021
857058a
chore(NA): remove yarn export
mistic Feb 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Import shared settings first so we can override below
import %workspace%/.bazelrc.common

## Disabled for now
# Remote cache settings for local env
# build --remote_cache=https://storage.googleapis.com/kibana-bazel-cache
# build --incompatible_remote_results_ignore_disk=true
Expand Down
23 changes: 13 additions & 10 deletions .bazelrc.common
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@
#
# The full list of Bazel options: https://docs.bazel.build/versions/master/command-line-reference.html

# Cache action outputs on disk so they persist across output_base and bazel shutdown (eg. changing branches)
build --disk_cache=bazel-cache/disk-cache
# Local Cache Settings
## Avoid cache results from being corrupt when changing source during build
common --experimental_guard_against_concurrent_changes

# Bazel repo cache settings
build --repository_cache=bazel-cache/repository-cache
## Cache action outputs on disk so they persist across output_base and bazel shutdown (eg. changing branches)
build --disk_cache=~/.bazel-cache/disk-cache

## Bazel repo cache settings
build --repository_cache=~/.bazel-cache/repository-cache

# Bazel will create symlinks from the workspace directory to output artifacts.
# Build results will be placed in a directory called "bazel-dist/bin"
# Build results will be placed in a directory called "bazel/bin"
# This will still create a bazel-out symlink in
# the project directory, which must be excluded from the
# editor's search path.
build --symlink_prefix=bazel-dist/
build --symlink_prefix=bazel/
# To disable the symlinks altogether (including bazel-out) we can use
# build --symlink_prefix=/
# however this makes it harder to find outputs.
Expand All @@ -37,9 +41,7 @@ common --color=yes
build --show_task_finish
build --noshow_progress
build --noshow_loading_progress

## enforced default values
build --show_result=1
build --show_result=0

# Specifies desired output mode for running tests.
# Valid values are
Expand Down Expand Up @@ -78,7 +80,8 @@ test:debug --test_output=streamed --test_strategy=exclusive --test_timeout=9999
# The node process will break before user code starts and wait for the debugger to connect.
run:debug --define=VERBOSE_LOGS=1 -- --node_options=--inspect-brk
# The following option will change the build output of certain rules such as terser and may not be desirable in all cases
build:debug --compilation_mode=dbg
# It will also output both the repo cache and action cache to a folder inside the repo
build:debug --compilation_mode=dbg --show_result=1 --disk_cache=bazel/disk-cache --repository_cache=bazel/repository-cache

# Turn off legacy external runfiles
# This prevents accidentally depending on this feature, which Bazel will remove.
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ report.asciidoc
.yarn-local-mirror

# Bazel
/bazel-*
/bazel
/.bazelrc.user
10 changes: 10 additions & 0 deletions src/dev/ci_setup/.bazelrc-ci
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
# Import and load bazelrc common settings for ci env
try-import %workspace%/src/dev/ci_setup/.bazelrc-ci.common

# Import and load bazelrc ci auth settings for BuildBuddy
try-import /var/lib/jenkins/.bazelrc-ci.auth

# BuildBuddy Remote Settings
build --bes_results_url=https://app.buildbuddy.io/invocation/
build --bes_backend=grpcs://cloud.buildbuddy.io
build --remote_cache=grpcs://cloud.buildbuddy.io
build --remote_timeout=3600

## Disabled for now as we are using BuildBuddy
# Remote cache settings for ci env
# build --google_default_credentials
# build --remote_upload_local_results=true
3 changes: 3 additions & 0 deletions src/dev/ci_setup/load_env_keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ else
PERCY_TOKEN=$(retry 5 vault read -field=value secret/kibana-issues/dev/percy)
export PERCY_TOKEN

KIBANA_BUILDBUDDY_CI_API_KEY=$(retry 5 vault read -field=value secret/kibana-issues/dev/kibana-buildbuddy-ci-api-key)
export KIBANA_BUILDBUDDY_CI_API_KEY

# remove vault related secrets
unset VAULT_ROLE_ID VAULT_SECRET_ID VAULT_TOKEN VAULT_ADDR
fi
15 changes: 11 additions & 4 deletions src/dev/ci_setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ echo " -- PARENT_DIR='$PARENT_DIR'"
echo " -- KIBANA_PKG_BRANCH='$KIBANA_PKG_BRANCH'"
echo " -- TEST_ES_SNAPSHOT_VERSION='$TEST_ES_SNAPSHOT_VERSION'"

###
### copy .bazelrc-ci into $HOME/.bazelrc
###
cp "src/dev/ci_setup/.bazelrc-ci" "$HOME/.bazelrc";

###
### generate .bazelrc-ci.auth into "$HOME/.bazelrc-ci.auth";
###
echo "# Generated by src/dev/ci_setup/setup.sh" > "$HOME/.bazelrc-ci.auth"
echo "build --remote_header=x-buildbuddy-api-key=$KIBANA_BUILDBUDDY_CI_API_KEY" >> "$HOME/.bazelrc-ci.auth"
tylersmalley marked this conversation as resolved.
Show resolved Hide resolved

###
### install dependencies
###
Expand Down Expand Up @@ -66,7 +77,3 @@ if [ "$GIT_CHANGES" ]; then
exit 1
fi

###
### copy .bazelrc-ci into $HOME/.bazelrc
###
cp "src/dev/ci_setup/.bazelrc-ci" "$HOME/.bazelrc";