-
Notifications
You must be signed in to change notification settings - Fork 259
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
Base layer manipulation #1637
Merged
helsaawy
merged 12 commits into
microsoft:main
from
gabriel-samfira:base-layer-manipulation-rebased
Feb 28, 2023
Merged
Base layer manipulation #1637
helsaawy
merged 12 commits into
microsoft:main
from
gabriel-samfira:base-layer-manipulation-rebased
Feb 28, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gabriel-samfira
force-pushed
the
base-layer-manipulation-rebased
branch
2 times, most recently
from
January 31, 2023 16:29
0f2ae9b
to
417c365
Compare
helsaawy
reviewed
Jan 31, 2023
helsaawy
reviewed
Jan 31, 2023
test/internal/scratch.go
Outdated
func CreateWCOWBlankBaseLayer(ctx context.Context, t *testing.T) []string { | ||
t.Helper() | ||
tempDir := t.TempDir() | ||
if err := wclayer.ConvertToBaseLayer(context.Background(), tempDir); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wclayer.ConvertToBaseLayer(ctx tempDir)
gabriel-samfira
force-pushed
the
base-layer-manipulation-rebased
branch
from
January 31, 2023 17:44
aca4cc6
to
255f402
Compare
This is the inverse of the baseLayerWriter: It walks Files/ and UtilityVM/Files/ (if present) and ignores the rest of the layer data, as it will be recreated when the layer is imported. Signed-off-by: Paul "TBBle" Hampson <[email protected]>
This API allows turning any collection of files into a WCOW base layer. It will create the necessary files in Files/ for hcsshim.ProcessBaseLayer to function, validate the necessary files for hcsshim.ProcessUtilityVMImage if UtilityVM/ exists, and then call those two APIs to complete the process. Calling this on a directory containing an untarred base layer OCI tarball, gives a very similar outcome to passing the tar stream through ociwclayer.ImportLayer. The new API is used in `TestSCSIAddRemoveWCOW` to create nearly-empty base layers for the scratch layers attached and removed from the utility VM. A wclayer command is also introduced: `makebaselayer` for testing and validation purposes. Signed-off-by: Paul "TBBle" Hampson <[email protected]>
Signed-off-by: Paul "TBBle" Hampson <[email protected]>
This change adds functions to generate valid, empty hives. Signed-off-by: Gabriel Adrian Samfira <[email protected]>
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
gabriel-samfira
force-pushed
the
base-layer-manipulation-rebased
branch
from
February 2, 2023 13:38
255f402
to
99c9146
Compare
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
helsaawy
reviewed
Feb 7, 2023
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
gabriel-samfira
force-pushed
the
base-layer-manipulation-rebased
branch
from
February 8, 2023 12:02
50a9616
to
077be0f
Compare
helsaawy
approved these changes
Feb 8, 2023
ambarve
reviewed
Feb 27, 2023
* We can use string instead of *uint16 in the //sys definition and allow mksyscall to generate the proper boilerplate. * do not shadow err if it's not nil Signed-off-by: Gabriel Adrian Samfira <[email protected]>
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
gabriel-samfira
force-pushed
the
base-layer-manipulation-rebased
branch
from
February 27, 2023 10:19
31e246a
to
b2acd4e
Compare
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
ambarve
approved these changes
Feb 28, 2023
This was referenced Mar 2, 2023
jsturtevant
added a commit
to jsturtevant/hcsshim
that referenced
this pull request
Mar 7, 2023
If a project creates a base layer image and wants to directly import the base then this ensure the baseline file are in place. It is a follow up to microsoft#1637 and enables containerd with ctr image import image.tar of a base layer. Signed-off-by: James Sturtevant <[email protected]>
princepereira
pushed a commit
to princepereira/hcsshim
that referenced
this pull request
Aug 29, 2024
* Simple baseLayerReader to export parentless layers This is the inverse of the baseLayerWriter: It walks Files/ and UtilityVM/Files/ (if present) and ignores the rest of the layer data, as it will be recreated when the layer is imported. Signed-off-by: Paul "TBBle" Hampson <[email protected]> * Introduce hcsshim.ConvertToBaseLayer This API allows turning any collection of files into a WCOW base layer. It will create the necessary files in Files/ for hcsshim.ProcessBaseLayer to function, validate the necessary files for hcsshim.ProcessUtilityVMImage if UtilityVM/ exists, and then call those two APIs to complete the process. Calling this on a directory containing an untarred base layer OCI tarball, gives a very similar outcome to passing the tar stream through ociwclayer.ImportLayer. The new API is used in `TestSCSIAddRemoveWCOW` to create nearly-empty base layers for the scratch layers attached and removed from the utility VM. A wclayer command is also introduced: `makebaselayer` for testing and validation purposes. Signed-off-by: Paul "TBBle" Hampson <[email protected]> * Include hard-linked files as hard-links in the tarstream Signed-off-by: Paul "TBBle" Hampson <[email protected]> * Use offline registry library to generate min hive This change adds functions to generate valid, empty hives. Signed-off-by: Gabriel Adrian Samfira <[email protected]> * Rename ofreg.go and close key Signed-off-by: Gabriel Adrian Samfira <[email protected]> * Fix temp dir creation Signed-off-by: Gabriel Adrian Samfira <[email protected]> * Cleanup tests Signed-off-by: Gabriel Adrian Samfira <[email protected]> * Fix ORCloseHive definition Signed-off-by: Gabriel Adrian Samfira <[email protected]> * Remove unused ctx from baseLayerReader Signed-off-by: Gabriel Adrian Samfira <[email protected]> * Use string in sys definition and check for err * We can use string instead of *uint16 in the //sys definition and allow mksyscall to generate the proper boilerplate. * do not shadow err if it's not nil Signed-off-by: Gabriel Adrian Samfira <[email protected]> * Close the r.proceed channel Signed-off-by: Gabriel Adrian Samfira <[email protected]> * Return if backup reader is nil Signed-off-by: Gabriel Adrian Samfira <[email protected]> --------- Signed-off-by: Paul "TBBle" Hampson <[email protected]> Signed-off-by: Gabriel Adrian Samfira <[email protected]> Co-authored-by: Paul "TBBle" Hampson <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is just a rebase of #901
@TBBle is currently on sabbatical so I will try to move the two PRs (this one and the one on containerd), forward.
All needed context for this PR is available on #901