Bazel: Allow passing extra HTTP headers to remote cache

Created on 7 May 2019  路  3Comments  路  Source: bazelbuild/bazel

It's currently not possible to pass extra HTTP headers to the remote cache. I would like to be able to do something like this:

bazel build --remote_http_cache=$SOME_URL --remote_http_header="Build-Id: some-id" --remote_http_header="Product-Name: Some-Name"

The idea is to allow for custom logic in the remote http cache to keep metrics about cache usage on a per-product or per-build basis.

P2 team-Remote-Exec feature request

Most helpful comment

SGTM. It seems like a good idea to also support this for gRPC as it's HTTP/2 after all.

I think I'd prefer a format like --remote_header=Name=Value.

All 3 comments

SGTM. It seems like a good idea to also support this for gRPC as it's HTTP/2 after all.

I think I'd prefer a format like --remote_header=Name=Value.

@ob are you planning to add support for GRPC headers?

I'm not sure how to do that. I'm not familiar with that section of the code. I'll take a look but if you have any pointers on what would need to be done I'd appreciate it.

Was this page helpful?
0 / 5 - 0 ratings