Skip to content

Commit

Permalink
NodePublishDevice
Browse files Browse the repository at this point in the history
This patch handles issue container-storage-interface#119 by adding two new RPCs,
"NodePublishDevice" and "NodeUnpublishDevice". These RPCs MUST be called
by the CO if the Node Plugin advertises the "PUBLISH_UNPUBLISH_DEVICE"
capability. Plugins that advertise this capability SHOULD defer volume
reference counting to the CO.
  • Loading branch information
akutz authored and davidz627 committed Jan 18, 2018
1 parent 716f53e commit a603ab3
Show file tree
Hide file tree
Showing 3 changed files with 656 additions and 400 deletions.
81 changes: 73 additions & 8 deletions csi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ service Controller {
}

service Node {
rpc NodePublishDevice (NodePublishDeviceRequest)
returns (NodePublishDeviceResponse) {}

rpc NodeUnpublishDevice (NodeUnpublishDeviceRequest)
returns (NodeUnpublishDeviceResponse) {}

rpc NodePublishVolume (NodePublishVolumeRequest)
returns (NodePublishVolumeResponse) {}

Expand Down Expand Up @@ -325,7 +331,8 @@ message ControllerPublishVolumeRequest {

message ControllerPublishVolumeResponse {
// The SP specific information that will be passed to the Plugin in
// the subsequent `NodePublishVolume` call for the given volume.
// the subsequent `NodePublishDevice` and `NodePublishVolume` calls
// for the given volume.
// This information is opaque to the CO. This field is OPTIONAL.
map<string, string> publish_volume_info = 1;
}
Expand Down Expand Up @@ -496,6 +503,51 @@ message ControllerServiceCapability {
}
////////
////////
message NodePublishDeviceRequest {
// The API version assumed by the CO. This is a REQUIRED field.
Version version = 1;

// The ID of the volume to publish. This field is REQUIRED.
string volume_id = 2;

// The CO SHALL set this field to the value returned by
// `ControllerPublishVolume` if the corresponding Controller Plugin
// has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be
// left unset if the corresponding Controller Plugin does not have
// this capability. This is an OPTIONAL field.
map<string, string> publish_volume_info = 3;

// 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 global_target_path per
// volume.
// This is a REQUIRED field.
string global_target_path = 4;

// The capability of the volume the CO expects the volume to have.
// This is a REQUIRED field.
VolumeCapability volume_capability = 5;
}

message NodePublishDeviceResponse {}
////////
////////
message NodeUnpublishDeviceRequest {
// The API version assumed by the CO. This is a REQUIRED field.
Version version = 1;

// The ID of the volume. This field is REQUIRED.
string volume_id = 2;

// The path at which the volume was published. It MUST be an absolute
// path in the root filesystem of the process serving this request.
// This is a REQUIRED field.
string global_target_path = 3;
}

message NodeUnpublishDeviceResponse {}
////////
////////
message NodePublishVolumeRequest {
// The API version assumed by the CO. This is a REQUIRED field.
Version version = 1;
Expand All @@ -510,21 +562,27 @@ message NodePublishVolumeRequest {
// this capability. This is an OPTIONAL field.
map<string, string> publish_volume_info = 3;

// The path to which the device was mounted by `NodePublishDevice`.
// It MUST be an absolute path in the root filesystem of the process
// serving this request.
// This is an OPTIONAL field.
string global_target_path = 4;

// 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.
// This is a REQUIRED field.
string target_path = 4;
string target_path = 5;

// The capability of the volume the CO expects the volume to have.
// This is a REQUIRED field.
VolumeCapability volume_capability = 5;
VolumeCapability volume_capability = 6;

// Whether to publish the volume in readonly mode. This field is
// REQUIRED.
bool readonly = 6;
bool readonly = 7;

// End user credentials used to authenticate/authorize node
// publish request.
Expand All @@ -537,12 +595,12 @@ message NodePublishVolumeRequest {
// users to pass through the required credentials. This information is
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
// This field is OPTIONAL.
map<string, string> user_credentials = 7;
map<string, string> user_credentials = 8;

// Attributes of the volume to publish. This field is OPTIONAL and
// MUST match the attributes of the VolumeInfo identified by
// `volume_id`.
map<string,string> volume_attributes = 8;
map<string,string> volume_attributes = 9;
}

message NodePublishVolumeResponse {}
Expand All @@ -555,10 +613,16 @@ message NodeUnpublishVolumeRequest {
// The ID of the volume. This field is REQUIRED.
string volume_id = 2;

// The path to which the device was mounted by `NodePublishDevice`.
// It MUST be an absolute path in the root filesystem of the process
// serving this request.
// This is an OPTIONAL field.
string global_target_path = 3;

// The path at which the volume was published. It MUST be an absolute
// path in the root filesystem of the process serving this request.
// This is a REQUIRED field.
string target_path = 3;
string target_path = 4;

// End user credentials used to authenticate/authorize node
// unpublish request.
Expand All @@ -571,7 +635,7 @@ message NodeUnpublishVolumeRequest {
// users to pass through the required credentials. This information is
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
// This field is OPTIONAL.
map<string, string> user_credentials = 4;
map<string, string> user_credentials = 5;
}

message NodeUnpublishVolumeResponse {}
Expand Down Expand Up @@ -614,6 +678,7 @@ message NodeServiceCapability {
message RPC {
enum Type {
UNKNOWN = 0;
PUBLISH_UNPUBLISH_DEVICE = 1;
}

Type type = 1;
Expand Down
Loading

0 comments on commit a603ab3

Please sign in to comment.