Add dmverity support to the erofs snapshotter using go-dmverity#12502
Conversation
ec43167 to
6d3f877
Compare
hsiangkao
left a comment
There was a problem hiding this comment.
just some premature comments.
54dd70b to
197f481
Compare
This comment was marked as spam.
This comment was marked as spam.
bbee8ed to
487f0ee
Compare
|
@dmcgowan, @AkihiroSuda, @cpuguy83, @fuweid Could you please take a look when you get a chance? :) |
487f0ee to
fec3969
Compare
ChengyuZhu6
left a comment
There was a problem hiding this comment.
@aadhar-agarwal Good work! Some comments:
9ec4e15 to
ad06e8f
Compare
f0275dc to
5df7f8a
Compare
ChengyuZhu6
left a comment
There was a problem hiding this comment.
@aadhar-agarwal Would you mind updating the code with dmverity? To fix linting issues, I have updated some API names in go-dmverity: https://github.com/containerd/go-dmverity/pull/5/files
021ce01 to
30d3d12
Compare
Updated! |
|
Open Question for reviewers: Before attempting to optimize this, I wanted to get guidance on whether it's the right approach. Summary Observation
Then during StartContainer, for the same layer:
The second dm-verity setup is identical to the first - same image, same verification. Logs (alpine container with single layer): Scale Questions
I don't want to add complexity (like keeping devices open after temp unmount) without understanding the intended behavior. |
There was a problem hiding this comment.
I tested the code, but found the following error when trying to run the container:
# ctr run --snapshotter erofs -t ubuntu:22.04 erofs-test sh
ctr: failed to create erofs mount for parent 1: dm-verity mode is 'on' but .dmverity metadata not found for layer /var/lib/containerd/io.containerd.snapshotter.v1.erofs/snapshots/1/layer.erofs"
Did we miss anything?
Hi @ChengyuZhu6, thanks for testing! I tried this and it works for me. A couple different reasons this may be happening:
|
@ChengyuZhu6 Can you confirm if it works? |
Kind ping @dmcgowan, @fuweid, @AkihiroSuda, @cpuguy83 Could I please get another review on this PR in order to land this for the 2.3 milestone? :) |
Signed-off-by: Aadhar Agarwal <[email protected]>
|
@ChengyuZhu6 can we tag a release for |
Add dm-verity support for EROFS layers in containerd
This PR introduces block-level data integrity verification for EROFS container layers using device-mapper verity (dm-verity):
go-dmverityto natively create Merkle hash trees and dm-verity devices for EROFS blobs.dmverity_modefor the snapshotter andenable_dmverityfor the differ.layer.erofs.dmverityalongside the blob.Note: When enabled, it requires a Linux kernel with dm-verity support and the
dm_veritymodule loaded. If using the veritysetup cli is preferred, please refer to #12457