mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
refactor drivers to use new getter
This commit is contained in:
@@ -24,6 +24,10 @@ The `exec` driver supports the following configuration in the job spec:
|
||||
* `artifact_source` – (Optional) Source location of an executable artifact. Must be accessible
|
||||
from the Nomad client. If you specify an `artifact_source` to be executed, you
|
||||
must reference it in the `command` as show in the examples below
|
||||
* `checksum` - **(Optional)** The checksum type and value for the `artifact_source` image.
|
||||
The format is `type:value`, where type is any of `md5`, `sha1`, `sha256`, or `sha512`,
|
||||
and the value is the computed checksum. If a checksum is supplied and does not
|
||||
match the downloaded artifact, the driver will fail to start
|
||||
* `args` - The argument list to the command, space seperated. Optional.
|
||||
|
||||
## Client Requirements
|
||||
@@ -53,6 +57,7 @@ To execute a binary specified by `artifact_source`:
|
||||
```
|
||||
config {
|
||||
artifact_source = "https://dl.dropboxusercontent.com/u/1234/binary.bin"
|
||||
checksum = "sha256:abd123445ds4555555555"
|
||||
command = "$NOMAD_TASK_DIR/binary.bin"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -18,8 +18,12 @@ HTTP from the Nomad client.
|
||||
|
||||
The `java` driver supports the following configuration in the job spec:
|
||||
|
||||
* `jar_source` - **(Required)** The hosted location of the source Jar file. Must be accessible
|
||||
* `artifact_source` - **(Required)** The hosted location of the source Jar file. Must be accessible
|
||||
from the Nomad client
|
||||
* `checksum` - **(Optional)** The checksum type and value for the `artifact_source` image.
|
||||
The format is `type:value`, where type is any of `md5`, `sha1`, `sha256`, or `sha512`,
|
||||
and the value is the computed checksum. If a checksum is supplied and does not
|
||||
match the downloaded artifact, the driver will fail to start
|
||||
|
||||
* `args` - **(Optional)** The argument list for the `java` command, space separated.
|
||||
|
||||
@@ -29,10 +33,27 @@ from the Nomad client
|
||||
## Client Requirements
|
||||
|
||||
The `java` driver requires Java to be installed and in your systems `$PATH`.
|
||||
The `jar_source` must be accessible by the node running Nomad. This can be an
|
||||
The `artifact_source` must be accessible by the node running Nomad. This can be an
|
||||
internal source, private to your cluster, but it must be reachable by the client
|
||||
over HTTP.
|
||||
|
||||
## Examples
|
||||
|
||||
A simple config block to run a Java Jar:
|
||||
|
||||
```json
|
||||
# Define a task to run
|
||||
task "web" {
|
||||
# Run a Java Jar
|
||||
driver = "java"
|
||||
|
||||
config {
|
||||
artifact_source = "https://dl.dropboxusercontent.com/u/1234/hello.jar"
|
||||
checksum = "md5:123445555555555"
|
||||
jvm_options = "-Xmx2048m -Xms256m"
|
||||
}
|
||||
```
|
||||
|
||||
## Client Attributes
|
||||
|
||||
The `java` driver will set the following client attributes:
|
||||
|
||||
@@ -23,10 +23,12 @@ The `Qemu` driver can execute any regular `qemu` image (e.g. `qcow`, `img`,
|
||||
|
||||
The `Qemu` driver supports the following configuration in the job spec:
|
||||
|
||||
* `image_source` - **(Required)** The hosted location of the source Qemu image. Must be accessible
|
||||
* `artifact_source` - **(Required)** The hosted location of the source Qemu image. Must be accessible
|
||||
from the Nomad client, via HTTP.
|
||||
* `checksum` - **(Required)** The SHA256 checksum of the `qemu` image. If the
|
||||
checksums do not match, the `Qemu` driver will fail to start the image
|
||||
* `checksum` - **(Optional)** The checksum type and value for the `artifact_source` image.
|
||||
The format is `type:value`, where type is any of `md5`, `sha1`, `sha256`, or `sha512`,
|
||||
and the value is the computed checksum. If a checksum is supplied and does not
|
||||
match the downloaded artifact, the driver will fail to start
|
||||
* `accelerator` - (Optional) The type of accelerator to use in the invocation.
|
||||
If the host machine has `Qemu` installed with KVM support, users can specify `kvm` for the `accelerator`. Default is `tcg`
|
||||
* `host_port` - **(Required)** Port on the host machine to forward to the guest
|
||||
@@ -38,7 +40,7 @@ in the `Task` specification
|
||||
## Client Requirements
|
||||
|
||||
The `Qemu` driver requires Qemu to be installed and in your system's `$PATH`.
|
||||
The `image_source` must be accessible by the node running Nomad. This can be an
|
||||
The `artifact_source` must be accessible by the node running Nomad. This can be an
|
||||
internal source, private to your cluster, but it must be reachable by the client
|
||||
over HTTP.
|
||||
|
||||
|
||||
@@ -22,6 +22,10 @@ The `raw_exec` driver supports the following configuration in the job spec:
|
||||
* `artifact_source` – (Optional) Source location of an executable artifact. Must be accessible
|
||||
from the Nomad client. If you specify an `artifact_source` to be executed, you
|
||||
must reference it in the `command` as show in the examples below
|
||||
* `checksum` - **(Optional)** The checksum type and value for the `artifact_source` image.
|
||||
The format is `type:value`, where type is any of `md5`, `sha1`, `sha256`, or `sha512`,
|
||||
and the value is the computed checksum. If a checksum is supplied and does not
|
||||
match the downloaded artifact, the driver will fail to start
|
||||
* `args` - The argument list to the command, space seperated. Optional.
|
||||
|
||||
## Client Requirements
|
||||
@@ -57,6 +61,7 @@ To execute a binary specified by `artifact_source`:
|
||||
```
|
||||
config {
|
||||
artifact_source = "https://dl.dropboxusercontent.com/u/1234/binary.bin"
|
||||
checksum = "sha256:133jifjiofu9090fsadjofsdjlk"
|
||||
command = "$NOMAD_TASK_DIR/binary.bin"
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user