@ship.zone/runner 2.1.0 → 4.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.
- package/.smartconfig.json +118 -3
- package/changelog.md +101 -0
- package/dist_rust/runnerworkspace_linux_amd64_musl +0 -0
- package/dist_rust/runnerworkspace_linux_amd64_musl.third-party-notices.json +679 -0
- package/dist_rust/runnerworkspace_linux_amd64_musl.third-party-notices.txt +15719 -0
- package/dist_rust/runnerworkspace_linux_amd64_musl.tsrust-build.json +5 -5
- package/dist_rust/runnerworkspace_linux_arm64_musl +0 -0
- package/dist_rust/runnerworkspace_linux_arm64_musl.third-party-notices.json +679 -0
- package/dist_rust/runnerworkspace_linux_arm64_musl.third-party-notices.txt +15719 -0
- package/dist_rust/runnerworkspace_linux_arm64_musl.tsrust-build.json +5 -5
- package/dist_ts/00_commitinfo_data.d.ts +8 -0
- package/dist_ts/00_commitinfo_data.js +9 -0
- package/dist_ts/api-client.d.ts +47 -0
- package/dist_ts/api-client.js +600 -0
- package/dist_ts/artifact-manager.d.ts +11 -0
- package/dist_ts/artifact-manager.js +140 -0
- package/dist_ts/attempt-state.d.ts +18 -0
- package/dist_ts/attempt-state.js +151 -0
- package/dist_ts/cache-manager.d.ts +13 -0
- package/dist_ts/cache-manager.js +300 -0
- package/dist_ts/cli-entry.d.ts +2 -0
- package/dist_ts/cli-entry.js +18 -0
- package/dist_ts/cli.d.ts +14 -0
- package/dist_ts/cli.js +243 -0
- package/dist_ts/config.d.ts +8 -0
- package/dist_ts/config.js +495 -0
- package/dist_ts/egress-proxy.d.ts +99 -0
- package/dist_ts/egress-proxy.js +607 -0
- package/dist_ts/errors.d.ts +41 -0
- package/dist_ts/errors.js +90 -0
- package/dist_ts/filesystem.d.ts +73 -0
- package/dist_ts/filesystem.js +207 -0
- package/dist_ts/index.d.ts +20 -0
- package/dist_ts/index.js +21 -0
- package/dist_ts/interfaces.d.ts +685 -0
- package/dist_ts/interfaces.js +3 -0
- package/dist_ts/log-sender.d.ts +26 -0
- package/dist_ts/log-sender.js +124 -0
- package/dist_ts/microvm-executor.d.ts +90 -0
- package/dist_ts/microvm-executor.js +1045 -0
- package/dist_ts/node-version.d.ts +11 -0
- package/dist_ts/node-version.js +43 -0
- package/dist_ts/npm-grants.d.ts +9 -0
- package/dist_ts/npm-grants.js +44 -0
- package/dist_ts/oci-registry.d.ts +73 -0
- package/dist_ts/oci-registry.js +508 -0
- package/dist_ts/plugins.d.ts +23 -0
- package/dist_ts/plugins.js +27 -0
- package/dist_ts/protocol-validator.d.ts +39 -0
- package/dist_ts/protocol-validator.js +488 -0
- package/dist_ts/redactor.d.ts +78 -0
- package/dist_ts/redactor.js +235 -0
- package/dist_ts/registration-state.d.ts +16 -0
- package/dist_ts/registration-state.js +171 -0
- package/dist_ts/runner.d.ts +65 -0
- package/dist_ts/runner.js +912 -0
- package/dist_ts/source-workspace.d.ts +10 -0
- package/dist_ts/source-workspace.js +125 -0
- package/dist_ts/spec-version.d.ts +11 -0
- package/dist_ts/spec-version.js +41 -0
- package/dist_ts/staging-scavenger.d.ts +7 -0
- package/dist_ts/staging-scavenger.js +63 -0
- package/dist_ts/state-owner.d.ts +74 -0
- package/dist_ts/state-owner.js +291 -0
- package/dist_ts/transfer-archive.d.ts +78 -0
- package/dist_ts/transfer-archive.js +1619 -0
- package/dist_ts/validation.d.ts +11 -0
- package/dist_ts/validation.js +79 -0
- package/dist_ts/vsock-protocol.d.ts +130 -0
- package/dist_ts/vsock-protocol.js +336 -0
- package/dist_ts/wire-schema.d.ts +10 -0
- package/dist_ts/wire-schema.js +114 -0
- package/native-notices/crates/bitflags-2.13.1/license-apache +201 -0
- package/native-notices/crates/bitflags-2.13.1/license-mit +25 -0
- package/native-notices/crates/cc-1.8.0/license-apache +201 -0
- package/native-notices/crates/cc-1.8.0/license-mit +25 -0
- package/native-notices/crates/cfg-if-1.0.4/license-apache +201 -0
- package/native-notices/crates/cfg-if-1.0.4/license-mit +25 -0
- package/native-notices/crates/cfg_aliases-0.2.2/license +9 -0
- package/native-notices/crates/cfg_aliases-0.2.2/notices.md +26 -0
- package/native-notices/crates/find-msvc-tools-0.1.14/license-apache +201 -0
- package/native-notices/crates/find-msvc-tools-0.1.14/license-mit +25 -0
- package/native-notices/crates/itoa-1.0.18/license-apache +176 -0
- package/native-notices/crates/itoa-1.0.18/license-mit +23 -0
- package/native-notices/crates/libc-0.2.189/license-apache +176 -0
- package/native-notices/crates/libc-0.2.189/license-mit +25 -0
- package/native-notices/crates/memchr-2.8.3/copying +3 -0
- package/native-notices/crates/memchr-2.8.3/license-mit +21 -0
- package/native-notices/crates/memchr-2.8.3/unlicense +24 -0
- package/native-notices/crates/nix-0.30.1/license +21 -0
- package/native-notices/crates/proc-macro2-1.0.107/license-apache +176 -0
- package/native-notices/crates/proc-macro2-1.0.107/license-mit +23 -0
- package/native-notices/crates/quote-1.0.47/license-apache +176 -0
- package/native-notices/crates/quote-1.0.47/license-mit +23 -0
- package/native-notices/crates/serde-1.0.229/license-apache +176 -0
- package/native-notices/crates/serde-1.0.229/license-mit +23 -0
- package/native-notices/crates/serde_core-1.0.229/license-apache +176 -0
- package/native-notices/crates/serde_core-1.0.229/license-mit +23 -0
- package/native-notices/crates/serde_derive-1.0.229/license-apache +176 -0
- package/native-notices/crates/serde_derive-1.0.229/license-mit +23 -0
- package/native-notices/crates/serde_json-1.0.151/license-apache +176 -0
- package/native-notices/crates/serde_json-1.0.151/license-mit +23 -0
- package/native-notices/crates/shlex-2.0.1/license-apache +13 -0
- package/native-notices/crates/shlex-2.0.1/license-mit +21 -0
- package/native-notices/crates/syn-3.0.3/license-apache +176 -0
- package/native-notices/crates/syn-3.0.3/license-mit +23 -0
- package/native-notices/crates/tikv-jemalloc-sys-0.7.1+5.3.1-0-g81034ce1f1373e37dc865038e1bc8eeecf559ce8/license-apache +201 -0
- package/native-notices/crates/tikv-jemalloc-sys-0.7.1+5.3.1-0-g81034ce1f1373e37dc865038e1bc8eeecf559ce8/license-mit +25 -0
- package/native-notices/crates/tikv-jemallocator-0.7.0/license-apache +201 -0
- package/native-notices/crates/tikv-jemallocator-0.7.0/license-mit +25 -0
- package/native-notices/crates/unicode-ident-1.0.24/license-apache +176 -0
- package/native-notices/crates/unicode-ident-1.0.24/license-mit +23 -0
- package/native-notices/crates/unicode-ident-1.0.24/license-unicode +39 -0
- package/native-notices/crates/zmij-1.0.23/license-mit +23 -0
- package/native-notices/manifest.json +763 -0
- package/native-notices/native/tikv-jemalloc-sys-0.7.1+5.3.1-0-g81034ce1f1373e37dc865038e1bc8eeecf559ce8/jemalloc-5.3.1/jemalloc-copying +27 -0
- package/native-notices/readme.md +46 -0
- package/native-notices/runtime/gcc/gpl-3.0.txt +674 -0
- package/native-notices/runtime/gcc/runtime-library-exception-3.1.txt +73 -0
- package/native-notices/runtime/libunwind-22.1.2/license.txt +311 -0
- package/native-notices/runtime/musl-1.2.5/copyright +193 -0
- package/native-notices/rust/compiler-builtins-license.txt +275 -0
- package/native-notices/rust/copyright-library.html +8266 -0
- package/native-notices/rust/crates/addr2line-0.25.1/license-apache +201 -0
- package/native-notices/rust/crates/addr2line-0.25.1/license-mit +25 -0
- package/native-notices/rust/crates/adler2-2.0.1/license-0bsd +12 -0
- package/native-notices/rust/crates/adler2-2.0.1/license-apache +201 -0
- package/native-notices/rust/crates/adler2-2.0.1/license-mit +23 -0
- package/native-notices/rust/crates/memchr-2.7.6/copying +3 -0
- package/native-notices/rust/crates/memchr-2.7.6/license-mit +21 -0
- package/native-notices/rust/crates/memchr-2.7.6/unlicense +24 -0
- package/native-notices/rust/crates/miniz_oxide-0.8.9/license +25 -0
- package/native-notices/rust/crates/miniz_oxide-0.8.9/license-apache.md +177 -0
- package/native-notices/rust/crates/miniz_oxide-0.8.9/license-mit.md +24 -0
- package/native-notices/rust/crates/miniz_oxide-0.8.9/license-zlib.md +14 -0
- package/native-notices/rust/crates/object-0.37.3/license-apache +201 -0
- package/native-notices/rust/crates/object-0.37.3/license-mit +25 -0
- package/native-notices/rust/licenses/apache-2.0.txt +73 -0
- package/native-notices/rust/licenses/bsd-2-clause.txt +9 -0
- package/native-notices/rust/licenses/cc-by-sa-4.0.txt +427 -0
- package/native-notices/rust/licenses/gcc-exception-3.1.txt +30 -0
- package/native-notices/rust/licenses/gpl-2.0-only.txt +133 -0
- package/native-notices/rust/licenses/gpl-3.0-or-later.txt +202 -0
- package/native-notices/rust/licenses/isc.txt +7 -0
- package/native-notices/rust/licenses/llvm-exception.txt +15 -0
- package/native-notices/rust/licenses/mit.txt +9 -0
- package/native-notices/rust/licenses/ncsa.txt +29 -0
- package/native-notices/rust/licenses/ofl-1.1.txt +43 -0
- package/native-notices/rust/licenses/unicode-3.0.txt +39 -0
- package/package.json +31 -26
- package/readme.md +157 -95
- package/rust/.cargo/config.toml +1 -1
- package/rust/Cargo.lock +1 -0
- package/rust/Cargo.toml +3 -2
- package/rust/src/cpio.rs +147 -0
- package/rust/src/extfs.rs +747 -0
- package/rust/src/guest.rs +2411 -0
- package/rust/src/lib.rs +197 -1
- package/rust/src/main.rs +7 -2
- package/rust/src/oci_tar.rs +842 -0
- package/rust-toolchain.toml +4 -0
- package/ts/00_commitinfo_data.ts +2 -2
- package/ts/api-client.ts +29 -8
- package/ts/artifact-manager.ts +9 -7
- package/ts/attempt-state.ts +75 -84
- package/ts/cache-manager.ts +22 -28
- package/ts/cli-entry.ts +17 -0
- package/ts/cli.ts +86 -53
- package/ts/config.ts +146 -62
- package/ts/egress-proxy.ts +649 -0
- package/ts/errors.ts +19 -0
- package/ts/filesystem.ts +316 -0
- package/ts/index.ts +20 -15
- package/ts/interfaces.ts +105 -23
- package/ts/log-sender.ts +4 -4
- package/ts/microvm-executor.ts +1265 -0
- package/ts/node-version.ts +49 -0
- package/ts/npm-grants.ts +49 -0
- package/ts/oci-registry.ts +649 -0
- package/ts/plugins.ts +25 -3
- package/ts/protocol-validator.ts +34 -30
- package/ts/redactor.ts +2 -2
- package/ts/registration-state.ts +82 -90
- package/ts/runner.ts +81 -34
- package/ts/source-workspace.ts +11 -8
- package/ts/spec-version.ts +2 -2
- package/ts/staging-scavenger.ts +37 -26
- package/ts/state-owner.ts +353 -0
- package/ts/transfer-archive.ts +214 -243
- package/ts/validation.ts +1 -1
- package/ts/vsock-protocol.ts +437 -0
- package/ts/wire-schema.ts +3 -3
- package/deno.json +0 -56
- package/deno.lock +0 -1495
- package/dist_npm/mod.d.ts +0 -967
- package/dist_npm/mod.js +0 -10058
- package/mod.ts +0 -8
- package/musl-copyright.md +0 -81
- package/third-party-licenses.md +0 -187
- package/ts/oci-executor.ts +0 -3137
|
@@ -0,0 +1,685 @@
|
|
|
1
|
+
export declare const runnerVersion: string;
|
|
2
|
+
export type TExecutionProfile = 'oci' | 'oci-image' | 'vm';
|
|
3
|
+
export type TRunnerRole = 'workload' | 'builder';
|
|
4
|
+
export type TIsolation = 'container' | 'microvm';
|
|
5
|
+
export type TRunnerFeature = 'source.tar-gz' | 'artifacts' | 'caches';
|
|
6
|
+
export type TLeaseFeature = 'image-pull-grants' | 'candidate-bindings' | 'npm-read-grants';
|
|
7
|
+
export type TNetworkMode = 'none' | 'egress';
|
|
8
|
+
export type TSourceFormat = 'tar.gz';
|
|
9
|
+
export type TArtifactPermission = 'none' | 'write';
|
|
10
|
+
export type TCachePermission = 'none' | 'read' | 'read-write';
|
|
11
|
+
export type TImagePermission = 'none' | 'push';
|
|
12
|
+
export type TCacheAccess = 'read' | 'read-write';
|
|
13
|
+
export type TArtifactWhen = 'always' | 'success' | 'failure';
|
|
14
|
+
export type TLogStream = 'stdout' | 'stderr' | 'runner';
|
|
15
|
+
export type TImageGrantAccess = 'pull' | 'push';
|
|
16
|
+
export type TJobCompletionStatus = 'succeeded' | 'failed' | 'canceled' | 'timed_out' | 'system_error';
|
|
17
|
+
export type TCancellationReason = 'user_requested' | 'superseded' | 'policy' | 'coordinator_shutdown';
|
|
18
|
+
export type TAbandonReason = 'runner_shutdown' | 'runner_error';
|
|
19
|
+
export type TJsonPrimitive = null | boolean | number | string;
|
|
20
|
+
export type TJsonValue = TJsonPrimitive | TJsonValue[] | {
|
|
21
|
+
[key: string]: TJsonValue;
|
|
22
|
+
};
|
|
23
|
+
export type TJsonObject = {
|
|
24
|
+
[key: string]: TJsonValue;
|
|
25
|
+
};
|
|
26
|
+
export interface IProtocolLimits {
|
|
27
|
+
maximumJsonBytes: number;
|
|
28
|
+
maximumLogChunkBytes: number;
|
|
29
|
+
maximumTotalLogBytes: number;
|
|
30
|
+
minimumLeaseSeconds: number;
|
|
31
|
+
maximumLeaseSeconds: number;
|
|
32
|
+
}
|
|
33
|
+
export interface IDiscoveryResponse {
|
|
34
|
+
spec: string;
|
|
35
|
+
basePath: '/api/runner';
|
|
36
|
+
status: 'draft';
|
|
37
|
+
serverTime: string;
|
|
38
|
+
limits: IProtocolLimits;
|
|
39
|
+
}
|
|
40
|
+
export interface IRunnerCredential {
|
|
41
|
+
credentialId: string;
|
|
42
|
+
runnerId: string;
|
|
43
|
+
token: string;
|
|
44
|
+
expiresAt: string;
|
|
45
|
+
previousCredentialValidUntil?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ITransferLimits {
|
|
48
|
+
maximumSourceArchiveBytes: number;
|
|
49
|
+
maximumSourceExtractedBytes: number;
|
|
50
|
+
maximumSourceEntries: number;
|
|
51
|
+
maximumArtifactArchiveBytes: number;
|
|
52
|
+
maximumArtifactExtractedBytes: number;
|
|
53
|
+
maximumArtifactEntries: number;
|
|
54
|
+
maximumArtifacts: number;
|
|
55
|
+
maximumCacheArchiveBytes: number;
|
|
56
|
+
maximumCacheExtractedBytes: number;
|
|
57
|
+
maximumCacheEntries: number;
|
|
58
|
+
maximumCaches: number;
|
|
59
|
+
maximumLogChunkBytes: number;
|
|
60
|
+
maximumTotalLogBytes: number;
|
|
61
|
+
maximumWorkspaceBytes: number;
|
|
62
|
+
maximumWorkspaceEntries: number;
|
|
63
|
+
}
|
|
64
|
+
export interface IResourceLimits {
|
|
65
|
+
maximumMemoryBytes: number;
|
|
66
|
+
maximumCpus: number;
|
|
67
|
+
maximumPids: number;
|
|
68
|
+
maximumSharedMemoryBytes: number;
|
|
69
|
+
}
|
|
70
|
+
export interface IRunnerCapabilities {
|
|
71
|
+
executionProfiles: TExecutionProfile[];
|
|
72
|
+
isolation: TIsolation[];
|
|
73
|
+
platforms: string[];
|
|
74
|
+
labels: string[];
|
|
75
|
+
features: TRunnerFeature[];
|
|
76
|
+
networks: TNetworkMode[];
|
|
77
|
+
sourceFormats: TSourceFormat[];
|
|
78
|
+
limits: ITransferLimits;
|
|
79
|
+
/** The largest resource ceilings the runner enforces per attempt. */
|
|
80
|
+
resources?: IResourceLimits;
|
|
81
|
+
/** The lease contents the runner uses. */
|
|
82
|
+
leaseFeatures?: TLeaseFeature[];
|
|
83
|
+
/** The largest job `timeoutMs` the runner executes. */
|
|
84
|
+
maximumTimeoutMs?: number;
|
|
85
|
+
}
|
|
86
|
+
export interface IRegisterRunnerRequest {
|
|
87
|
+
registrationRequestId: string;
|
|
88
|
+
spec: string;
|
|
89
|
+
runnerVersion: string;
|
|
90
|
+
name: string;
|
|
91
|
+
capabilities: IRunnerCapabilities;
|
|
92
|
+
}
|
|
93
|
+
export interface IRegisterRunnerResponse {
|
|
94
|
+
spec: string;
|
|
95
|
+
serverTime: string;
|
|
96
|
+
registrationReplayUntil: string;
|
|
97
|
+
credential: IRunnerCredential;
|
|
98
|
+
}
|
|
99
|
+
export interface IStartSessionRequest {
|
|
100
|
+
sessionRequestId: string;
|
|
101
|
+
runnerId: string;
|
|
102
|
+
spec: string;
|
|
103
|
+
runnerVersion: string;
|
|
104
|
+
capabilities: IRunnerCapabilities;
|
|
105
|
+
}
|
|
106
|
+
export interface IStartSessionResponse {
|
|
107
|
+
sessionId: string;
|
|
108
|
+
spec: string;
|
|
109
|
+
serverTime: string;
|
|
110
|
+
credential?: IRunnerCredential;
|
|
111
|
+
}
|
|
112
|
+
export interface IRunnerHeartbeatRequest {
|
|
113
|
+
runnerId: string;
|
|
114
|
+
sessionId: string;
|
|
115
|
+
}
|
|
116
|
+
export interface IRunnerHeartbeatResponse {
|
|
117
|
+
serverTime: string;
|
|
118
|
+
drainRequested: boolean;
|
|
119
|
+
credential?: IRunnerCredential;
|
|
120
|
+
}
|
|
121
|
+
export interface IClaimJobRequest {
|
|
122
|
+
claimRequestId: string;
|
|
123
|
+
runnerId: string;
|
|
124
|
+
sessionId: string;
|
|
125
|
+
capabilities: IRunnerCapabilities;
|
|
126
|
+
}
|
|
127
|
+
export interface IClaimJobResponse {
|
|
128
|
+
serverTime: string;
|
|
129
|
+
retryAfterMs?: number;
|
|
130
|
+
lease: unknown | null;
|
|
131
|
+
}
|
|
132
|
+
/** Attempt-scoped registry credential for one registry, repository, and access mode. */
|
|
133
|
+
export interface IImageGrant {
|
|
134
|
+
grantId: string;
|
|
135
|
+
access: TImageGrantAccess;
|
|
136
|
+
registry: string;
|
|
137
|
+
repository: string;
|
|
138
|
+
username: string;
|
|
139
|
+
secret: string;
|
|
140
|
+
expiresAt: string;
|
|
141
|
+
}
|
|
142
|
+
/** Resolution of one candidate reference of the job to a digest-pinned image. */
|
|
143
|
+
export interface IImageBinding {
|
|
144
|
+
candidate: string;
|
|
145
|
+
image: string;
|
|
146
|
+
}
|
|
147
|
+
/** Attempt-scoped read-only npm registry token for one `npmRead` entry of the job. */
|
|
148
|
+
export interface INpmGrant {
|
|
149
|
+
grantId: string;
|
|
150
|
+
registry: string;
|
|
151
|
+
scopes: string[];
|
|
152
|
+
secret: string;
|
|
153
|
+
expiresAt: string;
|
|
154
|
+
}
|
|
155
|
+
/** A lease exactly as the protocol defines it, for every execution profile. */
|
|
156
|
+
export interface IJobLease {
|
|
157
|
+
jobId: string;
|
|
158
|
+
attemptId: string;
|
|
159
|
+
leaseId: string;
|
|
160
|
+
fencingToken: string;
|
|
161
|
+
leaseExpiresAt: string;
|
|
162
|
+
job: TCompiledRunnerJob;
|
|
163
|
+
grants: IImageGrant[];
|
|
164
|
+
bindings: IImageBinding[];
|
|
165
|
+
npmGrants?: INpmGrant[];
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* A lease this runner executes in Firecracker `microvm` isolation (`oci`, `vm`, or `oci-image`),
|
|
169
|
+
* including optional attempt-scoped image grants, candidate bindings, and npm read grants.
|
|
170
|
+
*/
|
|
171
|
+
export interface IOciJobLease extends Omit<IJobLease, 'job'> {
|
|
172
|
+
job: TExecutableRunnerJob;
|
|
173
|
+
}
|
|
174
|
+
export interface IJobIdentity {
|
|
175
|
+
runnerId: string;
|
|
176
|
+
sessionId: string;
|
|
177
|
+
jobId: string;
|
|
178
|
+
attemptId: string;
|
|
179
|
+
leaseId: string;
|
|
180
|
+
fencingToken: string;
|
|
181
|
+
}
|
|
182
|
+
export interface IAcceptJobRequest {
|
|
183
|
+
acceptRequestId: string;
|
|
184
|
+
identity: IJobIdentity;
|
|
185
|
+
}
|
|
186
|
+
export interface IJobHeartbeatRequest {
|
|
187
|
+
identity: IJobIdentity;
|
|
188
|
+
observedCancellationRequestId?: string;
|
|
189
|
+
}
|
|
190
|
+
export interface ICancellationDirective {
|
|
191
|
+
requestId: string;
|
|
192
|
+
requestedAt: string;
|
|
193
|
+
reason: TCancellationReason;
|
|
194
|
+
terminateBy: string;
|
|
195
|
+
}
|
|
196
|
+
export interface IJobHeartbeatResponse {
|
|
197
|
+
serverTime: string;
|
|
198
|
+
leaseExpiresAt: string;
|
|
199
|
+
cancellation?: ICancellationDirective;
|
|
200
|
+
}
|
|
201
|
+
export interface ILogChunk {
|
|
202
|
+
identity: IJobIdentity;
|
|
203
|
+
sequence: number;
|
|
204
|
+
stream: TLogStream;
|
|
205
|
+
data: string;
|
|
206
|
+
timestamp: string;
|
|
207
|
+
}
|
|
208
|
+
export interface ILogAcknowledgement {
|
|
209
|
+
serverTime: string;
|
|
210
|
+
nextSequence: number;
|
|
211
|
+
}
|
|
212
|
+
export interface ICompleteJobRequest {
|
|
213
|
+
completionRequestId: string;
|
|
214
|
+
identity: IJobIdentity;
|
|
215
|
+
status: TJobCompletionStatus;
|
|
216
|
+
exitCode: number | null;
|
|
217
|
+
startedAt: string;
|
|
218
|
+
completedAt: string;
|
|
219
|
+
cancellationRequestId?: string;
|
|
220
|
+
error?: string;
|
|
221
|
+
}
|
|
222
|
+
export interface ICompleteJobResponse {
|
|
223
|
+
serverTime: string;
|
|
224
|
+
accepted: true;
|
|
225
|
+
}
|
|
226
|
+
export interface IAbandonJobRequest {
|
|
227
|
+
abandonRequestId: string;
|
|
228
|
+
identity: IJobIdentity;
|
|
229
|
+
reason: TAbandonReason;
|
|
230
|
+
}
|
|
231
|
+
export interface IRecoverAttemptRequest {
|
|
232
|
+
recoveryRequestId: string;
|
|
233
|
+
runnerId: string;
|
|
234
|
+
currentSessionId: string;
|
|
235
|
+
previousSessionId: string;
|
|
236
|
+
jobId: string;
|
|
237
|
+
attemptId: string;
|
|
238
|
+
reason: 'runner_restarted';
|
|
239
|
+
}
|
|
240
|
+
export interface IRecordImageRequest {
|
|
241
|
+
recordRequestId: string;
|
|
242
|
+
identity: IJobIdentity;
|
|
243
|
+
manifestDigest: string;
|
|
244
|
+
mediaType: 'application/vnd.oci.image.manifest.v1+json';
|
|
245
|
+
sizeBytes: number;
|
|
246
|
+
platform: string;
|
|
247
|
+
}
|
|
248
|
+
export interface IImageRecord {
|
|
249
|
+
registry: string;
|
|
250
|
+
repository: string;
|
|
251
|
+
manifestDigest: string;
|
|
252
|
+
mediaType: 'application/vnd.oci.image.manifest.v1+json';
|
|
253
|
+
sizeBytes: number;
|
|
254
|
+
platform: string;
|
|
255
|
+
createdAt: string;
|
|
256
|
+
}
|
|
257
|
+
export interface IProducedImageManifest {
|
|
258
|
+
readonly manifestDigest: string;
|
|
259
|
+
readonly mediaType: 'application/vnd.oci.image.manifest.v1+json';
|
|
260
|
+
readonly sizeBytes: number;
|
|
261
|
+
readonly platform: string;
|
|
262
|
+
}
|
|
263
|
+
export interface ITransferRecord {
|
|
264
|
+
name: string;
|
|
265
|
+
format: 'tar.gz';
|
|
266
|
+
sha256: string;
|
|
267
|
+
sizeBytes: number;
|
|
268
|
+
extractedSizeBytes: number;
|
|
269
|
+
entryCount: number;
|
|
270
|
+
createdAt: string;
|
|
271
|
+
}
|
|
272
|
+
export interface IErrorResponse {
|
|
273
|
+
error: {
|
|
274
|
+
code: string;
|
|
275
|
+
message: string;
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
export interface IJobRequirements {
|
|
279
|
+
executionProfile: TExecutionProfile;
|
|
280
|
+
isolation: TIsolation;
|
|
281
|
+
platform?: string;
|
|
282
|
+
labels: string[];
|
|
283
|
+
features: TRunnerFeature[];
|
|
284
|
+
limits: ITransferLimits;
|
|
285
|
+
}
|
|
286
|
+
export interface IJobPermissions {
|
|
287
|
+
source: 'read';
|
|
288
|
+
artifacts: TArtifactPermission;
|
|
289
|
+
caches: TCachePermission;
|
|
290
|
+
images: TImagePermission;
|
|
291
|
+
}
|
|
292
|
+
export interface IEgressRule {
|
|
293
|
+
host: string;
|
|
294
|
+
ports: number[];
|
|
295
|
+
}
|
|
296
|
+
export interface INoNetwork {
|
|
297
|
+
mode: 'none';
|
|
298
|
+
}
|
|
299
|
+
export interface IEgressNetwork {
|
|
300
|
+
mode: 'egress';
|
|
301
|
+
allow: IEgressRule[];
|
|
302
|
+
}
|
|
303
|
+
export type TJobNetwork = INoNetwork | IEgressNetwork;
|
|
304
|
+
export interface ICandidateReference {
|
|
305
|
+
candidate: string;
|
|
306
|
+
}
|
|
307
|
+
export type TImageReference = string | ICandidateReference;
|
|
308
|
+
export interface IOciExecution {
|
|
309
|
+
profile: 'oci';
|
|
310
|
+
image: TImageReference;
|
|
311
|
+
workingDirectory?: string;
|
|
312
|
+
}
|
|
313
|
+
export interface IVmExecution {
|
|
314
|
+
profile: 'vm';
|
|
315
|
+
image: TImageReference;
|
|
316
|
+
workingDirectory?: string;
|
|
317
|
+
}
|
|
318
|
+
export interface IBuildSecret {
|
|
319
|
+
id: string;
|
|
320
|
+
environment: string;
|
|
321
|
+
}
|
|
322
|
+
export interface IBaseImage {
|
|
323
|
+
name: string;
|
|
324
|
+
image: TImageReference;
|
|
325
|
+
}
|
|
326
|
+
export interface IImageBuild {
|
|
327
|
+
context: string;
|
|
328
|
+
dockerfile: string;
|
|
329
|
+
target?: string;
|
|
330
|
+
buildArgs: Record<string, string>;
|
|
331
|
+
secrets: IBuildSecret[];
|
|
332
|
+
labels: Record<string, string>;
|
|
333
|
+
baseImages: IBaseImage[];
|
|
334
|
+
}
|
|
335
|
+
export interface ICompiledStep {
|
|
336
|
+
name?: string;
|
|
337
|
+
command: string[];
|
|
338
|
+
environment: Record<string, string>;
|
|
339
|
+
}
|
|
340
|
+
export interface IJobSource {
|
|
341
|
+
format: 'tar.gz';
|
|
342
|
+
sha256: string;
|
|
343
|
+
sizeBytes: number;
|
|
344
|
+
extractedSizeBytes: number;
|
|
345
|
+
entryCount: number;
|
|
346
|
+
}
|
|
347
|
+
export interface IJobResources {
|
|
348
|
+
memoryBytes?: number;
|
|
349
|
+
cpus?: number;
|
|
350
|
+
pids?: number;
|
|
351
|
+
sharedMemoryBytes?: number;
|
|
352
|
+
}
|
|
353
|
+
export interface INpmReadEntry {
|
|
354
|
+
registry: string;
|
|
355
|
+
scopes: string[];
|
|
356
|
+
}
|
|
357
|
+
export interface IArtifactDeclaration {
|
|
358
|
+
name: string;
|
|
359
|
+
path: string;
|
|
360
|
+
format: 'tar.gz';
|
|
361
|
+
when: TArtifactWhen;
|
|
362
|
+
required: boolean;
|
|
363
|
+
maximumBytes: number;
|
|
364
|
+
maximumExtractedBytes: number;
|
|
365
|
+
maximumEntries: number;
|
|
366
|
+
retentionDays?: number;
|
|
367
|
+
}
|
|
368
|
+
export interface IBuildCacheDeclaration {
|
|
369
|
+
name: string;
|
|
370
|
+
key: string;
|
|
371
|
+
access: TCacheAccess;
|
|
372
|
+
maximumBytes: number;
|
|
373
|
+
maximumExtractedBytes: number;
|
|
374
|
+
maximumEntries: number;
|
|
375
|
+
retentionDays?: number;
|
|
376
|
+
}
|
|
377
|
+
export interface ICacheDeclaration extends IBuildCacheDeclaration {
|
|
378
|
+
paths: string[];
|
|
379
|
+
}
|
|
380
|
+
interface ICompiledRunnerJobBase {
|
|
381
|
+
spec: string;
|
|
382
|
+
sourceObjectId: string;
|
|
383
|
+
workflowDigest: string;
|
|
384
|
+
compiledPlanDigest: string;
|
|
385
|
+
requirements: IJobRequirements;
|
|
386
|
+
permissions: IJobPermissions;
|
|
387
|
+
network: TJobNetwork;
|
|
388
|
+
source: IJobSource;
|
|
389
|
+
secrets: Record<string, string>;
|
|
390
|
+
timeoutMs: number;
|
|
391
|
+
resources?: IJobResources;
|
|
392
|
+
npmRead?: INpmReadEntry[];
|
|
393
|
+
artifacts: IArtifactDeclaration[];
|
|
394
|
+
}
|
|
395
|
+
/** A compiled `oci` job: ordered argument-array steps in fresh containers. */
|
|
396
|
+
export interface IContainerRunnerJob extends ICompiledRunnerJobBase {
|
|
397
|
+
execution: IOciExecution;
|
|
398
|
+
steps: ICompiledStep[];
|
|
399
|
+
caches: ICacheDeclaration[];
|
|
400
|
+
}
|
|
401
|
+
/** A compiled `vm` job: ordered steps as root in one microVM guest per attempt. */
|
|
402
|
+
export interface IVmRunnerJob extends ICompiledRunnerJobBase {
|
|
403
|
+
execution: IVmExecution;
|
|
404
|
+
steps: ICompiledStep[];
|
|
405
|
+
caches: ICacheDeclaration[];
|
|
406
|
+
}
|
|
407
|
+
/** A compiled `oci-image` job: one single-platform image build in a microVM guest. */
|
|
408
|
+
export interface IImageBuildRunnerJob extends ICompiledRunnerJobBase {
|
|
409
|
+
build: IImageBuild;
|
|
410
|
+
caches: IBuildCacheDeclaration[];
|
|
411
|
+
}
|
|
412
|
+
/** Every compiled job shape the published runner job schema admits. */
|
|
413
|
+
export type TCompiledRunnerJob = IContainerRunnerJob | IVmRunnerJob | IImageBuildRunnerJob;
|
|
414
|
+
/** An `oci` job this runner executes in Firecracker `microvm` isolation. */
|
|
415
|
+
export interface IOciRunnerJob extends IContainerRunnerJob {
|
|
416
|
+
requirements: IJobRequirements & {
|
|
417
|
+
executionProfile: 'oci';
|
|
418
|
+
isolation: 'microvm';
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
/** A `vm` job this runner executes in Firecracker `microvm` isolation. */
|
|
422
|
+
export interface IVmExecutableRunnerJob extends IVmRunnerJob {
|
|
423
|
+
requirements: IJobRequirements & {
|
|
424
|
+
executionProfile: 'vm';
|
|
425
|
+
isolation: 'microvm';
|
|
426
|
+
platform: string;
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
/** An `oci-image` job this runner executes in a dedicated builder Firecracker microVM. */
|
|
430
|
+
export interface IImageBuildExecutableRunnerJob extends IImageBuildRunnerJob {
|
|
431
|
+
requirements: IJobRequirements & {
|
|
432
|
+
executionProfile: 'oci-image';
|
|
433
|
+
isolation: 'microvm';
|
|
434
|
+
platform: string;
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
/** Every compiled job shape this Firecracker runner can execute across workload and builder roles. */
|
|
438
|
+
export type TExecutableRunnerJob = IOciRunnerJob | IVmExecutableRunnerJob | IImageBuildExecutableRunnerJob;
|
|
439
|
+
export interface ITransferMetadata {
|
|
440
|
+
sha256: string;
|
|
441
|
+
sizeBytes: number;
|
|
442
|
+
extractedSizeBytes: number;
|
|
443
|
+
entryCount: number;
|
|
444
|
+
}
|
|
445
|
+
export interface ITransferDownload extends ITransferMetadata {
|
|
446
|
+
body: ReadableStream<Uint8Array>;
|
|
447
|
+
}
|
|
448
|
+
export interface ICacheDownloadMiss {
|
|
449
|
+
hit: false;
|
|
450
|
+
}
|
|
451
|
+
export interface ICacheDownloadHit extends ITransferDownload {
|
|
452
|
+
hit: true;
|
|
453
|
+
}
|
|
454
|
+
export type TCacheDownload = ICacheDownloadMiss | ICacheDownloadHit;
|
|
455
|
+
export type TOpenTransferBody = () => ReadableStream<Uint8Array> | Promise<ReadableStream<Uint8Array>>;
|
|
456
|
+
export interface ITransferManagerConfig {
|
|
457
|
+
stateDirectory: string;
|
|
458
|
+
transferStagingReserveBytes: number;
|
|
459
|
+
transferStagingReserveInodes: number;
|
|
460
|
+
maximumSourceArchiveBytes: number;
|
|
461
|
+
maximumSourceExtractedBytes: number;
|
|
462
|
+
maximumSourceEntries: number;
|
|
463
|
+
maximumArtifactBytes: number;
|
|
464
|
+
maximumArtifactExtractedBytes: number;
|
|
465
|
+
maximumArtifactEntries: number;
|
|
466
|
+
maximumArtifacts: number;
|
|
467
|
+
maximumCacheArchiveBytes: number;
|
|
468
|
+
maximumCacheExtractedBytes: number;
|
|
469
|
+
maximumCacheEntries: number;
|
|
470
|
+
maximumCaches: number;
|
|
471
|
+
maximumWorkspaceEntries: number;
|
|
472
|
+
oci: Pick<IOciExecutorConfig, 'workspaceSizeBytes'>;
|
|
473
|
+
}
|
|
474
|
+
export type TExecutionStopReason = 'job_canceled' | 'lease_lost' | 'lease_expired' | 'runner_shutdown' | 'job_timeout' | 'log_delivery_failed' | 'resource_limit';
|
|
475
|
+
export type TOciArchitecture = 'amd64' | 'arm64';
|
|
476
|
+
export type TOciHelperTarget = 'linux_amd64' | 'linux_arm64';
|
|
477
|
+
export interface IOciExecutorConfig {
|
|
478
|
+
/**
|
|
479
|
+
* Dedicated runner role per `@ship.zone/ci-spec`:
|
|
480
|
+
* - `'workload'`: executes `oci` and `vm` jobs (never `oci-image`).
|
|
481
|
+
* - `'builder'`: executes `oci-image` container builds exclusively (never `oci` or `vm`).
|
|
482
|
+
*/
|
|
483
|
+
runnerProfile: TRunnerRole;
|
|
484
|
+
/** Pinned Linux vmlinux kernel path for Firecracker microVMs. */
|
|
485
|
+
kernelPath: string;
|
|
486
|
+
/** Pinned ext2 guest rootfs containing rootless BuildKit (`buildkitd` + `buildctl`) for `builder` runners. */
|
|
487
|
+
builderRootfsPath?: string;
|
|
488
|
+
/** Optional override for the `buildctl` binary path inside the builder guest. */
|
|
489
|
+
buildctlPath?: string;
|
|
490
|
+
/** Optional smartvm-helper Unix socket path (defaults to `/run/smartvm/helper.sock`). */
|
|
491
|
+
smartvmSocketPath?: string;
|
|
492
|
+
/** Optional smartvm-bridge runtime directory for vsock relay sockets. */
|
|
493
|
+
smartvmRuntimeDir?: string;
|
|
494
|
+
/** Optional explicit path to the smartvm-bridge binary. */
|
|
495
|
+
smartvmBridgePath?: string;
|
|
496
|
+
/** Kernel boot arguments passed to Firecracker. */
|
|
497
|
+
bootArgs: string;
|
|
498
|
+
/** Maximum extracted OCI rootfs image bytes accepted during image materialization. */
|
|
499
|
+
maximumRootfsBytes: number;
|
|
500
|
+
/** Guest memory headroom reserved for the guest kernel and init agent on top of step memory. */
|
|
501
|
+
guestMemoryOverheadBytes: number;
|
|
502
|
+
/** Extra internal CIDRs blocked by the host egress proxy (e.g. coordinator network ranges). */
|
|
503
|
+
egressBlockedCidrs: string[];
|
|
504
|
+
workspaceHelperPath?: string;
|
|
505
|
+
allowedNetworks: TNetworkMode[];
|
|
506
|
+
containerUser: string;
|
|
507
|
+
defaultTimeoutMs: number;
|
|
508
|
+
maximumTimeoutMs: number;
|
|
509
|
+
defaultMemoryBytes: number;
|
|
510
|
+
maximumMemoryBytes: number;
|
|
511
|
+
defaultCpus: number;
|
|
512
|
+
maximumCpus: number;
|
|
513
|
+
defaultPids: number;
|
|
514
|
+
maximumPids: number;
|
|
515
|
+
defaultSharedMemoryBytes: number;
|
|
516
|
+
maximumSharedMemoryBytes: number;
|
|
517
|
+
workspaceSizeBytes: number;
|
|
518
|
+
temporarySizeBytes: number;
|
|
519
|
+
stopTimeoutSeconds: number;
|
|
520
|
+
}
|
|
521
|
+
export interface IRunnerConfig extends ITransferManagerConfig {
|
|
522
|
+
controlPlaneUrl: string;
|
|
523
|
+
allowInsecureLoopback: boolean;
|
|
524
|
+
name: string;
|
|
525
|
+
labels: string[];
|
|
526
|
+
bootstrapToken?: string;
|
|
527
|
+
runnerId?: string;
|
|
528
|
+
runnerCredentialId?: string;
|
|
529
|
+
runnerToken?: string;
|
|
530
|
+
runnerTokenExpiresAt?: string;
|
|
531
|
+
pollIntervalMs: number;
|
|
532
|
+
runnerHeartbeatIntervalMs: number;
|
|
533
|
+
jobHeartbeatIntervalMs: number;
|
|
534
|
+
leaseSafetyMarginMs: number;
|
|
535
|
+
requestTimeoutMs: number;
|
|
536
|
+
maximumResponseBytes: number;
|
|
537
|
+
sourceTransferTimeoutMs: number;
|
|
538
|
+
maximumLogBytes: number;
|
|
539
|
+
maximumLogChunkBytes: number;
|
|
540
|
+
artifactUploadTimeoutMs: number;
|
|
541
|
+
cacheTransferTimeoutMs: number;
|
|
542
|
+
maximumEnvironmentVariables: number;
|
|
543
|
+
maximumEnvironmentValueBytes: number;
|
|
544
|
+
maximumSecretBytes: number;
|
|
545
|
+
oci: IOciExecutorConfig;
|
|
546
|
+
}
|
|
547
|
+
export interface IExecutionContext {
|
|
548
|
+
runnerId: string;
|
|
549
|
+
sessionId: string;
|
|
550
|
+
lease: IOciJobLease;
|
|
551
|
+
preparedLease: IPreparedOciLease;
|
|
552
|
+
workspacePath: string;
|
|
553
|
+
/**
|
|
554
|
+
* Milliseconds left until the attempt deadline when execution starts: the job `timeoutMs`
|
|
555
|
+
* counted from the acceptance 204, less the time source extraction and cache restoration took.
|
|
556
|
+
*/
|
|
557
|
+
timeoutMs: number;
|
|
558
|
+
signal: AbortSignal;
|
|
559
|
+
terminationDeadline?: () => number | undefined;
|
|
560
|
+
onLog: (stream: 'stdout' | 'stderr', data: string) => Promise<void>;
|
|
561
|
+
}
|
|
562
|
+
export interface IMicroVmShapeInfo {
|
|
563
|
+
readonly id: string;
|
|
564
|
+
readonly vcpus: number;
|
|
565
|
+
readonly memMib: number;
|
|
566
|
+
}
|
|
567
|
+
export interface IOciRuntimeFacts {
|
|
568
|
+
readonly engine: 'firecracker';
|
|
569
|
+
readonly firecrackerVersion: string;
|
|
570
|
+
readonly endpoint: string;
|
|
571
|
+
readonly os: 'linux';
|
|
572
|
+
readonly architecture: TOciArchitecture;
|
|
573
|
+
readonly helperTarget: TOciHelperTarget;
|
|
574
|
+
readonly helperPath: string;
|
|
575
|
+
readonly helperSha256: string;
|
|
576
|
+
readonly initrdPath: string;
|
|
577
|
+
readonly kernelPath: string;
|
|
578
|
+
readonly shapes: readonly IMicroVmShapeInfo[];
|
|
579
|
+
}
|
|
580
|
+
export interface IPrepareOciLeaseContext {
|
|
581
|
+
runnerId: string;
|
|
582
|
+
sessionId: string;
|
|
583
|
+
lease: IOciJobLease;
|
|
584
|
+
signal: AbortSignal;
|
|
585
|
+
}
|
|
586
|
+
export interface IPreparedOciLease {
|
|
587
|
+
readonly preparationId: string;
|
|
588
|
+
readonly attemptId: string;
|
|
589
|
+
readonly image: string;
|
|
590
|
+
readonly imageArchitecture: TOciArchitecture;
|
|
591
|
+
readonly rootfsPath?: string;
|
|
592
|
+
readonly imageDigest?: string;
|
|
593
|
+
readonly shapeId?: string;
|
|
594
|
+
readonly defaultEnv?: Record<string, string>;
|
|
595
|
+
readonly defaultWorkingDir?: string;
|
|
596
|
+
cleanup(): Promise<void>;
|
|
597
|
+
}
|
|
598
|
+
export interface IWorkspaceTreeMetadata {
|
|
599
|
+
logicalBytes: number;
|
|
600
|
+
entryCount: number;
|
|
601
|
+
}
|
|
602
|
+
export interface IWorkspaceExportRequest {
|
|
603
|
+
selections: string[];
|
|
604
|
+
maximumBytes: number;
|
|
605
|
+
maximumEntries: number;
|
|
606
|
+
signal?: AbortSignal;
|
|
607
|
+
}
|
|
608
|
+
export interface IWorkspaceExport {
|
|
609
|
+
path: string;
|
|
610
|
+
metadata: IWorkspaceTreeMetadata;
|
|
611
|
+
cleanup(): Promise<void>;
|
|
612
|
+
}
|
|
613
|
+
export interface IRuntimeWorkspaceExporter {
|
|
614
|
+
exportSelected(request: IWorkspaceExportRequest): Promise<IWorkspaceExport>;
|
|
615
|
+
cleanup(): Promise<void>;
|
|
616
|
+
}
|
|
617
|
+
export interface IExecutionResult {
|
|
618
|
+
exitCode: number | null;
|
|
619
|
+
stopReason?: TExecutionStopReason;
|
|
620
|
+
producedImage?: IProducedImageManifest;
|
|
621
|
+
workspace?: IRuntimeWorkspaceExporter;
|
|
622
|
+
}
|
|
623
|
+
export interface IJobExecutor {
|
|
624
|
+
verifyRuntime(): Promise<IOciRuntimeFacts>;
|
|
625
|
+
prepareLease(context: IPrepareOciLeaseContext): Promise<IPreparedOciLease>;
|
|
626
|
+
reconcileOrphans(runnerId: string, currentSessionId: string): Promise<void>;
|
|
627
|
+
execute(context: IExecutionContext): Promise<IExecutionResult>;
|
|
628
|
+
}
|
|
629
|
+
export interface IPreparedWorkspace {
|
|
630
|
+
path: string;
|
|
631
|
+
metadata: IWorkspaceTreeMetadata;
|
|
632
|
+
materializedEntryCount: number;
|
|
633
|
+
cleanup(): Promise<void>;
|
|
634
|
+
}
|
|
635
|
+
export interface ISourcePrepareContext {
|
|
636
|
+
identity: IJobIdentity;
|
|
637
|
+
job: Pick<TExecutableRunnerJob, 'source' | 'permissions' | 'requirements'>;
|
|
638
|
+
signal: AbortSignal;
|
|
639
|
+
}
|
|
640
|
+
export interface IRunnerRunResult {
|
|
641
|
+
claimed: boolean;
|
|
642
|
+
status?: TJobCompletionStatus;
|
|
643
|
+
}
|
|
644
|
+
/** A streaming check of bytes against the attempt's redaction set. */
|
|
645
|
+
export interface ISecretContentMatcher {
|
|
646
|
+
/** Feeds bytes and returns whether a member has occurred anywhere in the stream so far. */
|
|
647
|
+
push(bytes: Uint8Array): boolean;
|
|
648
|
+
}
|
|
649
|
+
/** The attempt's redaction set as the archive publication check consumes it. */
|
|
650
|
+
export interface ISecretRedactionSet {
|
|
651
|
+
readonly empty: boolean;
|
|
652
|
+
occursIn(text: string): boolean;
|
|
653
|
+
createContentMatcher(): ISecretContentMatcher;
|
|
654
|
+
}
|
|
655
|
+
export interface IArtifactUploadContext {
|
|
656
|
+
workspace: IRuntimeWorkspaceExporter;
|
|
657
|
+
job: Pick<IOciRunnerJob | IVmExecutableRunnerJob, 'artifacts' | 'permissions' | 'requirements'>;
|
|
658
|
+
status: TJobCompletionStatus;
|
|
659
|
+
redactionSet: ISecretRedactionSet;
|
|
660
|
+
identity: IJobIdentity;
|
|
661
|
+
signal: AbortSignal;
|
|
662
|
+
}
|
|
663
|
+
export interface IArtifactManager {
|
|
664
|
+
upload(context: IArtifactUploadContext): Promise<void>;
|
|
665
|
+
}
|
|
666
|
+
export interface ICacheRestoreContext {
|
|
667
|
+
workspacePath: string;
|
|
668
|
+
workspaceEntryCount: number;
|
|
669
|
+
job: Pick<IOciRunnerJob | IVmExecutableRunnerJob, 'caches' | 'permissions' | 'requirements' | 'source'>;
|
|
670
|
+
identity: IJobIdentity;
|
|
671
|
+
signal: AbortSignal;
|
|
672
|
+
}
|
|
673
|
+
export interface ICacheSaveContext {
|
|
674
|
+
workspace: IRuntimeWorkspaceExporter;
|
|
675
|
+
job: Pick<IOciRunnerJob | IVmExecutableRunnerJob, 'caches' | 'permissions' | 'requirements'>;
|
|
676
|
+
status: TJobCompletionStatus;
|
|
677
|
+
redactionSet: ISecretRedactionSet;
|
|
678
|
+
identity: IJobIdentity;
|
|
679
|
+
signal: AbortSignal;
|
|
680
|
+
}
|
|
681
|
+
export interface ICacheManager {
|
|
682
|
+
restore(context: ICacheRestoreContext): Promise<void>;
|
|
683
|
+
save(context: ICacheSaveContext): Promise<void>;
|
|
684
|
+
}
|
|
685
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { commitinfo } from './00_commitinfo_data.js';
|
|
2
|
+
export const runnerVersion = commitinfo.version;
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRXJELE1BQU0sQ0FBQyxNQUFNLGFBQWEsR0FBVyxVQUFVLENBQUMsT0FBTyxDQUFDIn0=
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IJobIdentity, ILogAcknowledgement, ILogChunk } from './interfaces.js';
|
|
2
|
+
import { type SecretRedactionSet } from './redactor.js';
|
|
3
|
+
export interface ILogApi {
|
|
4
|
+
appendLog(chunk: ILogChunk, signal?: AbortSignal): Promise<ILogAcknowledgement>;
|
|
5
|
+
}
|
|
6
|
+
export declare class LogSender {
|
|
7
|
+
private readonly api;
|
|
8
|
+
private readonly identity;
|
|
9
|
+
private readonly maximumBytes;
|
|
10
|
+
private readonly maximumChunkBytes;
|
|
11
|
+
private readonly signal?;
|
|
12
|
+
private readonly redactors;
|
|
13
|
+
private readonly sequenceRedactor;
|
|
14
|
+
private sequence;
|
|
15
|
+
private sentBytes;
|
|
16
|
+
private operationQueue;
|
|
17
|
+
private terminalError;
|
|
18
|
+
private observationSequence;
|
|
19
|
+
private readonly lastObservation;
|
|
20
|
+
constructor(api: ILogApi, identity: IJobIdentity, redactionSet: SecretRedactionSet, maximumBytes: number, maximumChunkBytes: number, signal?: AbortSignal | undefined);
|
|
21
|
+
write(stream: 'stdout' | 'stderr', rawData: string): Promise<void>;
|
|
22
|
+
writeRunnerMessage(data: string): Promise<void>;
|
|
23
|
+
flush(): Promise<void>;
|
|
24
|
+
private schedule;
|
|
25
|
+
private sendBatch;
|
|
26
|
+
}
|