Skip to content

Conversation

@darstahl
Copy link
Contributor

This is a work in progress implementation of mounting Windows volumes on the host. It currently is failing the Basic snapshotter test due to a few assumptions made by the tests. The first issue is that the root directory of the layer is a link, which is tripping up the filesystem differ. The second is mounting a parent and child layer at the same time is currently failing.

This PR is to share the current progress.

/cc @johnstep @stevvooe @dmcgowan

Copy link
Member

Choose a reason for hiding this comment

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

This is stripping the target down to just the directory with no path separator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. It is required for the alternate data stream (ADS). Looking back at this, I think the better way to do this is to use filepath.Split and add the ADS tag to the filename and Join again.

Copy link
Member

Choose a reason for hiding this comment

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

Can you explain this one? Is there any documentation for this which could be referred to in a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an alternate data stream on the mounted layer folder. Short version is that this is used to store extra data on the same file without affecting the actual file.

Docs on alternate data streams that I can add in a comment https://blogs.technet.microsoft.com/askcore/2013/03/24/alternate-data-streams-in-ntfs/

Copy link
Member

Choose a reason for hiding this comment

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

Same comment here for documentation, curious what this means

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will look back at this to see if there is a better way to do it, but this is checking if the sandbox was mounted as a volume or if the function returned the path to the expanded layer on disk. \\?\ is the prefix of a volume on Windows, the volume path is of the form \\?\Volume{bc6dcf0c-7fde-4d12-9853-0d1dafad0b5b}\. If the expanded layer is returned instead of the volume GUID path, it needs to be mounted via symlink. Will add a comment to explain if I can't find a way that's obvious what it is doing.

@dmcgowan
Copy link
Member

It is nice to see the tests running though. The base related changes and changes to tests look good so far.

What is the impact of this target + ":layerid" file? They will just need to be created anywhere that is mounted or is created as metadata on the original target?

@dmcgowan dmcgowan added this to the 1.2 milestone Apr 16, 2018
@darstahl
Copy link
Contributor Author

target + ":layerid" is metadata on the mounted folder to correlate back to which HCS layer is being used to mount so that it can be unmounted. See above about Alternate Data Streams for more details on what is being used to store the metadata.

@darstahl
Copy link
Contributor Author

Pushed more commits that get the following tests passing on Windows:

t.Run("Basic", makeTest(name, snapshotterFn, checkSnapshotterBasic))
t.Run("StatActive", makeTest(name, snapshotterFn, checkSnapshotterStatActive))
t.Run("StatComitted", makeTest(name, snapshotterFn, checkSnapshotterStatCommitted))
t.Run("TransitivityTest", makeTest(name, snapshotterFn, checkSnapshotterTransitivity))
t.Run("PreareViewFailingtest", makeTest(name, snapshotterFn, checkSnapshotterPrepareView))
t.Run("Update", makeTest(name, snapshotterFn, checkUpdate))

@dmcgowan
Copy link
Member

dmcgowan commented May 2, 2018

Can you rebase, also there is a vet complaint

gometalinter --config .gometalinter.json ./...
snapshots\testsuite\testsuite.go:51::error: unreachable code (vet)
Makefile:109: recipe for target 'check' failed
mingw32-make: *** [check] Error 1

@darstahl
Copy link
Contributor Author

darstahl commented May 2, 2018

Vet failure is due to enabling certain tests while in development. I'm adding proper test skipping for tests that will not work on Windows in a change soon.

Will rebase.

@darstahl
Copy link
Contributor Author

darstahl commented May 5, 2018

Locally tests are passing. Debugging why they're failing in CI.

Edit: I also need to get the Continuity changes into there to vendor into containerd.

darstahl added 4 commits May 7, 2018 17:01
Signed-off-by: Darren Stahl <[email protected]>
Signed-off-by: Darren Stahl <[email protected]>
Signed-off-by: Darren Stahl <[email protected]>
Signed-off-by: Darren Stahl <[email protected]>
darstahl added 5 commits May 7, 2018 18:10
Signed-off-by: Darren Stahl <[email protected]>
Signed-off-by: Darren Stahl <[email protected]>
Signed-off-by: Darren Stahl <[email protected]>
@darstahl
Copy link
Contributor Author

darstahl commented May 9, 2018

This PR is ready for review pending containerd/continuity#113

darstahl added 3 commits May 9, 2018 12:03
Signed-off-by: Darren Stahl <[email protected]>
Signed-off-by: Darren Stahl <[email protected]>
Signed-off-by: Darren Stahl <[email protected]>
@codecov-io
Copy link

Codecov Report

Merging #2287 into master will decrease coverage by 3.96%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2287      +/-   ##
==========================================
- Coverage   49.28%   45.31%   -3.97%     
==========================================
  Files          84       93       +9     
  Lines        7424     9572    +2148     
==========================================
+ Hits         3659     4338     +679     
- Misses       3089     4532    +1443     
- Partials      676      702      +26
Flag Coverage Δ
#linux 49.28% <ø> (ø) ⬆️
#windows 41.75% <75%> (?)
Impacted Files Coverage Δ
snapshots/windows/windows.go 58.62% <75%> (ø)
oci/spec.go 40% <0%> (-10%) ⬇️
snapshots/native/native.go 43.89% <0%> (-10%) ⬇️
metadata/snapshot.go 45.8% <0%> (-8.96%) ⬇️
archive/compression/compression.go 43.93% <0%> (-8.9%) ⬇️
remotes/docker/fetcher.go 41.42% <0%> (-7.6%) ⬇️
content/local/writer.go 52.63% <0%> (-7.37%) ⬇️
archive/tar.go 43.05% <0%> (-6.95%) ⬇️
metadata/containers.go 47.97% <0%> (-6.62%) ⬇️
metadata/buckets.go 54.66% <0%> (-5.04%) ⬇️
... and 55 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6eee2a0...a12b082. Read the comment docs.

@crosbymichael
Copy link
Member

Going to close this one, we have a carry PR open and windows work is still ongoing

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.

4 participants