@ship.zone/ci-spec 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/.smartconfig.json +46 -0
  2. package/changelog.md +190 -0
  3. package/conformance/archive-cases.json +446 -0
  4. package/conformance/ci-actions/compile-invalid/build-arg-secret-collision.yml +31 -0
  5. package/conformance/ci-actions/compile-invalid/candidate-without-needs.yml +36 -0
  6. package/conformance/ci-actions/compile-invalid/needs-wider-triggers.yml +42 -0
  7. package/conformance/ci-actions/compile-invalid/npm-read-registry-not-allowlisted.yml +34 -0
  8. package/conformance/ci-actions/compile-invalid/publish-job-excludes-tag.yml +57 -0
  9. package/conformance/ci-actions/compile-invalid/shared-memory-above-memory.yml +28 -0
  10. package/conformance/ci-actions/compile-invalid/trigger-kind-without-job.yml +30 -0
  11. package/conformance/ci-actions/invalid/alias-affix-invalid.yml +33 -0
  12. package/conformance/ci-actions/invalid/alias.yml +32 -0
  13. package/conformance/ci-actions/invalid/bridge-network.yml +27 -0
  14. package/conformance/ci-actions/invalid/build-darwin-platform.yml +24 -0
  15. package/conformance/ci-actions/invalid/build-with-steps.yml +27 -0
  16. package/conformance/ci-actions/invalid/concurrency-empty-group.yml +28 -0
  17. package/conformance/ci-actions/invalid/concurrency-without-cancel-in-progress.yml +27 -0
  18. package/conformance/ci-actions/invalid/container-job-build-profile.yml +25 -0
  19. package/conformance/ci-actions/invalid/custom-tag.txt +23 -0
  20. package/conformance/ci-actions/invalid/duplicate-key.txt +24 -0
  21. package/conformance/ci-actions/invalid/egress-bare-wildcard.yml +29 -0
  22. package/conformance/ci-actions/invalid/egress-empty-allowlist.yml +28 -0
  23. package/conformance/ci-actions/invalid/egress-ip-literal.yml +29 -0
  24. package/conformance/ci-actions/invalid/egress-single-label-wildcard.yml +29 -0
  25. package/conformance/ci-actions/invalid/job-publish-permission.yml +28 -0
  26. package/conformance/ci-actions/invalid/job-trigger-undeclared-kind.yml +27 -0
  27. package/conformance/ci-actions/invalid/literal-alias-affix.yml +33 -0
  28. package/conformance/ci-actions/invalid/missing-spec.yml +24 -0
  29. package/conformance/ci-actions/invalid/multiple-documents.yml +25 -0
  30. package/conformance/ci-actions/invalid/npm-read-invalid-scope.yml +33 -0
  31. package/conformance/ci-actions/invalid/oci-darwin-platform.yml +25 -0
  32. package/conformance/ci-actions/invalid/permission-without-publication.yml +31 -0
  33. package/conformance/ci-actions/invalid/publish-order-duplicate.yml +50 -0
  34. package/conformance/ci-actions/invalid/publish-order-missing-kind.yml +48 -0
  35. package/conformance/ci-actions/invalid/publish-order-undeclared-kind.yml +45 -0
  36. package/conformance/ci-actions/invalid/publish-without-permission.yml +31 -0
  37. package/conformance/ci-actions/invalid/publish-without-tag-trigger.yml +31 -0
  38. package/conformance/ci-actions/invalid/release-notes-without-assets.yml +46 -0
  39. package/conformance/ci-actions/invalid/reserved-label-prefix.yml +25 -0
  40. package/conformance/ci-actions/invalid/reserved-label.yml +25 -0
  41. package/conformance/ci-actions/invalid/retention-above-maximum.yml +83 -0
  42. package/conformance/ci-actions/invalid/retention-below-minimum.yml +83 -0
  43. package/conformance/ci-actions/invalid/schema-version-field.yml +26 -0
  44. package/conformance/ci-actions/invalid/shared-memory-below-minimum.yml +28 -0
  45. package/conformance/ci-actions/invalid/shell-string.yml +21 -0
  46. package/conformance/ci-actions/invalid/spec-number.yml +25 -0
  47. package/conformance/ci-actions/invalid/spec-prerelease.yml +25 -0
  48. package/conformance/ci-actions/invalid/spec-range.yml +25 -0
  49. package/conformance/ci-actions/invalid/timeout-above-maximum.yml +26 -0
  50. package/conformance/ci-actions/invalid/timeout-below-minimum.yml +26 -0
  51. package/conformance/ci-actions/invalid/unknown-alias-kind.yml +31 -0
  52. package/conformance/ci-actions/invalid/unknown-key.yml +24 -0
  53. package/conformance/ci-actions/invalid/vm-darwin-candidate.yml +38 -0
  54. package/conformance/ci-actions/invalid/vm-darwin-shared-memory.yml +28 -0
  55. package/conformance/ci-actions/invalid/vm-oci-execution.yml +25 -0
  56. package/conformance/ci-actions/invalid/vm-unsupported-platform.yml +25 -0
  57. package/conformance/ci-actions/invalid/vm-without-platform.yml +24 -0
  58. package/conformance/ci-actions/valid/concurrency.yml +83 -0
  59. package/conformance/ci-actions/valid/egress.yml +40 -0
  60. package/conformance/ci-actions/valid/image-build.yml +80 -0
  61. package/conformance/ci-actions/valid/matrix.yml +45 -0
  62. package/conformance/ci-actions/valid/minimal.yml +25 -0
  63. package/conformance/ci-actions/valid/npm-read.yml +60 -0
  64. package/conformance/ci-actions/valid/release-assets.yml +114 -0
  65. package/conformance/ci-actions/valid/release-signing.yml +71 -0
  66. package/conformance/ci-actions/valid/release.yml +109 -0
  67. package/conformance/ci-actions/valid/resources.yml +79 -0
  68. package/conformance/ci-actions/valid/vm.yml +77 -0
  69. package/conformance/compile-cases.json +5885 -0
  70. package/conformance/compile-cases.schema.json +766 -0
  71. package/conformance/digest-cases.json +144 -0
  72. package/conformance/runner-cases.json +1238 -0
  73. package/conformance/runner-jobs/invalid/bridge-network.json +70 -0
  74. package/conformance/runner-jobs/invalid/build-darwin-platform.json +100 -0
  75. package/conformance/runner-jobs/invalid/build-with-steps.json +111 -0
  76. package/conformance/runner-jobs/invalid/build-without-microvm.json +100 -0
  77. package/conformance/runner-jobs/invalid/egress-empty-allowlist.json +71 -0
  78. package/conformance/runner-jobs/invalid/mutable-image.json +70 -0
  79. package/conformance/runner-jobs/invalid/npm-read-reserved-environment.json +82 -0
  80. package/conformance/runner-jobs/invalid/oci-darwin-platform.json +71 -0
  81. package/conformance/runner-jobs/invalid/push-permission-container.json +70 -0
  82. package/conformance/runner-jobs/invalid/shared-memory-below-minimum.json +71 -0
  83. package/conformance/runner-jobs/invalid/timeout-missing.json +69 -0
  84. package/conformance/runner-jobs/invalid/vm-without-microvm.json +82 -0
  85. package/conformance/runner-jobs/valid/candidate-test.json +72 -0
  86. package/conformance/runner-jobs/valid/egress.json +80 -0
  87. package/conformance/runner-jobs/valid/image-build.json +100 -0
  88. package/conformance/runner-jobs/valid/minimal.json +70 -0
  89. package/conformance/runner-jobs/valid/npm-read.json +81 -0
  90. package/conformance/runner-jobs/valid/resources.json +71 -0
  91. package/conformance/runner-jobs/valid/timeout-retention-defaults.json +91 -0
  92. package/conformance/runner-jobs/valid/vm-darwin.json +70 -0
  93. package/conformance/runner-jobs/valid/vm.json +82 -0
  94. package/conformance/runner-messages.json +2035 -0
  95. package/conformance/version-cases.json +125 -0
  96. package/dist_ts/00_commitinfo_data.d.ts +8 -0
  97. package/dist_ts/00_commitinfo_data.js +9 -0
  98. package/dist_ts/constants.d.ts +199 -0
  99. package/dist_ts/constants.js +106 -0
  100. package/dist_ts/index.d.ts +1 -0
  101. package/dist_ts/index.js +2 -0
  102. package/dist_ts/plugins.d.ts +1 -0
  103. package/dist_ts/plugins.js +3 -0
  104. package/examples/ci_actions.yml +64 -0
  105. package/license.md +21 -0
  106. package/package.json +72 -0
  107. package/readme.md +146 -0
  108. package/schemas/ci_actions.schema.json +1664 -0
  109. package/schemas/runner-job.schema.json +1172 -0
  110. package/spec/ci-actions.md +433 -0
  111. package/spec/runner-protocol.md +378 -0
  112. package/spec/runner.openapi.json +2182 -0
  113. package/ts/00_commitinfo_data.ts +8 -0
  114. package/ts/constants.ts +112 -0
  115. package/ts/index.ts +1 -0
  116. package/ts/plugins.ts +1 -0
@@ -0,0 +1,1172 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ship.zone/spec/ci/schemas/runner-job.schema.json",
4
+ "title": "ship.zone compiled runner job",
5
+ "description": "Immutable job issued by a conforming coordinator to a runner after workflow compilation and policy enforcement. The execution profile in requirements.executionProfile selects exactly one profile shape.",
6
+ "type": "object",
7
+ "unevaluatedProperties": false,
8
+ "required": [
9
+ "spec",
10
+ "sourceObjectId",
11
+ "workflowDigest",
12
+ "compiledPlanDigest",
13
+ "requirements",
14
+ "permissions",
15
+ "network",
16
+ "source",
17
+ "secrets",
18
+ "timeoutMs",
19
+ "artifacts",
20
+ "caches"
21
+ ],
22
+ "properties": {
23
+ "spec": {
24
+ "$ref": "#/$defs/specVersion"
25
+ },
26
+ "sourceObjectId": {
27
+ "$ref": "#/$defs/objectId"
28
+ },
29
+ "workflowDigest": {
30
+ "$ref": "#/$defs/sha256"
31
+ },
32
+ "compiledPlanDigest": {
33
+ "$ref": "#/$defs/sha256"
34
+ },
35
+ "requirements": {
36
+ "$ref": "#/$defs/requirements"
37
+ },
38
+ "permissions": {
39
+ "$ref": "#/$defs/permissions"
40
+ },
41
+ "network": {
42
+ "$ref": "#/$defs/network"
43
+ },
44
+ "source": {
45
+ "$ref": "#/$defs/source"
46
+ },
47
+ "secrets": {
48
+ "$ref": "#/$defs/environment"
49
+ },
50
+ "timeoutMs": {
51
+ "type": "integer",
52
+ "minimum": 1000,
53
+ "maximum": 86400000
54
+ },
55
+ "resources": {
56
+ "$ref": "#/$defs/resources"
57
+ },
58
+ "npmRead": {
59
+ "$ref": "#/$defs/npmRead"
60
+ },
61
+ "artifacts": {
62
+ "type": "array",
63
+ "maxItems": 64,
64
+ "items": {
65
+ "$ref": "#/$defs/artifact"
66
+ }
67
+ },
68
+ "caches": {
69
+ "type": "array",
70
+ "maxItems": 32
71
+ }
72
+ },
73
+ "oneOf": [
74
+ {
75
+ "$ref": "#/$defs/containerJob"
76
+ },
77
+ {
78
+ "$ref": "#/$defs/imageBuildJob"
79
+ },
80
+ {
81
+ "$ref": "#/$defs/vmJob"
82
+ }
83
+ ],
84
+ "allOf": [
85
+ {
86
+ "if": {
87
+ "type": "object",
88
+ "properties": {
89
+ "npmRead": {}
90
+ },
91
+ "required": ["npmRead"]
92
+ },
93
+ "then": {
94
+ "type": "object",
95
+ "properties": {
96
+ "steps": {
97
+ "type": "array",
98
+ "items": {
99
+ "type": "object",
100
+ "properties": {
101
+ "environment": {
102
+ "type": "object",
103
+ "properties": {
104
+ "NPM_CONFIG_USERCONFIG": false
105
+ }
106
+ }
107
+ }
108
+ }
109
+ },
110
+ "build": {
111
+ "type": "object",
112
+ "properties": {
113
+ "secrets": {
114
+ "type": "array",
115
+ "items": {
116
+ "type": "object",
117
+ "properties": {
118
+ "id": {
119
+ "not": {
120
+ "const": "npmrc"
121
+ }
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
130
+ },
131
+ {
132
+ "if": {
133
+ "type": "object",
134
+ "properties": {
135
+ "permissions": {
136
+ "type": "object",
137
+ "properties": {
138
+ "artifacts": {
139
+ "const": "none"
140
+ }
141
+ },
142
+ "required": ["artifacts"]
143
+ }
144
+ },
145
+ "required": ["permissions"]
146
+ },
147
+ "then": {
148
+ "type": "object",
149
+ "properties": {
150
+ "artifacts": {
151
+ "type": "array",
152
+ "maxItems": 0
153
+ }
154
+ }
155
+ }
156
+ },
157
+ {
158
+ "if": {
159
+ "type": "object",
160
+ "properties": {
161
+ "permissions": {
162
+ "type": "object",
163
+ "properties": {
164
+ "caches": {
165
+ "const": "none"
166
+ }
167
+ },
168
+ "required": ["caches"]
169
+ }
170
+ },
171
+ "required": ["permissions"]
172
+ },
173
+ "then": {
174
+ "type": "object",
175
+ "properties": {
176
+ "caches": {
177
+ "type": "array",
178
+ "maxItems": 0
179
+ }
180
+ }
181
+ }
182
+ },
183
+ {
184
+ "if": {
185
+ "type": "object",
186
+ "properties": {
187
+ "artifacts": {
188
+ "type": "array",
189
+ "minItems": 1
190
+ }
191
+ },
192
+ "required": ["artifacts"]
193
+ },
194
+ "then": {
195
+ "type": "object",
196
+ "properties": {
197
+ "permissions": {
198
+ "type": "object",
199
+ "properties": {
200
+ "artifacts": {
201
+ "const": "write"
202
+ }
203
+ },
204
+ "required": ["artifacts"]
205
+ },
206
+ "requirements": {
207
+ "type": "object",
208
+ "properties": {
209
+ "features": {
210
+ "type": "array",
211
+ "contains": {
212
+ "const": "artifacts"
213
+ }
214
+ }
215
+ },
216
+ "required": ["features"]
217
+ }
218
+ }
219
+ }
220
+ },
221
+ {
222
+ "if": {
223
+ "type": "object",
224
+ "properties": {
225
+ "caches": {
226
+ "type": "array",
227
+ "minItems": 1
228
+ }
229
+ },
230
+ "required": ["caches"]
231
+ },
232
+ "then": {
233
+ "type": "object",
234
+ "properties": {
235
+ "permissions": {
236
+ "type": "object",
237
+ "properties": {
238
+ "caches": {
239
+ "enum": ["read", "read-write"]
240
+ }
241
+ },
242
+ "required": ["caches"]
243
+ },
244
+ "requirements": {
245
+ "type": "object",
246
+ "properties": {
247
+ "features": {
248
+ "type": "array",
249
+ "contains": {
250
+ "const": "caches"
251
+ }
252
+ }
253
+ },
254
+ "required": ["features"]
255
+ }
256
+ }
257
+ }
258
+ },
259
+ {
260
+ "if": {
261
+ "type": "object",
262
+ "properties": {
263
+ "caches": {
264
+ "type": "array",
265
+ "contains": {
266
+ "type": "object",
267
+ "properties": {
268
+ "access": {
269
+ "const": "read-write"
270
+ }
271
+ },
272
+ "required": ["access"]
273
+ }
274
+ }
275
+ },
276
+ "required": ["caches"]
277
+ },
278
+ "then": {
279
+ "type": "object",
280
+ "properties": {
281
+ "permissions": {
282
+ "type": "object",
283
+ "properties": {
284
+ "caches": {
285
+ "const": "read-write"
286
+ }
287
+ },
288
+ "required": ["caches"]
289
+ }
290
+ }
291
+ }
292
+ }
293
+ ],
294
+ "$defs": {
295
+ "specVersion": {
296
+ "description": "A released @ship.zone/ci-spec package version in canonical MAJOR.MINOR.PATCH form without prerelease or build metadata. Each component has at most 15 digits, so every component is a safe integer.",
297
+ "type": "string",
298
+ "pattern": "^(?:0|[1-9][0-9]{0,14})\\.(?:0|[1-9][0-9]{0,14})\\.(?:0|[1-9][0-9]{0,14})$"
299
+ },
300
+ "containerProfile": {
301
+ "const": "oci"
302
+ },
303
+ "imageBuildProfile": {
304
+ "const": "oci-image"
305
+ },
306
+ "vmProfile": {
307
+ "const": "vm"
308
+ },
309
+ "executionProfile": {
310
+ "anyOf": [
311
+ {
312
+ "$ref": "#/$defs/containerProfile"
313
+ },
314
+ {
315
+ "$ref": "#/$defs/imageBuildProfile"
316
+ },
317
+ {
318
+ "$ref": "#/$defs/vmProfile"
319
+ }
320
+ ]
321
+ },
322
+ "isolation": {
323
+ "enum": ["container", "microvm"]
324
+ },
325
+ "feature": {
326
+ "enum": ["source.tar-gz", "artifacts", "caches"]
327
+ },
328
+ "networkMode": {
329
+ "enum": ["none", "egress"]
330
+ },
331
+ "containerJob": {
332
+ "type": "object",
333
+ "required": ["execution", "steps"],
334
+ "properties": {
335
+ "requirements": {
336
+ "type": "object",
337
+ "properties": {
338
+ "executionProfile": {
339
+ "$ref": "#/$defs/containerProfile"
340
+ },
341
+ "platform": {
342
+ "$ref": "#/$defs/linuxPlatform"
343
+ }
344
+ }
345
+ },
346
+ "permissions": {
347
+ "type": "object",
348
+ "properties": {
349
+ "images": {
350
+ "const": "none"
351
+ }
352
+ }
353
+ },
354
+ "execution": {
355
+ "$ref": "#/$defs/ociExecution"
356
+ },
357
+ "steps": {
358
+ "type": "array",
359
+ "minItems": 1,
360
+ "maxItems": 128,
361
+ "items": {
362
+ "$ref": "#/$defs/compiledStep"
363
+ }
364
+ },
365
+ "caches": {
366
+ "type": "array",
367
+ "items": {
368
+ "$ref": "#/$defs/cache"
369
+ }
370
+ }
371
+ }
372
+ },
373
+ "imageBuildJob": {
374
+ "type": "object",
375
+ "required": ["build"],
376
+ "properties": {
377
+ "requirements": {
378
+ "type": "object",
379
+ "required": ["platform"],
380
+ "properties": {
381
+ "executionProfile": {
382
+ "$ref": "#/$defs/imageBuildProfile"
383
+ },
384
+ "isolation": {
385
+ "const": "microvm"
386
+ },
387
+ "platform": {
388
+ "$ref": "#/$defs/linuxPlatform"
389
+ }
390
+ }
391
+ },
392
+ "permissions": {
393
+ "type": "object",
394
+ "properties": {
395
+ "images": {
396
+ "const": "push"
397
+ }
398
+ }
399
+ },
400
+ "build": {
401
+ "$ref": "#/$defs/imageBuild"
402
+ },
403
+ "artifacts": {
404
+ "type": "array",
405
+ "maxItems": 0
406
+ },
407
+ "caches": {
408
+ "type": "array",
409
+ "maxItems": 1,
410
+ "items": {
411
+ "$ref": "#/$defs/buildCache"
412
+ }
413
+ }
414
+ }
415
+ },
416
+ "vmJob": {
417
+ "type": "object",
418
+ "required": ["execution", "steps"],
419
+ "properties": {
420
+ "requirements": {
421
+ "type": "object",
422
+ "required": ["platform"],
423
+ "properties": {
424
+ "executionProfile": {
425
+ "$ref": "#/$defs/vmProfile"
426
+ },
427
+ "isolation": {
428
+ "const": "microvm"
429
+ },
430
+ "platform": {
431
+ "$ref": "#/$defs/vmPlatform"
432
+ }
433
+ }
434
+ },
435
+ "permissions": {
436
+ "type": "object",
437
+ "properties": {
438
+ "images": {
439
+ "const": "none"
440
+ }
441
+ }
442
+ },
443
+ "execution": {
444
+ "$ref": "#/$defs/vmExecution"
445
+ },
446
+ "steps": {
447
+ "type": "array",
448
+ "minItems": 1,
449
+ "maxItems": 128,
450
+ "items": {
451
+ "$ref": "#/$defs/compiledStep"
452
+ }
453
+ },
454
+ "caches": {
455
+ "type": "array",
456
+ "items": {
457
+ "$ref": "#/$defs/cache"
458
+ }
459
+ }
460
+ },
461
+ "allOf": [
462
+ {
463
+ "$ref": "#/$defs/darwinGuestRestrictions"
464
+ }
465
+ ]
466
+ },
467
+ "darwinGuestRestrictions": {
468
+ "description": "A darwin guest boots a digest-pinned VM image and has no /dev/shm.",
469
+ "if": {
470
+ "type": "object",
471
+ "properties": {
472
+ "requirements": {
473
+ "type": "object",
474
+ "properties": {
475
+ "platform": {
476
+ "const": "darwin/arm64"
477
+ }
478
+ },
479
+ "required": ["platform"]
480
+ }
481
+ },
482
+ "required": ["requirements"]
483
+ },
484
+ "then": {
485
+ "type": "object",
486
+ "properties": {
487
+ "execution": {
488
+ "type": "object",
489
+ "properties": {
490
+ "image": {
491
+ "$ref": "#/$defs/pinnedImage"
492
+ }
493
+ }
494
+ },
495
+ "resources": {
496
+ "type": "object",
497
+ "properties": {
498
+ "sharedMemoryBytes": false
499
+ }
500
+ }
501
+ }
502
+ }
503
+ },
504
+ "identifier": {
505
+ "type": "string",
506
+ "minLength": 1,
507
+ "maxLength": 64,
508
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"
509
+ },
510
+ "objectId": {
511
+ "type": "string",
512
+ "minLength": 40,
513
+ "maxLength": 64,
514
+ "pattern": "^[a-f0-9]+$"
515
+ },
516
+ "sha256": {
517
+ "type": "string",
518
+ "pattern": "^[a-f0-9]{64}$"
519
+ },
520
+ "platform": {
521
+ "type": "string",
522
+ "minLength": 3,
523
+ "maxLength": 64,
524
+ "pattern": "^[a-z0-9]+/[a-z0-9_]+(?:/[a-z0-9]+)?$"
525
+ },
526
+ "requirements": {
527
+ "type": "object",
528
+ "additionalProperties": false,
529
+ "required": ["executionProfile", "isolation", "labels", "features", "limits"],
530
+ "properties": {
531
+ "executionProfile": {
532
+ "$ref": "#/$defs/executionProfile"
533
+ },
534
+ "isolation": {
535
+ "$ref": "#/$defs/isolation"
536
+ },
537
+ "platform": {
538
+ "$ref": "#/$defs/platform"
539
+ },
540
+ "labels": {
541
+ "type": "array",
542
+ "maxItems": 32,
543
+ "uniqueItems": true,
544
+ "items": {
545
+ "$ref": "#/$defs/identifier"
546
+ }
547
+ },
548
+ "features": {
549
+ "type": "array",
550
+ "minItems": 1,
551
+ "maxItems": 16,
552
+ "uniqueItems": true,
553
+ "contains": {
554
+ "const": "source.tar-gz"
555
+ },
556
+ "items": {
557
+ "$ref": "#/$defs/feature"
558
+ }
559
+ },
560
+ "limits": {
561
+ "$ref": "#/$defs/limits"
562
+ }
563
+ }
564
+ },
565
+ "limits": {
566
+ "type": "object",
567
+ "additionalProperties": false,
568
+ "required": [
569
+ "maximumSourceArchiveBytes",
570
+ "maximumSourceExtractedBytes",
571
+ "maximumSourceEntries",
572
+ "maximumArtifactArchiveBytes",
573
+ "maximumArtifactExtractedBytes",
574
+ "maximumArtifactEntries",
575
+ "maximumArtifacts",
576
+ "maximumCacheArchiveBytes",
577
+ "maximumCacheExtractedBytes",
578
+ "maximumCacheEntries",
579
+ "maximumCaches",
580
+ "maximumLogChunkBytes",
581
+ "maximumTotalLogBytes",
582
+ "maximumWorkspaceBytes",
583
+ "maximumWorkspaceEntries"
584
+ ],
585
+ "properties": {
586
+ "maximumSourceArchiveBytes": {
587
+ "type": "integer",
588
+ "minimum": 0,
589
+ "maximum": 8589934592
590
+ },
591
+ "maximumSourceExtractedBytes": {
592
+ "type": "integer",
593
+ "minimum": 0,
594
+ "maximum": 68719476736
595
+ },
596
+ "maximumSourceEntries": {
597
+ "type": "integer",
598
+ "minimum": 0,
599
+ "maximum": 1000000
600
+ },
601
+ "maximumArtifactArchiveBytes": {
602
+ "type": "integer",
603
+ "minimum": 0,
604
+ "maximum": 17179869184
605
+ },
606
+ "maximumArtifactExtractedBytes": {
607
+ "type": "integer",
608
+ "minimum": 0,
609
+ "maximum": 137438953472
610
+ },
611
+ "maximumArtifactEntries": {
612
+ "type": "integer",
613
+ "minimum": 0,
614
+ "maximum": 1000000
615
+ },
616
+ "maximumArtifacts": {
617
+ "type": "integer",
618
+ "minimum": 0,
619
+ "maximum": 64
620
+ },
621
+ "maximumCacheArchiveBytes": {
622
+ "type": "integer",
623
+ "minimum": 0,
624
+ "maximum": 17179869184
625
+ },
626
+ "maximumCacheExtractedBytes": {
627
+ "type": "integer",
628
+ "minimum": 0,
629
+ "maximum": 137438953472
630
+ },
631
+ "maximumCacheEntries": {
632
+ "type": "integer",
633
+ "minimum": 0,
634
+ "maximum": 1000000
635
+ },
636
+ "maximumCaches": {
637
+ "type": "integer",
638
+ "minimum": 0,
639
+ "maximum": 32
640
+ },
641
+ "maximumLogChunkBytes": {
642
+ "type": "integer",
643
+ "minimum": 1,
644
+ "maximum": 65536
645
+ },
646
+ "maximumTotalLogBytes": {
647
+ "type": "integer",
648
+ "minimum": 0,
649
+ "maximum": 1073741824
650
+ },
651
+ "maximumWorkspaceBytes": {
652
+ "type": "integer",
653
+ "minimum": 16777216,
654
+ "maximum": 1099511627776
655
+ },
656
+ "maximumWorkspaceEntries": {
657
+ "type": "integer",
658
+ "minimum": 1,
659
+ "maximum": 2000000
660
+ }
661
+ }
662
+ },
663
+ "permissions": {
664
+ "type": "object",
665
+ "additionalProperties": false,
666
+ "required": ["source", "artifacts", "caches", "images"],
667
+ "properties": {
668
+ "source": {
669
+ "const": "read"
670
+ },
671
+ "artifacts": {
672
+ "enum": ["none", "write"]
673
+ },
674
+ "caches": {
675
+ "enum": ["none", "read", "read-write"]
676
+ },
677
+ "images": {
678
+ "enum": ["none", "push"]
679
+ }
680
+ }
681
+ },
682
+ "network": {
683
+ "oneOf": [
684
+ {
685
+ "type": "object",
686
+ "additionalProperties": false,
687
+ "required": ["mode"],
688
+ "properties": {
689
+ "mode": {
690
+ "const": "none"
691
+ }
692
+ }
693
+ },
694
+ {
695
+ "type": "object",
696
+ "additionalProperties": false,
697
+ "required": ["mode", "allow"],
698
+ "properties": {
699
+ "mode": {
700
+ "const": "egress"
701
+ },
702
+ "allow": {
703
+ "type": "array",
704
+ "minItems": 1,
705
+ "maxItems": 64,
706
+ "uniqueItems": true,
707
+ "items": {
708
+ "$ref": "#/$defs/egressRule"
709
+ }
710
+ }
711
+ }
712
+ }
713
+ ]
714
+ },
715
+ "egressRule": {
716
+ "type": "object",
717
+ "additionalProperties": false,
718
+ "required": ["host", "ports"],
719
+ "properties": {
720
+ "host": {
721
+ "$ref": "#/$defs/egressHost"
722
+ },
723
+ "ports": {
724
+ "type": "array",
725
+ "minItems": 1,
726
+ "maxItems": 16,
727
+ "uniqueItems": true,
728
+ "items": {
729
+ "type": "integer",
730
+ "minimum": 1,
731
+ "maximum": 65535
732
+ }
733
+ }
734
+ }
735
+ },
736
+ "egressHost": {
737
+ "type": "string",
738
+ "minLength": 3,
739
+ "maxLength": 253,
740
+ "pattern": "^(?:\\*\\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$"
741
+ },
742
+ "pinnedImage": {
743
+ "type": "string",
744
+ "minLength": 73,
745
+ "maxLength": 1024,
746
+ "pattern": "^[^\\s@]+@sha256:[a-f0-9]{64}$"
747
+ },
748
+ "candidateReference": {
749
+ "type": "object",
750
+ "additionalProperties": false,
751
+ "required": ["candidate"],
752
+ "properties": {
753
+ "candidate": {
754
+ "$ref": "#/$defs/identifier"
755
+ }
756
+ }
757
+ },
758
+ "imageReference": {
759
+ "oneOf": [
760
+ {
761
+ "$ref": "#/$defs/pinnedImage"
762
+ },
763
+ {
764
+ "$ref": "#/$defs/candidateReference"
765
+ }
766
+ ]
767
+ },
768
+ "ociExecution": {
769
+ "type": "object",
770
+ "additionalProperties": false,
771
+ "required": ["profile", "image"],
772
+ "properties": {
773
+ "profile": {
774
+ "$ref": "#/$defs/containerProfile"
775
+ },
776
+ "image": {
777
+ "$ref": "#/$defs/imageReference"
778
+ },
779
+ "workingDirectory": {
780
+ "type": "string",
781
+ "minLength": 1,
782
+ "maxLength": 256,
783
+ "pattern": "^/[A-Za-z0-9._/-]+$"
784
+ }
785
+ }
786
+ },
787
+ "vmExecution": {
788
+ "type": "object",
789
+ "additionalProperties": false,
790
+ "required": ["profile", "image"],
791
+ "properties": {
792
+ "profile": {
793
+ "$ref": "#/$defs/vmProfile"
794
+ },
795
+ "image": {
796
+ "$ref": "#/$defs/imageReference"
797
+ },
798
+ "workingDirectory": {
799
+ "type": "string",
800
+ "minLength": 1,
801
+ "maxLength": 256,
802
+ "pattern": "^/[A-Za-z0-9._/-]+$"
803
+ }
804
+ }
805
+ },
806
+ "linuxPlatform": {
807
+ "description": "Platforms of the oci and oci-image profiles, which execute only linux.",
808
+ "type": "string",
809
+ "allOf": [
810
+ {
811
+ "$ref": "#/$defs/platform"
812
+ }
813
+ ],
814
+ "pattern": "^linux/"
815
+ },
816
+ "vmPlatform": {
817
+ "description": "Guest platforms of the vm profile: every linux platform, and darwin/arm64.",
818
+ "anyOf": [
819
+ {
820
+ "$ref": "#/$defs/linuxPlatform"
821
+ },
822
+ {
823
+ "const": "darwin/arm64"
824
+ }
825
+ ]
826
+ },
827
+ "imageBuild": {
828
+ "type": "object",
829
+ "additionalProperties": false,
830
+ "required": ["context", "dockerfile", "buildArgs", "secrets", "labels", "baseImages"],
831
+ "properties": {
832
+ "context": {
833
+ "$ref": "#/$defs/relativePath"
834
+ },
835
+ "dockerfile": {
836
+ "$ref": "#/$defs/relativePath"
837
+ },
838
+ "target": {
839
+ "$ref": "#/$defs/identifier"
840
+ },
841
+ "buildArgs": {
842
+ "$ref": "#/$defs/buildArgs"
843
+ },
844
+ "secrets": {
845
+ "type": "array",
846
+ "maxItems": 32,
847
+ "uniqueItems": true,
848
+ "items": {
849
+ "$ref": "#/$defs/buildSecret"
850
+ }
851
+ },
852
+ "labels": {
853
+ "$ref": "#/$defs/imageLabels",
854
+ "type": "object",
855
+ "required": ["org.opencontainers.image.revision", "org.opencontainers.image.source"],
856
+ "properties": {
857
+ "org.opencontainers.image.revision": {
858
+ "$ref": "#/$defs/objectId"
859
+ },
860
+ "org.opencontainers.image.source": {
861
+ "type": "string",
862
+ "minLength": 1,
863
+ "maxLength": 1024
864
+ }
865
+ }
866
+ },
867
+ "baseImages": {
868
+ "type": "array",
869
+ "maxItems": 16,
870
+ "uniqueItems": true,
871
+ "items": {
872
+ "$ref": "#/$defs/baseImage"
873
+ }
874
+ }
875
+ }
876
+ },
877
+ "buildArgs": {
878
+ "type": "object",
879
+ "maxProperties": 64,
880
+ "propertyNames": {
881
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,127}$",
882
+ "not": {
883
+ "pattern": "^BUILDKIT_"
884
+ }
885
+ },
886
+ "additionalProperties": {
887
+ "type": "string",
888
+ "maxLength": 65536
889
+ }
890
+ },
891
+ "buildSecret": {
892
+ "type": "object",
893
+ "additionalProperties": false,
894
+ "required": ["id", "environment"],
895
+ "properties": {
896
+ "id": {
897
+ "$ref": "#/$defs/identifier"
898
+ },
899
+ "environment": {
900
+ "type": "string",
901
+ "pattern": "^[A-Z_][A-Z0-9_]{0,127}$"
902
+ }
903
+ }
904
+ },
905
+ "imageLabels": {
906
+ "type": "object",
907
+ "maxProperties": 64,
908
+ "propertyNames": {
909
+ "maxLength": 128,
910
+ "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
911
+ },
912
+ "additionalProperties": {
913
+ "type": "string",
914
+ "maxLength": 4096
915
+ }
916
+ },
917
+ "baseImage": {
918
+ "type": "object",
919
+ "additionalProperties": false,
920
+ "required": ["name", "image"],
921
+ "properties": {
922
+ "name": {
923
+ "type": "string",
924
+ "minLength": 1,
925
+ "maxLength": 64,
926
+ "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
927
+ },
928
+ "image": {
929
+ "$ref": "#/$defs/imageReference"
930
+ }
931
+ }
932
+ },
933
+ "compiledStep": {
934
+ "type": "object",
935
+ "additionalProperties": false,
936
+ "required": ["command", "environment"],
937
+ "properties": {
938
+ "name": {
939
+ "type": "string",
940
+ "minLength": 1,
941
+ "maxLength": 128
942
+ },
943
+ "command": {
944
+ "$ref": "#/$defs/command"
945
+ },
946
+ "environment": {
947
+ "$ref": "#/$defs/environment"
948
+ }
949
+ }
950
+ },
951
+ "command": {
952
+ "type": "array",
953
+ "minItems": 1,
954
+ "maxItems": 128,
955
+ "items": {
956
+ "type": "string",
957
+ "minLength": 1,
958
+ "maxLength": 16384
959
+ }
960
+ },
961
+ "source": {
962
+ "type": "object",
963
+ "additionalProperties": false,
964
+ "required": ["format", "sha256", "sizeBytes", "extractedSizeBytes", "entryCount"],
965
+ "properties": {
966
+ "format": {
967
+ "const": "tar.gz"
968
+ },
969
+ "sha256": {
970
+ "$ref": "#/$defs/sha256"
971
+ },
972
+ "sizeBytes": {
973
+ "type": "integer",
974
+ "minimum": 0,
975
+ "maximum": 8589934592
976
+ },
977
+ "extractedSizeBytes": {
978
+ "type": "integer",
979
+ "minimum": 0,
980
+ "maximum": 68719476736
981
+ },
982
+ "entryCount": {
983
+ "type": "integer",
984
+ "minimum": 0,
985
+ "maximum": 1000000
986
+ }
987
+ }
988
+ },
989
+ "environment": {
990
+ "type": "object",
991
+ "maxProperties": 128,
992
+ "propertyNames": {
993
+ "pattern": "^[A-Z_][A-Z0-9_]{0,127}$"
994
+ },
995
+ "additionalProperties": {
996
+ "type": "string",
997
+ "maxLength": 65536
998
+ }
999
+ },
1000
+ "resources": {
1001
+ "type": "object",
1002
+ "additionalProperties": false,
1003
+ "properties": {
1004
+ "memoryBytes": {
1005
+ "type": "integer",
1006
+ "minimum": 16777216,
1007
+ "maximum": 1099511627776
1008
+ },
1009
+ "cpus": {
1010
+ "type": "number",
1011
+ "exclusiveMinimum": 0,
1012
+ "maximum": 1024
1013
+ },
1014
+ "pids": {
1015
+ "type": "integer",
1016
+ "minimum": 1,
1017
+ "maximum": 1048576
1018
+ },
1019
+ "sharedMemoryBytes": {
1020
+ "type": "integer",
1021
+ "minimum": 1048576,
1022
+ "maximum": 1099511627776
1023
+ }
1024
+ }
1025
+ },
1026
+ "artifact": {
1027
+ "type": "object",
1028
+ "additionalProperties": false,
1029
+ "required": ["name", "path", "format", "when", "required", "maximumBytes", "maximumExtractedBytes", "maximumEntries"],
1030
+ "properties": {
1031
+ "name": {
1032
+ "$ref": "#/$defs/identifier"
1033
+ },
1034
+ "path": {
1035
+ "$ref": "#/$defs/relativePath"
1036
+ },
1037
+ "format": {
1038
+ "const": "tar.gz"
1039
+ },
1040
+ "when": {
1041
+ "enum": ["always", "success", "failure"]
1042
+ },
1043
+ "required": {
1044
+ "type": "boolean"
1045
+ },
1046
+ "maximumBytes": {
1047
+ "type": "integer",
1048
+ "minimum": 1,
1049
+ "maximum": 17179869184
1050
+ },
1051
+ "maximumExtractedBytes": {
1052
+ "type": "integer",
1053
+ "minimum": 1,
1054
+ "maximum": 137438953472
1055
+ },
1056
+ "maximumEntries": {
1057
+ "type": "integer",
1058
+ "minimum": 1,
1059
+ "maximum": 1000000
1060
+ },
1061
+ "retentionDays": {
1062
+ "type": "integer",
1063
+ "minimum": 1,
1064
+ "maximum": 3650
1065
+ }
1066
+ }
1067
+ },
1068
+ "cacheDeclaration": {
1069
+ "type": "object",
1070
+ "required": ["name", "key", "access", "maximumBytes", "maximumExtractedBytes", "maximumEntries"],
1071
+ "properties": {
1072
+ "name": {
1073
+ "$ref": "#/$defs/identifier"
1074
+ },
1075
+ "key": {
1076
+ "type": "string",
1077
+ "minLength": 1,
1078
+ "maxLength": 256
1079
+ },
1080
+ "access": {
1081
+ "enum": ["read", "read-write"]
1082
+ },
1083
+ "maximumBytes": {
1084
+ "type": "integer",
1085
+ "minimum": 1,
1086
+ "maximum": 17179869184
1087
+ },
1088
+ "maximumExtractedBytes": {
1089
+ "type": "integer",
1090
+ "minimum": 1,
1091
+ "maximum": 137438953472
1092
+ },
1093
+ "maximumEntries": {
1094
+ "type": "integer",
1095
+ "minimum": 1,
1096
+ "maximum": 1000000
1097
+ },
1098
+ "retentionDays": {
1099
+ "type": "integer",
1100
+ "minimum": 1,
1101
+ "maximum": 3650
1102
+ }
1103
+ }
1104
+ },
1105
+ "cache": {
1106
+ "$ref": "#/$defs/cacheDeclaration",
1107
+ "type": "object",
1108
+ "unevaluatedProperties": false,
1109
+ "required": ["paths"],
1110
+ "properties": {
1111
+ "paths": {
1112
+ "type": "array",
1113
+ "minItems": 1,
1114
+ "maxItems": 32,
1115
+ "uniqueItems": true,
1116
+ "items": {
1117
+ "$ref": "#/$defs/relativePath"
1118
+ }
1119
+ }
1120
+ }
1121
+ },
1122
+ "buildCache": {
1123
+ "$ref": "#/$defs/cacheDeclaration",
1124
+ "type": "object",
1125
+ "unevaluatedProperties": false
1126
+ },
1127
+ "npmRegistry": {
1128
+ "type": "string",
1129
+ "minLength": 9,
1130
+ "maxLength": 1024,
1131
+ "pattern": "^https://[a-z0-9.-]+(?::[0-9]{1,5})?(?:/[^\\s?#]*)?$"
1132
+ },
1133
+ "npmScope": {
1134
+ "type": "string",
1135
+ "minLength": 2,
1136
+ "maxLength": 129,
1137
+ "pattern": "^@[a-z0-9~-][a-z0-9_.~-]{0,127}$"
1138
+ },
1139
+ "npmRead": {
1140
+ "description": "Attempt-scoped read access to npm packages of the listed scopes on the listed registries.",
1141
+ "type": "array",
1142
+ "minItems": 1,
1143
+ "maxItems": 8,
1144
+ "uniqueItems": true,
1145
+ "items": {
1146
+ "type": "object",
1147
+ "additionalProperties": false,
1148
+ "required": ["registry", "scopes"],
1149
+ "properties": {
1150
+ "registry": {
1151
+ "$ref": "#/$defs/npmRegistry"
1152
+ },
1153
+ "scopes": {
1154
+ "type": "array",
1155
+ "minItems": 1,
1156
+ "maxItems": 16,
1157
+ "uniqueItems": true,
1158
+ "items": {
1159
+ "$ref": "#/$defs/npmScope"
1160
+ }
1161
+ }
1162
+ }
1163
+ }
1164
+ },
1165
+ "relativePath": {
1166
+ "type": "string",
1167
+ "minLength": 1,
1168
+ "maxLength": 1024,
1169
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\u0000).+$"
1170
+ }
1171
+ }
1172
+ }