github.com/ryanslade/nomad@v0.2.4-0.20160128061903-fc95782f2089/website/source/docs/drivers/raw_exec.html.md (about) 1 --- 2 layout: "docs" 3 page_title: "Drivers: Raw Exec" 4 sidebar_current: "docs-drivers-raw-exec" 5 description: |- 6 The Raw Exec task driver simply fork/execs and provides no isolation. 7 --- 8 9 # Raw Fork/Exec Driver 10 11 Name: `raw_exec` 12 13 The `raw_exec` driver is used to execute a command for a task without any 14 isolation. Further, the task is started as the same user as the Nomad process. 15 As such, it should be used with extreme care and is disabled by default. 16 17 ## Task Configuration 18 19 The `raw_exec` driver supports the following configuration in the job spec: 20 21 * `command` - The command to execute. Must be provided. 22 23 * `artifact_source` – (Optional) Source location of an executable artifact. Must 24 be accessible from the Nomad client. If you specify an `artifact_source` to be 25 executed, you must reference it in the `command` as show in the examples below 26 27 * `checksum` - (Optional) The checksum type and value for the `artifact_source` 28 image. The format is `type:value`, where type is any of `md5`, `sha1`, 29 `sha256`, or `sha512`, and the value is the computed checksum. If a checksum 30 is supplied and does not match the downloaded artifact, the driver will fail 31 to start 32 33 * `args` - (Optional) A list of arguments to the optional `command`. 34 References to environment variables or any [intepretable Nomad 35 variables](/docs/jobspec/index.html#interpreted_vars) will be interpreted 36 before launching the task. For example: 37 38 ``` 39 args = ["$nomad.ip", "$MY_ENV", "$meta.foo"] 40 ``` 41 42 ## Client Requirements 43 44 The `raw_exec` driver can run on all supported operating systems. It is however 45 disabled by default. In order to be enabled, the Nomad client configuration must 46 explicitly enable the `raw_exec` driver in the client's 47 [options](../agent/config.html#options) field: 48 49 ``` 50 client { 51 options = { 52 "driver.raw_exec.enable" = "1" 53 } 54 } 55 ``` 56 57 You must specify a `command` to be executed. Optionally you can specify an 58 `artifact_source` to be executed. Any `command` is assumed to be present on the 59 running client, or a downloaded artifact 60 61 ## Examples 62 63 To run a binary present on the Node: 64 65 ``` 66 config { 67 command = "/bin/sleep" 68 args = 1 69 } 70 ``` 71 72 To execute a binary specified by `artifact_source`: 73 74 ``` 75 config { 76 artifact_source = "https://dl.dropboxusercontent.com/u/1234/binary.bin" 77 checksum = "sha256:133jifjiofu9090fsadjofsdjlk" 78 command = "$NOMAD_TASK_DIR/binary.bin" 79 } 80 ``` 81 82 ## Client Attributes 83 84 The `raw_exec` driver will set the following client attributes: 85 86 * `driver.raw_exec` - This will be set to "1", indicating the 87 driver is available. 88 89 ## Resource Isolation 90 91 The `raw_exec` driver provides no isolation.