-
Notifications
You must be signed in to change notification settings - Fork 34
Add service to host crates registry queries #779
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
base: main
Are you sure you want to change the base?
Conversation
The full crates.io index corpus is too large and growing too fast to realistically assume we can have access to it all at once for inference purposes. This new component enables us to keep a fixed-size cache of snapshots on disk while rotating the least used snapshots out when other snapshots are requested. We unconditionally keep the current (i.e. non-archived) index cloned given it is the newest and most likely to be requested during inference. The interface also supports loading index portions from an existing filesystem which means it can also be used transiently to mediate access to these resources. stacked-commit: true
stacked-commit: true
2662d6e
to
be8b79f
Compare
|
||
var ( | ||
cacheDir = flag.String("cache-dir", "/tmp/registry-cache", "Directory to cache registry indices") | ||
maxSnapshots = flag.Int("max-snapshots", 18, "Maximum number of snapshot indices to cache") |
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.
nit: Where did 18 come from as the default? Based on approximate size of each?
image = data.google_artifact_registry_docker_image.crates-registry.self_link | ||
args = [ | ||
"--cache-dir=/cache", | ||
"--max-snapshots=16", |
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.
nit: Is this based on amount of memory and/or volume size? Probably worth a comment.
) | ||
|
||
// FindRegistryCommitRequest represents a request to find a registry commit | ||
type FindRegistryCommitRequest struct { |
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.
Is there a reason this request and response type is defined in the service implementation library rather than schema?
No description provided.