|
| 1 | +--- |
| 2 | +"$schema": http://json-schema.org/draft-04/schema# |
| 3 | +title: Generic worker payload |
| 4 | +description: |- |
| 5 | + This schema defines the structure of the `payload` property referred to in a |
| 6 | + Taskcluster Task definition. |
| 7 | +type: object |
| 8 | +required: |
| 9 | +- command |
| 10 | +- maxRunTime |
| 11 | +additionalProperties: false |
| 12 | +properties: |
| 13 | + command: |
| 14 | + title: Commands to run |
| 15 | + type: array |
| 16 | + minItems: 1 |
| 17 | + items: |
| 18 | + type: array |
| 19 | + minItems: 1 |
| 20 | + items: |
| 21 | + type: string |
| 22 | + description: |- |
| 23 | + One array per command (each command is an array of arguments). Several arrays |
| 24 | + for several commands. |
| 25 | +
|
| 26 | + Since: generic-worker 0.0.1 |
| 27 | + env: |
| 28 | + title: Env vars |
| 29 | + description: |- |
| 30 | + Env vars must be string to __string__ mappings (not number or boolean). For example: |
| 31 | + ``` |
| 32 | + { |
| 33 | + "PATH": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin", |
| 34 | + "GOOS": "darwin", |
| 35 | + "FOO_ENABLE": "true", |
| 36 | + "BAR_TOTAL": "3" |
| 37 | + } |
| 38 | + ``` |
| 39 | +
|
| 40 | + Since: generic-worker 0.0.1 |
| 41 | + type: object |
| 42 | + additionalProperties: |
| 43 | + type: string |
| 44 | + maxRunTime: |
| 45 | + type: integer |
| 46 | + title: Maximum run time in seconds |
| 47 | + description: |- |
| 48 | + Maximum time the task container can run in seconds. |
| 49 | +
|
| 50 | + Since: generic-worker 0.0.1 |
| 51 | + multipleOf: 1 |
| 52 | + minimum: 1 |
| 53 | + maximum: 86400 |
| 54 | + artifacts: |
| 55 | + type: array |
| 56 | + title: Artifacts to be published |
| 57 | + description: |- |
| 58 | + Artifacts to be published. |
| 59 | +
|
| 60 | + Since: generic-worker 1.0.0 |
| 61 | + items: |
| 62 | + type: object |
| 63 | + title: Artifact |
| 64 | + additionalProperties: false |
| 65 | + properties: |
| 66 | + type: |
| 67 | + title: Artifact upload type. |
| 68 | + type: string |
| 69 | + enum: |
| 70 | + - file |
| 71 | + - directory |
| 72 | + description: |- |
| 73 | + Artifacts can be either an individual `file` or a `directory` containing |
| 74 | + potentially multiple files with recursively included subdirectories. |
| 75 | +
|
| 76 | + Since: generic-worker 1.0.0 |
| 77 | + path: |
| 78 | + title: Artifact location |
| 79 | + type: string |
| 80 | + description: |- |
| 81 | + Relative path of the file/directory from the task directory. Note this is not an absolute |
| 82 | + path as is typically used in docker-worker, since the absolute task directory name is not |
| 83 | + known when the task is submitted. Example: `dist\regedit.exe`. It doesn't matter if |
| 84 | + forward slashes or backslashes are used. |
| 85 | +
|
| 86 | + Since: generic-worker 1.0.0 |
| 87 | + name: |
| 88 | + title: Name of the artifact |
| 89 | + type: string |
| 90 | + description: |- |
| 91 | + Name of the artifact, as it will be published. If not set, `path` will be used. |
| 92 | + Conventionally (although not enforced) path elements are forward slash separated. Example: |
| 93 | + `public/build/a/house`. Note, no scopes are required to read artifacts beginning `public/`. |
| 94 | + Artifact names not beginning `public/` are scope-protected (caller requires scopes to |
| 95 | + download the artifact). See the Queue documentation for more information. |
| 96 | +
|
| 97 | + Since: generic-worker 8.1.0 |
| 98 | + expires: |
| 99 | + title: Expiry date and time |
| 100 | + type: string |
| 101 | + format: date-time |
| 102 | + description: |- |
| 103 | + Date when artifact should expire must be in the future, no earlier than task deadline, but |
| 104 | + no later than task expiry. If not set, defaults to task expiry. |
| 105 | +
|
| 106 | + Since: generic-worker 1.0.0 |
| 107 | + contentType: |
| 108 | + title: Content-Type header when serving artifact over HTTP |
| 109 | + type: string |
| 110 | + description: |- |
| 111 | + Explicitly set the value of the HTTP `Content-Type` response header when the artifact(s) |
| 112 | + is/are served over HTTP(S). If not provided (this property is optional) the worker will |
| 113 | + guess the content type of artifacts based on the filename extension of the file storing |
| 114 | + the artifact content. It does this by looking at the system filename-to-mimetype mappings |
| 115 | + defined in multiple `mime.types` files located under `/etc`. Note, setting `contentType` |
| 116 | + on a directory artifact will apply the same contentType to all files contained in the |
| 117 | + directory. |
| 118 | +
|
| 119 | + See [mime.TypeByExtension](https://godoc.org/mime#TypeByExtension). |
| 120 | +
|
| 121 | + Since: generic-worker 10.4.0 |
| 122 | + required: |
| 123 | + - type |
| 124 | + - path |
| 125 | + features: |
| 126 | + title: Feature flags |
| 127 | + description: |- |
| 128 | + Feature flags enable additional functionality. |
| 129 | +
|
| 130 | + Since: generic-worker 5.3.0 |
| 131 | + type: object |
| 132 | + additionalProperties: false |
| 133 | + properties: |
| 134 | + chainOfTrust: |
| 135 | + type: boolean |
| 136 | + title: Enable generation of a openpgp signed Chain of Trust artifact |
| 137 | + description: |- |
| 138 | + An artifact named `public/chainOfTrust.json.asc` should be generated |
| 139 | + which will include information for downstream tasks to build a level |
| 140 | + of trust for the artifacts produced by the task and the environment |
| 141 | + it ran in. |
| 142 | +
|
| 143 | + Since: generic-worker 5.3.0 |
| 144 | + taskclusterProxy: |
| 145 | + type: boolean |
| 146 | + title: Run [taskcluster-proxy](https://github.com/taskcluster/taskcluster-proxy) to allow tasks to dynamically proxy requests to taskcluster services |
| 147 | + description: |- |
| 148 | + The taskcluster proxy provides an easy and safe way to make authenticated |
| 149 | + taskcluster requests within the scope(s) of a particular task. See |
| 150 | + [the github project](https://github.com/taskcluster/taskcluster-proxy) for more information. |
| 151 | +
|
| 152 | + Since: generic-worker 10.6.0 |
| 153 | + mounts: |
| 154 | + type: array |
| 155 | + description: |- |
| 156 | + Directories and/or files to be mounted. |
| 157 | +
|
| 158 | + Since: generic-worker 5.4.0 |
| 159 | + items: |
| 160 | + title: Mount |
| 161 | + "$ref": "#/definitions/mount" |
| 162 | + osGroups: |
| 163 | + type: array |
| 164 | + title: OS Groups |
| 165 | + description: |- |
| 166 | + A list of OS Groups that the task user should be a member of. Requires |
| 167 | + scope `generic-worker:os-group:<os-group>` for each group listed. |
| 168 | +
|
| 169 | + Since: generic-worker 6.0.0 |
| 170 | + items: |
| 171 | + type: string |
| 172 | + supersederUrl: |
| 173 | + type: string |
| 174 | + title: Superseder URL |
| 175 | + description: |- |
| 176 | + URL of a service that can indicate tasks superseding this one; the current `taskId` |
| 177 | + will be appended as a query argument `taskId`. The service should return an object with |
| 178 | + a `supersedes` key containing a list of `taskId`s, including the supplied `taskId`. The |
| 179 | + tasks should be ordered such that each task supersedes all tasks appearing later in the |
| 180 | + list. |
| 181 | +
|
| 182 | + See [superseding](https://docs.taskcluster.net/reference/platform/taskcluster-queue/docs/superseding) for more detail. |
| 183 | +
|
| 184 | + Since: generic-worker 10.2.2 |
| 185 | + format: uri |
| 186 | +definitions: |
| 187 | + mount: |
| 188 | + title: Mount |
| 189 | + oneOf: |
| 190 | + - "$ref": "#/definitions/fileMount" |
| 191 | + - "$ref": "#/definitions/writableDirectoryCache" |
| 192 | + - "$ref": "#/definitions/readOnlyDirectory" |
| 193 | + fileMount: |
| 194 | + type: object |
| 195 | + title: File Mount |
| 196 | + properties: |
| 197 | + file: |
| 198 | + title: File |
| 199 | + type: string |
| 200 | + description: |- |
| 201 | + The filesystem location to mount the file. |
| 202 | +
|
| 203 | + Since: generic-worker 5.4.0 |
| 204 | + content: |
| 205 | + description: |- |
| 206 | + Content of the file to be mounted. |
| 207 | +
|
| 208 | + Since: generic-worker 5.4.0 |
| 209 | + "$ref": "#/definitions/content" |
| 210 | + additionalProperties: false |
| 211 | + required: |
| 212 | + - file |
| 213 | + - content |
| 214 | + writableDirectoryCache: |
| 215 | + type: object |
| 216 | + title: Writable Directory Cache |
| 217 | + properties: |
| 218 | + directory: |
| 219 | + title: Directory Volume |
| 220 | + type: string |
| 221 | + description: |- |
| 222 | + The filesystem location to mount the directory volume. |
| 223 | +
|
| 224 | + Since: generic-worker 5.4.0 |
| 225 | + cacheName: |
| 226 | + title: Cache Name |
| 227 | + type: string |
| 228 | + description: |- |
| 229 | + Implies a read/write cache directory volume. A unique name for the |
| 230 | + cache volume. Requires scope `generic-worker:cache:<cache-name>`. |
| 231 | + Note if this cache is loaded from an artifact, you will also require |
| 232 | + scope `queue:get-artifact:<artifact-name>` to use this cache. |
| 233 | +
|
| 234 | + Since: generic-worker 5.4.0 |
| 235 | + content: |
| 236 | + title: Content |
| 237 | + description: |- |
| 238 | + Optional content to be preloaded when initially creating the cache |
| 239 | + (if set, `format` must also be provided). |
| 240 | +
|
| 241 | + Since: generic-worker 5.4.0 |
| 242 | + "$ref": "#/definitions/content" |
| 243 | + format: |
| 244 | + title: Format |
| 245 | + type: string |
| 246 | + description: |- |
| 247 | + Archive format of the preloaded content (if `content` provided). |
| 248 | +
|
| 249 | + Since: generic-worker 5.4.0 |
| 250 | + enum: |
| 251 | + - rar |
| 252 | + - tar.bz2 |
| 253 | + - tar.gz |
| 254 | + - zip |
| 255 | + additionalProperties: false |
| 256 | + required: |
| 257 | + - directory |
| 258 | + - cacheName |
| 259 | + dependencies: |
| 260 | + content: |
| 261 | + - format |
| 262 | + format: |
| 263 | + - content |
| 264 | + readOnlyDirectory: |
| 265 | + type: object |
| 266 | + title: Read Only Directory |
| 267 | + properties: |
| 268 | + directory: |
| 269 | + title: Directory |
| 270 | + type: string |
| 271 | + description: |- |
| 272 | + The filesystem location to mount the directory volume. |
| 273 | +
|
| 274 | + Since: generic-worker 5.4.0 |
| 275 | + content: |
| 276 | + title: Content |
| 277 | + description: |- |
| 278 | + Contents of read only directory. |
| 279 | +
|
| 280 | + Since: generic-worker 5.4.0 |
| 281 | + "$ref": "#/definitions/content" |
| 282 | + format: |
| 283 | + title: Format |
| 284 | + type: string |
| 285 | + description: |- |
| 286 | + Archive format of content for read only directory. |
| 287 | +
|
| 288 | + Since: generic-worker 5.4.0 |
| 289 | + enum: |
| 290 | + - rar |
| 291 | + - tar.bz2 |
| 292 | + - tar.gz |
| 293 | + - zip |
| 294 | + additionalProperties: false |
| 295 | + required: |
| 296 | + - directory |
| 297 | + - content |
| 298 | + - format |
| 299 | + content: |
| 300 | + oneOf: |
| 301 | + - title: Artifact Content |
| 302 | + description: |- |
| 303 | + Requires scope `queue:get-artifact:<artifact-name>`. |
| 304 | +
|
| 305 | + Since: generic-worker 5.4.0 |
| 306 | + type: object |
| 307 | + properties: |
| 308 | + taskId: |
| 309 | + type: string |
| 310 | + pattern: "^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$" |
| 311 | + artifact: |
| 312 | + type: string |
| 313 | + maxLength: 1024 |
| 314 | + additionalProperties: false |
| 315 | + required: |
| 316 | + - taskId |
| 317 | + - artifact |
| 318 | + - title: URL Content |
| 319 | + description: |- |
| 320 | + URL to download content from. |
| 321 | +
|
| 322 | + Since: generic-worker 5.4.0 |
| 323 | + type: object |
| 324 | + properties: |
| 325 | + url: |
| 326 | + type: string |
| 327 | + title: URL |
| 328 | + description: |- |
| 329 | + URL to download content from. |
| 330 | +
|
| 331 | + Since: generic-worker 5.4.0 |
| 332 | + format: uri |
| 333 | + additionalProperties: false |
| 334 | + required: |
| 335 | + - url |
0 commit comments