You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ch...@apache.org on 2018/07/13 21:41:12 UTC

[07/17] mesos git commit: Introduced `CREATE_DISK` and `DESTROY_DISK` operations.

Introduced `CREATE_DISK` and `DESTROY_DISK` operations.

This patch introduces `CREATE_DISK` and `DESTROY_DISK` operations for
conversion between RAW disk resaurces and MOUNT/BLOCK disk resources to
replace `CREATE_VOLUME`/`DESTROY_VOLUME`/`CREATE_BLOCK`/`DESTROY_BLOCK`.

This replacement involves two aspects:

1. Renaming: The term "volume" is overloaded and created name conflicts
   in mesos. This renaming would lead to cleaner names in ACL and other
   places, and is more consistent with CSI.

2. Removing PATH support. PATH disks are used to split a disk resource
   into smaller chunks for concurrent independent uses. However, this
   concept does not quite fit CSI well.

Review: https://reviews.apache.org/r/67779


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/83a653c4
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/83a653c4
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/83a653c4

Branch: refs/heads/master
Commit: 83a653c4a851f23ea95d61ae533917be9174581d
Parents: d7b03e7
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
Authored: Thu Jun 28 17:22:25 2018 -0700
Committer: Chun-Hung Hsiao <ch...@mesosphere.io>
Committed: Fri Jul 13 14:30:07 2018 -0700

----------------------------------------------------------------------
 include/mesos/mesos.proto    | 34 ++++++++++++----------------------
 include/mesos/v1/mesos.proto | 33 ++++++++++++---------------------
 2 files changed, 24 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/83a653c4/include/mesos/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 463e6ad..5a985fc 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -1923,12 +1923,10 @@ message Offer {
       UNRESERVE = 3;
       CREATE = 4;
       DESTROY = 5;
-      CREATE_VOLUME = 7;  // EXPERIMENTAL.
-      DESTROY_VOLUME = 8; // EXPERIMENTAL.
-      CREATE_BLOCK = 9;   // EXPERIMENTAL.
-      DESTROY_BLOCK = 10; // EXPERIMENTAL.
       GROW_VOLUME = 11;   // EXPERIMENTAL.
       SHRINK_VOLUME = 12; // EXPERIMENTAL.
+      CREATE_DISK = 13;   // EXPERIMENTAL.
+      DESTROY_DISK = 14;  // EXPERIMENTAL.
     }
 
     // TODO(vinod): Deprecate this in favor of `LaunchGroup` below.
@@ -1983,31 +1981,25 @@ message Offer {
       required Value.Scalar subtract = 2;
     }
 
+    // Create a `MOUNT` or `BLOCK` disk resource from a `RAW` disk resource.
     // NOTE: For the time being, this API is subject to change and the related
     // feature is experimental.
-    message CreateVolume {
+    message CreateDisk {
       required Resource source = 1;
-      required Resource.DiskInfo.Source.Type target_type = 2;
-    }
 
-    // NOTE: For the time being, this API is subject to change and the related
-    // feature is experimental.
-    message DestroyVolume {
-      required Resource volume = 1;
+      // NOTE: Only `MOUNT` or `BLOCK` is allowed in the `target_type` field.
+      required Resource.DiskInfo.Source.Type target_type = 2;
     }
 
+    // Destroy a `MOUNT` or `BLOCK` disk resource. This will result in a `RAW`
+    // disk resource.
     // NOTE: For the time being, this API is subject to change and the related
     // feature is experimental.
-    message CreateBlock {
+    message DestroyDisk {
+      // NOTE: Only a `MOUNT` or `BLOCK` disk is allowed in the `source` field.
       required Resource source = 1;
     }
 
-    // NOTE: For the time being, this API is subject to change and the related
-    // feature is experimental.
-    message DestroyBlock {
-      required Resource block = 1;
-    }
-
     optional Type type = 1;
 
     // NOTE: The `id` field will allow frameworks to indicate that they wish to
@@ -2023,10 +2015,8 @@ message Offer {
     optional Destroy destroy = 6;
     optional GrowVolume grow_volume = 13; // EXPERIMENTAL.
     optional ShrinkVolume shrink_volume = 14; // EXPERIMENTAL.
-    optional CreateVolume create_volume = 8;
-    optional DestroyVolume destroy_volume = 9;
-    optional CreateBlock create_block = 10;
-    optional DestroyBlock destroy_block = 11;
+    optional CreateDisk create_disk = 15; // EXPERIMENTAL.
+    optional DestroyDisk destroy_disk = 16; // EXPERIMENTAL.
   }
 }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/83a653c4/include/mesos/v1/mesos.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto
index 8eaad9c..a5ebb78 100644
--- a/include/mesos/v1/mesos.proto
+++ b/include/mesos/v1/mesos.proto
@@ -1915,12 +1915,10 @@ message Offer {
       UNRESERVE = 3;
       CREATE = 4;
       DESTROY = 5;
-      CREATE_VOLUME = 7;  // EXPERIMENTAL.
-      DESTROY_VOLUME = 8; // EXPERIMENTAL.
-      CREATE_BLOCK = 9;   // EXPERIMENTAL.
-      DESTROY_BLOCK = 10; // EXPERIMENTAL.
       GROW_VOLUME = 11;   // EXPERIMENTAL.
       SHRINK_VOLUME = 12; // EXPERIMENTAL.
+      CREATE_DISK = 13;   // EXPERIMENTAL.
+      DESTROY_DISK = 14;  // EXPERIMENTAL.
     }
 
     // TODO(vinod): Deprecate this in favor of `LaunchGroup` below.
@@ -1975,30 +1973,25 @@ message Offer {
       required Value.Scalar subtract = 2;
     }
 
+    // Create a `MOUNT` or `BLOCK` disk resource from a `RAW` disk resource.
     // NOTE: For the time being, this API is subject to change and the related
     // feature is experimental.
-    message CreateVolume {
+    message CreateDisk {
       required Resource source = 1;
-      required Resource.DiskInfo.Source.Type target_type = 2;
-    }
 
-    // NOTE: For the time being, this API is subject to change and the related
-    // feature is experimental.
-    message DestroyVolume {
-      required Resource volume = 1;
+      // NOTE: Only `MOUNT` or `BLOCK` is allowed in the `target_type` field.
+      required Resource.DiskInfo.Source.Type target_type = 2;
     }
 
+    // Destroy a `MOUNT` or `BLOCK` disk resource. This will result in a `RAW`
+    // disk resource.
     // NOTE: For the time being, this API is subject to change and the related
     // feature is experimental.
-    message CreateBlock {
+    message DestroyDisk {
+      // NOTE: Only a `MOUNT` or `BLOCK` disk is allowed in the `source` field.
       required Resource source = 1;
     }
 
-    // NOTE: For the time being, this API is subject to change and the related
-    // feature is experimental.
-    message DestroyBlock {
-      required Resource block = 1;
-    }
 
     optional Type type = 1;
 
@@ -2015,10 +2008,8 @@ message Offer {
     optional Destroy destroy = 6;
     optional GrowVolume grow_volume = 13; // EXPERIMENTAL.
     optional ShrinkVolume shrink_volume = 14; // EXPERIMENTAL.
-    optional CreateVolume create_volume = 8;
-    optional DestroyVolume destroy_volume = 9;
-    optional CreateBlock create_block = 10;
-    optional DestroyBlock destroy_block = 11;
+    optional CreateDisk create_disk = 15; // EXPERIMENTAL.
+    optional DestroyDisk destroy_disk = 16; // EXPERIMENTAL.
   }
 }