Skip to content

Conversation

@adityaramani
Copy link
Contributor

Define a UnpackStrategy function type in the SnapshotStore to give more control over how an image is unpacked.

Previously, we were creating a 512 GB sparse block file for the initial file system of a container, which is overkill.

With this change, the vminit image is unpacked to a smaller block file, while container images are unpacked to the 512 GB block

Follows the same pattern as https://github.com/apple/container/blob/main/Sources/Helpers/RuntimeLinux/RuntimeLinuxHelper.swift#L71

@adityaramani adityaramani requested review from ehazlett and jglogan June 30, 2025 23:01
guard platform.os == "linux" else {
return nil
}
var minBlockSize = 512.gib()
Copy link
Contributor

@jglogan jglogan Jul 1, 2025

Choose a reason for hiding this comment

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

Is this a disk/filesystem size, or a block size? Is the blockSizeInBytes parameter to EXT4Unpacker a bit misleading?

}
var minBlockSize = 512.gib()
if image.reference == ClientDefaults.get(key: .defaultInitImage) {
minBlockSize = 512.mib()
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's see if we can move this to a UserDefault in a followup so that end users can customize this size.

@crosbymichael crosbymichael merged commit 4bfa6c2 into apple:main Jul 1, 2025
2 checks passed
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