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

Support flexible LCOW layer parsing and partitioned layers #1745

Merged
merged 2 commits into from
May 15, 2023

Conversation

kevpar
Copy link
Member

@kevpar kevpar commented Apr 23, 2023

This is commit 6/6 in a chain. Recommended to review in order. If reviewing a later PR in the chain, you can view individual commits to see just what that PR changes.

This PR increases the flexibility of how we handle LCOW layers. This gives us greater ability to represent layers differently. For example, this PR also adds a new lcow-partitioned-layer type which consists of a VHD path and a partition index on that VHD for each read-only layer.

Please see individual commits for details.

Copy link
Contributor

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

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

One comment, otherwise lgtm

Copy link
Contributor

@anmaxvl anmaxvl left a comment

Choose a reason for hiding this comment

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

lgtm (given linter is happy)

@kevpar kevpar force-pushed the lcow-layers branch 3 times, most recently from fae0655 to e425877 Compare May 10, 2023 23:54
@kevpar kevpar force-pushed the lcow-layers branch 4 times, most recently from f2274c6 to 0244f81 Compare May 15, 2023 18:42
Previously, layer information for both Windows and Linux containers was
passed throughout the shim through the OCI runtime spec's
Windows.LayerFolders field. This was used to store the set of
directories used for the layers, including the scratch. The exact
semantics of what is expected in these directories differed between
Windows and Linux. This approach worked okay, but had a few annoying
limitations. For instance, there was no way to represent more complex
layer data, such as a VHD path as well as a partition index on that VHD.

This change removes the use of Windows.LayerFolders completely for Linux
containers, and instead creates a new layers.LCOWLayers type that is
used to represent Linux layer configuration. This new type is passed
into hcsoci.CreateContainer, and from there is passed into
layers.MountLCOWLayers where it is actually used to set up the
filesystem for the container.

The new layers.LCOWLayers type is currently quite simple, but having
this as a proper Go type allows us a lot of flexibility in the future.
We can add more fields on this struct, but we could also change out the
nested LCOWLayer type for an interface, for instance, if we wanted to
support new types of layers that have drastically different
representation.

This change does not aim to touch the way Windows container layers are
handled, nor how the Windows UVM root filesystem is set up. These would
be good things to improve in the future, but the Windows container
layers are more complicated in how they are used, so this is left for
future work.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
Adds support for a new type of LCOW mount that can use individual disk
partitions for each read-only layer. This change adds the work to parse
the new layer type and pass it through the shim, as well as the support
to the shim-side SCSI package to send the partition index in the guest
request.

This change does not add the GCS-side work to actually mount the
specified partition. That will come in a future change.

This change also does not handle formatting the scratch disk. It it
desired to be able to format it on the fly when creating the container,
but that will also come in a future change.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
@kevpar kevpar merged commit 22bf0b5 into microsoft:main May 15, 2023
9 checks passed
@kevpar
Copy link
Member Author

kevpar commented May 15, 2023

I bypassed branch protection on the merge since the latest push was just a simple rebase on top of main after the previous stacked PR was merged.

anmaxvl pushed a commit that referenced this pull request Oct 20, 2023
This PR updates our ADO fork to commits in hcsshim up to commit hash [7769a64](7769a64). This includes support for partitioned scsi devices and ensuring filesystem format for lcow scsi devices.

Related work items: #1728, #1740, #1741, #1742, #1743, #1744, #1745, #1747, #1748, #1749, #1750, #1752, #1754, #1756, #1757, #1767, #1769, #1771, #1772, #1773, #1779
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.

None yet

4 participants