-
Notifications
You must be signed in to change notification settings - Fork 160
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
Add grpc proxy backend #680
Changes from 14 commits
79de165
7af17e2
23219e9
3afd5ff
8e000f6
849eccc
32b6218
b7144c2
728b2d6
1ec3a38
1aa918d
569e34e
6498cbe
d3afb83
ddf4182
cf04071
303a252
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,6 +243,20 @@ OPTIONS: | |
Goroutines to process parallel uploads to backend. (default: 100) | ||
[$BAZEL_REMOTE_NUM_UPLOADERS] | ||
|
||
--grpc_proxy.url value The base URL to use for a grpc proxy backend, e.g. | ||
localhost:9090 or example.com:7070. | ||
[$BAZEL_REMOTE_GRPC_PROXY_URL] | ||
|
||
--grpc_proxy.key_file value Path to a key used to authenticate with the | ||
proxy backend using mTLS. If this flag is provided, then | ||
grpc_proxy.cert_file must also be specified. | ||
[$BAZEL_REMOTE_GRPC_PROXY_KEY_FILE] | ||
|
||
--grpc_proxy.cert_file value Path to a certificate used to authenticate | ||
with the proxy backend using mTLS. If this flag is provided, then | ||
grpc_proxy.key_file must also be specified. | ||
[BAZEL_REMOTE_GRPC_PROXY_CERT_FILE] | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How difficult would it be to add support for basic/password authentication? I think we should consider adding this, mostly to avoid documenting that it doesn't work, but also because it's probably easier to setup a system test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The password authentication is right now used only for clients to authenticate with bazel-remote, but not for it to authenticate with the proxy backend. As far as I can tell, none of the existing proxies support this right now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The bazel-remote <-> proxy backend authentiation is completely separate from the client <-> bazel-remote authentication though. If bazel-remote is the main intended use case for the grpc proxy backend, then I think we should support that. But this would be OK to land in a followup (I can help if needed). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did not realise that the http proxy actualy supports basic auth, just need to pass the credentials in the proxy url. I took a stab at doing the same for the grpc proxy. |
||
--http_proxy.url value The base URL to use for a http proxy backend. | ||
[$BAZEL_REMOTE_HTTP_PROXY_URL] | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = [ | ||
"grpcproxy.go", | ||
"readcloser.go", | ||
], | ||
importpath = "github.com/buchgr/bazel-remote/v2/cache/grpcproxy", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//cache:go_default_library", | ||
"//genproto/build/bazel/remote/asset/v1:go_default_library", | ||
"//genproto/build/bazel/remote/execution/v2:go_default_library", | ||
"//utils/backendproxy:go_default_library", | ||
mostynb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"@com_github_google_uuid//:go_default_library", | ||
"@go_googleapis//google/bytestream:bytestream_go_proto", | ||
"@org_golang_google_grpc//:go_default_library", | ||
"@org_golang_google_grpc//codes:go_default_library", | ||
"@org_golang_google_grpc//status:go_default_library", | ||
"@org_golang_google_protobuf//proto:go_default_library", | ||
], | ||
) | ||
|
||
go_test( | ||
name = "go_default_test", | ||
srcs = ["grpcproxy_test.go"], | ||
embed = [":go_default_library"], | ||
deps = [ | ||
"//cache:go_default_library", | ||
"//cache/disk:go_default_library", | ||
"//genproto/build/bazel/remote/execution/v2:go_default_library", | ||
"//server:go_default_library", | ||
"//utils:go_default_library", | ||
"@com_github_google_uuid//:go_default_library", | ||
"@go_googleapis//google/bytestream:bytestream_go_proto", | ||
"@org_golang_google_grpc//:go_default_library", | ||
"@org_golang_google_grpc//credentials/insecure:go_default_library", | ||
"@org_golang_google_grpc//test/bufconn:go_default_library", | ||
"@org_golang_google_protobuf//proto:go_default_library", | ||
], | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should probably provide a way to use TLS when talking to the proxy backend and not using mTLS. It looks like this PR uses TLS when authenticating with the proxy backend via mTLS (which makes sense), otherwise TLS is not used at all when talking to the proxy backend?