forked from taskcluster/generic-worker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_posix.yml
457 lines (416 loc) · 14.1 KB
/
docker_posix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
---
"$schema": http://json-schema.org/draft-04/schema#
title: Generic worker payload
description: |-
This schema defines the structure of the `payload` property referred to in a
Taskcluster Task definition.
type: object
required:
- command
- maxRunTime
additionalProperties: false
properties:
command:
title: Commands to run
type: array
minItems: 1
items:
type: array
minItems: 1
items:
type: string
description: |-
One array per command (each command is an array of arguments). Several arrays
for several commands.
Since: generic-worker 0.0.1
env:
title: Env vars
description: |-
Env vars must be string to __string__ mappings (not number or boolean). For example:
```
{
"PATH": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
"GOOS": "darwin",
"FOO_ENABLE": "true",
"BAR_TOTAL": "3"
}
```
Note, the following environment variables will automatically be set in the task
commands:
* `TASK_ID` - the task ID of the currently running task
* `TASKCLUSTER_ROOT_URL` - the root URL of the taskcluster deployment
* `TASKCLUSTER_PROXY_URL` (if taskcluster proxy feature enabled) - the
taskcluster authentication proxy for making unauthenticated taskcluster
API calls
Since: generic-worker 0.0.1
type: object
additionalProperties:
type: string
maxRunTime:
type: integer
title: Maximum run time in seconds
description: |-
Maximum time the task container can run in seconds.
Since: generic-worker 0.0.1
multipleOf: 1
minimum: 1
maximum: 86400
artifacts:
type: array
title: Artifacts to be published
description: |-
Artifacts to be published.
Since: generic-worker 1.0.0
items:
type: object
title: Artifact
additionalProperties: false
properties:
type:
title: Artifact upload type.
type: string
enum:
- file
- directory
description: |-
Artifacts can be either an individual `file` or a `directory` containing
potentially multiple files with recursively included subdirectories.
Since: generic-worker 1.0.0
path:
title: Artifact location
type: string
description: |-
Relative path of the file/directory from the task directory. Note this is not an absolute
path as is typically used in docker-worker, since the absolute task directory name is not
known when the task is submitted. Example: `dist\regedit.exe`. It doesn't matter if
forward slashes or backslashes are used.
Since: generic-worker 1.0.0
name:
title: Name of the artifact
type: string
description: |-
Name of the artifact, as it will be published. If not set, `path` will be used.
Conventionally (although not enforced) path elements are forward slash separated. Example:
`public/build/a/house`. Note, no scopes are required to read artifacts beginning `public/`.
Artifact names not beginning `public/` are scope-protected (caller requires scopes to
download the artifact). See the Queue documentation for more information.
Since: generic-worker 8.1.0
expires:
title: Expiry date and time
type: string
format: date-time
description: |-
Date when artifact should expire must be in the future, no earlier than task deadline, but
no later than task expiry. If not set, defaults to task expiry.
Since: generic-worker 1.0.0
contentType:
title: Content-Type header when serving artifact over HTTP
type: string
description: |-
Explicitly set the value of the HTTP `Content-Type` response header when the artifact(s)
is/are served over HTTP(S). If not provided (this property is optional) the worker will
guess the content type of artifacts based on the filename extension of the file storing
the artifact content. It does this by looking at the system filename-to-mimetype mappings
defined in multiple `mime.types` files located under `/etc`. Note, setting `contentType`
on a directory artifact will apply the same contentType to all files contained in the
directory.
See [mime.TypeByExtension](https://godoc.org/mime#TypeByExtension).
Since: generic-worker 10.4.0
contentEncoding:
title: Content-Encoding header when serving artifact over HTTP.
type: string
enum:
- identity
- gzip
description: |-
Content-Encoding for the artifact. If not provided, `gzip` will be used, except for the
following file extensions, where `identity` will be used, since they are already
compressed:
* jpg
* jpeg
* png
* gif
* webp
* 7z
* zip
* gz
* tgz
* bz2
* tbz
* whl
* xz
* swf
* flv
* woff
* woff2
Note, setting `contentEncoding` on a directory artifact will apply the same content
encoding to all the files contained in the directory.
Since: generic-worker 16.2.0
required:
- type
- path
features:
title: Feature flags
description: |-
Feature flags enable additional functionality.
Since: generic-worker 5.3.0
type: object
additionalProperties: false
properties:
chainOfTrust:
type: boolean
title: Enable generation of signed Chain of Trust artifacts
description: |-
Artifacts named `public/chain-of-trust.json` and
`public/chain-of-trust.json.sig` should be generated which will
include information for downstream tasks to build a level of trust
for the artifacts produced by the task and the environment it ran in.
Since: generic-worker 5.3.0
taskclusterProxy:
type: boolean
title: Run [taskcluster-proxy](https://github.com/taskcluster/taskcluster-proxy) to allow tasks to dynamically proxy requests to taskcluster services
description: |-
The taskcluster proxy provides an easy and safe way to make authenticated
taskcluster requests within the scope(s) of a particular task. See
[the github project](https://github.com/taskcluster/taskcluster-proxy) for more information.
Since: generic-worker 10.6.0
mounts:
type: array
description: |-
Directories and/or files to be mounted.
Since: generic-worker 5.4.0
items:
title: Mount
"$ref": "#/definitions/mount"
osGroups:
type: array
title: OS Groups
description: |-
A list of OS Groups that the task user should be a member of. Not yet implemented on
non-Windows platforms, therefore this optional property may only be an empty array if
provided.
Since: generic-worker 6.0.0
items:
type: string
maxItems: 0
supersederUrl:
type: string
title: Superseder URL
description: |-
URL of a service that can indicate tasks superseding this one; the current `taskId`
will be appended as a query argument `taskId`. The service should return an object with
a `supersedes` key containing a list of `taskId`s, including the supplied `taskId`. The
tasks should be ordered such that each task supersedes all tasks appearing later in the
list.
See [superseding](https://docs.taskcluster.net/reference/platform/taskcluster-queue/docs/superseding) for more detail.
Since: generic-worker 10.2.2
format: uri
onExitStatus:
title: Exit code handling
description: |-
By default tasks will be resolved with `state/reasonResolved`: `completed/completed`
if all task commands have a zero exit code, or `failed/failed` if any command has a
non-zero exit code. This payload property allows customsation of the task resolution
based on exit code of task commands.
type: object
additionalProperties: false
properties:
retry:
title: Intermittent task exit codes
description: |-
Exit codes for any command in the task payload to cause this task to
be resolved as `exception/intermittent-task`. Typically the Queue
will then schedule a new run of the existing `taskId` (rerun) if not
all task runs have been exhausted.
See [itermittent tasks](https://docs.taskcluster.net/docs/reference/platform/taskcluster-queue/docs/worker-interaction#intermittent-tasks) for more detail.
Since: generic-worker 10.10.0
type: array
items:
title: Exit codes
type: integer
minimum: 1
definitions:
mount:
title: Mount
oneOf:
- "$ref": "#/definitions/fileMount"
- "$ref": "#/definitions/writableDirectoryCache"
- "$ref": "#/definitions/readOnlyDirectory"
fileMount:
type: object
title: File Mount
properties:
file:
title: File
type: string
description: |-
The filesystem location to mount the file.
Since: generic-worker 5.4.0
content:
description: |-
Content of the file to be mounted.
Since: generic-worker 5.4.0
"$ref": "#/definitions/content"
additionalProperties: false
required:
- file
- content
writableDirectoryCache:
type: object
title: Writable Directory Cache
properties:
directory:
title: Directory Volume
type: string
description: |-
The filesystem location to mount the directory volume.
Since: generic-worker 5.4.0
cacheName:
title: Cache Name
type: string
description: |-
Implies a read/write cache directory volume. A unique name for the
cache volume. Requires scope `generic-worker:cache:<cache-name>`.
Note if this cache is loaded from an artifact, you will also require
scope `queue:get-artifact:<artifact-name>` to use this cache.
Since: generic-worker 5.4.0
content:
title: Content
description: |-
Optional content to be preloaded when initially creating the cache
(if set, `format` must also be provided).
Since: generic-worker 5.4.0
"$ref": "#/definitions/content"
format:
title: Format
type: string
description: |-
Archive format of the preloaded content (if `content` provided).
Since: generic-worker 5.4.0
enum:
- rar
- tar.bz2
- tar.gz
- zip
additionalProperties: false
required:
- directory
- cacheName
dependencies:
content:
- format
format:
- content
readOnlyDirectory:
type: object
title: Read Only Directory
properties:
directory:
title: Directory
type: string
description: |-
The filesystem location to mount the directory volume.
Since: generic-worker 5.4.0
content:
title: Content
description: |-
Contents of read only directory.
Since: generic-worker 5.4.0
"$ref": "#/definitions/content"
format:
title: Format
type: string
description: |-
Archive format of content for read only directory.
Since: generic-worker 5.4.0
enum:
- rar
- tar.bz2
- tar.gz
- zip
additionalProperties: false
required:
- directory
- content
- format
content:
oneOf:
- title: Artifact Content
description: |-
Requires scope `queue:get-artifact:<artifact-name>`.
Since: generic-worker 5.4.0
type: object
properties:
taskId:
type: string
pattern: "^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$"
artifact:
type: string
maxLength: 1024
sha256:
type: string
title: SHA 256
description: |-
The required SHA 256 of the content body.
Since: generic-worker 10.8.0
pattern: '^[a-f0-9]{64}$'
additionalProperties: false
required:
- taskId
- artifact
- title: URL Content
description: |-
URL to download content from.
Since: generic-worker 5.4.0
type: object
properties:
url:
type: string
title: URL
description: |-
URL to download content from.
Since: generic-worker 5.4.0
format: uri
sha256:
type: string
title: SHA 256
description: |-
The required SHA 256 of the content body.
Since: generic-worker 10.8.0
pattern: '^[a-f0-9]{64}$'
additionalProperties: false
required:
- url
- title: Raw Content
description: |-
Byte-for-byte literal inline content of file/archive, up to 64KB in size.
Since: generic-worker 11.1.0
type: object
properties:
raw:
type: string
maxLength: 65536
title: Raw
description: |-
Byte-for-byte literal inline content of file/archive, up to 64KB in size.
Since: generic-worker 11.1.0
additionalProperties: false
required:
- raw
- title: Base64 Content
description: |-
Base64 encoded content of file/archive, up to 64KB (encoded) in size.
Since: generic-worker 11.1.0
type: object
properties:
base64:
type: string
maxLength: 65536
title: Base64
description: |-
Base64 encoded content of file/archive, up to 64KB (encoded) in size.
Since: generic-worker 11.1.0
pattern: '^[A-Za-z0-9/+]+[=]{0,2}$'
additionalProperties: false
required:
- base64