-
Notifications
You must be signed in to change notification settings - Fork 3.8k
mount: add ExtraOptions field for Mount struct #6746
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
Conversation
|
Hi @luodw. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
Build succeeded.
|
api/types/mount.proto
Outdated
| // Options specifies zero or more fstab style mount options. | ||
| repeated string options = 4; | ||
|
|
||
| // ExtraOption specifies zero or more extra options except fstab style options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add example values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AkihiroSuda Ok, different case maybe need different extraoptions, take nydus as an example, nydus-snapshotter(remote-snapshotter) should delivery nydus image metadata file and nydus daemom configs to kata-shim runtime, so these two items can be add to extraoptions to delivery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is about interface change. If the case is more specifically, like demo or something, it will be easy to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luodw I think it is important to emphasize (in the interface comments) that the ExtraOptions field is opaque to containerd and is ignored by the containerd mount.Mount API. It aims to provide a way for the snapshotter to pass extra information to the container runtime.
An example of such extra information, in the nydus case, can be the nydus image bootstrap file location and the nydusd configuration, etc. It will be put into a predefined structure in a string format and be decoded in kata runtime, where this information is then passed to nydusd for real usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fuweid @AkihiroSuda @ktock Thanks for your comments! Does the approach make sense to you? We don't have an end-to-end demo yet. But we can work on integration first if you prefer to see it working end-to-end wise (which requires modification to nydus-snapshotter, containerd and kata).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fuweid Thanks, I have run a end-to-end demo in my dev machine successfully, and maybe it is more clear to show the code,
|
Build succeeded.
|
mount/mount.go
Outdated
| // these are platform specific. | ||
| Options []string | ||
| // ExtraOptions contains extra options except fstab-style mount options. | ||
| ExtraOptions []string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this used for mounting a filesystem?
If the purpose is configuring the runtime, isn't task-related structs (e.g. TaskInfo) the proper place to fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktock This field is not used to mount a filesystem like overlayfs, it's main role is used to delivery config information. As remote-snapshotter(take stargz-snapshotter for example) only return []mount.Mount, so if we want to delivery some config information from remote-snapshotter to runtime, adding ExtraOptions field may be a suitable way.
In containerd, it will ignore ExtraOptions and do mount overlayfs as original logic. In runtime, it will parse the ExtraOptions and use it. In nydus case, nydus-snapshotter will add nydus image metedata file path and config to ExtraOptions and delivery to kata-runtime, kata-runtime used these info to request nydusd (fuse/virtiofs daemon) to mount nydus rafs fllesystem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if this should be more of a MetaData field (making it more clear it's entirely up to the consumer what to use it for)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thaJeztah Do you mean renaming ExtraOption []string to MetaData []string? It does make it more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I was thinking along those lines (but of course could use input from others); mostly was reading along, and if I understand it correctly, effectively this information is arbitrary "extra information", that can be used by other systems for <insert purpose here>.
Naming it MetaData (or something like that), makes it clearer that whatever is in that field is not a strict "contract" (from containerd's perspective).
Of course the description of the field should also outline this, and could (perhaps) add some recommendations (e.g. recommend to use a common prefix (io.katacontainers.someopt=foo)) <--- thinking out loud here; I know we did the same recommendation for labels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thaJeztah Thanks for you advise, I agree that MetaDatas []string is more clear. I have updated the field and it's description, hope for your reivew again.
|
Build succeeded.
|
When intergrating nydus with kata, it need pass some information from nydus-snapshotter to kata-shim runtime, so this pr adds MetaDatas field for Mount struct to carry extra infomation. Signed-off-by: luodaowen.backend <[email protected]>
|
Build succeeded.
|
| Type: m.Type, | ||
| Source: m.Source, | ||
| Options: m.Options, | ||
| MetaDatas: m.MetaDatas, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be Metadata (or MetaData) (singular), as data is already plural.
But ok to wait with changing as the discussion hasn't completed yet, so maintainers may have more input on this 😅
dmcgowan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extending the mount interface needs more design consideration before making interface changes. We try to avoid extending existing interfaces to side load metadata. For the mount case, there are other features that necessitate a deeper look at the mount type such as device activation or other pre-mount configuration. We should first discuss the commonality of these features and the needed behavior changes by the mounters.
|
/ok-to-test |
|
PR needs rebase. DetailsInstructions 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. |
|
This PR is stale because it has been open 90 days with no activity. This PR will be closed in 7 days unless new comments are made or the stale label is removed. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
When intergrating nydus-snapshotter with kata, it need delivery some
information to kata-shim runtime, so this pr add ExtraOptions for Mount struct to
delivery infomations and it would also be useful for other remote
snapshotters and runtimes.
Issue: 6656
Signed-off-by: luodaowen.backend [email protected]