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

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

Conversation

skateman
Copy link
Member

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 ✅

📢 Thoughts on this report? Let us know!

@skateman
Copy link
Member 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants