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

ci: use registry cache backend instead of gha #443

Closed
wants to merge 8 commits into from

Conversation

rjaegers
Copy link
Member

@rjaegers rjaegers commented Jun 10, 2024

Pull Request

Description of changes

This PR moves the build-push Docker cache from the GitHub Actions (gha) cache back-end to the registry back-end. The cached results will be pushed to a (private) package in the registry and used for subsequent builds. Contrary to the gha cache this does not take ancestry into account. All branches can freely use this cache, hence the removal of the Docker step in prime-cache.

Some more details about the different caches can be found here: https://blacksmith.sh/blog/cache-is-king-a-guide-for-docker-layer-caching-in-github-actions.

Checklist

  • I have followed the contribution guidelines for this repository
  • I have added tests for new behavior, and have not broken any existing tests
  • I have added or updated relevant documentation
  • I have verified that all added components are accounted for in the SBOM

@rjaegers rjaegers requested a review from a team as a code owner June 10, 2024 13:57
Copy link
Contributor

github-actions bot commented Jun 10, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 14 0 0.06s
✅ DOCKERFILE hadolint 2 0 0.52s
✅ JSON prettier 11 0 0 0.92s
✅ JSON v8r 10 0 4.48s
✅ MARKDOWN markdownlint 8 0 0 1.1s
✅ MARKDOWN markdown-table-formatter 8 0 0 0.25s
✅ REPOSITORY checkov yes no 18.27s
✅ REPOSITORY gitleaks yes no 0.43s
✅ REPOSITORY git_diff yes no 0.01s
✅ REPOSITORY grype yes no 13.91s
✅ REPOSITORY secretlint yes no 1.69s
✅ REPOSITORY trivy yes no 7.15s
✅ REPOSITORY trivy-sbom yes no 1.63s
✅ REPOSITORY trufflehog yes no 3.53s
✅ SPELL lychee 48 0 1.42s
✅ YAML prettier 19 0 0 1.31s
✅ YAML v8r 19 0 14.81s
✅ YAML yamllint 19 0 0.52s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

Copy link
Contributor

github-actions bot commented Jun 10, 2024

Test Results

 2 files  ±0   2 suites  ±0   51s ⏱️ ±0s
26 tests ±0  26 ✅ ±0  0 💤 ±0  0 ❌ ±0 
28 runs  ±0  28 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit d846b39. ± Comparison against base commit 24442b0.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Jun 10, 2024

Compressed layer size comparison

Comparing ghcr.io/philips-software/amp-devcontainer-rust:latest to ghcr.io/philips-software/amp-devcontainer-rust@sha256:5bfcb8b58a1991fe77291bf8e806be3a70ebfb8e008be526ac313eb8c0ca259b

OS/Platform Previous Size Current Size Delta
linux/amd64 432.86M 432.86M 188.00 (+0.00%)
linux/arm64 572.09M 572.09M -468.00 (-0.00%)

Copy link
Contributor

github-actions bot commented Jun 10, 2024

Compressed layer size comparison

Comparing ghcr.io/philips-software/amp-devcontainer-cpp:latest to ghcr.io/philips-software/amp-devcontainer-cpp@sha256:d60fad6aa6cf489c7a0d42b1fe925622c2547752a5394ec89594122bf9c55094

OS/Platform Previous Size Current Size Delta
linux/amd64 640.27M 640.27M -217.00 (-0.00%)
linux/arm64 632.60M 632.62M 15.72K (+0.00%)

@daantimmer
Copy link
Collaborator

Care to explain the reason behind this change?

@rjaegers
Copy link
Member Author

It is/was an experiment to see if the cache works better when using a different back-end.

There are some pros/cons to this approach. Some of which can be found here: https://blacksmith.sh/blog/cache-is-king-a-guide-for-docker-layer-caching-in-github-actions.

@magi-arun magi-arun requested a review from EkelmansPh June 11, 2024 07:58
@rjaegers rjaegers changed the title chore: use registry cache backend instead of gha ci: use registry cache backend instead of gha Jun 12, 2024
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@rjaegers rjaegers added this pull request to the merge queue Jun 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 12, 2024
@rjaegers
Copy link
Member Author

Closing this one as it does not seem to provide benefits over GHA approach.

@rjaegers rjaegers closed this Jun 12, 2024
@rjaegers rjaegers deleted the feature/use-registry-caching branch June 12, 2024 08:15
Copy link
Contributor

Pull Request Report (#443)

Static measures

Description Value
Number of added lines 10
Number of deleted lines 18
Number of changed files 4
Number of commits 8
Number of reviews 1
Number of comments (w/o review comments) 8
Number of reviews that contains a comment to resolve 0
Number of reviews that requested a change from the author 0
Number of reviews that approved the Pull Request 1
Get the total number of participants of a Pull Request 6

Time related measures

Description Value
PR lead time (from creation to close of PR) 1.8 Days
Time that was spend on the branch before the PR was created 4.6 Min
Time that was spend on the branch before the PR was merged 0 Sec
Time to merge after last review 0 Sec

Status check related measures

Description Value
Total runtime for last status check run (Workflow for PR) 12.6 Min
Total time spend in last status check run on PR 8.4 Min

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.

3 participants