@elaraai/e3-core 0.0.2-beta.12 → 0.0.2-beta.14
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/dist/src/dataflow.d.ts +118 -9
- package/dist/src/dataflow.d.ts.map +1 -1
- package/dist/src/dataflow.js +283 -54
- package/dist/src/dataflow.js.map +1 -1
- package/dist/src/errors.d.ts +11 -6
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +10 -3
- package/dist/src/errors.js.map +1 -1
- package/dist/src/execution/index.d.ts +14 -0
- package/dist/src/execution/index.d.ts.map +1 -0
- package/dist/src/execution/index.js +6 -0
- package/dist/src/execution/index.js.map +1 -0
- package/dist/src/execution/interfaces.d.ts +244 -0
- package/dist/src/execution/interfaces.d.ts.map +1 -0
- package/dist/src/execution/interfaces.js +6 -0
- package/dist/src/execution/interfaces.js.map +1 -0
- package/dist/src/executions.d.ts +48 -38
- package/dist/src/executions.d.ts.map +1 -1
- package/dist/src/executions.js +117 -162
- package/dist/src/executions.js.map +1 -1
- package/dist/src/gc.d.ts +9 -2
- package/dist/src/gc.d.ts.map +1 -1
- package/dist/src/gc.js +19 -9
- package/dist/src/gc.js.map +1 -1
- package/dist/src/index.d.ts +8 -6
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +22 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/objects.d.ts +6 -6
- package/dist/src/objects.js +6 -6
- package/dist/src/packages.d.ts +22 -14
- package/dist/src/packages.d.ts.map +1 -1
- package/dist/src/packages.js +45 -79
- package/dist/src/packages.js.map +1 -1
- package/dist/src/repository.d.ts +8 -4
- package/dist/src/repository.d.ts.map +1 -1
- package/dist/src/repository.js +25 -29
- package/dist/src/repository.js.map +1 -1
- package/dist/src/storage/index.d.ts +17 -0
- package/dist/src/storage/index.d.ts.map +1 -0
- package/dist/src/storage/index.js +8 -0
- package/dist/src/storage/index.js.map +1 -0
- package/dist/src/storage/interfaces.d.ts +299 -0
- package/dist/src/storage/interfaces.d.ts.map +1 -0
- package/dist/src/storage/interfaces.js +6 -0
- package/dist/src/storage/interfaces.js.map +1 -0
- package/dist/src/storage/local/LocalBackend.d.ts +51 -0
- package/dist/src/storage/local/LocalBackend.d.ts.map +1 -0
- package/dist/src/storage/local/LocalBackend.js +73 -0
- package/dist/src/storage/local/LocalBackend.js.map +1 -0
- package/dist/src/storage/local/LocalLockService.d.ts +22 -0
- package/dist/src/storage/local/LocalLockService.d.ts.map +1 -0
- package/dist/src/storage/local/LocalLockService.js +38 -0
- package/dist/src/storage/local/LocalLockService.js.map +1 -0
- package/dist/src/storage/local/LocalLogStore.d.ts +23 -0
- package/dist/src/storage/local/LocalLogStore.d.ts.map +1 -0
- package/dist/src/storage/local/LocalLogStore.js +66 -0
- package/dist/src/storage/local/LocalLogStore.js.map +1 -0
- package/dist/src/storage/local/LocalObjectStore.d.ts +19 -0
- package/dist/src/storage/local/LocalObjectStore.d.ts.map +1 -0
- package/dist/src/storage/local/LocalObjectStore.js +68 -0
- package/dist/src/storage/local/LocalObjectStore.js.map +1 -0
- package/dist/src/storage/local/LocalRefStore.d.ts +35 -0
- package/dist/src/storage/local/LocalRefStore.d.ts.map +1 -0
- package/dist/src/storage/local/LocalRefStore.js +233 -0
- package/dist/src/storage/local/LocalRefStore.js.map +1 -0
- package/dist/src/storage/local/index.d.ts +16 -0
- package/dist/src/storage/local/index.d.ts.map +1 -0
- package/dist/src/storage/local/index.js +16 -0
- package/dist/src/storage/local/index.js.map +1 -0
- package/dist/src/tasks.d.ts +16 -10
- package/dist/src/tasks.d.ts.map +1 -1
- package/dist/src/tasks.js +35 -41
- package/dist/src/tasks.js.map +1 -1
- package/dist/src/test-helpers.d.ts +4 -4
- package/dist/src/test-helpers.d.ts.map +1 -1
- package/dist/src/test-helpers.js +6 -20
- package/dist/src/test-helpers.js.map +1 -1
- package/dist/src/trees.d.ts +41 -29
- package/dist/src/trees.d.ts.map +1 -1
- package/dist/src/trees.js +112 -109
- package/dist/src/trees.js.map +1 -1
- package/dist/src/workspaceLock.d.ts +29 -7
- package/dist/src/workspaceLock.d.ts.map +1 -1
- package/dist/src/workspaceLock.js +130 -40
- package/dist/src/workspaceLock.js.map +1 -1
- package/dist/src/workspaceStatus.d.ts +6 -4
- package/dist/src/workspaceStatus.d.ts.map +1 -1
- package/dist/src/workspaceStatus.js +42 -58
- package/dist/src/workspaceStatus.js.map +1 -1
- package/dist/src/workspaces.d.ts +35 -26
- package/dist/src/workspaces.d.ts.map +1 -1
- package/dist/src/workspaces.js +93 -116
- package/dist/src/workspaces.js.map +1 -1
- package/package.json +3 -3
package/dist/src/errors.js
CHANGED
|
@@ -57,9 +57,16 @@ export class WorkspaceLockError extends E3Error {
|
|
|
57
57
|
workspace;
|
|
58
58
|
holder;
|
|
59
59
|
constructor(workspace, holder) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
let msg;
|
|
61
|
+
if (!holder) {
|
|
62
|
+
msg = `Workspace '${workspace}' is locked by another process`;
|
|
63
|
+
}
|
|
64
|
+
else if (holder.pid !== undefined) {
|
|
65
|
+
msg = `Workspace '${workspace}' is locked by process ${holder.pid} (since ${holder.acquiredAt})`;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
msg = `Workspace '${workspace}' is locked (since ${holder.acquiredAt})`;
|
|
69
|
+
}
|
|
63
70
|
super(msg);
|
|
64
71
|
this.workspace = workspace;
|
|
65
72
|
this.holder = holder;
|
package/dist/src/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,gFAAgF;AAChF,aAAa;AACb,gFAAgF;AAEhF,mCAAmC;AACnC,MAAM,OAAO,OAAQ,SAAQ,KAAK;IAChC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,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 -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Execution abstraction layer for e3 dataflow.
|
|
7
|
+
*
|
|
8
|
+
* This module provides interfaces that separate orchestration from business
|
|
9
|
+
* logic, enabling different execution strategies:
|
|
10
|
+
* - LocalDataflowExecutor: In-process execution with AsyncMutex (CLI, local dev)
|
|
11
|
+
* - StepFunctionsDataflowExecutor: AWS Step Functions orchestration (cloud)
|
|
12
|
+
*/
|
|
13
|
+
export { type TaskExecuteOptions, type TaskResult, type TaskRunner, type ExecutionHandle, type DataflowStatus, type DataflowExecuteOptions, type DataflowExecuteResult, type DataflowExecutor, type TaskGraph, type DataflowGetGraphFn, type DataflowCheckCacheFn, type DataflowWriteOutputFn, type DataflowGetReadyTasksFn, } from './interfaces.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/execution/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,UAAU,EAEf,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EAErB,KAAK,SAAS,EAEd,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,GAC7B,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/execution/index.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Execution abstraction interfaces for e3 dataflow.
|
|
7
|
+
*
|
|
8
|
+
* These interfaces separate orchestration from business logic, enabling:
|
|
9
|
+
* - LocalDataflowExecutor: In-process execution with AsyncMutex (CLI, local dev)
|
|
10
|
+
* - StepFunctionsDataflowExecutor: AWS Step Functions orchestration (cloud)
|
|
11
|
+
*
|
|
12
|
+
* The core insight: Everything in dataflowExecute() except the processQueue()
|
|
13
|
+
* loop is pure business logic that both local and cloud execution share.
|
|
14
|
+
* By extracting these as functions and abstracting the orchestration,
|
|
15
|
+
* Step Functions can replace the local loop while reusing all e3-core logic.
|
|
16
|
+
*/
|
|
17
|
+
import type { StorageBackend, LockHandle } from '../storage/interfaces.js';
|
|
18
|
+
/**
|
|
19
|
+
* Options for task execution.
|
|
20
|
+
*/
|
|
21
|
+
export interface TaskExecuteOptions {
|
|
22
|
+
/** Force execution even if cached */
|
|
23
|
+
force?: boolean;
|
|
24
|
+
/** AbortSignal for cancellation */
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
/** Callback for stdout data */
|
|
27
|
+
onStdout?: (data: string) => void;
|
|
28
|
+
/** Callback for stderr data */
|
|
29
|
+
onStderr?: (data: string) => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Result of a single task execution.
|
|
33
|
+
*/
|
|
34
|
+
export interface TaskResult {
|
|
35
|
+
/** Final state */
|
|
36
|
+
state: 'success' | 'failed' | 'error';
|
|
37
|
+
/** Whether the result was served from cache */
|
|
38
|
+
cached: boolean;
|
|
39
|
+
/** Output hash (if state is 'success') */
|
|
40
|
+
outputHash?: string;
|
|
41
|
+
/** Exit code (if state is 'failed') */
|
|
42
|
+
exitCode?: number;
|
|
43
|
+
/** Error message (if state is 'error') */
|
|
44
|
+
error?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Task execution abstraction.
|
|
48
|
+
*
|
|
49
|
+
* Implementations:
|
|
50
|
+
* - LocalTaskRunner: Spawns east-node/east-py/julia processes locally
|
|
51
|
+
* - LambdaTaskRunner: Dispatches to AWS Lambda
|
|
52
|
+
* - FargateTaskRunner: Dispatches to AWS Fargate
|
|
53
|
+
*/
|
|
54
|
+
export interface TaskRunner {
|
|
55
|
+
/**
|
|
56
|
+
* Execute a task.
|
|
57
|
+
*
|
|
58
|
+
* @param storage - Storage backend
|
|
59
|
+
* @param taskHash - Hash of the TaskObject
|
|
60
|
+
* @param inputHashes - Hashes of input datasets
|
|
61
|
+
* @param options - Execution options
|
|
62
|
+
* @returns Task result
|
|
63
|
+
*/
|
|
64
|
+
execute(storage: StorageBackend, taskHash: string, inputHashes: string[], options?: TaskExecuteOptions): Promise<TaskResult>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Handle to a running dataflow execution.
|
|
68
|
+
*/
|
|
69
|
+
export interface ExecutionHandle {
|
|
70
|
+
/** Unique execution ID (Local: UUID, Cloud: Step Functions ARN) */
|
|
71
|
+
readonly id: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Status of a dataflow execution.
|
|
75
|
+
*/
|
|
76
|
+
export interface DataflowStatus {
|
|
77
|
+
/** Current state */
|
|
78
|
+
state: 'running' | 'completed' | 'failed' | 'cancelled';
|
|
79
|
+
/** Tasks that have completed successfully */
|
|
80
|
+
completed: string[];
|
|
81
|
+
/** Tasks currently running */
|
|
82
|
+
running: string[];
|
|
83
|
+
/** Tasks waiting to run */
|
|
84
|
+
pending: string[];
|
|
85
|
+
/** Tasks that failed */
|
|
86
|
+
failed: string[];
|
|
87
|
+
/** Tasks skipped due to upstream failure */
|
|
88
|
+
skipped: string[];
|
|
89
|
+
/** Error message if state is 'failed' */
|
|
90
|
+
error?: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Options for dataflow execution.
|
|
94
|
+
*/
|
|
95
|
+
export interface DataflowExecuteOptions {
|
|
96
|
+
/** Maximum concurrent task executions (default: 4) */
|
|
97
|
+
concurrency?: number;
|
|
98
|
+
/** Force re-execution even if cached (default: false) */
|
|
99
|
+
force?: boolean;
|
|
100
|
+
/** Filter to run only specific task(s) by exact name */
|
|
101
|
+
filter?: string;
|
|
102
|
+
/** AbortSignal for cancellation */
|
|
103
|
+
signal?: AbortSignal;
|
|
104
|
+
/** External lock handle (if caller manages locking) */
|
|
105
|
+
lock?: LockHandle;
|
|
106
|
+
/** Callback when a task starts */
|
|
107
|
+
onTaskStart?: (taskName: string) => void;
|
|
108
|
+
/** Callback when a task completes */
|
|
109
|
+
onTaskComplete?: (taskName: string, result: TaskResult) => void;
|
|
110
|
+
/** Callback for task stdout */
|
|
111
|
+
onStdout?: (taskName: string, data: string) => void;
|
|
112
|
+
/** Callback for task stderr */
|
|
113
|
+
onStderr?: (taskName: string, data: string) => void;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Result of a dataflow execution.
|
|
117
|
+
*/
|
|
118
|
+
export interface DataflowExecuteResult {
|
|
119
|
+
/** Overall success - true if all tasks completed successfully */
|
|
120
|
+
success: boolean;
|
|
121
|
+
/** Number of tasks executed (not from cache) */
|
|
122
|
+
executed: number;
|
|
123
|
+
/** Number of tasks served from cache */
|
|
124
|
+
cached: number;
|
|
125
|
+
/** Number of tasks that failed */
|
|
126
|
+
failed: number;
|
|
127
|
+
/** Number of tasks skipped due to upstream failure */
|
|
128
|
+
skipped: number;
|
|
129
|
+
/** Total duration in milliseconds */
|
|
130
|
+
duration: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Dataflow orchestration abstraction.
|
|
134
|
+
*
|
|
135
|
+
* Implementations:
|
|
136
|
+
* - LocalDataflowExecutor: In-process loop with AsyncMutex
|
|
137
|
+
* - StepFunctionsDataflowExecutor: AWS Step Functions state machine
|
|
138
|
+
*/
|
|
139
|
+
export interface DataflowExecutor {
|
|
140
|
+
/**
|
|
141
|
+
* Start a dataflow execution.
|
|
142
|
+
*
|
|
143
|
+
* Returns immediately with a handle. Use getStatus() to poll for completion.
|
|
144
|
+
*
|
|
145
|
+
* @param storage - Storage backend
|
|
146
|
+
* @param workspace - Workspace name
|
|
147
|
+
* @param options - Execution options
|
|
148
|
+
* @returns Execution handle
|
|
149
|
+
*/
|
|
150
|
+
start(storage: StorageBackend, workspace: string, options?: DataflowExecuteOptions): Promise<ExecutionHandle>;
|
|
151
|
+
/**
|
|
152
|
+
* Get the status of a dataflow execution.
|
|
153
|
+
*
|
|
154
|
+
* @param handle - Execution handle from start()
|
|
155
|
+
* @returns Current status
|
|
156
|
+
*/
|
|
157
|
+
getStatus(handle: ExecutionHandle): Promise<DataflowStatus>;
|
|
158
|
+
/**
|
|
159
|
+
* Cancel a running dataflow execution.
|
|
160
|
+
*
|
|
161
|
+
* Running tasks will be terminated. The execution will transition to
|
|
162
|
+
* 'cancelled' state.
|
|
163
|
+
*
|
|
164
|
+
* @param handle - Execution handle from start()
|
|
165
|
+
*/
|
|
166
|
+
cancel(handle: ExecutionHandle): Promise<void>;
|
|
167
|
+
/**
|
|
168
|
+
* Wait for a dataflow execution to complete.
|
|
169
|
+
*
|
|
170
|
+
* @param handle - Execution handle from start()
|
|
171
|
+
* @returns Final result
|
|
172
|
+
*/
|
|
173
|
+
wait(handle: ExecutionHandle): Promise<DataflowExecuteResult>;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Task dependency graph.
|
|
177
|
+
*/
|
|
178
|
+
export interface TaskGraph {
|
|
179
|
+
/** Map of task name -> task info */
|
|
180
|
+
tasks: Map<string, {
|
|
181
|
+
hash: string;
|
|
182
|
+
inputPaths: string[];
|
|
183
|
+
outputPath: string;
|
|
184
|
+
dependencies: string[];
|
|
185
|
+
}>;
|
|
186
|
+
/** Map of output path -> producing task name */
|
|
187
|
+
outputToTask: Map<string, string>;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* These functions are the shared business logic that both local and cloud
|
|
191
|
+
* execution use. They are called by the orchestrator (LocalDataflowExecutor
|
|
192
|
+
* or Step Functions via Lambda handlers).
|
|
193
|
+
*
|
|
194
|
+
* Note: These are defined as function signatures here for documentation.
|
|
195
|
+
* The actual implementations are in dataflow.ts and will be exported
|
|
196
|
+
* as standalone functions.
|
|
197
|
+
*/
|
|
198
|
+
/**
|
|
199
|
+
* Get the task dependency graph for a workspace.
|
|
200
|
+
*
|
|
201
|
+
* Pure function - reads workspace state and package to build DAG.
|
|
202
|
+
*
|
|
203
|
+
* @param storage - Storage backend
|
|
204
|
+
* @param workspace - Workspace name
|
|
205
|
+
* @returns Task dependency graph
|
|
206
|
+
*/
|
|
207
|
+
export type DataflowGetGraphFn = (storage: StorageBackend, workspace: string) => Promise<TaskGraph>;
|
|
208
|
+
/**
|
|
209
|
+
* Check if a task's output is cached.
|
|
210
|
+
*
|
|
211
|
+
* Returns the cached output hash if available and valid.
|
|
212
|
+
*
|
|
213
|
+
* @param storage - Storage backend
|
|
214
|
+
* @param workspace - Workspace name
|
|
215
|
+
* @param taskHash - Task object hash
|
|
216
|
+
* @param inputHashes - Input dataset hashes
|
|
217
|
+
* @returns Cached output hash, or null if not cached or invalid
|
|
218
|
+
*/
|
|
219
|
+
export type DataflowCheckCacheFn = (storage: StorageBackend, workspace: string, taskHash: string, inputHashes: string[]) => Promise<string | null>;
|
|
220
|
+
/**
|
|
221
|
+
* Write task output to workspace tree.
|
|
222
|
+
*
|
|
223
|
+
* Called after successful task execution to update the workspace.
|
|
224
|
+
*
|
|
225
|
+
* @param storage - Storage backend
|
|
226
|
+
* @param workspace - Workspace name
|
|
227
|
+
* @param taskName - Task name
|
|
228
|
+
* @param outputPath - Output dataset path
|
|
229
|
+
* @param outputHash - Output object hash
|
|
230
|
+
*/
|
|
231
|
+
export type DataflowWriteOutputFn = (storage: StorageBackend, workspace: string, taskName: string, outputPath: string, outputHash: string) => Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Get tasks that are ready to execute.
|
|
234
|
+
*
|
|
235
|
+
* A task is ready when all its input dependencies have values assigned.
|
|
236
|
+
*
|
|
237
|
+
* @param storage - Storage backend
|
|
238
|
+
* @param workspace - Workspace name
|
|
239
|
+
* @param graph - Task dependency graph
|
|
240
|
+
* @param completed - Set of completed task names
|
|
241
|
+
* @returns Array of task names ready to execute
|
|
242
|
+
*/
|
|
243
|
+
export type DataflowGetReadyTasksFn = (storage: StorageBackend, workspace: string, graph: TaskGraph, completed: Set<string>) => Promise<string[]>;
|
|
244
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/execution/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAM3E;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mCAAmC;IACnC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,kBAAkB;IAClB,KAAK,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;IACtC,+CAA+C;IAC/C,MAAM,EAAE,OAAO,CAAC;IAChB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;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CAAC,CAAC;IACH,gDAAgD;IAChD,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,SAAS,CAAC,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EAAE,KAClB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAE5B;;;;;;;;;;GAUG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB;;;;;;;;;;GAUG;AACH,MAAM,MAAM,uBAAuB,GAAG,CACpC,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,KACnB,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/execution/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/dist/src/executions.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
5
|
import { type ExecutionStatus } from '@elaraai/e3-types';
|
|
6
|
+
import type { StorageBackend, LogChunk } from './storage/interfaces.js';
|
|
6
7
|
/**
|
|
7
8
|
* Compute the combined hash of input hashes.
|
|
8
9
|
*
|
|
@@ -13,52 +14,72 @@ import { type ExecutionStatus } from '@elaraai/e3-types';
|
|
|
13
14
|
* @returns Combined SHA256 hash
|
|
14
15
|
*/
|
|
15
16
|
export declare function inputsHash(inputHashes: string[]): string;
|
|
16
|
-
/**
|
|
17
|
-
* Get the filesystem path for an execution directory.
|
|
18
|
-
*
|
|
19
|
-
* @param repoPath - Path to .e3 repository
|
|
20
|
-
* @param taskHash - Hash of the task object
|
|
21
|
-
* @param inHash - Combined hash of input hashes
|
|
22
|
-
* @returns Path to execution directory: executions/<taskHash>/<inputsHash>/
|
|
23
|
-
*/
|
|
24
|
-
export declare function executionPath(repoPath: string, taskHash: string, inHash: string): string;
|
|
25
17
|
/**
|
|
26
18
|
* Get execution status.
|
|
27
19
|
*
|
|
28
|
-
* @param
|
|
20
|
+
* @param storage - Storage backend
|
|
21
|
+
* @param repo - Repository identifier (for local storage, the path to e3 repository directory)
|
|
29
22
|
* @param taskHash - Hash of the task object
|
|
30
23
|
* @param inHash - Combined hash of input hashes
|
|
31
24
|
* @returns ExecutionStatus or null if execution doesn't exist
|
|
32
25
|
* @throws {ExecutionCorruptError} If status file exists but cannot be decoded
|
|
33
26
|
*/
|
|
34
|
-
export declare function executionGet(
|
|
27
|
+
export declare function executionGet(storage: StorageBackend, repo: string, taskHash: string, inHash: string): Promise<ExecutionStatus | null>;
|
|
35
28
|
/**
|
|
36
29
|
* Get output hash for a completed execution.
|
|
37
30
|
*
|
|
38
|
-
* @param
|
|
31
|
+
* @param storage - Storage backend
|
|
32
|
+
* @param repo - Repository identifier (for local storage, the path to e3 repository directory)
|
|
39
33
|
* @param taskHash - Hash of the task object
|
|
40
34
|
* @param inHash - Combined hash of input hashes
|
|
41
35
|
* @returns Output hash or null if not complete or failed
|
|
42
36
|
*/
|
|
43
|
-
export declare function executionGetOutput(
|
|
37
|
+
export declare function executionGetOutput(storage: StorageBackend, repo: string, taskHash: string, inHash: string): Promise<string | null>;
|
|
44
38
|
/**
|
|
45
39
|
* List all input hashes that have executions for a given task.
|
|
46
40
|
*
|
|
47
|
-
* @param
|
|
41
|
+
* @param storage - Storage backend
|
|
42
|
+
* @param repo - Repository identifier (for local storage, the path to e3 repository directory)
|
|
48
43
|
* @param taskHash - Hash of the task object
|
|
49
44
|
* @returns Array of input hashes
|
|
50
45
|
*/
|
|
51
|
-
export declare function executionListForTask(
|
|
46
|
+
export declare function executionListForTask(storage: StorageBackend, repo: string, taskHash: string): Promise<string[]>;
|
|
52
47
|
/**
|
|
53
48
|
* List all executions in the repository.
|
|
54
49
|
*
|
|
55
|
-
* @param
|
|
50
|
+
* @param storage - Storage backend
|
|
51
|
+
* @param repo - Repository identifier (for local storage, the path to e3 repository directory)
|
|
56
52
|
* @returns Array of { taskHash, inputsHash } objects
|
|
57
53
|
*/
|
|
58
|
-
export declare function executionList(
|
|
54
|
+
export declare function executionList(storage: StorageBackend, repo: string): Promise<Array<{
|
|
59
55
|
taskHash: string;
|
|
60
56
|
inputsHash: string;
|
|
61
57
|
}>>;
|
|
58
|
+
/**
|
|
59
|
+
* Result of finding the current execution for a task
|
|
60
|
+
*/
|
|
61
|
+
export interface CurrentExecutionRef {
|
|
62
|
+
/** Hash of the task object */
|
|
63
|
+
taskHash: string;
|
|
64
|
+
/** Combined hash of input hashes */
|
|
65
|
+
inputsHash: string;
|
|
66
|
+
/** True if this matches the current workspace input state */
|
|
67
|
+
isCurrent: boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Find the execution reference for a task in a workspace.
|
|
71
|
+
*
|
|
72
|
+
* This looks up the task's current input hashes from the workspace state
|
|
73
|
+
* and finds the matching execution. If no execution exists for the current
|
|
74
|
+
* inputs, falls back to the most recent execution.
|
|
75
|
+
*
|
|
76
|
+
* @param storage - Storage backend
|
|
77
|
+
* @param repo - Repository identifier (for local storage, the path to e3 repository directory)
|
|
78
|
+
* @param ws - Workspace name
|
|
79
|
+
* @param taskName - Task name
|
|
80
|
+
* @returns Execution reference or null if no executions exist
|
|
81
|
+
*/
|
|
82
|
+
export declare function executionFindCurrent(storage: StorageBackend, repo: string, ws: string, taskName: string): Promise<CurrentExecutionRef | null>;
|
|
62
83
|
/**
|
|
63
84
|
* Options for reading execution logs
|
|
64
85
|
*/
|
|
@@ -68,44 +89,32 @@ export interface LogReadOptions {
|
|
|
68
89
|
/** Maximum bytes to read (default: 64KB) */
|
|
69
90
|
limit?: number;
|
|
70
91
|
}
|
|
71
|
-
|
|
72
|
-
* Result of reading a log chunk
|
|
73
|
-
*/
|
|
74
|
-
export interface LogChunk {
|
|
75
|
-
/** Log content (UTF-8) */
|
|
76
|
-
data: string;
|
|
77
|
-
/** Byte offset of this chunk */
|
|
78
|
-
offset: number;
|
|
79
|
-
/** Bytes in this chunk */
|
|
80
|
-
size: number;
|
|
81
|
-
/** Total log file size (for pagination) */
|
|
82
|
-
totalSize: number;
|
|
83
|
-
/** True if this is the end of the file */
|
|
84
|
-
complete: boolean;
|
|
85
|
-
}
|
|
92
|
+
export type { LogChunk };
|
|
86
93
|
/**
|
|
87
94
|
* Read execution logs with pagination support.
|
|
88
95
|
*
|
|
89
|
-
* @param
|
|
96
|
+
* @param storage - Storage backend
|
|
97
|
+
* @param repo - Repository identifier (for local storage, the path to e3 repository directory)
|
|
90
98
|
* @param taskHash - Hash of the task object
|
|
91
99
|
* @param inHash - Combined hash of input hashes
|
|
92
100
|
* @param stream - Which log stream to read ('stdout' or 'stderr')
|
|
93
101
|
* @param options - Pagination options
|
|
94
102
|
* @returns Log chunk with data and metadata
|
|
95
103
|
*/
|
|
96
|
-
export declare function executionReadLog(
|
|
104
|
+
export declare function executionReadLog(storage: StorageBackend, repo: string, taskHash: string, inHash: string, stream: 'stdout' | 'stderr', options?: LogReadOptions): Promise<LogChunk>;
|
|
97
105
|
/**
|
|
98
106
|
* Evaluate command IR to get exec args.
|
|
99
107
|
*
|
|
100
108
|
* The IR is an East function: (inputs: Array<String>, output: String) -> Array<String>
|
|
101
109
|
*
|
|
102
|
-
* @param
|
|
110
|
+
* @param storage - Storage backend
|
|
111
|
+
* @param repo - Repository identifier (for local storage, the path to e3 repository directory)
|
|
103
112
|
* @param commandIrHash - Hash of the IR object
|
|
104
113
|
* @param inputPaths - Paths to staged input files
|
|
105
114
|
* @param outputPath - Path where output should be written
|
|
106
115
|
* @returns Array of strings to exec
|
|
107
116
|
*/
|
|
108
|
-
export declare function evaluateCommandIr(
|
|
117
|
+
export declare function evaluateCommandIr(storage: StorageBackend, repo: string, commandIrHash: string, inputPaths: string[], outputPath: string): Promise<string[]>;
|
|
109
118
|
/**
|
|
110
119
|
* Get the current system boot ID.
|
|
111
120
|
* Used for detecting stale locks/processes after system reboot.
|
|
@@ -166,11 +175,12 @@ export interface ExecutionResult {
|
|
|
166
175
|
* 5. Runs the command
|
|
167
176
|
* 6. Stores the output and updates status
|
|
168
177
|
*
|
|
169
|
-
* @param
|
|
178
|
+
* @param storage - Storage backend
|
|
179
|
+
* @param repo - Repository identifier (for local storage, the path to e3 repository directory)
|
|
170
180
|
* @param taskHash - Hash of the task object
|
|
171
181
|
* @param inputHashes - Array of input dataset hashes
|
|
172
182
|
* @param options - Execution options
|
|
173
183
|
* @returns Execution result
|
|
174
184
|
*/
|
|
175
|
-
export declare function taskExecute(
|
|
185
|
+
export declare function taskExecute(storage: StorageBackend, repo: string, taskHash: string, inputHashes: string[], options?: ExecuteOptions): Promise<ExecutionResult>;
|
|
176
186
|
//# sourceMappingURL=executions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executions.d.ts","sourceRoot":"","sources":["../../src/executions.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"executions.d.ts","sourceRoot":"","sources":["../../src/executions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkBH,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAA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