Skip to content

Avoid external cache for QEMU#2018

Closed
egibs wants to merge 1 commit into
chainguard-dev:mainfrom
egibs:qemu-cache-dir-performance
Closed

Avoid external cache for QEMU#2018
egibs wants to merge 1 commit into
chainguard-dev:mainfrom
egibs:qemu-cache-dir-performance

Conversation

@egibs

@egibs egibs commented May 30, 2025

Copy link
Copy Markdown
Member

Using /var/cache/melange within QEMU over 9p (at least on macOS?) has sizable performance implications. For instance, I spent 20 minutes downloading Go packages and still did not manage to move onto a build.

For QEMU, we can use a local directory in /home/build to avoid the performance hit unless there's a better way to do this. This also improves the isolation story since we aren't sharing a cache between builds.

Edit: cadvisor builds in ~90 seconds in CI with this code and it previously took ~5 minutes.

Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
@egibs egibs requested a review from 89luca89 May 30, 2025 15:49
clog.FromContext(ctx).Debugf("qemu: additional mountpoint %s into /mount/%s", v.Destination, v.Destination)
setupMountCommand = setupMountCommand + "&& mkdir -p /mount/" + v.Destination +
" && mount -t 9p " + v.Destination + " /mount/" + v.Destination
" && mount -t 9p " + v.Destination + " /mount/" + strings.TrimPrefix(v.Destination, "/")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was resulting in /mount//var/cache/melange.

@egibs egibs closed this May 30, 2025
@egibs egibs deleted the qemu-cache-dir-performance branch October 21, 2025 18:29
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.

1 participant