Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feats: support encrypting nydus data blobs #498

Merged
merged 1 commit into from
Jul 13, 2023

Conversation

taoohong
Copy link
Contributor

@taoohong taoohong commented Jun 20, 2023

support encrypting nydus data blobs

Related issue

@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Merging #498 (3915fce) into main (3338db6) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #498      +/-   ##
==========================================
- Coverage   37.91%   37.89%   -0.02%     
==========================================
  Files          60       60              
  Lines        7074     7077       +3     
==========================================
  Hits         2682     2682              
- Misses       4080     4083       +3     
  Partials      312      312              
Impacted Files Coverage Δ
pkg/converter/tool/builder.go 0.00% <0.00%> (ø)
pkg/converter/tool/feature.go 89.85% <ø> (ø)

Copy link
Member

@sctb512 sctb512 left a comment

Choose a reason for hiding this comment

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

LGTM

pkg/converter/constant.go Outdated Show resolved Hide resolved
pkg/converter/constant.go Outdated Show resolved Hide resolved
pkg/converter/convert_unix.go Outdated Show resolved Hide resolved
pkg/converter/convert_unix.go Outdated Show resolved Hide resolved
pkg/converter/types.go Outdated Show resolved Hide resolved
@taoohong taoohong force-pushed the nydus-image-encrypt branch 2 times, most recently from eb0dfdc to 4f663c3 Compare July 11, 2023 03:04
@taoohong
Copy link
Contributor Author

taoohong commented Jul 11, 2023

I've add a test for encrypt since last commit in order to revole the code coverage problem. But it seems that the CI is not based on the latest nydus-image, causing the smoke unit test to fail. 😢 cc @changweige

@changweige
Copy link
Member

I've add a test for encrypt since last commit in order to revole the code coverage problem. But it seems that the CI is not based on the latest nydus-image, causing the smoke unit test to fail. 😢 cc @changweige

I've add a test for encrypt since last commit in order to revole the code coverage problem. But it seems that the CI is not based on the latest nydus-image, causing the smoke unit test to fail. 😢 cc @changweige

Is there any plan for the next nydusd/nydus-image release with an image encryption feature?

@taoohong
Copy link
Contributor Author

I've add a test for encrypt since last commit in order to revole the code coverage problem. But it seems that the CI is not based on the latest nydus-image, causing the smoke unit test to fail. 😢 cc @changweige

I've add a test for encrypt since last commit in order to revole the code coverage problem. But it seems that the CI is not based on the latest nydus-image, causing the smoke unit test to fail. 😢 cc @changweige

Is there any plan for the next nydusd/nydus-image release with an image encryption feature?

cc @jiangliu

Copy link
Member

@changweige changweige left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. But for the sake of compatibility, we have to check if the underlying nydus toolchain meets our feature requirements in the function DetectFeatures. In this PR, the required feature would be --encrypt.

@changweige
Copy link
Member

If there is no concrete plan for the next nydus-image release, we can move the CI test to another PR and just check if the underlying nydus-image has the feature --encrypt?

@taoohong
Copy link
Contributor Author

taoohong commented Jul 12, 2023

just check if the underlying nydus-image has the feature --encrypt?

yes

If there is no concrete plan for the next nydus-image release, we can move the CI test to another PR and just check if the underlying nydus-image has the feature --encrypt?

codecov/patch would fail due to 0.00% of diff hit if I don't add the CI test. PR can still be merged even if this test failed?

@changweige
Copy link
Member

just check if the underlying nydus-image has the feature --encrypt?

yes

If there is no concrete plan for the next nydus-image release, we can move the CI test to another PR and just check if the underlying nydus-image has the feature --encrypt?

codecov/patch would fail due to 0.00% of diff hit if I don't add the CI test. PR can still be merged even if this test failed?

In fact the result from codecov/patch is not a strong restriction, I can still press merge if it fails.

@@ -32,6 +32,9 @@ const (
// into a big batch chunk, which can reduce the the size of the image
// and accelerate the runtime file loading.
FeatureBatchSize Feature = "--batch-size"
// The option `--encrypt` enables converting directories, tar files
// or OCI images into encrypted nydus blob.
FeatureEncrypt Feature = "--encrypt"
Copy link
Member

Choose a reason for hiding this comment

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

Should we detect if the required feature encrypt is supported by nydus-image? Seems we only define a constant here.

	requiredFeatures := tool.NewFeatures(tool.FeatureTar2Rafs)
	if opt.BatchSize != "" && opt.BatchSize != "0" {
		requiredFeatures.Add(tool.FeatureBatchSize)
	}

	detectedFeatures, err := tool.DetectFeatures(builderPath, required features, tool.GetHelp)
	if err != nil {
		return nil, err

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Support encrypting nydus data blobs.

Signed-off-by: taohong <[email protected]>
Copy link
Member

@changweige changweige left a comment

Choose a reason for hiding this comment

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

LGMT

@changweige
Copy link
Member

Thanks

@changweige changweige merged commit e02116c into containerd:main Jul 13, 2023
16 of 17 checks passed
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