Skip to content

Conversation

msuozzo
Copy link
Member

@msuozzo msuozzo commented Sep 12, 2025

No description provided.

@msuozzo msuozzo requested a review from wbxyz September 12, 2025 19:51
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

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")
Copy link
Member

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",
Copy link
Member

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 {
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants