Skip to content

feat(build): add PrefetchIndexes for resolving against one index snapshot - #2488

Draft
markusthoemmes wants to merge 1 commit into
chainguard-dev:mainfrom
markusthoemmes:prefetched-indexes
Draft

markusthoemmes wants to merge 1 commit into
chainguard-dev:mainfrom
markusthoemmes:prefetched-indexes

Conversation

@markusthoemmes

Copy link
Copy Markdown
Member

Resolving many image configurations re-fetches and revalidates the repository indexes for every configuration, variant, and architecture, which is a large number of HEAD and GET round-trips and, because each resolve issues its own HEAD, can bind different architectures to different index generations - so a package published to one architecture mid-resolve resolves as absent on the other. PrefetchIndexes fetches each repository/architecture index once and returns a snapshot; passing it via WithPrefetchedIndexes makes GetRepositoryIndexes return it verbatim, so every resolve shares one consistent generation and the index round-trips collapse to a single fetch per repository and architecture. The snapshot is opt-in and does not change behaviour for callers that do not pass it.

…shot

Resolving many image configurations re-fetches and revalidates the repository indexes for every configuration, variant, and architecture, which is a large number of HEAD and GET round-trips and, because each resolve issues its own HEAD, can bind different architectures to different index generations - so a package published to one architecture mid-resolve resolves as absent on the other. PrefetchIndexes fetches each repository/architecture index once and returns a snapshot; passing it via WithPrefetchedIndexes makes GetRepositoryIndexes return it verbatim, so every resolve shares one consistent generation and the index round-trips collapse to a single fetch per repository and architecture. The snapshot is opt-in and does not change behaviour for callers that do not pass it.
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.

1 participant