From edab031f41198a67dcd4550bd1618209ed9e8267 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Tue, 15 Mar 2016 21:02:38 -0700 Subject: [PATCH] artifact docs --- website/source/docs/jobspec/index.html.md | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/website/source/docs/jobspec/index.html.md b/website/source/docs/jobspec/index.html.md index 644192659b0..f5e6d3805bb 100644 --- a/website/source/docs/jobspec/index.html.md +++ b/website/source/docs/jobspec/index.html.md @@ -268,6 +268,10 @@ The `task` object supports the following keys: * `logs` - Logs allows configuring log rotation for the `stdout` and `stderr` buffers of a Task. See the log rotation reference below for more details. +* `artifact` - Defines an artifact to be downloaded before the task is run. This + can be provided multiple times to define additional artifacts to download. See + the artifacts reference for more details. + ### Resources The `resources` object supports the following keys: @@ -405,6 +409,40 @@ In the above example we have asked Nomad to retain 3 rotated files for both `stderr` and `stdout` and size of each file is 10MB. The minimum disk space that would be required for the task would be 60MB. +### Artifact + +Nomad downloads artifacts using +[`go-getter`](https://github.com/hashicorp/go-getter). The `go-getter` library +allows downloading of artifacts from various sources using a URL as the input +source. The key/value pairs given in the `options` block map directly to +parameters appended to the supplied `source` url. These are then used by +`go-getter` to appropriately download the artifact. `go-getter` also has a CLI +tool to validate its URL and can be used to check if the Nomad `artifact` is +valid. + +Nomad allows downloading `http`, `https`, and `S3` artifacts. If these artifacts +are archives (zip, tar.gz, bz2, etc.), these will be unarchived before the task +is started. + +The `artifact` object maps supports the following keys: + +* `source` - The path to the artifact to download. + +* `options` - The `options` block allows setting parameters for `go-getter`. An + example is given below: + +``` +options { + # Validate the downloaded artifact + checksum = "md5:c4aa853ad2215426eb7d70a21922e794" + + # S3 options for downloading artifacts from S3 + aws_access_key_id = "" + aws_access_key_secret = "" + aws_access_token = "" +} +``` + ## JSON Syntax Job files can also be specified in JSON. The conversion is straightforward