-
Notifications
You must be signed in to change notification settings - Fork 59
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
RFC: Bazel Query Service #29
Comments
As a datum, I had a hallway-con conversation with Benjamin and Armoo (I hope I'm spelling that correct, I never had to write it down before) about this exact behavior. They said that they had a lot of issues with using the Git CLI to get a local checkout of files. Inconsistent checkouts, missing files, leaving files on disk that were deleted in a commit. You might consider using something like JGit which can expose any single commit's tree in Java without writing to disk and dealing with those issues. |
Thanks for the tip @achew22 ! |
We have some rough hopes of building something similar but much simpler in the future too. The basic idea we had was whenever calculating hashes for a revision, try fetch it from S3, else generate and store it in S3. |
We've achieved a "good enough" implementation of this by independently doing what @zoidyzoidzoid suggested. We have a two-level local + s3 cache for the hash blobs produced by |
In the BazelCon talk that inspired this repo, at this timestamp:
https://youtu.be/9Dk7mtIm7_A?t=1875
Benjamin talks about how Dropbox operationalized the bazel-diff tool by hosting it as a service. This issue proposes that we implement such a thing in this repo.
Language: Java, since that's what's already used in this repo
Storage: for the cache behavior, we need to store the hashes.json files at a given Git SHA. It should persist over server shutdowns since cache misses introduce a lot of latency. Can make this configurable but AWS S3 seems like the obvious choice most users would want.
Hosting: Ben points out in the talk that a custom load balancer can be needed for this service. So it's not enough to just ship a docker (OCI) image that has a runnable service with networking, we probably need a k8s manifest that also describes how to run a few instances of the query service, health/load checks, and a load balancer that finds available instance to send requests. Maybe even a dynamic scaling to adjust the number of instances.
Getting the code: we'd have to use a git client (probably assume one is on the
$PATH
and call it as a subprocess). Then we have to checkout the workspace at various SHAs. When a server comes up it should do an initial fetch of the repo before reporting healthy to accept requests. Need to give user configurability to reach their git server (auth keys, etc). Also have to deal with bad git state (maybe just detect and lame duck the server rather than try to repair)Prior art:
The text was updated successfully, but these errors were encountered: