tensorlake 0.5.142 → 0.5.145

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 (77) hide show
  1. package/README.md +11 -159
  2. package/applications.cjs +3 -0
  3. package/applications.d.cts +1 -0
  4. package/applications.d.ts +1 -0
  5. package/applications.js +1 -0
  6. package/index.cjs +3 -0
  7. package/index.d.cts +1 -0
  8. package/index.d.ts +1 -0
  9. package/index.js +1 -0
  10. package/package.json +25 -68
  11. package/bin/function-executor.js +0 -8
  12. package/bin/tensorlake-create-sandbox-image.js +0 -9
  13. package/bin/tensorlake-deploy.cjs +0 -8
  14. package/bin/tensorlake-import-sandbox-image.js +0 -9
  15. package/bin/tensorlake-typescript-function-runner.js +0 -8
  16. package/dist/applications/index.cjs +0 -4812
  17. package/dist/applications/index.cjs.map +0 -1
  18. package/dist/applications/index.d.cts +0 -130
  19. package/dist/applications/index.d.ts +0 -130
  20. package/dist/applications/index.js +0 -4773
  21. package/dist/applications/index.js.map +0 -1
  22. package/dist/function-agent/main.cjs +0 -1838
  23. package/dist/function-agent/main.cjs.map +0 -1
  24. package/dist/function-agent/main.d.cts +0 -3
  25. package/dist/function-agent/main.d.ts +0 -3
  26. package/dist/function-agent/main.js +0 -1825
  27. package/dist/function-agent/main.js.map +0 -1
  28. package/dist/function-executor/main.cjs +0 -4944
  29. package/dist/function-executor/main.cjs.map +0 -1
  30. package/dist/function-executor/main.d.cts +0 -4
  31. package/dist/function-executor/main.d.ts +0 -4
  32. package/dist/function-executor/main.js +0 -4902
  33. package/dist/function-executor/main.js.map +0 -1
  34. package/dist/index.cjs +0 -10175
  35. package/dist/index.cjs.map +0 -1
  36. package/dist/index.d.cts +0 -2427
  37. package/dist/index.d.ts +0 -2427
  38. package/dist/index.js +0 -10099
  39. package/dist/index.js.map +0 -1
  40. package/dist/native-worker.cjs +0 -278
  41. package/dist/native-worker.cjs.map +0 -1
  42. package/dist/native-worker.d.cts +0 -2
  43. package/dist/native-worker.d.ts +0 -2
  44. package/dist/native-worker.js +0 -276
  45. package/dist/native-worker.js.map +0 -1
  46. package/dist/remote-D95Y6Czr.d.cts +0 -282
  47. package/dist/remote-omwTzbfj.d.ts +0 -282
  48. package/dist/sandbox-image-ChzWDeZy.d.cts +0 -357
  49. package/dist/sandbox-image-ChzWDeZy.d.ts +0 -357
  50. package/dist/sandbox-image.cjs +0 -1992
  51. package/dist/sandbox-image.cjs.map +0 -1
  52. package/dist/sandbox-image.d.cts +0 -1
  53. package/dist/sandbox-image.d.ts +0 -1
  54. package/dist/sandbox-image.js +0 -1987
  55. package/dist/sandbox-image.js.map +0 -1
  56. package/lib/libc.cjs +0 -61
  57. package/lib/libc.d.cts +0 -1
  58. package/lib/runtime.cjs +0 -155
  59. package/runtime/function-executor/manifest.json +0 -59
  60. package/runtime/function-executor/package/bin/function-executor.js +0 -8
  61. package/runtime/function-executor/package/dist/function-executor/main.js +0 -4902
  62. package/runtime/function-executor/package/dist/function-executor/main.js.map +0 -1
  63. package/runtime/function-executor/package/dist/native-worker.cjs +0 -278
  64. package/runtime/function-executor/package/dist/native-worker.cjs.map +0 -1
  65. package/runtime/function-executor/package/npm-shrinkwrap.json +0 -475
  66. package/runtime/function-executor/package/package.json +0 -22
  67. package/runtime/function-executor/package/proto/README.md +0 -18
  68. package/runtime/function-executor/package/proto/tensorlake/function_executor/proto/function_executor.proto +0 -613
  69. package/runtime/function-executor/package/proto/tensorlake/function_executor/proto/status.proto +0 -42
  70. package/runtime/typescript-function-runner/manifest.json +0 -44
  71. package/runtime/typescript-function-runner/package/bin/tensorlake-typescript-function-runner.js +0 -8
  72. package/runtime/typescript-function-runner/package/dist/function-agent/main.js +0 -1825
  73. package/runtime/typescript-function-runner/package/dist/function-agent/main.js.map +0 -1
  74. package/runtime/typescript-function-runner/package/dist/native-worker.cjs +0 -278
  75. package/runtime/typescript-function-runner/package/dist/native-worker.cjs.map +0 -1
  76. package/runtime/typescript-function-runner/package/npm-shrinkwrap.json +0 -580
  77. package/runtime/typescript-function-runner/package/package.json +0 -25
@@ -1,613 +0,0 @@
1
- syntax = "proto3";
2
-
3
- import "google/protobuf/timestamp.proto";
4
- import "tensorlake/function_executor/proto/status.proto";
5
-
6
- package function_executor_service;
7
-
8
- // The messages should not use any Python SDK objects. Only Function Executor implemented
9
- // in Python is allowed to import Python SDK to run customer functions. This ensures that
10
- // all the other components can be written in any language.
11
-
12
- // The standard Empty message.
13
- message Empty {}
14
-
15
- enum SerializedObjectEncoding {
16
- SERIALIZED_OBJECT_ENCODING_UNKNOWN = 0;
17
- SERIALIZED_OBJECT_ENCODING_UTF8_JSON = 1;
18
- SERIALIZED_OBJECT_ENCODING_UTF8_TEXT = 2;
19
- SERIALIZED_OBJECT_ENCODING_BINARY_PICKLE = 3;
20
- SERIALIZED_OBJECT_ENCODING_BINARY_ZIP = 4;
21
- SERIALIZED_OBJECT_ENCODING_RAW = 5;
22
- }
23
-
24
- message SerializedObjectManifest {
25
- optional SerializedObjectEncoding encoding = 1;
26
- optional uint64 encoding_version = 2;
27
- // Includes data and metadata.
28
- optional uint64 size = 3;
29
- // Metadata is stored before the actual data. This field is required when
30
- // the manifest describes a SerializedObjectInsideBLOB.
31
- optional uint64 metadata_size = 4;
32
- // Includes data and metadata.
33
- optional string sha256_hash = 5;
34
- // MIME type. Only set when raw encoding is used.
35
- optional string content_type = 6;
36
- // ID of the function call that returned this SO as it's return value.
37
- // SOs which are not a function call return value, don't have this field set.
38
- optional string source_function_call_id = 7;
39
- }
40
-
41
- // Full serialized object with all its data.
42
- message SerializedObject {
43
- optional SerializedObjectManifest manifest = 1;
44
- optional bytes data = 2;
45
- }
46
-
47
- // A chunk of a BLOB in a BLOB store.
48
- message BLOBChunk {
49
- // URI of the chunk.
50
- // S3 URI if the data is stored in S3.
51
- // Starts with "file://"" prefix if the data is stored on a local file system.
52
- optional string uri = 1;
53
- // Actual size of chunk data if the BLOB has data.
54
- // Requested chunk size if the BLOB has no data yet (can be used for data upload).
55
- optional uint64 size = 2;
56
- // None if the BLOB has data.
57
- // ETag of the chunk data (generated by BLOB store) if the BLOB chunk was used to upload data.
58
- optional string etag = 3;
59
- }
60
-
61
- // A BLOB in a BLOB store.
62
- message BLOB {
63
- // ID of the BLOB, unique per allocation.
64
- optional string id = 1;
65
- // Ordered chunks of the BLOB if the BLOB has data.
66
- // Ordered chunks of the BLOB that can be used to upload data if the BLOB has no data yet.
67
- repeated BLOBChunk chunks = 2;
68
- }
69
-
70
- // Serialized object stored inside a BLOB.
71
- // The BLOB is determined from the protocol context.
72
- message SerializedObjectInsideBLOB {
73
- optional SerializedObjectManifest manifest = 1;
74
- // Offset inside the BLOB where the serialized object data starts.
75
- optional uint64 offset = 2;
76
- }
77
-
78
- message HttpRequestHeader {
79
- optional string name = 1;
80
- optional string value = 2;
81
- }
82
-
83
- message RequestContext {
84
- repeated HttpRequestHeader headers = 1;
85
- }
86
-
87
- message FunctionRef {
88
- optional string namespace = 1;
89
- optional string application_name = 2;
90
- optional string function_name = 3;
91
- optional string application_version = 4;
92
- }
93
-
94
- // InitializeRequest contains information about the function
95
- // that Function Executor is going to run the allocation for.
96
- message InitializeRequest {
97
- optional FunctionRef function = 1;
98
- optional SerializedObject application_code = 2;
99
- }
100
-
101
- enum InitializationOutcomeCode {
102
- INITIALIZATION_OUTCOME_CODE_UNKNOWN = 0;
103
- INITIALIZATION_OUTCOME_CODE_SUCCESS = 1;
104
- INITIALIZATION_OUTCOME_CODE_FAILURE = 2;
105
- }
106
-
107
- enum InitializationFailureReason {
108
- INITIALIZATION_FAILURE_REASON_UNKNOWN = 0;
109
- INITIALIZATION_FAILURE_REASON_INTERNAL_ERROR = 1;
110
- INITIALIZATION_FAILURE_REASON_FUNCTION_ERROR = 2;
111
- }
112
-
113
- message InitializeResponse {
114
- optional InitializationOutcomeCode outcome_code = 1;
115
- optional InitializationFailureReason failure_reason = 2;
116
- // Customer-visible and human-readable when failure_reason is
117
- // INITIALIZATION_FAILURE_REASON_FUNCTION_ERROR. Other failure reasons are
118
- // diagnostic and not guaranteed to be suitable for customer display.
119
- optional string error_message = 3;
120
- }
121
-
122
- message ListAllocationsRequest {}
123
-
124
- message ListAllocationsResponse {
125
- repeated Allocation allocations = 1;
126
- }
127
-
128
- message Metrics {
129
- // TODO: Delete the Metrics message once Executor stops using it.
130
- }
131
-
132
- enum AllocationOutcomeCode {
133
- ALLOCATION_OUTCOME_CODE_UNKNOWN = 0;
134
- ALLOCATION_OUTCOME_CODE_SUCCESS = 1;
135
- ALLOCATION_OUTCOME_CODE_FAILURE = 2;
136
- }
137
-
138
- enum AllocationFailureReason {
139
- ALLOCATION_FAILURE_REASON_UNKNOWN = 0;
140
- ALLOCATION_FAILURE_REASON_INTERNAL_ERROR = 1;
141
- ALLOCATION_FAILURE_REASON_FUNCTION_ERROR = 2;
142
- ALLOCATION_FAILURE_REASON_REQUEST_ERROR = 3;
143
- ALLOCATION_FAILURE_REASON_REPLAY_EVENT_HISTORY_MISMATCH = 4;
144
- }
145
-
146
- message AllocationProgress {
147
- float current = 1;
148
- float total = 2;
149
- }
150
-
151
- message AllocationOutputBLOBRequest {
152
- // ID of the BLOB in AllocationState, unique per allocation.
153
- // New BLOB requests are detected by comparing IDs.
154
- optional string id = 1;
155
- optional uint64 size = 2;
156
- }
157
-
158
- message AllocationFunctionCall {
159
- // ID of the function call in AllocationState, unique per allocation.
160
- // New function calls are detected by comparing IDs.
161
- // This is different from function call IDs in ExecutionPlanUpdates.
162
- optional string id = 3;
163
- optional ExecutionPlanUpdates updates = 1;
164
- // SerializedObjectInsideBLOB arguments from the execution
165
- // plan are stored inside this BLOB.
166
- // Optional, not set if no function arguments in updates.
167
- optional BLOB args_blob = 2;
168
- }
169
-
170
- // Watcher for a function call started by the allocation.
171
- // A presence of a watcher means that customer code is blocked waiting
172
- // for the watcher's function call to finish.
173
- message AllocationFunctionCallWatcher {
174
- // Deprecated: Use id to match the watcher.
175
- optional string watcher_id = 1;
176
- // Deprecated: Use root_function_call_id.
177
- optional string function_call_id = 2;
178
- // ID of the watcher in AllocationState, unique per allocation.
179
- // New watchers are detected by comparing IDs.
180
- optional string id = 3;
181
- // root_function_call_id from ExecutionPlanUpdates of an already started allocation function call.
182
- optional string root_function_call_id = 4;
183
- }
184
-
185
- message AllocationRequestStatePrepareReadOperation {}
186
-
187
- message AllocationRequestStatePrepareWriteOperation {
188
- optional uint64 size = 1;
189
- }
190
-
191
- message AllocationRequestStateCommitWriteOperation {
192
- // BLOB with the uploaded data.
193
- optional BLOB blob = 1;
194
- }
195
-
196
- message AllocationRequestStateOperation {
197
- // ID of the operation in AllocationState, unique per allocation.
198
- // New operations are detected by comparing IDs.
199
- optional string operation_id = 1;
200
- optional string state_key = 2;
201
- oneof operation {
202
- AllocationRequestStatePrepareReadOperation prepare_read = 3;
203
- AllocationRequestStatePrepareWriteOperation prepare_write = 4;
204
- AllocationRequestStateCommitWriteOperation commit_write = 5;
205
- }
206
- }
207
-
208
- message AllocationState {
209
- // Optional current allocation progress.
210
- optional AllocationProgress progress = 1;
211
- // Requests for writable BLOBs so allocation can upload data there.
212
- repeated AllocationOutputBLOBRequest output_blob_requests = 2;
213
- // Function calls started by the allocation.
214
- //
215
- // If a not finished function call gets removed from this list then
216
- // it doesn't get cancelled by the client. ExecutionPlanUpdates are immutable.
217
- repeated AllocationFunctionCall function_calls = 3;
218
- // Watchers for function calls started by the allocation.
219
- repeated AllocationFunctionCallWatcher function_call_watchers = 4;
220
- // Request state operations.
221
- repeated AllocationRequestStateOperation request_state_operations = 7;
222
-
223
- // Optional allocation result. Set when allocation finishes.
224
- AllocationResult result = 5;
225
- // Required state hash.
226
- optional string sha256_hash = 6;
227
- }
228
-
229
- // FunctionInputs contains the input data for allocation execution
230
- message FunctionInputs {
231
- // Values for function call arguments.
232
- repeated SerializedObjectInsideBLOB args = 1;
233
- // Each arg has a matching BLOB.
234
- repeated BLOB arg_blobs = 2;
235
- // BLOB where to upload request error message if allocation fails with request error.
236
- optional BLOB request_error_blob = 3;
237
- // SDK metadata for function calls created by SDK.
238
- // Empty byte array for application function calls.
239
- optional bytes function_call_metadata = 4;
240
- // Sanitized metadata from the application invocation request.
241
- optional RequestContext request_context = 5;
242
- }
243
-
244
- message FunctionArg {
245
- oneof source {
246
- // Data dependency reference to another function call.
247
- string function_call_id = 1;
248
- // Stored inside uploaded_function_outputs_blob or args_blob.
249
- SerializedObjectInsideBLOB value = 2;
250
- }
251
- }
252
-
253
- message FunctionCall {
254
- optional string id = 1;
255
- optional FunctionRef target = 2;
256
- repeated FunctionArg args = 3;
257
- optional bytes call_metadata = 4;
258
- }
259
-
260
- // Deprecated: SDK now generates an equivalent chain of function calls for a reduce operation.
261
- message ReduceOp {
262
- optional string id = 1;
263
- // Contains at least two items.
264
- repeated FunctionArg collection = 2;
265
- optional FunctionRef reducer = 3;
266
- optional bytes call_metadata = 4;
267
- }
268
-
269
-
270
- message ExecutionPlanUpdate {
271
- oneof op {
272
- FunctionCall function_call = 10;
273
- // Deprecated, see ReduceOp message.
274
- ReduceOp reduce = 12;
275
- }
276
- }
277
-
278
- message ExecutionPlanUpdates {
279
- repeated ExecutionPlanUpdate updates = 1;
280
- optional string root_function_call_id = 2;
281
- // Optional timestamp for when to start the plan execution.
282
- optional google.protobuf.Timestamp start_at = 3;
283
- }
284
-
285
- // AllocationResult contains the execution outcome and outputs of an allocation.
286
- message AllocationResult {
287
- optional AllocationOutcomeCode outcome_code = 1;
288
- optional AllocationFailureReason failure_reason = 2;
289
- oneof outputs {
290
- SerializedObjectInsideBLOB value = 3;
291
- ExecutionPlanUpdates updates = 4;
292
- }
293
- // The function_outputs_blob with uploaded function outputs.
294
- optional BLOB uploaded_function_outputs_blob = 5;
295
- // User payload for request error if allocation failed with request error.
296
- // Stored inside uploaded_request_error_blob.
297
- optional SerializedObjectInsideBLOB request_error_output = 6;
298
- // The request_error_blob with uploaded request error output, if any.
299
- optional BLOB uploaded_request_error_blob = 7;
300
- optional Metrics metrics = 8;
301
- }
302
-
303
- enum ReplayMode {
304
- // Initial run, no replay.
305
- REPLAY_MODE_NONE = 0;
306
- // Deterministic replay, fail on mismatch.
307
- REPLAY_MODE_STRICT = 1;
308
- // Replay what matches, re-execute on divergence.
309
- REPLAY_MODE_ADAPTIVE = 2;
310
- }
311
-
312
- // Allocation represents an allocation with its metadata and execution result
313
- message Allocation {
314
- optional string request_id = 1;
315
- optional string function_call_id = 2;
316
- optional string allocation_id = 3;
317
- optional FunctionInputs inputs = 4;
318
- // Set when allocation finishes.
319
- optional AllocationResult result = 5;
320
- // If set, replays until end of the allocation event log.
321
- optional ReplayMode replay_mode = 10;
322
- }
323
-
324
- message CreateAllocationRequest {
325
- optional Allocation allocation = 1;
326
- }
327
-
328
- message WatchAllocationStateRequest {
329
- optional string allocation_id = 1;
330
- }
331
-
332
- message DeleteAllocationRequest {
333
- optional string allocation_id = 1;
334
- }
335
-
336
- message AllocationOutputBlob {
337
- optional google.rpc.Status status = 1;
338
- // Set if status is OK.
339
- optional BLOB blob = 2;
340
- }
341
-
342
- message AllocationFunctionCallResult {
343
- // Deprecated: Use watcher_id to match the result to the watcher.
344
- // TODO: Delete this field once all FEs use watcher_id.
345
- // root_function_call_id from ExecutionPlanUpdates of the function call.
346
- optional string function_call_id = 1;
347
- optional string watcher_id = 7;
348
- optional AllocationOutcomeCode outcome_code = 2;
349
- optional SerializedObjectInsideBLOB value_output = 3;
350
- optional BLOB value_blob = 4;
351
- optional SerializedObjectInsideBLOB request_error_output = 5;
352
- optional BLOB request_error_blob = 6;
353
- }
354
-
355
- message AllocationFunctionCallCreationResult {
356
- // Deprecated: Use allocation_function_call_id to match the result to the function call.
357
- // From ExecutionPlanUpdates.root_function_call_id.
358
- optional string function_call_id = 1;
359
- // allocation_function_call_id from AllocationFunctionCall.
360
- optional string allocation_function_call_id = 3;
361
- optional google.rpc.Status status = 2;
362
- }
363
-
364
- message AllocationRequestStatePrepareReadOperationResult {
365
- // A readable BLOB with the value of the requested key.
366
- // Reading the BLOB will fail if the state key doesn't exist.
367
- optional BLOB blob = 1;
368
- }
369
-
370
- message AllocationRequestStatePrepareWriteOperationResult {
371
- // A writable BLOB where the allocation can upload the value for the requested key.
372
- optional BLOB blob = 1;
373
- }
374
-
375
- message AllocationRequestStateCommitWriteOperationResult {}
376
-
377
- message AllocationRequestStateOperationResult {
378
- optional string operation_id = 1;
379
- optional google.rpc.Status status = 3;
380
- // result is set if status is OK.
381
- oneof result {
382
- AllocationRequestStatePrepareReadOperationResult prepare_read = 4;
383
- AllocationRequestStatePrepareWriteOperationResult prepare_write = 5;
384
- AllocationRequestStateCommitWriteOperationResult commit_write = 6;
385
- }
386
- }
387
-
388
- message AllocationUpdate {
389
- // Target allocation ID.
390
- optional string allocation_id = 1;
391
- oneof update {
392
- // Function call result if the function call is watched by allocation.
393
- AllocationFunctionCallResult function_call_result = 2;
394
- // TODO: Delete output_blob_deprecated once all FEs can use both
395
- // output_blob_deprecated and output_blob.
396
- BLOB output_blob_deprecated = 3;
397
- AllocationOutputBlob output_blob = 4;
398
- AllocationRequestStateOperationResult request_state_operation_result = 5;
399
- // Result of creating a function call requested by the allocation.
400
- AllocationFunctionCallCreationResult function_call_creation_result = 6;
401
- }
402
- }
403
-
404
- // === Allocation Execution Log ===
405
- //
406
- // Execution events describe what happened in the allocation while executing its function call.
407
- // Available starting from FE version 0.1.3.
408
-
409
- // An execution event describing a function call creation by the allocation's user code.
410
- message AllocationExecutionEventCreateFunctionCall {
411
- // function_call_id is updates.root_function_call_id.
412
- optional ExecutionPlanUpdates updates = 1;
413
- // BLOB where serialized function arguments from updates are stored.
414
- // SerializedObjectInsideBLOB args in updates reference offsets within this BLOB.
415
- // Optional, not set if no function arguments in updates.
416
- optional BLOB args_blob = 2;
417
- }
418
-
419
- // An execution event describing a user code side failure while creating a function call.
420
- message AllocationExecutionEventFunctionCallCreationFailed {
421
- optional string function_call_id = 1;
422
- // SDK metadata for function call creation error.
423
- optional bytes metadata = 2;
424
- }
425
-
426
- // An execution event describing a function call watcher creation by the allocation's user code.
427
- // The watcher means the user code is blocked waiting for the watched function call to finish.
428
- message AllocationExecutionEventCreateFunctionCallWatcher {
429
- // ID of the function call to watch.
430
- optional string function_call_id = 1;
431
- // Optional deadline for the watcher. The watcher times out if the function call
432
- // doesn't finish before the deadline.
433
- optional google.protobuf.Timestamp deadline = 2;
434
- }
435
-
436
- // An execution event describing the allocation finishing.
437
- // This is the last event in the execution log. No further events are produced after this.
438
- message AllocationExecutionEventFinishAllocation {
439
- optional AllocationOutcomeCode outcome_code = 1;
440
- optional AllocationFailureReason failure_reason = 2;
441
- oneof outputs {
442
- // Serialized return value. Stored inside uploaded_function_outputs_blob.
443
- SerializedObjectInsideBLOB value = 3;
444
- // Tail function call id if tail call.
445
- string tail_call_durable_id = 4;
446
- }
447
- // BLOB with uploaded function outputs, set when value output is present.
448
- optional BLOB uploaded_function_outputs_blob = 5;
449
- // Serialized request error payload if allocation failed with request error.
450
- // Stored inside uploaded_request_error_blob.
451
- optional SerializedObjectInsideBLOB request_error_output = 6;
452
- // BLOB with uploaded request error output, if any.
453
- optional BLOB uploaded_request_error_blob = 7;
454
- }
455
-
456
- // A single execution event in the allocation execution log.
457
- message AllocationExecutionEvent {
458
- oneof event {
459
- AllocationExecutionEventCreateFunctionCall create_function_call = 1;
460
- AllocationExecutionEventFunctionCallCreationFailed function_call_creation_failed = 2;
461
- AllocationExecutionEventCreateFunctionCallWatcher create_function_call_watcher = 3;
462
- AllocationExecutionEventFinishAllocation finish_allocation = 4;
463
- }
464
- }
465
-
466
- message GetAllocationExecutionLogBatchRequest {
467
- optional string allocation_id = 1;
468
- }
469
-
470
- message GetAllocationExecutionLogBatchResponse {
471
- repeated AllocationExecutionEvent events = 1;
472
- }
473
-
474
- message AdvanceAllocationExecutionLogBatchRequest {
475
- optional string allocation_id = 1;
476
- }
477
-
478
- // === Allocation Event Log ===
479
- //
480
- // Allocation events describe what happened in the request and possibly in the whole world
481
- // that is relevant for the allocation.
482
- // Available starting from FE version 0.1.3.
483
-
484
- // An event notifying that a function call has been created on the server (or failed to create).
485
- message AllocationEventFunctionCallCreated {
486
- // ID of the function call that was created.
487
- optional string function_call_id = 1;
488
- // OK if the function call was created successfully.
489
- optional google.rpc.Status status = 2;
490
- // This is the same metadata that the FE/SDK sent when requesting the function call creation
491
- // and when sending AllocationExecutionEventFunctionCallCreationFailed.
492
- optional bytes metadata = 3;
493
- }
494
-
495
- message AllocationEventFunctionCallWatcherCreated {
496
- // ID of the function call the watcher is for.
497
- optional string function_call_id = 1;
498
- // OK if the function call watcher was created successfully.
499
- optional google.rpc.Status status = 2;
500
- }
501
-
502
- enum FunctionCallWatcherStatus {
503
- FUNCTION_CALL_WATCHER_STATUS_UNKNOWN = 0;
504
- FUNCTION_CALL_WATCHER_STATUS_COMPLETED = 1;
505
- // Watcher timed out, the function call is still running.
506
- FUNCTION_CALL_WATCHER_STATUS_TIMEDOUT = 2;
507
- }
508
-
509
- // An event delivering the result of a watched function call.
510
- message AllocationEventFunctionCallWatcherResult {
511
- // ID of the function call that completed.
512
- optional string function_call_id = 1;
513
- optional AllocationOutcomeCode outcome_code = 2;
514
- optional FunctionCallWatcherStatus watcher_status = 3;
515
- // Set on success: serialized return value stored inside value_blob.
516
- optional SerializedObjectInsideBLOB value_output = 4;
517
- optional BLOB value_blob = 5;
518
- // Set on request error: serialized request error stored inside request_error_blob.
519
- optional SerializedObjectInsideBLOB request_error_output = 6;
520
- optional BLOB request_error_blob = 7;
521
- }
522
-
523
- // A single event in the allocation event log.
524
- message AllocationEvent {
525
- // Monotonical logical clock for ordering of events. Not continuous.
526
- optional uint64 clock = 1;
527
- oneof event {
528
- AllocationEventFunctionCallCreated function_call_created = 2;
529
- AllocationEventFunctionCallWatcherCreated function_call_watcher_created = 3;
530
- AllocationEventFunctionCallWatcherResult function_call_watcher_result = 4;
531
- }
532
- }
533
-
534
- // FE sends a read request to say what event it needs next.
535
- // indexify-dataplane streams these requests via watch_allocation_event_log_reads.
536
- message ReadAllocationEventLogRequest {
537
- optional string allocation_id = 1;
538
- optional uint64 after_clock = 2; // 0 is the beginning of the log
539
- optional uint32 max_entries = 3; // Pagination limit
540
- }
541
-
542
- // Response to a ReadAllocationEventLogRequest, containing the requested events.
543
- message ReadAllocationEventLogResponse {
544
- optional string allocation_id = 1;
545
- repeated AllocationEvent entries = 2;
546
- // Clock of the last returned entry.
547
- optional uint64 last_clock = 3;
548
- // True if more entries exist after last_clock.
549
- optional bool has_more = 4;
550
- }
551
-
552
- message WatchAllocationEventLogReads {
553
- optional string allocation_id = 1;
554
- }
555
-
556
- message HealthCheckRequest {}
557
-
558
- message HealthCheckResponse {
559
- optional bool healthy = 1;
560
- optional string status_message = 2;
561
- }
562
-
563
- message InfoRequest {}
564
-
565
- message InfoResponse {
566
- // Internal version of this Function Executor.
567
- // Semantic versioning schema is used with format 0.0.0.
568
- // Used to support migrations.
569
- optional string version = 1;
570
- // The version of the SDK used in this Function Executor to run customer code.
571
- optional string sdk_version = 2;
572
- // The language of the SDK. Currently supported values:
573
- // - "python"
574
- optional string sdk_language = 3;
575
- // The version of the SDK language. The language's versioning format is used.
576
- optional string sdk_language_version = 4;
577
- }
578
-
579
- service FunctionExecutor {
580
- // Initializes the Function Executor to run allocations
581
- // for a particular function. This method is called only
582
- // once per Function Executor as it can only run a single function.
583
- // It should be called before calling create_allocation.
584
- rpc initialize(InitializeRequest) returns (InitializeResponse);
585
- // Lists the currently-running allocations.
586
- rpc list_allocations(ListAllocationsRequest) returns (ListAllocationsResponse);
587
- // Creates and starts the allocation specified in the request.
588
- rpc create_allocation(CreateAllocationRequest) returns (Empty);
589
- // Streams updates of the allocation state until allocation finishes.
590
- // If allocation is finished, streams the final state and closes the stream.
591
- rpc watch_allocation_state(WatchAllocationStateRequest) returns (stream AllocationState);
592
- // Deletes the allocation. The allocation must be finished before calling this method.
593
- rpc delete_allocation(DeleteAllocationRequest) returns (Empty);
594
- // Send an update to an allocation.
595
- rpc send_allocation_update(AllocationUpdate) returns (Empty);
596
- // Allocation execution log. Available starting from FE version 0.1.3.
597
- // Returns current allocation execution log batch. Blocks if there is no log batch yet.
598
- rpc get_allocation_execution_log_batch(GetAllocationExecutionLogBatchRequest) returns (GetAllocationExecutionLogBatchResponse);
599
- // Advances the current allocation execution log batch to the next one.
600
- rpc advance_allocation_execution_log_batch(AdvanceAllocationExecutionLogBatchRequest) returns (Empty);
601
-
602
- // Allocation event log. Available starting from FE version 0.1.3.
603
- // Streams allocation event log read requests coming from the FE.
604
- rpc watch_allocation_event_log_reads(WatchAllocationEventLogReads) returns (stream ReadAllocationEventLogRequest);
605
- // Sends a response to a read request from the event log.
606
- rpc send_allocation_event_log_read_response(ReadAllocationEventLogResponse) returns (Empty);
607
-
608
- // Health check method to check if the FE is able to run allocations.
609
- // The FE should be initialized before calling this method.
610
- rpc check_health(HealthCheckRequest) returns (HealthCheckResponse);
611
- // Information about this Function Executor.
612
- rpc get_info(InfoRequest) returns (InfoResponse);
613
- }
@@ -1,42 +0,0 @@
1
- // Copyright 2025 Google LLC
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
- syntax = "proto3";
15
- package google.rpc;
16
- import "google/protobuf/any.proto";
17
- option cc_enable_arenas = true;
18
- option go_package = "google.golang.org/genproto/googleapis/rpc/status;status";
19
- option java_multiple_files = true;
20
- option java_outer_classname = "StatusProto";
21
- option java_package = "com.google.rpc";
22
- option objc_class_prefix = "RPC";
23
- // The `Status` type defines a logical error model that is suitable for
24
- // different programming environments, including REST APIs and RPC APIs. It is
25
- // used by [gRPC](https://github.com/grpc). Each `Status` message contains
26
- // three pieces of data: error code, error message, and error details.
27
- //
28
- // You can find out more about this error model and how to work with it in the
29
- // [API Design Guide](https://cloud.google.com/apis/design/errors).
30
- message Status {
31
- // The status code, which should be an enum value of
32
- // [google.rpc.Code][google.rpc.Code].
33
- int32 code = 1;
34
- // A developer-facing error message, which should be in English. Any
35
- // user-facing error message should be localized and sent in the
36
- // [google.rpc.Status.details][google.rpc.Status.details] field, or localized
37
- // by the client.
38
- string message = 2;
39
- // A list of messages that carry the error details. There is a common set of
40
- // message types for APIs to use.
41
- repeated google.protobuf.Any details = 3;
42
- }