This is an automated email from the ASF dual-hosted git repository.

qianzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit e5514e903478b688c6bcde7ca2551ba424055d10
Author: Qian Zhang <zhq527...@gmail.com>
AuthorDate: Wed Jul 8 11:22:09 2020 +0800

    Updated `CSIPluginInfo` for supporting 3rd party CSI plugins.
    
    Review: https://reviews.apache.org/r/72661
---
 include/mesos/mesos.proto    | 38 ++++++++++++++++++++++++++++++++++----
 include/mesos/v1/mesos.proto | 38 ++++++++++++++++++++++++++++++++++----
 2 files changed, 68 insertions(+), 8 deletions(-)

diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index fe371ea..0f91d88 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -1063,7 +1063,7 @@ message SlaveInfo {
 
 
 /**
- * Describes the container configuration to run a CSI plugin component.
+ * Describes the container configuration to run a managed CSI plugin.
  */
 message CSIPluginContainerInfo {
   enum Service {
@@ -1080,6 +1080,15 @@ message CSIPluginContainerInfo {
 
 
 /**
+ * Describes the endpoint of an unmanaged CSI plugin service.
+ */
+message CSIPluginEndpoint {
+  required CSIPluginContainerInfo.Service csi_service = 1;
+  required string endpoint = 2;
+}
+
+
+/**
  * Describes a CSI plugin.
  */
 message CSIPluginInfo {
@@ -1103,13 +1112,34 @@ message CSIPluginInfo {
   // that the concatenation of type and name is unique in the cluster, and it
   // remains the same if the instance is migrated to another agent (e.g., there
   // is a change in the agent ID).
-  required string name = 2;
-
-  // A list of container configurations to run CSI plugin components.
+  optional string name = 2 [default = "default"];
+
+  // We support two kinds of CSI plugins:
+  //   1. Managed CSI plugins: This is the plugin which will be launched by
+  //      Mesos as standalone container, and Mesos will internally determine
+  //      its endpoint when launching it and manage its whole lifecyle. For 
this
+  //      kind of plugins, the `containers` field below must be specified.
+  //   2. Unmanaged CSI plugins: This is the plugin which is launched out of
+  //      Mesos (e.g., manually launched by the operator). For this kind of
+  //      plugins, the `endpoints` field below must be specified because Mesos
+  //      needs it to call CSI gRPC methods.
+  // Please note that only one of the `containers` and `endpoints` fields 
should
+  // be specified.
+
+  // A list of container configurations to run managed CSI plugin.
   // The controller service will be served by the first configuration
   // that contains `CONTROLLER_SERVICE`, and the node service will be
   // served by the first configuration that contains `NODE_SERVICE`.
   repeated CSIPluginContainerInfo containers = 3;
+
+  // The service endpoints of the unmanaged CSI plugin. An endpoint is usually
+  // a path to a Unix domain socket.
+  repeated CSIPluginEndpoint endpoints = 4;
+
+  // The root directory of all the target paths managed by the CSI plugin.
+  // Each volume will be published by the CSI plugin at a sub-directory
+  // under this path.
+  optional string target_path_root = 5;
 }
 
 
diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto
index effcfa1..f25db8a 100644
--- a/include/mesos/v1/mesos.proto
+++ b/include/mesos/v1/mesos.proto
@@ -1051,7 +1051,7 @@ message AgentInfo {
 
 
 /**
- * Describes the container configuration to run a CSI plugin component.
+ * Describes the container configuration to run a managed CSI plugin.
  */
 message CSIPluginContainerInfo {
   enum Service {
@@ -1068,6 +1068,15 @@ message CSIPluginContainerInfo {
 
 
 /**
+ * Describes the endpoint of an unmanaged CSI plugin service.
+ */
+message CSIPluginEndpoint {
+  required CSIPluginContainerInfo.Service csi_service = 1;
+  required string endpoint = 2;
+}
+
+
+/**
  * Describes a CSI plugin.
  */
 message CSIPluginInfo {
@@ -1091,13 +1100,34 @@ message CSIPluginInfo {
   // that the concatenation of type and name is unique in the cluster, and it
   // remains the same if the instance is migrated to another agent (e.g., there
   // is a change in the agent ID).
-  required string name = 2;
-
-  // A list of container configurations to run CSI plugin components.
+  optional string name = 2 [default = "default"];
+
+  // We support two kinds of CSI plugins:
+  //   1. Managed CSI plugins: This is the plugin which will be launched by
+  //      Mesos as standalone container, and Mesos will internally determine
+  //      its endpoint when launching it and manage its whole lifecyle. For 
this
+  //      kind of plugins, the `containers` field below must be specified.
+  //   2. Unmanaged CSI plugins: This is the plugin which is launched out of
+  //      Mesos (e.g., manually launched by the operator). For this kind of
+  //      plugins, the `endpoints` field below must be specified because Mesos
+  //      needs it to call CSI gRPC methods.
+  // Please note that only one of the `containers` and `endpoints` fields 
should
+  // be specified.
+
+  // A list of container configurations to run managed CSI plugin.
   // The controller service will be served by the first configuration
   // that contains `CONTROLLER_SERVICE`, and the node service will be
   // served by the first configuration that contains `NODE_SERVICE`.
   repeated CSIPluginContainerInfo containers = 3;
+
+  // The service endpoints of the unmanaged CSI plugin. An endpoint is usually
+  // a path to a Unix domain socket.
+  repeated CSIPluginEndpoint endpoints = 4;
+
+  // The root directory of all the target paths managed by the CSI plugin.
+  // Each volume will be published by the CSI plugin at a sub-directory
+  // under this path.
+  optional string target_path_root = 5;
 }
 
 

Reply via email to