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

perf(CI): RHICOMPL-3878 enable caching of yum packages between stages #1720

Closed
wants to merge 1 commit into from

Conversation

skateman
Copy link
Collaborator

The RUN command in the Dockerfile suppors a two-way overlayed cache mount, i.e. all changes are stored both inside the container and outside the file after the build finishes. In our case this can be utilized to speed up the installation process of the packages in $deps for the second stage. The first stage is explicitly configured to store RPMs and other metadata under /var/cache/yum and doesn't clear the cache upon a successful build. By mounting the same cache for the second stage, there are zero packages downloaded when installing. The microdnf clean all command at the end of the second stage clears both the container's and the host's cache, so the container size remains small and the host will not leak cached RPMs to other test runs.

The whole build process is ~20 seconds faster:

# Before
podman build .  257.70s user 71.00s system 132% cpu 4:08.86 total
# After
podman build .  237.44s user 67.19s system 134% cpu 3:45.85 total

Secure Coding Practices Checklist GitHub Link

Secure Coding Checklist

  • Input Validation
  • Output Encoding
  • Authentication and Password Management
  • Session Management
  • Access Control
  • Cryptographic Practices
  • Error Handling and Logging
  • Data Protection
  • Communication Security
  • System Configuration
  • Database Security
  • File Management
  • Memory Management
  • General Coding Practices

@skateman skateman requested a review from a team as a code owner June 30, 2023 13:59
@skateman skateman changed the title perf(CI): RHICOMPL-3874 enable caching of yum packages between stages perf(CI): RHICOMPL-3878 enable caching of yum packages between stages Jun 30, 2023
@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.34%. Comparing base (f1e1217) to head (6e1bbb8).
Report is 599 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1720   +/-   ##
=======================================
  Coverage   98.34%   98.34%           
=======================================
  Files         184      184           
  Lines        3743     3743           
=======================================
  Hits         3681     3681           
  Misses         62       62           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@skateman
Copy link
Collaborator Author

Seems like podman version on some of our jenkins nodes is too old for this, we need at least 4.1.0

Copy link
Collaborator

@vkrizan vkrizan left a comment

Choose a reason for hiding this comment

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

Nice!

@skateman skateman marked this pull request as draft May 22, 2024 05:04
@skateman skateman closed this Jan 1, 2025
@skateman skateman deleted the yum-cache branch January 1, 2025 07:15
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