diff --git a/website/source/docs/drivers/docker.html.md b/website/source/docs/drivers/docker.html.md index 4575831ec..2b9b4d43b 100644 --- a/website/source/docs/drivers/docker.html.md +++ b/website/source/docs/drivers/docker.html.md @@ -334,7 +334,20 @@ The `docker` driver will set the following client attributes: * `driver.docker` - This will be set to "1", indicating the driver is available. -* `driver.docker.version` - This will be set to version of the docker server +* `driver.docker.version` - This will be set to version of the docker server. + +Here is an example of using these properties in a job file: + +```hcl +job "docs" { + # Require docker version higher than 1.2. + constraint { + attribute = "${driver.docker.version}" + operator = ">" + version = "1.2" + } +} +``` ## Resource Isolation diff --git a/website/source/docs/drivers/exec.html.md b/website/source/docs/drivers/exec.html.md index 17d7d9a44..8de50ae38 100644 --- a/website/source/docs/drivers/exec.html.md +++ b/website/source/docs/drivers/exec.html.md @@ -85,8 +85,20 @@ also applies for running Nomad in -dev mode. The `exec` driver will set the following client attributes: -* `driver.exec` - This will be set to "1", indicating the - driver is available. +* `driver.exec` - This will be set to "1", indicating the driver is available. + +Here is an example of using these properties in a job file: + +```hcl +job "docs" { + # Only run this job where exec is enabled. (Note: this constraint is applied + # automatically if you specify a task that uses the exec driver). + constraint { + attribute = "${driver.exec}" + value = "1" + } +} +``` ## Resource Isolation diff --git a/website/source/docs/drivers/java.html.md b/website/source/docs/drivers/java.html.md index 9d4f395a7..35e25e72a 100644 --- a/website/source/docs/drivers/java.html.md +++ b/website/source/docs/drivers/java.html.md @@ -12,7 +12,7 @@ Name: `java` The `Java` driver is used to execute Java applications packaged into a Java Jar file. The driver requires the Jar file to be accessible from the Nomad -client via the [`artifact` downloader](/docs/jobspec/index.html#artifact_doc). +client via the [`artifact` downloader](/docs/jobspec/index.html#artifact_doc). ## Task Configuration @@ -61,7 +61,7 @@ task "web" { ## Client Requirements -The `java` driver requires Java to be installed and in your system's `$PATH`. On +The `java` driver requires Java to be installed and in your system's `$PATH`. On Linux, Nomad must run as root since it will use `chroot` and `cgroups` which require root privileges. The task must also specify at least one artifact to download, as this is the only way to retrieve the Jar being run. @@ -76,6 +76,19 @@ this by executing `java -version` on the host and parsing the output * `driver.java.runtime` - Runtime version, ex: `Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)` * `driver.java.vm` - Virtual Machine information, ex: `Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)` +Here is an example of using these properties in a job file: + +```hcl +job "docs" { + # Only run this job where the JVM is higher than version 1.6.0. + constraint { + attribute = "${driver.java.version}" + operator = ">" + value = "1.6.0" + } +} +``` + ## Resource Isolation The resource isolation provided varies by the operating system of @@ -87,4 +100,3 @@ running as root, many of these mechanisms cannot be used. As a baseline, the Java jars will be run inside a Java Virtual Machine, providing a minimum amount of isolation. - diff --git a/website/source/docs/drivers/qemu.html.md b/website/source/docs/drivers/qemu.html.md index 182af6828..6eedcb5b3 100644 --- a/website/source/docs/drivers/qemu.html.md +++ b/website/source/docs/drivers/qemu.html.md @@ -20,7 +20,7 @@ The `Qemu` driver can execute any regular `qemu` image (e.g. `qcow`, `img`, `iso`), and is currently invoked with `qemu-system-x86_64`. The driver requires the image to be accessible from the Nomad client via the -[`artifact` downloader](/docs/jobspec/index.html#artifact_doc). +[`artifact` downloader](/docs/jobspec/index.html#artifact_doc). ## Task Configuration @@ -82,6 +82,19 @@ The `Qemu` driver will set the following client attributes: this by executing `qemu-system-x86_64 -version` on the host and parsing the output * `driver.qemu.version` - Version of `qemu-system-x86_64`, ex: `2.4.0` +Here is an example of using these properties in a job file: + +```hcl +job "docs" { + # Only run this job where the qemu version is higher than 1.2.3. + constraint { + attribute = "${driver.qemu.version}" + operator = ">" + value = "1.2.3" + } +} +``` + ## Resource Isolation Nomad uses Qemu to provide full software virtualization for virtual machine diff --git a/website/source/docs/drivers/raw_exec.html.md b/website/source/docs/drivers/raw_exec.html.md index bf8441822..48d4d7d22 100644 --- a/website/source/docs/drivers/raw_exec.html.md +++ b/website/source/docs/drivers/raw_exec.html.md @@ -86,8 +86,20 @@ explicitly enable the `raw_exec` driver in the client's The `raw_exec` driver will set the following client attributes: -* `driver.raw_exec` - This will be set to "1", indicating the - driver is available. +* `driver.raw_exec` - This will be set to "1", indicating the driver is available. + +Here is an example of using these properties in a job file: + +```hcl +job "docs" { + # Only run this job where raw-exec is enabled. (Note: this constraint is + # applied automatically if you specify a task that uses the raw-exec driver). + constraint { + attribute = "${driver.raw_exec}" + value = "1" + } +} +``` ## Resource Isolation diff --git a/website/source/docs/drivers/rkt.html.md b/website/source/docs/drivers/rkt.html.md index aacb0033c..549b34f2a 100644 --- a/website/source/docs/drivers/rkt.html.md +++ b/website/source/docs/drivers/rkt.html.md @@ -47,7 +47,7 @@ The `rkt` driver supports the following configuration in the job spec: ## Task Directories The `rkt` driver currently does not support mounting of the `alloc/` and `local/` directories. -Once support is added, version `v0.10.0` or above of `rkt` will be required. +Once support is added, version `v0.10.0` or above of `rkt` will be required. ## Client Requirements @@ -66,6 +66,19 @@ this by executing `rkt version` on the host and parsing the output version is `0.14.0` * `driver.rkt.appc.version` - Version of `appc` that `rkt` is using eg: `0.8.1` +Here is an example of using these properties in a job file: + +```hcl +job "docs" { + # Only run this job where the rkt version is higher than 0.8. + constraint { + attribute = "${driver.rkt.version}" + operator = ">" + value = "0.8" + } +} +``` + ## Resource Isolation This driver supports CPU and memory isolation by delegating to `rkt`. Network isolation