Skip to content
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

Allow Galaxy downloader to trust collection cache #78

Merged

Conversation

felixfontein
Copy link
Collaborator

This allows to reduce the number of requests to the Galaxy server to zero when rebuilding Ansible (or a stable/devel docsite) when all required collection artifacts are already in the cache. Also the filename for the artifact is now determined by antsibull-core, and no longer by the Galaxy server.

Right now antsibull-core doesn't trust the cache and asks the Galaxy server for the filename and the SHA256 checksum of the artifact, and only then checks whether it has a file of that name in its cache, and whether the checksum matches. This means that even if the cache has been populated by the previous antsibull-build prepare call a few minutes ago, it has to query the Galaxy server again to make sure it has the latest versions. Especially since Community Galaxy does not allow the content of published collections to change, it is safe (especially for development purposes) to assume that the cache is trustworthy.

@felixfontein
Copy link
Collaborator Author

I think trust_collection_cache should be part of the library context as well, so this should be rebased on top of #81 and adjusted. Marking as draft until #81 is done.

@felixfontein felixfontein marked this pull request as draft April 30, 2023 19:38
@felixfontein felixfontein force-pushed the trust-collection-cache branch from 54b6c2e to 945b1a9 Compare April 30, 2023 20:00
@felixfontein
Copy link
Collaborator Author

felixfontein commented Apr 30, 2023

(Now contains #81.)

@felixfontein felixfontein force-pushed the trust-collection-cache branch from 945b1a9 to e6cda28 Compare May 1, 2023 06:22
@felixfontein felixfontein marked this pull request as ready for review May 1, 2023 06:27
@felixfontein
Copy link
Collaborator Author

This is now ready for reviewing.

Copy link
Collaborator

@gotmax23 gotmax23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! I left you a couple comments.

src/antsibull_core/galaxy.py Outdated Show resolved Hide resolved
src/antsibull_core/galaxy.py Outdated Show resolved Hide resolved
src/antsibull_core/galaxy.py Show resolved Hide resolved
src/antsibull_core/galaxy.py Outdated Show resolved Hide resolved
src/antsibull_core/galaxy.py Outdated Show resolved Hide resolved
src/antsibull_core/utils/io.py Show resolved Hide resolved
@felixfontein felixfontein merged commit 59f1d05 into ansible-community:main May 2, 2023
@felixfontein felixfontein deleted the trust-collection-cache branch May 2, 2023 19:26
@felixfontein
Copy link
Collaborator Author

@gotmax23 thanks for reviewing this!

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