You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR is a re-implementation on the shareable namespace feature that was originally introduced by #5043, which was reverted due to a bug identified during testing.
The new implementation follows and extends the semantic of the existing content sharing policy, by allowing the content of a namespace (if configured as "shareable") to be accessible from other namespaces even "content_sharing_policy" is set to "isolated".
For example:
$ cat config.toml
[plugins]
[plugins.bolt]
content_sharing_policy = "isolated"
// 0. label the shared namespace
$ ctr ns label shared containerd.io/namespace.shareable=true
// 1. pull image into shared namespace
$ ctr -n shared i pull docker.io/library/hello-world:latest
// 2. pull the same image into test namespace, this should be much quicker
// due to content sharing
$ ctr -n test i pull docker.io/library/hello-world:latest
// 3. run container in test namespace
$ ctr -n test run --rm docker.io/library/hello-world:latest demo
I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Whether this feature should piggyback off the "isolated" policy...
I went back and forth on this one but think it is probably fine the way it is. Since "shared" is the default policy already and this requires explicitly setting the label. Generally, we don't consider it a point of security weakness to make these changes over the API. Even with namespace enforcement, this would only allow an API to give up hash verified data to another namespace, not access anything new.
Efficiency
This won't effect the "shared" default policy. For "isolate" the impact still looks minimal, especially since it is only on open writer. There is a potential for caching the shared namespaces in the future but the improvement is likely minimal, although could save some IO for larger databases. The measuring factor there might be more lock time, since it is performed during a global write lock.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-introducing the shareable namespace feature
Related PR: #5043
This PR is a re-implementation on the shareable namespace feature that was originally introduced by #5043, which was reverted due to a bug identified during testing.
The new implementation follows and extends the semantic of the existing content sharing policy, by allowing the content of a namespace (if configured as "shareable") to be accessible from other namespaces even "content_sharing_policy" is set to "isolated".
For example:
Signed-off-by: Henry Wang henwang@amazon.com