FIX - Ci improvement - Added Kapua docker image caching into Action process #3787
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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