I would like to keep the bazel cache around to not download it all the times (shave off few minutes of download).
From 0.10. Bazel seems to be able to use remote caching with GCS support
Do I need to have the service account.json specifically set for the image or I can just use the cloudbuilder container ?
should I just use a volume and gsutil rsync before/after ?
/cc @googlestanke
My understanding is that if the builder service account ([email protected]) has write access to the bucket in question, it should Just Work, but I haven't tried it myself yet.
I just got this working! I had to make sure the builder service account had access, but then also for me the magic missing flag to bazel was --google_default_credentials i.e.
- name: gcr.io/cloud-builders/bazel
args: ['build', '--google_default_credentials', '--spawn_strategy=remote', '--genrule_strategy=remote', '--strategy=Javac=remote', '--strategy=Closure=remote', '--remote_http_cache=https://storage.googleapis.com/mybucket', '//cmd/...']
mybucket is the placeholder for my bucket
Until I added the google_default_credentials flag I was getting C++ compilation of rule '@com_google_protobuf//:protoc_lib' failed (Exit 34). Note: Remote connection/protocol failed with: execution failed
Most helpful comment
I just got this working! I had to make sure the builder service account had access, but then also for me the magic missing flag to bazel was
--google_default_credentialsi.e.mybucketis the placeholder for my bucketUntil I added the google_default_credentials flag I was getting
C++ compilation of rule '@com_google_protobuf//:protoc_lib' failed (Exit 34). Note: Remote connection/protocol failed with: execution failed