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

spec: Clarify target_path and staging_target_path #312

Merged
merged 1 commit into from
Nov 9, 2018

Conversation

jieyu
Copy link
Member

@jieyu jieyu commented Nov 9, 2018

This patch clarifies the target_path and staging_target_path in the
spec. It is CO's responsibility to make sure that SP has the permission
to read or write target_path and staging_target_path, and is able to
create files/directories if the path does not exist.

This patch also changes the wording in NodeStageVolume call to enable
those plugins that want to use the NodeStageVolume call as a lifecycle
hook, but does not want to mount to the staging_target_path.

Closes #285
Closes #80
Closes #294
Closes #295

@jieyu jieyu requested review from jdef and saad-ali November 9, 2018 00:45
csi.proto Outdated
// staging_target_path per volume.
// `staging_target_path` per volume. The SP MUST NOT use symbolic link
// to staged the volume. The CO SHALL ensure that the path exists, and
// that the process serving the request has `read` and `write`
Copy link
Contributor

Choose a reason for hiding this comment

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

typo in to staged the volume ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! Fixed!

Copy link
Member

@jdef jdef left a comment

Choose a reason for hiding this comment

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

LGTM mod nits from @gnufied

spec.md Outdated
@@ -1848,8 +1854,12 @@ message NodePublishVolumeRequest {
// The path to which the volume will be published. It MUST be an
// absolute path in the root filesystem of the process serving this
// request. The CO SHALL ensure uniqueness of target_path per volume.
// The CO SHALL ensure that the path exists, and that the process
// serving the request has `read` and `write` permissions to the path.
// The SP MUST NOT use symbolic link to publish the volume. The CO
Copy link
Member

Choose a reason for hiding this comment

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

I can imagine a local ephemeral volume that only does Mount Volume not Block Volume, it might make sense to use symlink for such volumes. And with the added requirement below that the CO will create an empty file for block and an empty dir for mount, I'm not sure explicitly excluding symlink is necessary. I'd prefer to remove this line unless we have a strong reason for it.

Copy link
Member Author

@jieyu jieyu Nov 9, 2018

Choose a reason for hiding this comment

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

The use of symlink is naturally incompatible with the need to create empty file/directory (i.e., mount points) for volumes because SP then needs to delete the mount points created by the CO, and replace it with a symlink. The same argument applies to the use of mknod for block volumes. Symlink is almost certainly a bad idea because it's relative to the filesystem root of the Plugin process, which might be different that that of the CO's.

I am actually leaning toward just dictating that it is has to be mount based. I think this align with our goal for SP to write one plugin that works for all COs.

What do you guys think? cc @saad-ali @julian-hj ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we also stop people from having part of PATH being symbolic link? I remember - some users define /var/lib/kubelet to be a symbolic link for example and in that case the path will be /var/lib/kubelet/plugins/volumes/csi/xxx.

Copy link
Member Author

Choose a reason for hiding this comment

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

We switched to not letting CO to create the mount point. SP can do that. CO needs to make sure SP has the permission to do that.

Copy link
Member

@saad-ali saad-ali left a comment

Choose a reason for hiding this comment

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

I am leaning towards not having the CO create the path. That way the plugin can do what ever it wants. And if there is a new cool way on a different platform making data available at a path, the spec doesn't need to be updated?

spec.md Outdated
@@ -1730,10 +1730,16 @@ message NodeStageVolumeRequest {
// this capability. This is an OPTIONAL field.
map<string, string> publish_info = 2;

// The path to which the volume will be published. It MUST be an
// The path to which the volume will be staged. It MUST be an
Copy link
Member

Choose a reason for hiding this comment

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

Can you address Issue #295 (comment) while you are touching this code?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@jieyu jieyu force-pushed the target_path branch 3 times, most recently from c61e1e1 to be7fa84 Compare November 9, 2018 22:39
@saad-ali
Copy link
Member

saad-ali commented Nov 9, 2018

Mostly LGTM. Is it worth adding: SP MAY create the target_path as necessary if it does not exist.?

This patch clarifies the `target_path` and `staging_target_path` in the
spec. It is CO's responsibility to make sure that SP has the permission
to read or write `target_path` and `staging_target_path`, and is able to
create files/directories if the path does not exist.

This patch also changes the wording in `NodeStageVolume` call to enable
those plugins that want to use the `NodeStageVolume` call as a lifecycle
hook, but does not want to mount to the `staging_target_path`.
@jieyu
Copy link
Member Author

jieyu commented Nov 9, 2018

@saad-ali i don't think that's necessary. The comment already says that The path to which the volume MAY be staged. and The path to which the volume will be published..

@saad-ali
Copy link
Member

saad-ali commented Nov 9, 2018

SGTM
LGTM
/approve

@saad-ali saad-ali merged commit 08e9876 into container-storage-interface:master Nov 9, 2018
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