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

FIX - Ci improvement - Added Kapua docker image caching into Action process #3787

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Agnul97
Copy link
Contributor

@Agnul97 Agnul97 commented Jun 7, 2023

Brief description of the PR.
This PR wants to re-introduce docker image caching in the GitHub action process.
NOTE: this PR is actually in draft mode for the technical limitations of this platform, for extra info see the related issue.

Related Issue
This PR fixes/closes #3688

Description of the solution adopted
As suggested in the related issue with the first post, I changed the old gitAction used to cache docker images with the forked/updated one, https://github.com/marketplace/actions/docker-layer-caching2.

I defined a brand new action that acts as a wrapper for such action and retries the caching retrieval a fixed number of times if some failure occurs. This is done because, on rare occasions, I get a 429 error on the cache retrieval step of such Action BEFORE INTRODUCING SUCH RETRY MECHANISM. I was thinking that, by retrying the Action N times, with a delay between each try, the error could be overcome and the cache retrieved correctly. This error could be related to the technical limitation discussed in the related issue but I don't think so, based on my experiments. In this regard, I think that another cause could be the fact that multiple jobs try to concurrently retrieve the cache, and this is the rationale behind the delay I inserted in the retry mechanism.

Unluckily GitHub Actions doesn't provide loops so I had to insert a fixed number of re-tries in this "hard-coded" form.
Also, instead of this, I tried to use a third-party GitAction that retries Actions and allows to define a delay between tries (this one https://github.com/marketplace/actions/retry-action) BUT, at the moment of this work, it was having problems with docker-related Actions like mine, so I had to give up. I've seen a PR opened on such Acion that solves this problem so maybe in the future It can be restored here.

Any side note on the changes made
As explained, possible 429 errors on cache retrieval steps

@Agnul97 Agnul97 changed the title Added Kapua docker image caching into Action process FIX - Ci improvement - Added Kapua docker image caching into Action process Jun 7, 2023
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.

github action optimizations (builds repeated needlessly)
1 participant