forked from taskcluster/taskcluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerated_multiuser_darwin.go
1463 lines (1353 loc) · 58.5 KB
/
generated_multiuser_darwin.go
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
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//go:build multiuser
// This source code file is AUTO-GENERATED by github.com/taskcluster/jsonschema2go
package main
import (
"encoding/json"
"errors"
tcclient "github.com/taskcluster/taskcluster/v54/clients/client-go"
)
type (
Artifact struct {
// 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:
//
// * 7z
// * bz2
// * deb
// * dmg
// * flv
// * gif
// * gz
// * jpeg
// * jpg
// * png
// * swf
// * tbz
// * tgz
// * webp
// * whl
// * woff
// * woff2
// * xz
// * zip
// * zst
//
// 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
//
// Possible values:
// * "identity"
// * "gzip"
ContentEncoding string `json:"contentEncoding,omitempty"`
// 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://pkg.go.dev/mime#TypeByExtension).
//
// Since: generic-worker 10.4.0
ContentType string `json:"contentType,omitempty"`
// 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
Expires tcclient.Time `json:"expires,omitempty"`
// 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
Name string `json:"name,omitempty"`
// 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
Path string `json:"path"`
// Artifacts can be either an individual `file` or a `directory` containing
// potentially multiple files with recursively included subdirectories.
//
// Since: generic-worker 1.0.0
//
// Possible values:
// * "file"
// * "directory"
Type string `json:"type"`
}
// Requires scope `queue:get-artifact:<artifact-name>`.
//
// Since: generic-worker 5.4.0
ArtifactContent struct {
// Max length: 1024
Artifact string `json:"artifact"`
// If provided, the required SHA256 of the content body.
//
// Since: generic-worker 10.8.0
//
// Syntax: ^[a-f0-9]{64}$
SHA256 string `json:"sha256,omitempty"`
// Syntax: ^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$
TaskID string `json:"taskId"`
}
// Base64 encoded content of file/archive, up to 64KB (encoded) in size.
//
// Since: generic-worker 11.1.0
Base64Content struct {
// Base64 encoded content of file/archive, up to 64KB (encoded) in size.
//
// Since: generic-worker 11.1.0
//
// Syntax: ^[A-Za-z0-9/+]+[=]{0,2}$
// Max length: 65536
Base64 string `json:"base64"`
}
// Set of capabilities that must be enabled or made available to the task container Example: ```{ "capabilities": { "privileged": true }```
Capabilities struct {
// Allows devices from the host system to be attached to a task container similar to using `--device` in docker.
Devices Devices `json:"devices,omitempty"`
// Allows a task to run in a privileged container, similar to running docker with `--privileged`. This only works for worker-types configured to enable it.
//
// Default: false
Privileged bool `json:"privileged" default:"false"`
}
// Allows devices from the host system to be attached to a task container similar to using `--device` in docker.
Devices struct {
// Mount /dev/shm from the host in the container.
HostSharedMemory bool `json:"hostSharedMemory,omitempty"`
// Mount /dev/kvm from the host in the container.
KVM bool `json:"kvm,omitempty"`
// Audio loopback device created using snd-aloop
LoopbackAudio bool `json:"loopbackAudio,omitempty"`
// Video loopback device created using v4l2loopback.
LoopbackVideo bool `json:"loopbackVideo,omitempty"`
}
// Image to use for the task. Images can be specified as an image tag as used by a docker registry, or as an object declaring type and name/namespace
DockerImageArtifact struct {
Path string `json:"path"`
TaskID string `json:"taskId"`
// Possible values:
// * "task-image"
Type string `json:"type"`
}
// Image to use for the task. Images can be specified as an image tag as used by a docker registry, or as an object declaring type and name/namespace
DockerImageName string
DockerWorkerArtifact struct {
Expires tcclient.Time `json:"expires,omitempty"`
Path string `json:"path"`
// Possible values:
// * "file"
// * "directory"
Type string `json:"type"`
}
// Used to enable additional functionality.
DockerWorkerFeatureFlags struct {
// This allows you to use the Linux ptrace functionality inside the container; it is otherwise disallowed by Docker's security policy.
//
// Default: false
AllowPtrace bool `json:"allowPtrace" default:"false"`
// Default: true
Artifacts bool `json:"artifacts" default:"true"`
// Useful if live logging is not interesting but the overalllog is later on
//
// Default: true
BulkLog bool `json:"bulkLog" default:"true"`
// Artifacts named chain-of-trust.json and 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.
//
// Default: false
ChainOfTrust bool `json:"chainOfTrust" default:"false"`
// Runs docker-in-docker and binds `/var/run/docker.sock` into the container. Doesn't allow privileged mode, capabilities or host volume mounts.
//
// Default: false
Dind bool `json:"dind" default:"false"`
// Uploads docker images as artifacts
//
// Default: false
DockerSave bool `json:"dockerSave" default:"false"`
// This allows you to interactively run commands inside the container and attaches you to the stdin/stdout/stderr over a websocket. Can be used for SSH-like access to docker containers.
//
// Default: false
Interactive bool `json:"interactive" default:"false"`
// Logs are stored on the worker during the duration of tasks and available via http chunked streaming then uploaded to s3
//
// Default: true
LocalLiveLog bool `json:"localLiveLog" default:"true"`
// The auth proxy allows making requests to taskcluster/queue and taskcluster/scheduler directly from your task with the same scopes as set in the task. This can be used to make api calls via the [client](https://github.com/taskcluster/taskcluster-client) CURL, etc... Without embedding credentials in the task.
//
// Default: false
TaskclusterProxy bool `json:"taskclusterProxy" default:"false"`
}
// `.payload` field of the queue.
DockerWorkerPayload struct {
// Artifact upload map example: ```{"public/build.tar.gz": {"path": "/home/worker/build.tar.gz", "expires": "2016-05-28T16:12:56.693817Z", "type": "file"}}```
Artifacts map[string]DockerWorkerArtifact `json:"artifacts,omitempty"`
// Caches are mounted within the docker container at the mount point specified. Example: ```{ "CACHE NAME": "/mount/path/in/container" }```
//
// Map entries:
Cache map[string]string `json:"cache,omitempty"`
// Set of capabilities that must be enabled or made available to the task container Example: ```{ "capabilities": { "privileged": true }```
Capabilities Capabilities `json:"capabilities,omitempty"`
// Example: `['/bin/bash', '-c', 'ls']`.
//
// Default: []
//
// Array items:
Command []string `json:"command,omitempty"`
// Example: ```
// {
// "PATH": '/borked/path'
// "ENV_NAME": "VALUE"
// }
// ```
//
// Map entries:
Env map[string]string `json:"env,omitempty"`
// Used to enable additional functionality.
Features DockerWorkerFeatureFlags `json:"features,omitempty"`
// Image to use for the task. Images can be specified as an image tag as used by a docker registry, or as an object declaring type and name/namespace
//
// One of:
// * DockerImageName
// * NamedDockerImage
// * IndexedDockerImage
// * DockerImageArtifact
Image json.RawMessage `json:"image"`
// Specifies a custom name for the livelog artifact. Note that this is also used in determining the name of the backing log artifact name. Backing log artifact name matches livelog artifact name with `_backing` appended, prior to the file extension (if present). For example, `apple/banana.log.txt` results in livelog artifact `apple/banana.log.txt` and backing log artifact `apple/banana.log_backing.txt`. Defaults to `public/logs/live.log`.
//
// Default: "public/logs/live.log"
Log string `json:"log" default:"public/logs/live.log"`
// Maximum time the task container can run in seconds.
//
// Mininum: 1
// Maximum: 86400
MaxRunTime int64 `json:"maxRunTime"`
// By default docker-worker will fail a task with a non-zero exit status without retrying. This payload property allows a task owner to define certain exit statuses that will be marked as a retriable exception.
OnExitStatus ExitStatusHandling `json:"onExitStatus,omitempty"`
// Maintained for backward compatibility, but no longer used
SupersederURL string `json:"supersederUrl,omitempty"`
}
// 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.
ExitCodeHandling struct {
// If the task exists with a purge caches exit status, all caches
// associated with the task will be purged.
//
// Since: generic-worker 49.0.0
//
// Array items:
// Mininum: 1
PurgeCaches []int64 `json:"purgeCaches,omitempty"`
// 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
//
// Array items:
// Mininum: 1
Retry []int64 `json:"retry,omitempty"`
}
// By default docker-worker will fail a task with a non-zero exit status without retrying. This payload property allows a task owner to define certain exit statuses that will be marked as a retriable exception.
ExitStatusHandling struct {
// If the task exists with a purge caches exit status, all caches associated with the task will be purged.
//
// Array items:
PurgeCaches []int64 `json:"purgeCaches,omitempty"`
// If the task exists with a retriable exit status, the task will be marked as an exception and a new run created.
//
// Array items:
Retry []int64 `json:"retry,omitempty"`
}
// Feature flags enable additional functionality.
//
// Since: generic-worker 5.3.0
FeatureFlags struct {
// The backing log feature publishes a task artifact containing the complete
// stderr and stdout of the task.
//
// Since: generic-worker 48.2.0
//
// Default: true
BackingLog bool `json:"backingLog" default:"true"`
// 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
ChainOfTrust bool `json:"chainOfTrust,omitempty"`
// This allows you to interactively run commands from within the worker
// as the task user. This may be useful for debugging purposes.
// Can be used for SSH-like access to the running worker.
// Note that this feature works differently from the `interactive` feature
// in docker worker, which `docker exec`s into the running container.
// Since tasks on generic worker are not guaranteed to be running in a
// container, a bash shell is started on the task user's account.
// A user can then `docker exec` into the a running container, if there
// is one.
//
// Since: generic-worker 49.2.0
Interactive bool `json:"interactive,omitempty"`
// The live log feature streams the combined stderr and stdout to a task artifact
// so that the output is available while the task is running.
//
// Since: generic-worker 48.2.0
//
// Default: true
LiveLog bool `json:"liveLog" default:"true"`
// Video loopback device created using v4l2loopback.
// A video device will be available for the task. Its
// location will be passed to the task via environment
// variable `TASKCLUSTER_VIDEO_DEVICE`. The
// location will be `/dev/video<N>` where `<N>` is
// an integer between 0 and 255. The value of `<N>`
// is not static, and therefore either the environment
// variable should be used, or `/dev` should be
// scanned in order to determine the correct location.
// Tasks should not assume a constant value.
//
// This feature is only available on Linux. If a task
// is submitted with this feature enabled on a non-Linux,
// posix platform (FreeBSD, macOS), the task will resolve as
// `exception/malformed-payload`.
//
// Since: generic-worker 53.1.0
LoopbackVideo bool `json:"loopbackVideo,omitempty"`
// 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/tree/main/tools/taskcluster-proxy) for more information.
//
// Since: generic-worker 10.6.0
TaskclusterProxy bool `json:"taskclusterProxy,omitempty"`
}
FileMount struct {
// One of:
// * ArtifactContent
// * IndexedContent
// * URLContent
// * RawContent
// * Base64Content
Content json.RawMessage `json:"content"`
// The filesystem location to mount the file.
//
// Since: generic-worker 5.4.0
File string `json:"file"`
}
// This schema defines the structure of the `payload` property referred to in a
// Taskcluster Task definition.
GenericWorkerPayload struct {
// Artifacts to be published.
//
// Since: generic-worker 1.0.0
Artifacts []Artifact `json:"artifacts,omitempty"`
// One array per command (each command is an array of arguments). Several arrays
// for several commands.
//
// Since: generic-worker 0.0.1
//
// Array items:
// Array items:
Command [][]string `json:"command"`
// 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, but may be overridden by environment variables in the task payload:
// * `HOME` - the home directory of the task user
// * `PATH` - `/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin`
// * `USER` - the name of the task user
//
// The following environment variables will automatically be set in the task
// commands, and may not be overridden by environment variables in the task payload:
// * `DISPLAY` - `:0` (Linux only)
// * `TASK_ID` - the task ID of the currently running task
// * `RUN_ID` - the run 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
// * `TASK_USER_CREDENTIALS` (if config property `runTasksAsCurrentUser` set to
// `true` in `generic-worker.config` file - the absolute file location of a
// json file containing the current task OS user account name and password.
// This is only useful for the generic-worker multiuser CI tasks, where
// `runTasksAsCurrentUser` is set to `true`.
// * `TASKCLUSTER_WORKER_LOCATION`. See
// [RFC #0148](https://github.com/taskcluster/taskcluster-rfcs/blob/master/rfcs/0148-taskcluster-worker-location.md)
// for details.
//
// Since: generic-worker 0.0.1
//
// Map entries:
Env map[string]string `json:"env,omitempty"`
// Feature flags enable additional functionality.
//
// Since: generic-worker 5.3.0
Features FeatureFlags `json:"features,omitempty"`
// Configuration for task logs.
//
// Since: generic-worker 48.2.0
Logs Logs `json:"logs,omitempty"`
// Maximum time the task container can run in seconds.
//
// Since: generic-worker 0.0.1
//
// Mininum: 1
// Maximum: 86400
MaxRunTime int64 `json:"maxRunTime"`
// Directories and/or files to be mounted.
//
// Since: generic-worker 5.4.0
//
// Array items:
// One of:
// * FileMount
// * WritableDirectoryCache
// * ReadOnlyDirectory
Mounts []json.RawMessage `json:"mounts,omitempty"`
// 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.
OnExitStatus ExitCodeHandling `json:"onExitStatus,omitempty"`
// A list of OS Groups that the task user should be a member of.
//
// Since: generic-worker 6.0.0 (Windows)
// Since: generic-worker 54.4.0 (FreeBSD, Linux, macOS)
//
// Array items:
OSGroups []string `json:"osGroups,omitempty"`
// This property is allowed for backward compatibility, but is unused.
SupersederURL string `json:"supersederUrl,omitempty"`
}
// Content originating from a task artifact that has been indexed by the Taskcluster Index Service.
//
// Since: generic-worker 51.0.0
IndexedContent struct {
// Max length: 1024
Artifact string `json:"artifact"`
// Max length: 255
Namespace string `json:"namespace"`
}
// Image to use for the task. Images can be specified as an image tag as used by a docker registry, or as an object declaring type and name/namespace
IndexedDockerImage struct {
Namespace string `json:"namespace"`
Path string `json:"path"`
// Possible values:
// * "indexed-image"
Type string `json:"type"`
}
// Configuration for task logs.
//
// Since: generic-worker 48.2.0
Logs struct {
// Specifies a custom name for the backing log artifact.
// This is only used if `features.backingLog` is `true`.
//
// Since: generic-worker 48.2.0
//
// Default: "public/logs/live_backing.log"
Backing string `json:"backing" default:"public/logs/live_backing.log"`
// Specifies a custom name for the live log artifact.
// This is only used if `features.liveLog` is `true`.
//
// Since: generic-worker 48.2.0
//
// Default: "public/logs/live.log"
Live string `json:"live" default:"public/logs/live.log"`
}
// Image to use for the task. Images can be specified as an image tag as used by a docker registry, or as an object declaring type and name/namespace
NamedDockerImage struct {
Name string `json:"name"`
// Possible values:
// * "docker-image"
Type string `json:"type"`
}
// One of:
// * GenericWorkerPayload
// * DockerWorkerPayload
Payload json.RawMessage
// Byte-for-byte literal inline content of file/archive, up to 64KB in size.
//
// Since: generic-worker 11.1.0
RawContent struct {
// Byte-for-byte literal inline content of file/archive, up to 64KB in size.
//
// Since: generic-worker 11.1.0
//
// Max length: 65536
Raw string `json:"raw"`
}
ReadOnlyDirectory struct {
// One of:
// * ArtifactContent
// * IndexedContent
// * URLContent
// * RawContent
// * Base64Content
Content json.RawMessage `json:"content"`
// The filesystem location to mount the directory volume.
//
// Since: generic-worker 5.4.0
Directory string `json:"directory"`
// Archive format of content for read only directory.
//
// Since: generic-worker 5.4.0
//
// Possible values:
// * "rar"
// * "tar.bz2"
// * "tar.gz"
// * "tar.xz"
// * "tar.zst"
// * "zip"
Format string `json:"format"`
}
// URL to download content from.
//
// Since: generic-worker 5.4.0
URLContent struct {
// If provided, the required SHA256 of the content body.
//
// Since: generic-worker 10.8.0
//
// Syntax: ^[a-f0-9]{64}$
SHA256 string `json:"sha256,omitempty"`
// URL to download content from.
//
// Since: generic-worker 5.4.0
URL string `json:"url"`
}
WritableDirectoryCache struct {
// 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
CacheName string `json:"cacheName"`
// One of:
// * ArtifactContent
// * IndexedContent
// * URLContent
// * RawContent
// * Base64Content
Content json.RawMessage `json:"content,omitempty"`
// The filesystem location to mount the directory volume.
//
// Since: generic-worker 5.4.0
Directory string `json:"directory"`
// Archive format of the preloaded content (if `content` provided).
//
// Since: generic-worker 5.4.0
//
// Possible values:
// * "rar"
// * "tar.bz2"
// * "tar.gz"
// * "tar.xz"
// * "tar.zst"
// * "zip"
Format string `json:"format,omitempty"`
}
)
// MarshalJSON calls json.RawMessage method of the same name. Required since
// Payload is of type json.RawMessage...
func (m *Payload) MarshalJSON() ([]byte, error) {
x := json.RawMessage(*m)
return (&x).MarshalJSON()
}
// UnmarshalJSON is a copy of the json.RawMessage implementation.
func (m *Payload) UnmarshalJSON(data []byte) error {
if m == nil {
return errors.New("Payload: UnmarshalJSON on nil pointer")
}
*m = append((*m)[0:0], data...)
return nil
}
// Returns json schema for the payload part of the task definition. Please
// note we use a go string and do not load an external file, since we want this
// to be *part of the compiled executable*. If this sat in another file that
// was loaded at runtime, it would not be burned into the build, which would be
// bad for the following two reasons:
// 1. we could no longer distribute a single binary file that didn't require
// installation/extraction
// 2. the payload schema is specific to the version of the code, therefore
// should be versioned directly with the code and *frozen on build*.
//
// Run `generic-worker show-payload-schema` to output this schema to standard
// out.
func JSONSchema() string {
return `{
"$id": "/schemas/generic-worker/multiuser_posix.json#",
"$schema": "/schemas/common/metaschema.json#",
"definitions": {
"artifact": {
"additionalProperties": false,
"properties": {
"expires": {
"format": "date-time",
"title": "Date when artifact should expire must be in the future.",
"type": "string"
},
"path": {
"title": "Location of artifact in container, as an absolute path.",
"type": "string"
},
"type": {
"enum": [
"file",
"directory"
],
"title": "Artifact upload type.",
"type": "string"
}
},
"required": [
"type",
"path"
],
"title": "Docker Worker Artifact",
"type": "object"
},
"content": {
"oneOf": [
{
"additionalProperties": false,
"description": "Requires scope ` + "`" + `queue:get-artifact:\u003cartifact-name\u003e` + "`" + `.\n\nSince: generic-worker 5.4.0",
"properties": {
"artifact": {
"maxLength": 1024,
"type": "string"
},
"sha256": {
"description": "If provided, the required SHA256 of the content body.\n\nSince: generic-worker 10.8.0",
"pattern": "^[a-f0-9]{64}$",
"title": "SHA 256",
"type": "string"
},
"taskId": {
"pattern": "^[A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw]$",
"type": "string"
}
},
"required": [
"taskId",
"artifact"
],
"title": "Artifact Content",
"type": "object"
},
{
"additionalProperties": false,
"description": "Content originating from a task artifact that has been indexed by the Taskcluster Index Service.\n\nSince: generic-worker 51.0.0",
"properties": {
"artifact": {
"maxLength": 1024,
"type": "string"
},
"namespace": {
"maxLength": 255,
"type": "string"
}
},
"required": [
"namespace",
"artifact"
],
"title": "Indexed Content",
"type": "object"
},
{
"additionalProperties": false,
"description": "URL to download content from.\n\nSince: generic-worker 5.4.0",
"properties": {
"sha256": {
"description": "If provided, the required SHA256 of the content body.\n\nSince: generic-worker 10.8.0",
"pattern": "^[a-f0-9]{64}$",
"title": "SHA 256",
"type": "string"
},
"url": {
"description": "URL to download content from.\n\nSince: generic-worker 5.4.0",
"format": "uri",
"title": "URL",
"type": "string"
}
},
"required": [
"url"
],
"title": "URL Content",
"type": "object"
},
{
"additionalProperties": false,
"description": "Byte-for-byte literal inline content of file/archive, up to 64KB in size.\n\nSince: generic-worker 11.1.0",
"properties": {
"raw": {
"description": "Byte-for-byte literal inline content of file/archive, up to 64KB in size.\n\nSince: generic-worker 11.1.0",
"maxLength": 65536,
"title": "Raw",
"type": "string"
}
},
"required": [
"raw"
],
"title": "Raw Content",
"type": "object"
},
{
"additionalProperties": false,
"description": "Base64 encoded content of file/archive, up to 64KB (encoded) in size.\n\nSince: generic-worker 11.1.0",
"properties": {
"base64": {
"description": "Base64 encoded content of file/archive, up to 64KB (encoded) in size.\n\nSince: generic-worker 11.1.0",
"maxLength": 65536,
"pattern": "^[A-Za-z0-9/+]+[=]{0,2}$",
"title": "Base64",
"type": "string"
}
},
"required": [
"base64"
],
"title": "Base64 Content",
"type": "object"
}
]
},
"fileMount": {
"additionalProperties": false,
"properties": {
"content": {
"$ref": "#/definitions/content",
"description": "Content of the file to be mounted.\n\nSince: generic-worker 5.4.0"
},
"file": {
"description": "The filesystem location to mount the file.\n\nSince: generic-worker 5.4.0",
"title": "File",
"type": "string"
}
},
"required": [
"file",
"content"
],
"title": "File Mount",
"type": "object"
},
"mount": {
"oneOf": [
{
"$ref": "#/definitions/fileMount"
},
{
"$ref": "#/definitions/writableDirectoryCache"
},
{
"$ref": "#/definitions/readOnlyDirectory"
}
],
"title": "Mount"
},
"readOnlyDirectory": {
"additionalProperties": false,
"properties": {
"content": {
"$ref": "#/definitions/content",
"description": "Contents of read only directory.\n\nSince: generic-worker 5.4.0",
"title": "Content"
},
"directory": {
"description": "The filesystem location to mount the directory volume.\n\nSince: generic-worker 5.4.0",
"title": "Directory",
"type": "string"
},
"format": {
"description": "Archive format of content for read only directory.\n\nSince: generic-worker 5.4.0",
"enum": [
"rar",
"tar.bz2",
"tar.gz",
"tar.xz",
"tar.zst",
"zip"
],
"title": "Format",
"type": "string"
}
},
"required": [
"directory",
"content",
"format"
],
"title": "Read Only Directory",
"type": "object"
},
"writableDirectoryCache": {
"additionalProperties": false,
"dependencies": {
"content": [
"format"
],
"format": [
"content"
]
},
"properties": {
"cacheName": {
"description": "Implies a read/write cache directory volume. A unique name for the\ncache volume. Requires scope ` + "`" + `generic-worker:cache:\u003ccache-name\u003e` + "`" + `.\nNote if this cache is loaded from an artifact, you will also require\nscope ` + "`" + `queue:get-artifact:\u003cartifact-name\u003e` + "`" + ` to use this cache.\n\nSince: generic-worker 5.4.0",
"title": "Cache Name",
"type": "string"
},
"content": {
"$ref": "#/definitions/content",
"description": "Optional content to be preloaded when initially creating the cache\n(if set, ` + "`" + `format` + "`" + ` must also be provided).\n\nSince: generic-worker 5.4.0",
"title": "Content"
},
"directory": {
"description": "The filesystem location to mount the directory volume.\n\nSince: generic-worker 5.4.0",
"title": "Directory Volume",
"type": "string"
},
"format": {
"description": "Archive format of the preloaded content (if ` + "`" + `content` + "`" + ` provided).\n\nSince: generic-worker 5.4.0",
"enum": [
"rar",
"tar.bz2",
"tar.gz",
"tar.xz",
"tar.zst",
"zip"
],
"title": "Format",
"type": "string"
}
},
"required": [
"directory",
"cacheName"
],
"title": "Writable Directory Cache",
"type": "object"
}
},
"oneOf": [
{
"additionalProperties": false,
"description": "This schema defines the structure of the ` + "`" + `payload` + "`" + ` property referred to in a\nTaskcluster Task definition.",
"properties": {
"artifacts": {
"description": "Artifacts to be published.\n\nSince: generic-worker 1.0.0",
"items": {
"additionalProperties": false,
"properties": {
"contentEncoding": {
"description": "Content-Encoding for the artifact. If not provided, ` + "`" + `gzip` + "`" + ` will be used, except for the\nfollowing file extensions, where ` + "`" + `identity` + "`" + ` will be used, since they are already\ncompressed:\n\n* 7z\n* bz2\n* deb\n* dmg\n* flv\n* gif\n* gz\n* jpeg\n* jpg\n* png\n* swf\n* tbz\n* tgz\n* webp\n* whl\n* woff\n* woff2\n* xz\n* zip\n* zst\n\nNote, setting ` + "`" + `contentEncoding` + "`" + ` on a directory artifact will apply the same content\nencoding to all the files contained in the directory.\n\nSince: generic-worker 16.2.0",
"enum": [
"identity",
"gzip"
],
"title": "Content-Encoding header when serving artifact over HTTP.",
"type": "string"
},
"contentType": {
"description": "Explicitly set the value of the HTTP ` + "`" + `Content-Type` + "`" + ` response header when the artifact(s)\nis/are served over HTTP(S). If not provided (this property is optional) the worker will\nguess the content type of artifacts based on the filename extension of the file storing\nthe artifact content. It does this by looking at the system filename-to-mimetype mappings\ndefined in multiple ` + "`" + `mime.types` + "`" + ` files located under ` + "`" + `/etc` + "`" + `. Note, setting ` + "`" + `contentType` + "`" + `\non a directory artifact will apply the same contentType to all files contained in the\ndirectory.\n\nSee [mime.TypeByExtension](https://pkg.go.dev/mime#TypeByExtension).\n\nSince: generic-worker 10.4.0",
"title": "Content-Type header when serving artifact over HTTP",
"type": "string"
},
"expires": {
"description": "Date when artifact should expire must be in the future, no earlier than task deadline, but\nno later than task expiry. If not set, defaults to task expiry.\n\nSince: generic-worker 1.0.0",
"format": "date-time",
"title": "Expiry date and time",
"type": "string"
},
"name": {
"description": "Name of the artifact, as it will be published. If not set, ` + "`" + `path` + "`" + ` will be used.\nConventionally (although not enforced) path elements are forward slash separated. Example:\n` + "`" + `public/build/a/house` + "`" + `. Note, no scopes are required to read artifacts beginning ` + "`" + `public/` + "`" + `.\nArtifact names not beginning ` + "`" + `public/` + "`" + ` are scope-protected (caller requires scopes to\ndownload the artifact). See the Queue documentation for more information.\n\nSince: generic-worker 8.1.0",
"title": "Name of the artifact",