feat: Explore storing EROFS layers #16
Can we expand this comment? I would have assumed that we would want to unmount and then snapshot the upperdir (which becomes a lowerdir in future?)
Let's add a comment about whether the 2 is a hard limit (e.g. overlayfs is limited to 2/3 layers) vs a heuristic
Let's test this using an e2e test instead of a unit test
We should check that the error is indeed IsNotFound; any error other than IsNotFound should be returned as an error
Is this slices.Reverse ?
Let's just store the volume information as a proto file on disk, perhaps in the directory where we are building all the layers and layer mounts. This should let us detect when e.g. we're trying to upload a new version of the disk, but someone else has also uploaded one ("optimistic concurrency")
If two volumes have the same read-only EROFS layer, we want to download it once and store it once.
Do we need ErofsSha256? It feels redundant with ErofsLayers (and we have to do this little dance every time)
Nit: isUpperLayerEmpty
OK really great stuff, some proposed tweaks
I think we have to return this error, we have to retry here or there will be silent data loss
Same here, we need to return the error to force a retry, otherwise there will be silent data loss
Can we always save the snapshot.pb, even without erofs?
This should be an error that we return
Approved these changes.
So I'm assuming something is going wrong in our e2e test with our unmount:
e2e_test.go:439: Waiting for pod layers-pod-1 to be ready in namespace default
e2e_test.go:439: Pod layers-pod-1 phase: Pending, ready: false
e2e_test.go:439: Pod layers-pod-1 phase: Pending, ready: false
e2e_test.go:439: Pod layers-pod-1 phase: Running, ready: true
e2e_test.go:439: Pod layers-pod-1 is ready (phase: Running)
e2e_test.go:444: Deleting Pod 1 to trigger layer 1 upload
panic: test timed out after 20m0s
running tests:
TestEROFSLayersE2E (14m53s)
Let's put a relatively short timeout on pod deletion (1 minute), and let's dump logs and the pod status etc if we hit the timeout. Create a function to dump logs in the harness, as we'll want to extend this in future (e.g. to write to an ARTIFACTS dir etc)
Approved these changes.
justinsb
codebot-robot
Please review this Pull Request to explore storing volume snapshots as EROFS layers.
It implements a mode where we download EROFS snapshots as a sequence of layers and stack them using OverlayFS, write changed files in the upper-level overlay to a new EROFS layer when unpublishing, and validate layers with the native Go Fsck.
Fixes #13