Add a REST -> gRPC proxy/gateway to BuildGrid
Context
Currently bgd-browser uses grpc-web to communicate with BuildGrid. However, this requires use of Envoy to provide a proxy to translate from grpc-web to real gRPC, and vice versa. Envoy isn't practical to deploy in our infrastructure, so we need to replace this communication with something that doesn't require it.
Proposed Solution
The most flexible approach here will be to implement a simple REST API which provides endpoints which effectively proxy at least the request types we need through to a backend BuildGrid. It makes sense to build this functionality into BuildGrid itself, to allow us to reuse code when relevant, and avoid the need for yet more separate tools to deploy.
It should be integrated as a separate part of the command line tool though, rather than being part of the bgd server command's config language. We should pick a lightweight library to do this, potentially aiohttp due to its excellent websockets support.
Acceptance Criteria
This is done when we have a REST API covering at least the functionality needed by bgd-browser.
Consider whether the following are required, and complete if so:
-
Unit tests -
Metrics -
Documentation update(s)