You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2016/04/08 23:20:03 UTC

[4/5] mesos git commit: Updated documentation to mention GPUs as a first class resource.

Updated documentation to mention GPUs as a first class resource.

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


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

Branch: refs/heads/master
Commit: a741bed38c34c5da6ffb1c7b2e80a8b393d8bce8
Parents: 517ee2c
Author: Kevin Klues <kl...@gmail.com>
Authored: Fri Apr 8 14:15:39 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Fri Apr 8 14:15:39 2016 -0700

----------------------------------------------------------------------
 docs/attributes-resources.md | 17 ++++++--
 docs/monitoring.md           | 84 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 97 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a741bed3/docs/attributes-resources.md
----------------------------------------------------------------------
diff --git a/docs/attributes-resources.md b/docs/attributes-resources.md
index 26468d9..7d687ff 100644
--- a/docs/attributes-resources.md
+++ b/docs/attributes-resources.md
@@ -37,7 +37,7 @@ Attributes are key-value pairs (where value is optional) that Mesos passes along
 
 ## Resources
 
-Mesos can manage three different *types* of resources: scalars, ranges, and sets.  These are used to represent the different resources that a Mesos slave has to offer.  For example, a scalar resource type could be used to represent the amount of memory on a slave. Scalar resources are represented using floating point numbers to allow fractional values to be specified (e.g., "1.5 CPUs"). Mesos only supports three decimal digits of precision for scalar resources (e.g., reserving "1.5123 CPUs" is considered equivalent to reserving "1.512 CPUs").
+Mesos can manage three different *types* of resources: scalars, ranges, and sets.  These are used to represent the different resources that a Mesos slave has to offer.  For example, a scalar resource type could be used to represent the amount of memory on a slave. Scalar resources are represented using floating point numbers to allow fractional values to be specified (e.g., "1.5 CPUs"). Mesos only supports three decimal digits of precision for scalar resources (e.g., reserving "1.5123 CPUs" is considered equivalent to reserving "1.512 CPUs"). For GPUs, Mesos only supports whole number values.
 
 Resources can be specified either with a JSON array or a semicolon-delimited string of key-value pairs.  If, after examining the examples below, you have questions about the format of the JSON, inspect the `Resource` protobuf message definition in `include/mesos/mesos.proto`.
 
@@ -95,6 +95,7 @@ Note that `resourceRole` must be a valid role name; see the [roles](roles.md) do
 There are several kinds of resources that have predefined behavior:
 
   - `cpus`
+  - `gpus`
   - `disk`
   - `mem`
   - `ports`
@@ -109,9 +110,9 @@ By default, Mesos will try to autodetect the resources available at the local ma
 
 Here are some examples of how to configure the resources at a Mesos slave:
 
-    --resources='cpus:24;mem:24576;disk:409600;ports:[21000-24000,30000-34000];bugs(debug_role):{a,b,c}'
+    --resources='cpus:24;gpus:2;mem:24576;disk:409600;ports:[21000-24000,30000-34000];bugs(debug_role):{a,b,c}'
 
-    --resources='[{"name":"cpus","type":"SCALAR","scalar":{"value":24}},{"name":"mem","type":"SCALAR","scalar":{"value":24576}},{"name":"disk","type":"SCALAR","scalar":{"value":409600}},{"name":"ports","type":"RANGES","ranges":{"range":[{"begin":21000,"end":24000},{"begin":30000,"end":34000}]}},{"name":"bugs","type":"SET","set":{"item":["a","b","c"]},"role":"debug_role"}]'
+    --resources='[{"name":"cpus","type":"SCALAR","scalar":{"value":24}},{"name":"gpus","type":"SCALAR","scalar":{"value":2}},{"name":"mem","type":"SCALAR","scalar":{"value":24576}},{"name":"disk","type":"SCALAR","scalar":{"value":409600}},{"name":"ports","type":"RANGES","ranges":{"range":[{"begin":21000,"end":24000},{"begin":30000,"end":34000}]}},{"name":"bugs","type":"SET","set":{"item":["a","b","c"]},"role":"debug_role"}]'
 
 Or given a file `resources.txt` containing the following:
 
@@ -124,6 +125,13 @@ Or given a file `resources.txt` containing the following:
         }
       },
       {
+        "name": "gpus",
+        "type": "SCALAR",
+        "scalar": {
+          "value": 2
+        }
+      },
+      {
         "name": "mem",
         "type": "SCALAR",
         "scalar": {
@@ -171,11 +179,12 @@ You can do:
 
     $ path/to/mesos-slave --resources=file:///path/to/resources.txt ...
 
-In this case, we have five resources of three different types: scalars, a range, and a set.  There are scalars called `cpus`, `mem` and `disk`, a range called `ports`, and a set called `bugs`. `bugs` is assigned to the role `debug_role`, while the other resources do not specify a role and are thus assigned to the default role.
+In this case, we have five resources of three different types: scalars, a range, and a set.  There are scalars called `cpus`, `gpus`, `mem` and `disk`, a range called `ports`, and a set called `bugs`. `bugs` is assigned to the role `debug_role`, while the other resources do not specify a role and are thus assigned to the default role.
 
 Note: the "default role" can be set by the `--default_role` flag.
 
   - scalar called `cpus`, with the value `24`
+  - scalar called `gpus`, with the value `2`
   - scalar called `mem`, with the value `24576`
   - scalar called `disk`, with the value `409600`
   - range called `ports`, with values `21000` through `24000` and `30000` through `34000` (inclusive)

http://git-wip-us.apache.org/repos/asf/mesos/blob/a741bed3/docs/monitoring.md
----------------------------------------------------------------------
diff --git a/docs/monitoring.md b/docs/monitoring.md
index 38b4144..69d0f98 100644
--- a/docs/monitoring.md
+++ b/docs/monitoring.md
@@ -149,6 +149,48 @@ framework is misbehaving.
 </tr>
 <tr>
   <td>
+  <code>master/gpus_percent</code>
+  </td>
+  <td>Percentage of allocated GPUs</td>
+  <td>Gauge</td>
+</tr>
+<tr>
+  <td>
+  <code>master/gpus_used</code>
+  </td>
+  <td>Number of allocated GPUs</td>
+  <td>Gauge</td>
+</tr>
+<tr>
+  <td>
+  <code>master/gpus_total</code>
+  </td>
+  <td>Number of GPUs</td>
+  <td>Gauge</td>
+</tr>
+<tr>
+  <td>
+  <code>master/gpus_revocable_percent</code>
+  </td>
+  <td>Percentage of allocated revocable GPUs</td>
+  <td>Gauge</td>
+</tr>
+<tr>
+  <td>
+  <code>master/gpus_revocable_total</code>
+  </td>
+  <td>Number of revocable GPUs</td>
+  <td>Gauge</td>
+</tr>
+<tr>
+  <td>
+  <code>master/gpus_revocable_used</code>
+  </td>
+  <td>Number of allocated revocable GPUs</td>
+  <td>Gauge</td>
+</tr>
+<tr>
+  <td>
   <code>master/mem_percent</code>
   </td>
   <td>Percentage of allocated memory</td>
@@ -1149,6 +1191,48 @@ the slave and their current usage.
 </tr>
 <tr>
   <td>
+  <code>slave/gpus_percent</code>
+  </td>
+  <td>Percentage of allocated GPUs</td>
+  <td>Gauge</td>
+</tr>
+<tr>
+  <td>
+  <code>slave/gpus_used</code>
+  </td>
+  <td>Number of allocated GPUs</td>
+  <td>Gauge</td>
+</tr>
+<tr>
+  <td>
+  <code>slave/gpus_total</code>
+  </td>
+  <td>Number of GPUs</td>
+  <td>Gauge</td>
+</tr>
+<tr>
+  <td>
+  <code>slave/gpus_revocable_percent</code>
+  </td>
+  <td>Percentage of allocated revocable GPUs</td>
+  <td>Gauge</td>
+</tr>
+<tr>
+  <td>
+  <code>slave/gpus_revocable_total</code>
+  </td>
+  <td>Number of revocable GPUs</td>
+  <td>Gauge</td>
+</tr>
+<tr>
+  <td>
+  <code>slave/gpus_revocable_used</code>
+  </td>
+  <td>Number of allocated revocable GPUs</td>
+  <td>Gauge</td>
+</tr>
+<tr>
+  <td>
   <code>slave/mem_percent</code>
   </td>
   <td>Percentage of allocated memory</td>