Skip to content

Conversation

@jackowfish
Copy link
Contributor

@jackowfish jackowfish commented Oct 2, 2025

Overview

Adding S3 backend support to nydusify commit

Related Issues

Change Details

Added S3 Backend support - similarly to how it's implemented for nydusify convert - needed the ability to upload these commits directly to blob storage, so re-used most of the of the implementation from there.

Test Results

Have tested via nerdctl to s3 and Cloudflare R2 - working as expected.

Change Type

Please select the type of change your pull request relates to:

  • Bug Fix
  • Feature Addition
  • Documentation Update
  • Code Refactoring
  • Performance Improvement
  • Other (please describe)

Self-Checklist

Before submitting a pull request, please ensure you have completed the following:

  • I have run a code style check and addressed any warnings/errors.
  • I have added appropriate comments to my code (if applicable).
  • I have updated the documentation (if applicable).
  • I have written appropriate unit tests.

@jackowfish jackowfish force-pushed the jack/add-s3-to-commit branch from b768d30 to a70f3ec Compare October 2, 2025 21:21
@BraveY
Copy link
Contributor

BraveY commented Oct 9, 2025

@jackowfish Great work, Please tidy up the commit message and sign it so that it can pass the DCO check.

if err := targetRemoter.Push(ctx, blobDesc, true, reader); err != nil {
return nil, errors.Wrap(err, "push blob with HTTP")
// Push to backend storage if configured, otherwise use registry
if blobBackend != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems the previous interface definition enforcing the use of paths wasn't very reasonable, which led to this workaround. It caused an extra disk write, resulting in additional overhead. Perhaps in the future, we could consider revising this backend's Upload interface to accept a reader instead.

@BraveY
Copy link
Contributor

BraveY commented Oct 9, 2025

@jackowfish Great work, Please tidy up the commit message and sign it so that it can pass the DCO check.

Others LGTM!

config.RootFS.DiffIDs = append(config.RootFS.DiffIDs, mountBlob.Desc.Digest)

// When using S3 backend, skip adding new blob DiffIDs since they won't be in manifest
if opt.BackendType != "s3" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

May be if opt.BackendType != "registry" {.


// When using S3 backend, skip adding new blobs to manifest since they're referenced via URLs
// and Nydus only needs the bootstrap layer to function
if opt.BackendType != "s3" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto.

lowerDirs = strings.TrimPrefix(mount[0].Options[2], "lowerdir=")
upperDir = strings.TrimPrefix(mount[0].Options[1], "upperdir=")

// Parse overlay mount options properly - they can be in any order
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice work.

@jackowfish jackowfish force-pushed the jack/add-s3-to-commit branch from a70f3ec to 1df0a91 Compare October 22, 2025 16:40
@jackowfish jackowfish requested a review from a team as a code owner October 22, 2025 16:40
@jackowfish jackowfish requested review from BraveY, imeoer and liubogithub and removed request for a team October 22, 2025 16:40
@jackowfish jackowfish force-pushed the jack/add-s3-to-commit branch 2 times, most recently from 49c72b6 to ba1a626 Compare October 22, 2025 16:48
Signed-off-by: Jack Decker <[email protected]>
@codecov
Copy link

codecov bot commented Oct 22, 2025

Codecov Report

❌ Patch coverage is 7.27273% with 102 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.74%. Comparing base (4d586f4) to head (cda8618).

Files with missing lines Patch % Lines
contrib/nydusify/pkg/committer/commiter.go 0.00% 83 Missing ⚠️
contrib/nydusify/cmd/nydusify.go 0.00% 8 Missing ⚠️
contrib/nydusify/pkg/committer/manager.go 0.00% 6 Missing ⚠️
contrib/nydusify/pkg/converter/converter.go 0.00% 3 Missing ⚠️
contrib/nydusify/pkg/backend/s3.go 80.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1775      +/-   ##
==========================================
- Coverage   54.78%   54.74%   -0.04%     
==========================================
  Files         199      199              
  Lines       54197    54274      +77     
  Branches    44727    44727              
==========================================
+ Hits        29692    29714      +22     
- Misses      23016    23071      +55     
  Partials     1489     1489              
Files with missing lines Coverage Δ
contrib/nydusify/pkg/backend/s3.go 36.15% <80.00%> (+3.92%) ⬆️
contrib/nydusify/pkg/converter/converter.go 63.52% <0.00%> (-0.47%) ⬇️
contrib/nydusify/pkg/committer/manager.go 0.00% <0.00%> (ø)
contrib/nydusify/cmd/nydusify.go 16.74% <0.00%> (-0.16%) ⬇️
contrib/nydusify/pkg/committer/commiter.go 0.00% <0.00%> (ø)

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants