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
Added caching mechanism for Galaxy API requests #71904
Conversation
This comment has been minimized.
This comment has been minimized.
I've had another look at the latest_version/highest_version mechanism and it looks like Galaxy and AH do sort this value so it's not just the last one uploaded. This means the version check to see whether we should invalid the cache won't work if an older semver was published. I still think it's worth caching the data and just rely on the 24 hour fallback or a manual removal of the cache for this scenario. It shouldn't be too common for an older version to be published after a newer one. |
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.
Looks good. I'd prefer not to cache artifacts, or at least not by default.
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.
Looks good to me
8fa3038
to
68add39
Compare
After investigating the test failures there are a few problems that need to be solved before this can be merged in:
The first could be bypassed by using the latest/highest_version field as that works as expected but that has the same issue as the 2nd point. Publishing a collection at an older version will not be picked up resulting in the cli not knowing about it until the TTL (24 hours) is up. I want to wait an see if both of these issues will be fixed anytime soon in all iterations of the API before trying to merge something in. |
pulp_ansible 0.5.0 is included in the 4.2.0rc2 release of galaxy_ng. It can be seen referenced in setup.py. Should land on c.rh.c by the end of the week, or end of next week at the latest. |
Thanks for the info, I’ll look at getting the pulp oci contain images updated (if they haven’t been already) so it uses the rc2 release and then test again in CI. |
Has been updated pulp/pulp-oci-images#34, will need to update |
Looks like Pulp 0.5.0 has fixed the |
68add39
to
8a7d6e5
Compare
The |
The changes required to make this work in Pulp are now in place and CI has been updated to test this properly. I'm going to merge this in so we can get some more people to try it out and hopefully get some more feedback. |
SUMMARY
Try to cache the results when calling the Galaxy API to speed up the
install
command. A lot of the time in this step is spent querying the available versions, as well as the metadata for each collection. By caching this information we should dramatically decrease the time it takes to install a collection, especially as time goes on and more versions are added.For example here is the time difference for just
community.general
(will be a popular collection)We could even speed this up further by caching the actual collection artifacts but I'm unsure whether we actually want that behaviour or not.
ISSUE TYPE
COMPONENT NAME
ansible-galaxy