nydus icon indicating copy to clipboard operation
nydus copied to clipboard

overlay: add overlay implementation

Open WeiZhang555 opened this issue 1 year ago • 6 comments

With help of newly introduced Overlay FileSystem in fuse-backend-rs library, now we can create writable rootfs in Nydus. Implementation of writable rootfs is based on one passthrough FS(as upper layer) over one readonly rafs(as lower layer).

To do so, configuration is extended with some Overlay options.

Details

An userspace overlay filesystem is usable for control of user data, with this implementation, Nydus can have stronger control on container rootfs.

Types of changes

What types of changes does your PullRequest introduce? Put an x in all the boxes that apply:

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation Update (if none of the other choices apply)

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • [ ] I have updated the documentation accordingly.
  • [x] I have added tests to cover my changes.

WeiZhang555 avatar Jan 25 '24 07:01 WeiZhang555

The PR is not ready for merging since it rely heavily on fuse-backend-rs changes(see PR ), this PR can be regarded as a simple demo usage of userspace Overlay FS currently.

WeiZhang555 avatar Jan 25 '24 07:01 WeiZhang555

Codecov Report

Attention: Patch coverage is 11.68831% with 68 lines in your changes are missing coverage. Please review.

Project coverage is 61.22%. Comparing base (3dfa9e9) to head (e2bc4bf).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1544      +/-   ##
==========================================
- Coverage   61.29%   61.22%   -0.08%     
==========================================
  Files         144      144              
  Lines       47035    47100      +65     
  Branches    44537    44602      +65     
==========================================
+ Hits        28832    28838       +6     
- Misses      16719    16778      +59     
  Partials     1484     1484              
Files Coverage Δ
builder/src/core/context.rs 67.06% <100.00%> (+0.03%) :arrow_up:
api/src/config.rs 87.58% <80.00%> (-0.03%) :arrow_down:
storage/src/device.rs 69.26% <0.00%> (+0.22%) :arrow_up:
rafs/src/fs.rs 34.33% <28.57%> (-0.20%) :arrow_down:
service/src/fs_service.rs 40.92% <3.27%> (-10.20%) :arrow_down:

... and 1 file with indirect coverage changes

codecov[bot] avatar Jan 25 '24 07:01 codecov[bot]

Thanks for the implementation! Please also add a test case in https://github.com/dragonflyoss/nydus/tree/master/smoke/tests (maybe create a overlay_writable_test.go ?).

imeoer avatar Feb 20 '24 11:02 imeoer

Maybe we should get macOS to pass unit tests as well: https://github.com/dragonflyoss/nydus/actions/runs/7735769409/job/21091979887?pr=1544

others LGTM, thanks!

Smoke test cases were added and passed.

WeiZhang555 avatar Mar 07 '24 07:03 WeiZhang555

image

It seems the CI broken, others LGTM!

imeoer avatar Mar 11 '24 02:03 imeoer

Thanks, LGTM! We can also add the doc in https://github.com/dragonflyoss/nydus/blob/master/docs/nydusd.md, may be Enable Overlay Writable ?

imeoer avatar Mar 13 '24 07:03 imeoer

@imeoer docs updated to docs/nydus-overlayfs.md

WeiZhang555 avatar Mar 15 '24 02:03 WeiZhang555

LGTM, thanks!

imeoer avatar Mar 15 '24 06:03 imeoer