@ship.zone/runner 3.0.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 +19 -1
- package/changelog.md +43 -0
- package/dist_rust/runnerworkspace_linux_amd64_musl +0 -0
- package/dist_rust/runnerworkspace_linux_amd64_musl.tsrust-build.json +4 -4
- package/dist_rust/runnerworkspace_linux_arm64_musl +0 -0
- package/dist_rust/runnerworkspace_linux_arm64_musl.tsrust-build.json +4 -4
- package/dist_ts/00_commitinfo_data.js +3 -3
- package/dist_ts/api-client.d.ts +2 -1
- package/dist_ts/api-client.js +10 -2
- package/dist_ts/artifact-manager.js +1 -1
- package/dist_ts/attempt-state.js +1 -1
- package/dist_ts/cache-manager.js +1 -1
- package/dist_ts/cli-entry.js +17 -3
- package/dist_ts/cli.js +39 -11
- package/dist_ts/config.js +70 -20
- package/dist_ts/egress-proxy.d.ts +99 -0
- package/dist_ts/egress-proxy.js +607 -0
- package/dist_ts/errors.js +1 -1
- package/dist_ts/filesystem.js +1 -1
- package/dist_ts/index.d.ts +5 -1
- package/dist_ts/index.js +6 -2
- package/dist_ts/interfaces.d.ts +93 -22
- package/dist_ts/interfaces.js +1 -1
- package/dist_ts/log-sender.js +1 -1
- 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 +6 -2
- package/dist_ts/plugins.js +7 -3
- package/dist_ts/protocol-validator.d.ts +3 -3
- package/dist_ts/protocol-validator.js +26 -21
- package/dist_ts/redactor.js +1 -1
- package/dist_ts/registration-state.js +1 -1
- package/dist_ts/runner.d.ts +6 -5
- package/dist_ts/runner.js +48 -18
- package/dist_ts/source-workspace.js +1 -1
- package/dist_ts/spec-version.js +1 -1
- package/dist_ts/staging-scavenger.js +1 -1
- package/dist_ts/state-owner.js +4 -2
- package/dist_ts/transfer-archive.js +1 -1
- package/dist_ts/validation.js +1 -1
- package/dist_ts/vsock-protocol.d.ts +130 -0
- package/dist_ts/vsock-protocol.js +336 -0
- package/dist_ts/wire-schema.js +1 -1
- package/package.json +9 -6
- package/readme.md +72 -61
- package/rust/Cargo.lock +1 -0
- package/rust/Cargo.toml +2 -1
- 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 +41 -0
- package/rust/src/main.rs +6 -1
- package/rust/src/oci_tar.rs +842 -0
- package/ts/00_commitinfo_data.ts +2 -2
- package/ts/api-client.ts +19 -1
- package/ts/cli-entry.ts +15 -2
- package/ts/cli.ts +33 -11
- package/ts/config.ts +96 -23
- package/ts/egress-proxy.ts +649 -0
- package/ts/index.ts +5 -1
- package/ts/interfaces.ts +103 -21
- 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 +6 -2
- package/ts/protocol-validator.ts +29 -25
- package/ts/runner.ts +51 -17
- package/ts/state-owner.ts +8 -1
- package/ts/vsock-protocol.ts +437 -0
- package/dist_ts/oci-executor.d.ts +0 -155
- package/dist_ts/oci-executor.js +0 -2238
- package/ts/oci-executor.ts +0 -2989
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { type RunnerStateOwner } from './state-owner.js';
|
|
2
|
-
import type { ICompiledStep, IExecutionContext, IExecutionResult, IJobExecutor, IOciExecutorConfig, IOciJobLease, IOciRuntimeFacts, IPreparedOciLease, IPrepareOciLeaseContext, IRunnerConfig, TOciHelperTarget } from './interfaces.js';
|
|
3
|
-
export declare const workspaceHelperReserveBytes: number;
|
|
4
|
-
export declare const workspaceFixedInodes = 3;
|
|
5
|
-
export interface IOciRuntimeCommandRequest {
|
|
6
|
-
executable: string;
|
|
7
|
-
args: string[];
|
|
8
|
-
environment: Record<string, string>;
|
|
9
|
-
timeoutMs: number;
|
|
10
|
-
signal?: AbortSignal;
|
|
11
|
-
maximumOutputBytes?: number;
|
|
12
|
-
onOutput?: (stream: 'stdout' | 'stderr', chunk: Uint8Array) => Promise<void>;
|
|
13
|
-
}
|
|
14
|
-
export interface IOciRuntimeCommandResult {
|
|
15
|
-
success: boolean;
|
|
16
|
-
code: number;
|
|
17
|
-
stdout: Uint8Array;
|
|
18
|
-
stderr: Uint8Array;
|
|
19
|
-
}
|
|
20
|
-
export type TOciRuntimeCommandRunner = (request: IOciRuntimeCommandRequest) => Promise<IOciRuntimeCommandResult>;
|
|
21
|
-
export interface IRuntimeMakeTempOptions {
|
|
22
|
-
dir?: string;
|
|
23
|
-
prefix?: string;
|
|
24
|
-
suffix?: string;
|
|
25
|
-
}
|
|
26
|
-
export interface IRuntimeRemoveOptions {
|
|
27
|
-
recursive?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export interface IRuntimeDirectoryEntry {
|
|
30
|
-
name: string;
|
|
31
|
-
isFile: boolean;
|
|
32
|
-
isDirectory: boolean;
|
|
33
|
-
isSymlink: boolean;
|
|
34
|
-
}
|
|
35
|
-
export interface IRuntimeFileInfo {
|
|
36
|
-
isDirectory: boolean;
|
|
37
|
-
isSymlink: boolean;
|
|
38
|
-
uid: number | null;
|
|
39
|
-
mtime: Date | null;
|
|
40
|
-
dev: number | null;
|
|
41
|
-
ino: number | null;
|
|
42
|
-
}
|
|
43
|
-
export interface IOciExecutorDependencies {
|
|
44
|
-
commandRunner?: TOciRuntimeCommandRunner;
|
|
45
|
-
runtimeEnvironment?: Record<string, string>;
|
|
46
|
-
resolveHelperPath?: (target: TOciHelperTarget) => Promise<string>;
|
|
47
|
-
probeTmpfs?: (helperPath: string) => Promise<number>;
|
|
48
|
-
randomId?: () => string;
|
|
49
|
-
now?: () => number;
|
|
50
|
-
makeTempDir?: (options: IRuntimeMakeTempOptions) => Promise<string>;
|
|
51
|
-
chmod?: (path: string, mode: number) => Promise<void>;
|
|
52
|
-
remove?: (path: string, options?: IRuntimeRemoveOptions) => Promise<void>;
|
|
53
|
-
}
|
|
54
|
-
export interface IHostTmpfsProbeScavengerDependencies {
|
|
55
|
-
getUid?: () => number | undefined;
|
|
56
|
-
now?: () => number;
|
|
57
|
-
readDir?: (path: string) => AsyncIterable<IRuntimeDirectoryEntry>;
|
|
58
|
-
lstat?: (path: string) => Promise<IRuntimeFileInfo>;
|
|
59
|
-
remove?: (path: string, options?: IRuntimeRemoveOptions) => Promise<void>;
|
|
60
|
-
}
|
|
61
|
-
export interface IWorkspaceVolumeLimits {
|
|
62
|
-
blockSize: number;
|
|
63
|
-
logicalBytes: number;
|
|
64
|
-
maximumEntries: number;
|
|
65
|
-
reserveBytes: number;
|
|
66
|
-
sizeBytes: number;
|
|
67
|
-
inodeLimit: number;
|
|
68
|
-
}
|
|
69
|
-
export interface IOciRunCommand {
|
|
70
|
-
args: string[];
|
|
71
|
-
environment: Record<string, string>;
|
|
72
|
-
}
|
|
73
|
-
export interface IOciStepCommandInput {
|
|
74
|
-
runnerId: string;
|
|
75
|
-
sessionId: string;
|
|
76
|
-
lease: IOciJobLease;
|
|
77
|
-
step: ICompiledStep;
|
|
78
|
-
containerName: string;
|
|
79
|
-
volumeName: string;
|
|
80
|
-
}
|
|
81
|
-
export interface IOciHelperCommandInput {
|
|
82
|
-
runnerId: string;
|
|
83
|
-
sessionId: string;
|
|
84
|
-
attemptId: string;
|
|
85
|
-
containerName: string;
|
|
86
|
-
image: string;
|
|
87
|
-
helperPath: string;
|
|
88
|
-
command: string[];
|
|
89
|
-
volumeName?: string;
|
|
90
|
-
sourcePath?: string;
|
|
91
|
-
destinationPath?: string;
|
|
92
|
-
}
|
|
93
|
-
export declare const scavengeHostTmpfsProbes: (directory?: string, dependencies?: IHostTmpfsProbeScavengerDependencies, runtimeProbeOwnerId?: string) => Promise<void>;
|
|
94
|
-
export declare const calculateWorkspaceVolumeLimits: (logicalBytes: number, maximumEntries: number, blockSize: number) => IWorkspaceVolumeLimits;
|
|
95
|
-
export declare const buildOciRunCommand: (config: IRunnerConfig, input: IOciStepCommandInput) => IOciRunCommand;
|
|
96
|
-
export declare const buildOciHelperCreateCommand: (config: IRunnerConfig, input: IOciHelperCommandInput) => string[];
|
|
97
|
-
export declare class OciExecutor implements IJobExecutor {
|
|
98
|
-
private readonly config;
|
|
99
|
-
private readonly stateOwner;
|
|
100
|
-
private readonly runtimeEnvironment;
|
|
101
|
-
private readonly commandRunner;
|
|
102
|
-
private readonly randomId;
|
|
103
|
-
private readonly now;
|
|
104
|
-
private readonly resolveHelperPathImplementation;
|
|
105
|
-
private readonly probeTmpfsImplementation;
|
|
106
|
-
private readonly makeTempDir;
|
|
107
|
-
private readonly chmod;
|
|
108
|
-
private readonly remove;
|
|
109
|
-
private runtimeFacts?;
|
|
110
|
-
private readonly preparedLeases;
|
|
111
|
-
/**
|
|
112
|
-
* @param stateOwner Ownership of `config.stateDirectory`, where the executor keeps its workspace
|
|
113
|
-
* helpers, runtime probe owner marker and workspace exports.
|
|
114
|
-
*/
|
|
115
|
-
constructor(config: IRunnerConfig, stateOwner: RunnerStateOwner, dependencies?: IOciExecutorDependencies);
|
|
116
|
-
verifyRuntime(): Promise<IOciRuntimeFacts>;
|
|
117
|
-
prepareLease(context: IPrepareOciLeaseContext): Promise<IPreparedOciLease>;
|
|
118
|
-
reconcileOrphans(runnerId: string, currentSessionId: string): Promise<void>;
|
|
119
|
-
execute(context: IExecutionContext): Promise<IExecutionResult>;
|
|
120
|
-
private requireRuntimeFacts;
|
|
121
|
-
private validateLeaseIdentity;
|
|
122
|
-
private resolvePackagedHelper;
|
|
123
|
-
private materializeWorkspaceHelper;
|
|
124
|
-
private ensureWorkspaceHelperDirectory;
|
|
125
|
-
private ensureRuntimeProbeOwner;
|
|
126
|
-
private validateRuntimeProbeOwnerMarker;
|
|
127
|
-
private scavengeWorkspaceHelpers;
|
|
128
|
-
private recoverInterruptedWorkspaceHelperPublication;
|
|
129
|
-
private validateMaterializedWorkspaceHelper;
|
|
130
|
-
private syncDirectory;
|
|
131
|
-
private probeHostTmpfs;
|
|
132
|
-
private readFilesystemProbe;
|
|
133
|
-
private reconcileRuntimeProbeVolumes;
|
|
134
|
-
private probeRuntimeVolume;
|
|
135
|
-
private volumeCreateArgs;
|
|
136
|
-
private parseImageInspection;
|
|
137
|
-
private parseContainerState;
|
|
138
|
-
private parseCounts;
|
|
139
|
-
private runHostHelper;
|
|
140
|
-
private runRuntime;
|
|
141
|
-
private runInertContainer;
|
|
142
|
-
private runWorkspaceHelper;
|
|
143
|
-
private startVolumeHolder;
|
|
144
|
-
private measureWorkspace;
|
|
145
|
-
private readWorkspaceCapacity;
|
|
146
|
-
private runStepContainer;
|
|
147
|
-
private stopContainer;
|
|
148
|
-
private stopAndRemoveContainer;
|
|
149
|
-
private removeContainer;
|
|
150
|
-
private removeVolume;
|
|
151
|
-
private removePath;
|
|
152
|
-
private createResourceName;
|
|
153
|
-
private randomHex;
|
|
154
|
-
}
|
|
155
|
-
export declare const copyOciConfig: (config: IOciExecutorConfig) => IOciExecutorConfig;
|