Support for the gRPC Docker registry proxy#25
Conversation
vladaionescu
left a comment
There was a problem hiding this comment.
LGTM! Perhaps @alexcb should also review this.
|
|
||
| // parseHeader parses the incoming request header and extracts the method, path, | ||
| // & header values. | ||
| func parseHeader(r io.Reader) (method string, path string, header http.Header, err error) { |
There was a problem hiding this comment.
so you've created your own webserver I see? interesting :)
(if it works, it works.)
alexcb
left a comment
There was a problem hiding this comment.
I think it looks good -- my only concern is if we find ourselves needing to proxy anything else this is tied to the http protocol. I think it's fine for now -- if (and this is a big if) we need to proxy to a different service, i think it would be good to refactor this to be more generic (e.g. Proxy could take some sort of serviceID).
Please rebase all your commits prior to merging this PR
Interesting point. This service is purpose-built to speak with the embedded registry, but it's certainly possible to register other services on the gRPC connection for other purposes. We could definitely take a look at making this more generic, like you suggested, as the need arises. I may also take a look at streaming the raw HTTP data over a lower-level TCP connection. I figured the HTTP libraries would help with some of the overhead, but that may not be necessary. |
|
On second thought, I think I may leave this as is for the time being. We can always revisit it later if needed. |
f695a69 to
343404c
Compare
This PR adds support for proxying image registry requests to the BK-embedded registry using a gRPC stream. A local proxy is used by the container frontend to "pull" an image from the local or remote BK via the gRPC proxy.  Associated with: earthly/buildkit#25
This PR adds a new gRPC service that makes use of the pre-existing gRPC connection to stream registry image data out of the embedded registry and into the local container frontend (
docker pull, etc.).Associated with: earthly/earthly#3299