Skip to content

Conversation

@gabriel-samfira
Copy link
Contributor

@gabriel-samfira gabriel-samfira commented Feb 2, 2023

This PR is just a rebase of #4419.

@TBBle is currently on sabbatical so I will try to move the two PRs (this one and the one in microsoft/hcsshim#1637), forward.

All needed context for this PR is available in #4419 .

In addition to the great work done in #4419, this PR makes use of the Bind Filter in Windows, which gives us functionality similar to what we have on Linux via bind mounts. It allows us to avoid some Windows special cases.

Note: This PR will fail to build without the above mentioned dependency. Marking it as draft for now. Also, there is still some cleanup I need to do (ex: remove unused functions), which will be addressed shortly.

@k8s-ci-robot
Copy link

Hi @gabriel-samfira. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@gabriel-samfira gabriel-samfira changed the title Wcow mount layers rebased Mount snapshots on Windows Feb 2, 2023
@gabriel-samfira gabriel-samfira force-pushed the wcow_mount_layers_rebased branch 2 times, most recently from d5f6575 to 03ffa12 Compare February 4, 2023 10:34
@gabriel-samfira
Copy link
Contributor Author

Dropped commit gabriel-samfira@6dae7f9 as we're using the bind filter, which doesn't use junction points. Thus, this issue should not manifest.

Also, with the change to continuity (containerd/continuity#212), we'll also get a proper diff between layers.

@gabriel-samfira
Copy link
Contributor Author

The snapshot tests require the SeBackupPrivilege and SeRestorePrivilege to have access to system files inside the container layer mount points.

@gabriel-samfira
Copy link
Contributor Author

This commit: 03ffa12

Adds two new files, one of which is generated code via mksyscall. I can add the headers to one of them, but the other one is generated. Any tips on how to handle this situation? Should this be moved in some other package?

@helsaawy Do you think something like this should be added to go-winio? Any other suggestions are welcome.

@dcantah
Copy link
Member

dcantah commented Feb 6, 2023

@gabriel-samfira Ping me when this is ready!

@gabriel-samfira
Copy link
Contributor Author

@gabriel-samfira Ping me when this is ready!

You bet! The more reviews and scrutiny this gets, the less stressed I'll be that I made a silly mistake somewhere which will blow up later 😄 .

@gabriel-samfira
Copy link
Contributor Author

Hi @dcantah !

If you have the time, feel free to review this branch. Sadly, I didn't get all the "metadata" files in the previous PR to continuity. I opened a new one here: containerd/continuity#219.

In this branch, I have a temporary hack that points to my continuity branch, but other than that, this should be ready to review. Have a look when you get a chance!

Thanks!

@dcantah
Copy link
Member

dcantah commented Feb 28, 2023

Woo! I'll definitely carve out some time this week

@gabriel-samfira
Copy link
Contributor Author

gabriel-samfira commented Feb 28, 2023

Integration tests seem to have passed! 😄 . Well...everything aside from a couple of Vagrant BOX tests.

https://github.com/containerd/containerd/actions/runs/4297996002

Will mark this ready for review as soon as containerd/continuity#219 merges.

@gabriel-samfira gabriel-samfira force-pushed the wcow_mount_layers_rebased branch from f506c0f to 2c79882 Compare February 28, 2023 23:42
@TBBle
Copy link
Contributor

TBBle commented Mar 1, 2023

Oh, we aren't seeing the test failures that lead to bd51841? Awesome!

I wonder if that was actually related to the HCS/WCIFS support, and using Bind Filter has fixed it? Or perhaps there was some other bug that has been fixed in-passing. (I could never reproduce it in hcsshim directly, but I also never ruled out a HCS-internal race condition)

Oh. A quick look at the test run suggests we might need to bump the Windows Integration test-run time-limit, it's currently 50m, and one of the four runs hit this in a very late stage (critest execution). The other three are also really close, so I don't think this was a failure or problem, it's just that with the new tests enabled from the snapshot suite, the expected runtime is longer. I'm guessing 60 minutes would be enough, but to avoid false-negatives, perhaps 90m?

I am viscerally excited by the progress here. ^_^

@gabriel-samfira
Copy link
Contributor Author

Oh, we aren't seeing the test failures that lead to bd51841? Awesome!

If it was "File in use" it may have been an older bug. I remember fixing one like that here:

microsoft/hcsshim#1249

Not sure if it is the same one you were seeing back in 2021 😄 .

Increasing the timeout sounds prudent (we had to do it before on Windows). Will probably do that in a separate PR.

@gabriel-samfira
Copy link
Contributor Author

Oh. A quick look at the test run suggests we might need to bump the Windows Integration test-run time-limit, it's currently 50m, and one of the four runs hit this in a very late stage (critest execution). The other three are also really close, so I don't think this was a failure or problem, it's just that with the new tests enabled from the snapshot suite, the expected runtime is longer. I'm guessing 60 minutes would be enough, but to avoid false-negatives, perhaps 90m?

@aznashwan was kind enough to open a PR for this here: #8183

Thanks @aznashwan !

@gabriel-samfira
Copy link
Contributor Author

Marking this as ready for review, as there is just one simple PR it depends on, and it would be useful to get more eyes on this sooner rather than later.

As opposed to a writable layer derived from a base layer, the volume
path of a base layer, once activated and prepared will not be a WCIFS
volume, but the actual path on disk to the snapshot. We cannot directly
mount this folder, as that would mean a client may gain access and
potentially damage important metadata files that would render the layer
unusabble.

For base layers we need to mount the Files folder which must exist in
any valid base windows-layer.

Signed-off-by: Gabriel Adrian Samfira <[email protected]>
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
@gabriel-samfira gabriel-samfira force-pushed the wcow_mount_layers_rebased branch from f5067be to 93dc6e6 Compare April 3, 2023 16:55
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
@gabriel-samfira gabriel-samfira force-pushed the wcow_mount_layers_rebased branch from 93dc6e6 to 1279ad8 Compare April 4, 2023 06:18
@gabriel-samfira
Copy link
Contributor Author

gabriel-samfira commented Apr 4, 2023

Hi @dmcgowan @estesp @kevpar

Could you spare a few minutes to look over this PR? Thanks!

Copy link
Member

@kzys kzys left a comment

Choose a reason for hiding this comment

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

Looks good to me. Only have nits and I'm fine addressing them later.

@gabriel-samfira
Copy link
Contributor Author

Thank you @kzys !

Addressing the nits now.

  * Improve error messages
  * remove a check for the existance of unmount target. We probably
    should not mask that the target was missing.

Signed-off-by: Gabriel Adrian Samfira <[email protected]>
@MikeZappa87
Copy link
Contributor

/lgtm

@dcantah
Copy link
Member

dcantah commented Apr 6, 2023

Anyone able to check this in? We have 4 approvals from maintainers

@kzys kzys merged commit 7cd72cc into containerd:main Apr 6, 2023
@TBBle
Copy link
Contributor

TBBle commented Apr 6, 2023

Woo, and I cannot emphasise this enough, hoo!

@gabriel-samfira
Copy link
Contributor Author

Woo, and I cannot emphasise this enough, hoo!

There are [insert_favorite_beverage] I need to send your way 😄.

@fuweid
Copy link
Member

fuweid commented Apr 7, 2023

@gabriel-samfira @TBBle thanks for making this and your patience.

@MikeZappa87
Copy link
Contributor

MikeZappa87 commented Apr 7, 2023

Woo, and I cannot emphasise this enough, hoo!

There are [insert_favorite_beverage] I need to send your way 😄.

What kind of hazy ipa's do you have in your area?

@dcantah
Copy link
Member

dcantah commented Apr 7, 2023

Thrilled to see this land finally 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants