document artifact downloading

This commit is contained in:
Alex Dadgar
2016-03-16 09:56:04 -07:00
parent 40870bc519
commit 23de2f95a4
8 changed files with 167 additions and 107 deletions

View File

@@ -10,22 +10,18 @@ description: |-
Name: `java`
The `Java` driver is used to execute Java applications packaged into a Java Jar
file. The driver currently requires the Jar file be accessible via
HTTP from the Nomad client.
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).
## Task Configuration
The `java` driver supports the following configuration in the job spec:
* `artifact_source` - 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
* `jar_path` - The path to the downloaded Jar. In most cases this will just be
the name of the Jar. However, if the supplied artifact is an archive that
contains the Jar in a subfolder, the path will need to be the relative path
(`subdir/from_archive/my.jar`).
* `args` - (Optional) A list of arguments to the optional `command`.
References to environment variables or any [intepretable Nomad
@@ -39,30 +35,36 @@ The `java` driver supports the following configuration in the job spec:
* `jvm_options` - (Optional) A list of JVM options to be passed while invoking
java. These options are passed not validated in any way in Nomad.
## Client Requirements
The `java` driver requires Java to be installed and in your systems `$PATH`.
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"
jar_path = "hello.jar"
jvm_options = "-Xmx2048m -Xms256m"
}
# Specifying an artifact is required with the "java"
# driver. This is the # mechanism to ship the Jar to be run.
artifact {
source = "https://dl.dropboxusercontent.com/u/1234/hello.jar"
options {
checksum = "md5:123445555555555"
}
}
```
## Client Requirements
The `java` driver requires Java to be installed and in your systems `$PATH`. The
task must also specify at least one artifact to download as this is the only way
to retrieve the Jar being run.
## Client Attributes
The `java` driver will set the following client attributes: