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

Use BAZEL_BUILD_EXTRA_OPTIONS to setup Bazel remote cache #32989

Closed
Winbobob opened this issue Mar 19, 2024 · 5 comments
Closed

Use BAZEL_BUILD_EXTRA_OPTIONS to setup Bazel remote cache #32989

Winbobob opened this issue Mar 19, 2024 · 5 comments
Labels
area/build enhancement Feature requests. Not bugs or questions.

Comments

@Winbobob
Copy link
Member

Title

Use BAZEL_BUILD_EXTRA_OPTIONS to setup Bazel remote cache

Description

The example command mentioned in this README does not work well when you need to specify the header for remote cache.

This is because both basic and bearer AuthN schemes need the quotes to group the content and use quotes here can be tricky. Especially there are already two layers of quotes with in ./ci/run_envoy_docker.sh.

Proposal

Update this README:

  • for simply Bazel remote cache options, especially without quotes, we use the BAZEL_BUILD_EXTRA_OPTIONS env variables.
  • for complex Bazel remote cache options, especially with quotes, we add/append the options to the user.bazelrc files.
@Winbobob Winbobob added the triage Issue requires triage label Mar 19, 2024
@htuch
Copy link
Member

htuch commented Mar 21, 2024

@phlax

@htuch htuch added enhancement Feature requests. Not bugs or questions. area/build and removed triage Issue requires triage labels Mar 21, 2024
@phlax
Copy link
Member

phlax commented Mar 21, 2024

@Winbobob sgtm

we have been gradually shifting configs into .bazelrc and away from env vars or cli flags for the reasons you point out and many others also

are you up for raising a PR to adjust the dev docs?

the readme you linked is pretty hopelessly out of date - its on my agenda to do some work on dev docs - but for now i think its the best place (for ref there is also bazel/README amongst others)

@Winbobob
Copy link
Member Author

Cool, thank you for the confirmation! I can create the PR.

@moderation
Copy link
Contributor

After a couple of years of enjoying the Google RBE, my builds now download GBs of *.dwo files and the builds are now super slow and serial.
image
I'm guessing my ~/.bazelrc is out of date but haven't been able to work out the right commands

@phlax
Copy link
Member

phlax commented Mar 26, 2024

@moderation the easiest way to use RBE ive found is to place just the credentials in user.bazelrc - ie:

build --google_credentials=./gcloud.token

and then after doing export ENVOY_RBE=1 use the ci/do_ci.sh targets

this is the closest to what ci is doing

using bazel directly you want something like:

build --remote_instance_name=projects/envoy-ci/instances/default_instance
build --remote_cache=grpcs://remotebuildexecution.googleapis.com
build --remote_executor=grpcs://remotebuildexecution.googleapis.com
build --jobs=40

depending on the toolchain you want you probably also need something like:

build --config=rbe-toolchain-clang-libc++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build enhancement Feature requests. Not bugs or questions.
Projects
None yet
Development

No branches or pull requests

4 participants