modal 0.10.2-dev.8 → 0.11.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/README.md +1 -0
- package/dist/index.cjs +692 -71
- package/dist/index.d.cts +96 -24
- package/dist/index.d.ts +96 -24
- package/dist/index.js +691 -71
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3322,6 +3322,56 @@ function cloudBucketMount_MetadataTTLTypeToJSON(object) {
|
|
|
3322
3322
|
return "UNRECOGNIZED";
|
|
3323
3323
|
}
|
|
3324
3324
|
}
|
|
3325
|
+
function endpointGetInfoResponse_EndpointStatusFromJSON(object) {
|
|
3326
|
+
switch (object) {
|
|
3327
|
+
case 0:
|
|
3328
|
+
case "ENDPOINT_STATUS_UNSPECIFIED":
|
|
3329
|
+
return 0 /* ENDPOINT_STATUS_UNSPECIFIED */;
|
|
3330
|
+
case 1:
|
|
3331
|
+
case "ENDPOINT_STATUS_PROVISIONING":
|
|
3332
|
+
return 1 /* ENDPOINT_STATUS_PROVISIONING */;
|
|
3333
|
+
case 2:
|
|
3334
|
+
case "ENDPOINT_STATUS_LIVE":
|
|
3335
|
+
return 2 /* ENDPOINT_STATUS_LIVE */;
|
|
3336
|
+
case 3:
|
|
3337
|
+
case "ENDPOINT_STATUS_FAILED":
|
|
3338
|
+
return 3 /* ENDPOINT_STATUS_FAILED */;
|
|
3339
|
+
case 4:
|
|
3340
|
+
case "ENDPOINT_STATUS_CANCELLING":
|
|
3341
|
+
return 4 /* ENDPOINT_STATUS_CANCELLING */;
|
|
3342
|
+
case 5:
|
|
3343
|
+
case "ENDPOINT_STATUS_CANCELLED":
|
|
3344
|
+
return 5 /* ENDPOINT_STATUS_CANCELLED */;
|
|
3345
|
+
case 6:
|
|
3346
|
+
case "ENDPOINT_STATUS_STOPPED":
|
|
3347
|
+
return 6 /* ENDPOINT_STATUS_STOPPED */;
|
|
3348
|
+
case -1:
|
|
3349
|
+
case "UNRECOGNIZED":
|
|
3350
|
+
default:
|
|
3351
|
+
return -1 /* UNRECOGNIZED */;
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
3354
|
+
function endpointGetInfoResponse_EndpointStatusToJSON(object) {
|
|
3355
|
+
switch (object) {
|
|
3356
|
+
case 0 /* ENDPOINT_STATUS_UNSPECIFIED */:
|
|
3357
|
+
return "ENDPOINT_STATUS_UNSPECIFIED";
|
|
3358
|
+
case 1 /* ENDPOINT_STATUS_PROVISIONING */:
|
|
3359
|
+
return "ENDPOINT_STATUS_PROVISIONING";
|
|
3360
|
+
case 2 /* ENDPOINT_STATUS_LIVE */:
|
|
3361
|
+
return "ENDPOINT_STATUS_LIVE";
|
|
3362
|
+
case 3 /* ENDPOINT_STATUS_FAILED */:
|
|
3363
|
+
return "ENDPOINT_STATUS_FAILED";
|
|
3364
|
+
case 4 /* ENDPOINT_STATUS_CANCELLING */:
|
|
3365
|
+
return "ENDPOINT_STATUS_CANCELLING";
|
|
3366
|
+
case 5 /* ENDPOINT_STATUS_CANCELLED */:
|
|
3367
|
+
return "ENDPOINT_STATUS_CANCELLED";
|
|
3368
|
+
case 6 /* ENDPOINT_STATUS_STOPPED */:
|
|
3369
|
+
return "ENDPOINT_STATUS_STOPPED";
|
|
3370
|
+
case -1 /* UNRECOGNIZED */:
|
|
3371
|
+
default:
|
|
3372
|
+
return "UNRECOGNIZED";
|
|
3373
|
+
}
|
|
3374
|
+
}
|
|
3325
3375
|
function fileEntry_FileTypeFromJSON(object) {
|
|
3326
3376
|
switch (object) {
|
|
3327
3377
|
case 0:
|
|
@@ -18253,6 +18303,407 @@ var EndpointGetByNameResponse = {
|
|
|
18253
18303
|
return message;
|
|
18254
18304
|
}
|
|
18255
18305
|
};
|
|
18306
|
+
function createBaseEndpointGetInfoRequest() {
|
|
18307
|
+
return { endpointId: "" };
|
|
18308
|
+
}
|
|
18309
|
+
var EndpointGetInfoRequest = {
|
|
18310
|
+
encode(message, writer = new BinaryWriter()) {
|
|
18311
|
+
if (message.endpointId !== "") {
|
|
18312
|
+
writer.uint32(10).string(message.endpointId);
|
|
18313
|
+
}
|
|
18314
|
+
return writer;
|
|
18315
|
+
},
|
|
18316
|
+
decode(input, length) {
|
|
18317
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
18318
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
18319
|
+
const message = createBaseEndpointGetInfoRequest();
|
|
18320
|
+
while (reader.pos < end) {
|
|
18321
|
+
const tag = reader.uint32();
|
|
18322
|
+
switch (tag >>> 3) {
|
|
18323
|
+
case 1: {
|
|
18324
|
+
if (tag !== 10) {
|
|
18325
|
+
break;
|
|
18326
|
+
}
|
|
18327
|
+
message.endpointId = reader.string();
|
|
18328
|
+
continue;
|
|
18329
|
+
}
|
|
18330
|
+
}
|
|
18331
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
18332
|
+
break;
|
|
18333
|
+
}
|
|
18334
|
+
reader.skip(tag & 7);
|
|
18335
|
+
}
|
|
18336
|
+
return message;
|
|
18337
|
+
},
|
|
18338
|
+
fromJSON(object) {
|
|
18339
|
+
return { endpointId: isSet5(object.endpointId) ? globalThis.String(object.endpointId) : "" };
|
|
18340
|
+
},
|
|
18341
|
+
toJSON(message) {
|
|
18342
|
+
const obj = {};
|
|
18343
|
+
if (message.endpointId !== "") {
|
|
18344
|
+
obj.endpointId = message.endpointId;
|
|
18345
|
+
}
|
|
18346
|
+
return obj;
|
|
18347
|
+
},
|
|
18348
|
+
create(base) {
|
|
18349
|
+
return EndpointGetInfoRequest.fromPartial(base ?? {});
|
|
18350
|
+
},
|
|
18351
|
+
fromPartial(object) {
|
|
18352
|
+
const message = createBaseEndpointGetInfoRequest();
|
|
18353
|
+
message.endpointId = object.endpointId ?? "";
|
|
18354
|
+
return message;
|
|
18355
|
+
}
|
|
18356
|
+
};
|
|
18357
|
+
function createBaseEndpointGetInfoResponse() {
|
|
18358
|
+
return { info: void 0, metadata: void 0 };
|
|
18359
|
+
}
|
|
18360
|
+
var EndpointGetInfoResponse = {
|
|
18361
|
+
encode(message, writer = new BinaryWriter()) {
|
|
18362
|
+
if (message.info !== void 0) {
|
|
18363
|
+
EndpointGetInfoResponse_EndpointInfoSummary.encode(message.info, writer.uint32(10).fork()).join();
|
|
18364
|
+
}
|
|
18365
|
+
if (message.metadata !== void 0) {
|
|
18366
|
+
EndpointGetInfoResponse_EndpointHandleMetadata.encode(message.metadata, writer.uint32(18).fork()).join();
|
|
18367
|
+
}
|
|
18368
|
+
return writer;
|
|
18369
|
+
},
|
|
18370
|
+
decode(input, length) {
|
|
18371
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
18372
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
18373
|
+
const message = createBaseEndpointGetInfoResponse();
|
|
18374
|
+
while (reader.pos < end) {
|
|
18375
|
+
const tag = reader.uint32();
|
|
18376
|
+
switch (tag >>> 3) {
|
|
18377
|
+
case 1: {
|
|
18378
|
+
if (tag !== 10) {
|
|
18379
|
+
break;
|
|
18380
|
+
}
|
|
18381
|
+
message.info = EndpointGetInfoResponse_EndpointInfoSummary.decode(reader, reader.uint32());
|
|
18382
|
+
continue;
|
|
18383
|
+
}
|
|
18384
|
+
case 2: {
|
|
18385
|
+
if (tag !== 18) {
|
|
18386
|
+
break;
|
|
18387
|
+
}
|
|
18388
|
+
message.metadata = EndpointGetInfoResponse_EndpointHandleMetadata.decode(reader, reader.uint32());
|
|
18389
|
+
continue;
|
|
18390
|
+
}
|
|
18391
|
+
}
|
|
18392
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
18393
|
+
break;
|
|
18394
|
+
}
|
|
18395
|
+
reader.skip(tag & 7);
|
|
18396
|
+
}
|
|
18397
|
+
return message;
|
|
18398
|
+
},
|
|
18399
|
+
fromJSON(object) {
|
|
18400
|
+
return {
|
|
18401
|
+
info: isSet5(object.info) ? EndpointGetInfoResponse_EndpointInfoSummary.fromJSON(object.info) : void 0,
|
|
18402
|
+
metadata: isSet5(object.metadata) ? EndpointGetInfoResponse_EndpointHandleMetadata.fromJSON(object.metadata) : void 0
|
|
18403
|
+
};
|
|
18404
|
+
},
|
|
18405
|
+
toJSON(message) {
|
|
18406
|
+
const obj = {};
|
|
18407
|
+
if (message.info !== void 0) {
|
|
18408
|
+
obj.info = EndpointGetInfoResponse_EndpointInfoSummary.toJSON(message.info);
|
|
18409
|
+
}
|
|
18410
|
+
if (message.metadata !== void 0) {
|
|
18411
|
+
obj.metadata = EndpointGetInfoResponse_EndpointHandleMetadata.toJSON(message.metadata);
|
|
18412
|
+
}
|
|
18413
|
+
return obj;
|
|
18414
|
+
},
|
|
18415
|
+
create(base) {
|
|
18416
|
+
return EndpointGetInfoResponse.fromPartial(base ?? {});
|
|
18417
|
+
},
|
|
18418
|
+
fromPartial(object) {
|
|
18419
|
+
const message = createBaseEndpointGetInfoResponse();
|
|
18420
|
+
message.info = object.info !== void 0 && object.info !== null ? EndpointGetInfoResponse_EndpointInfoSummary.fromPartial(object.info) : void 0;
|
|
18421
|
+
message.metadata = object.metadata !== void 0 && object.metadata !== null ? EndpointGetInfoResponse_EndpointHandleMetadata.fromPartial(object.metadata) : void 0;
|
|
18422
|
+
return message;
|
|
18423
|
+
}
|
|
18424
|
+
};
|
|
18425
|
+
function createBaseEndpointGetInfoResponse_EndpointInfoSummary() {
|
|
18426
|
+
return {
|
|
18427
|
+
name: "",
|
|
18428
|
+
repoId: "",
|
|
18429
|
+
revision: "",
|
|
18430
|
+
serviceUrl: "",
|
|
18431
|
+
requiresProxyAuth: false,
|
|
18432
|
+
servingMode: 0,
|
|
18433
|
+
status: 0,
|
|
18434
|
+
lifecycle: void 0,
|
|
18435
|
+
volumeId: "",
|
|
18436
|
+
modelPath: ""
|
|
18437
|
+
};
|
|
18438
|
+
}
|
|
18439
|
+
var EndpointGetInfoResponse_EndpointInfoSummary = {
|
|
18440
|
+
encode(message, writer = new BinaryWriter()) {
|
|
18441
|
+
if (message.name !== "") {
|
|
18442
|
+
writer.uint32(10).string(message.name);
|
|
18443
|
+
}
|
|
18444
|
+
if (message.repoId !== "") {
|
|
18445
|
+
writer.uint32(18).string(message.repoId);
|
|
18446
|
+
}
|
|
18447
|
+
if (message.revision !== "") {
|
|
18448
|
+
writer.uint32(26).string(message.revision);
|
|
18449
|
+
}
|
|
18450
|
+
if (message.serviceUrl !== "") {
|
|
18451
|
+
writer.uint32(34).string(message.serviceUrl);
|
|
18452
|
+
}
|
|
18453
|
+
if (message.requiresProxyAuth !== false) {
|
|
18454
|
+
writer.uint32(40).bool(message.requiresProxyAuth);
|
|
18455
|
+
}
|
|
18456
|
+
if (message.servingMode !== 0) {
|
|
18457
|
+
writer.uint32(48).int32(message.servingMode);
|
|
18458
|
+
}
|
|
18459
|
+
if (message.status !== 0) {
|
|
18460
|
+
writer.uint32(56).int32(message.status);
|
|
18461
|
+
}
|
|
18462
|
+
if (message.lifecycle !== void 0) {
|
|
18463
|
+
EndpointLifecycle.encode(message.lifecycle, writer.uint32(66).fork()).join();
|
|
18464
|
+
}
|
|
18465
|
+
if (message.volumeId !== "") {
|
|
18466
|
+
writer.uint32(90).string(message.volumeId);
|
|
18467
|
+
}
|
|
18468
|
+
if (message.modelPath !== "") {
|
|
18469
|
+
writer.uint32(98).string(message.modelPath);
|
|
18470
|
+
}
|
|
18471
|
+
return writer;
|
|
18472
|
+
},
|
|
18473
|
+
decode(input, length) {
|
|
18474
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
18475
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
18476
|
+
const message = createBaseEndpointGetInfoResponse_EndpointInfoSummary();
|
|
18477
|
+
while (reader.pos < end) {
|
|
18478
|
+
const tag = reader.uint32();
|
|
18479
|
+
switch (tag >>> 3) {
|
|
18480
|
+
case 1: {
|
|
18481
|
+
if (tag !== 10) {
|
|
18482
|
+
break;
|
|
18483
|
+
}
|
|
18484
|
+
message.name = reader.string();
|
|
18485
|
+
continue;
|
|
18486
|
+
}
|
|
18487
|
+
case 2: {
|
|
18488
|
+
if (tag !== 18) {
|
|
18489
|
+
break;
|
|
18490
|
+
}
|
|
18491
|
+
message.repoId = reader.string();
|
|
18492
|
+
continue;
|
|
18493
|
+
}
|
|
18494
|
+
case 3: {
|
|
18495
|
+
if (tag !== 26) {
|
|
18496
|
+
break;
|
|
18497
|
+
}
|
|
18498
|
+
message.revision = reader.string();
|
|
18499
|
+
continue;
|
|
18500
|
+
}
|
|
18501
|
+
case 4: {
|
|
18502
|
+
if (tag !== 34) {
|
|
18503
|
+
break;
|
|
18504
|
+
}
|
|
18505
|
+
message.serviceUrl = reader.string();
|
|
18506
|
+
continue;
|
|
18507
|
+
}
|
|
18508
|
+
case 5: {
|
|
18509
|
+
if (tag !== 40) {
|
|
18510
|
+
break;
|
|
18511
|
+
}
|
|
18512
|
+
message.requiresProxyAuth = reader.bool();
|
|
18513
|
+
continue;
|
|
18514
|
+
}
|
|
18515
|
+
case 6: {
|
|
18516
|
+
if (tag !== 48) {
|
|
18517
|
+
break;
|
|
18518
|
+
}
|
|
18519
|
+
message.servingMode = reader.int32();
|
|
18520
|
+
continue;
|
|
18521
|
+
}
|
|
18522
|
+
case 7: {
|
|
18523
|
+
if (tag !== 56) {
|
|
18524
|
+
break;
|
|
18525
|
+
}
|
|
18526
|
+
message.status = reader.int32();
|
|
18527
|
+
continue;
|
|
18528
|
+
}
|
|
18529
|
+
case 8: {
|
|
18530
|
+
if (tag !== 66) {
|
|
18531
|
+
break;
|
|
18532
|
+
}
|
|
18533
|
+
message.lifecycle = EndpointLifecycle.decode(reader, reader.uint32());
|
|
18534
|
+
continue;
|
|
18535
|
+
}
|
|
18536
|
+
case 11: {
|
|
18537
|
+
if (tag !== 90) {
|
|
18538
|
+
break;
|
|
18539
|
+
}
|
|
18540
|
+
message.volumeId = reader.string();
|
|
18541
|
+
continue;
|
|
18542
|
+
}
|
|
18543
|
+
case 12: {
|
|
18544
|
+
if (tag !== 98) {
|
|
18545
|
+
break;
|
|
18546
|
+
}
|
|
18547
|
+
message.modelPath = reader.string();
|
|
18548
|
+
continue;
|
|
18549
|
+
}
|
|
18550
|
+
}
|
|
18551
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
18552
|
+
break;
|
|
18553
|
+
}
|
|
18554
|
+
reader.skip(tag & 7);
|
|
18555
|
+
}
|
|
18556
|
+
return message;
|
|
18557
|
+
},
|
|
18558
|
+
fromJSON(object) {
|
|
18559
|
+
return {
|
|
18560
|
+
name: isSet5(object.name) ? globalThis.String(object.name) : "",
|
|
18561
|
+
repoId: isSet5(object.repoId) ? globalThis.String(object.repoId) : "",
|
|
18562
|
+
revision: isSet5(object.revision) ? globalThis.String(object.revision) : "",
|
|
18563
|
+
serviceUrl: isSet5(object.serviceUrl) ? globalThis.String(object.serviceUrl) : "",
|
|
18564
|
+
requiresProxyAuth: isSet5(object.requiresProxyAuth) ? globalThis.Boolean(object.requiresProxyAuth) : false,
|
|
18565
|
+
servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0,
|
|
18566
|
+
status: isSet5(object.status) ? endpointGetInfoResponse_EndpointStatusFromJSON(object.status) : 0,
|
|
18567
|
+
lifecycle: isSet5(object.lifecycle) ? EndpointLifecycle.fromJSON(object.lifecycle) : void 0,
|
|
18568
|
+
volumeId: isSet5(object.volumeId) ? globalThis.String(object.volumeId) : "",
|
|
18569
|
+
modelPath: isSet5(object.modelPath) ? globalThis.String(object.modelPath) : ""
|
|
18570
|
+
};
|
|
18571
|
+
},
|
|
18572
|
+
toJSON(message) {
|
|
18573
|
+
const obj = {};
|
|
18574
|
+
if (message.name !== "") {
|
|
18575
|
+
obj.name = message.name;
|
|
18576
|
+
}
|
|
18577
|
+
if (message.repoId !== "") {
|
|
18578
|
+
obj.repoId = message.repoId;
|
|
18579
|
+
}
|
|
18580
|
+
if (message.revision !== "") {
|
|
18581
|
+
obj.revision = message.revision;
|
|
18582
|
+
}
|
|
18583
|
+
if (message.serviceUrl !== "") {
|
|
18584
|
+
obj.serviceUrl = message.serviceUrl;
|
|
18585
|
+
}
|
|
18586
|
+
if (message.requiresProxyAuth !== false) {
|
|
18587
|
+
obj.requiresProxyAuth = message.requiresProxyAuth;
|
|
18588
|
+
}
|
|
18589
|
+
if (message.servingMode !== 0) {
|
|
18590
|
+
obj.servingMode = endpointServingModeToJSON(message.servingMode);
|
|
18591
|
+
}
|
|
18592
|
+
if (message.status !== 0) {
|
|
18593
|
+
obj.status = endpointGetInfoResponse_EndpointStatusToJSON(message.status);
|
|
18594
|
+
}
|
|
18595
|
+
if (message.lifecycle !== void 0) {
|
|
18596
|
+
obj.lifecycle = EndpointLifecycle.toJSON(message.lifecycle);
|
|
18597
|
+
}
|
|
18598
|
+
if (message.volumeId !== "") {
|
|
18599
|
+
obj.volumeId = message.volumeId;
|
|
18600
|
+
}
|
|
18601
|
+
if (message.modelPath !== "") {
|
|
18602
|
+
obj.modelPath = message.modelPath;
|
|
18603
|
+
}
|
|
18604
|
+
return obj;
|
|
18605
|
+
},
|
|
18606
|
+
create(base) {
|
|
18607
|
+
return EndpointGetInfoResponse_EndpointInfoSummary.fromPartial(base ?? {});
|
|
18608
|
+
},
|
|
18609
|
+
fromPartial(object) {
|
|
18610
|
+
const message = createBaseEndpointGetInfoResponse_EndpointInfoSummary();
|
|
18611
|
+
message.name = object.name ?? "";
|
|
18612
|
+
message.repoId = object.repoId ?? "";
|
|
18613
|
+
message.revision = object.revision ?? "";
|
|
18614
|
+
message.serviceUrl = object.serviceUrl ?? "";
|
|
18615
|
+
message.requiresProxyAuth = object.requiresProxyAuth ?? false;
|
|
18616
|
+
message.servingMode = object.servingMode ?? 0;
|
|
18617
|
+
message.status = object.status ?? 0;
|
|
18618
|
+
message.lifecycle = object.lifecycle !== void 0 && object.lifecycle !== null ? EndpointLifecycle.fromPartial(object.lifecycle) : void 0;
|
|
18619
|
+
message.volumeId = object.volumeId ?? "";
|
|
18620
|
+
message.modelPath = object.modelPath ?? "";
|
|
18621
|
+
return message;
|
|
18622
|
+
}
|
|
18623
|
+
};
|
|
18624
|
+
function createBaseEndpointGetInfoResponse_EndpointHandleMetadata() {
|
|
18625
|
+
return { appId: "", serverId: "", environmentName: "" };
|
|
18626
|
+
}
|
|
18627
|
+
var EndpointGetInfoResponse_EndpointHandleMetadata = {
|
|
18628
|
+
encode(message, writer = new BinaryWriter()) {
|
|
18629
|
+
if (message.appId !== "") {
|
|
18630
|
+
writer.uint32(10).string(message.appId);
|
|
18631
|
+
}
|
|
18632
|
+
if (message.serverId !== "") {
|
|
18633
|
+
writer.uint32(18).string(message.serverId);
|
|
18634
|
+
}
|
|
18635
|
+
if (message.environmentName !== "") {
|
|
18636
|
+
writer.uint32(26).string(message.environmentName);
|
|
18637
|
+
}
|
|
18638
|
+
return writer;
|
|
18639
|
+
},
|
|
18640
|
+
decode(input, length) {
|
|
18641
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
18642
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
18643
|
+
const message = createBaseEndpointGetInfoResponse_EndpointHandleMetadata();
|
|
18644
|
+
while (reader.pos < end) {
|
|
18645
|
+
const tag = reader.uint32();
|
|
18646
|
+
switch (tag >>> 3) {
|
|
18647
|
+
case 1: {
|
|
18648
|
+
if (tag !== 10) {
|
|
18649
|
+
break;
|
|
18650
|
+
}
|
|
18651
|
+
message.appId = reader.string();
|
|
18652
|
+
continue;
|
|
18653
|
+
}
|
|
18654
|
+
case 2: {
|
|
18655
|
+
if (tag !== 18) {
|
|
18656
|
+
break;
|
|
18657
|
+
}
|
|
18658
|
+
message.serverId = reader.string();
|
|
18659
|
+
continue;
|
|
18660
|
+
}
|
|
18661
|
+
case 3: {
|
|
18662
|
+
if (tag !== 26) {
|
|
18663
|
+
break;
|
|
18664
|
+
}
|
|
18665
|
+
message.environmentName = reader.string();
|
|
18666
|
+
continue;
|
|
18667
|
+
}
|
|
18668
|
+
}
|
|
18669
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
18670
|
+
break;
|
|
18671
|
+
}
|
|
18672
|
+
reader.skip(tag & 7);
|
|
18673
|
+
}
|
|
18674
|
+
return message;
|
|
18675
|
+
},
|
|
18676
|
+
fromJSON(object) {
|
|
18677
|
+
return {
|
|
18678
|
+
appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
|
|
18679
|
+
serverId: isSet5(object.serverId) ? globalThis.String(object.serverId) : "",
|
|
18680
|
+
environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : ""
|
|
18681
|
+
};
|
|
18682
|
+
},
|
|
18683
|
+
toJSON(message) {
|
|
18684
|
+
const obj = {};
|
|
18685
|
+
if (message.appId !== "") {
|
|
18686
|
+
obj.appId = message.appId;
|
|
18687
|
+
}
|
|
18688
|
+
if (message.serverId !== "") {
|
|
18689
|
+
obj.serverId = message.serverId;
|
|
18690
|
+
}
|
|
18691
|
+
if (message.environmentName !== "") {
|
|
18692
|
+
obj.environmentName = message.environmentName;
|
|
18693
|
+
}
|
|
18694
|
+
return obj;
|
|
18695
|
+
},
|
|
18696
|
+
create(base) {
|
|
18697
|
+
return EndpointGetInfoResponse_EndpointHandleMetadata.fromPartial(base ?? {});
|
|
18698
|
+
},
|
|
18699
|
+
fromPartial(object) {
|
|
18700
|
+
const message = createBaseEndpointGetInfoResponse_EndpointHandleMetadata();
|
|
18701
|
+
message.appId = object.appId ?? "";
|
|
18702
|
+
message.serverId = object.serverId ?? "";
|
|
18703
|
+
message.environmentName = object.environmentName ?? "";
|
|
18704
|
+
return message;
|
|
18705
|
+
}
|
|
18706
|
+
};
|
|
18256
18707
|
function createBaseEndpointGetLifecycleRequest() {
|
|
18257
18708
|
return { endpointId: "" };
|
|
18258
18709
|
}
|
|
@@ -22518,7 +22969,6 @@ function createBaseFunctionMessage() {
|
|
|
22518
22969
|
ExperimentalFabricSize: 0,
|
|
22519
22970
|
untrusted: false,
|
|
22520
22971
|
ExperimentalBufferContainers: 0,
|
|
22521
|
-
ExperimentalProxyIp: void 0,
|
|
22522
22972
|
runtimePerfRecord: false,
|
|
22523
22973
|
schedule: void 0,
|
|
22524
22974
|
snapshotDebug: false,
|
|
@@ -22712,9 +23162,6 @@ var FunctionMessage = {
|
|
|
22712
23162
|
if (message.ExperimentalBufferContainers !== 0) {
|
|
22713
23163
|
writer.uint32(552).uint32(message.ExperimentalBufferContainers);
|
|
22714
23164
|
}
|
|
22715
|
-
if (message.ExperimentalProxyIp !== void 0) {
|
|
22716
|
-
writer.uint32(562).string(message.ExperimentalProxyIp);
|
|
22717
|
-
}
|
|
22718
23165
|
if (message.runtimePerfRecord !== false) {
|
|
22719
23166
|
writer.uint32(568).bool(message.runtimePerfRecord);
|
|
22720
23167
|
}
|
|
@@ -23185,13 +23632,6 @@ var FunctionMessage = {
|
|
|
23185
23632
|
message.ExperimentalBufferContainers = reader.uint32();
|
|
23186
23633
|
continue;
|
|
23187
23634
|
}
|
|
23188
|
-
case 70: {
|
|
23189
|
-
if (tag !== 562) {
|
|
23190
|
-
break;
|
|
23191
|
-
}
|
|
23192
|
-
message.ExperimentalProxyIp = reader.string();
|
|
23193
|
-
continue;
|
|
23194
|
-
}
|
|
23195
23635
|
case 71: {
|
|
23196
23636
|
if (tag !== 568) {
|
|
23197
23637
|
break;
|
|
@@ -23445,7 +23885,6 @@ var FunctionMessage = {
|
|
|
23445
23885
|
ExperimentalFabricSize: isSet5(object.ExperimentalFabricSize) ? globalThis.Number(object.ExperimentalFabricSize) : 0,
|
|
23446
23886
|
untrusted: isSet5(object.untrusted) ? globalThis.Boolean(object.untrusted) : false,
|
|
23447
23887
|
ExperimentalBufferContainers: isSet5(object.ExperimentalBufferContainers) ? globalThis.Number(object.ExperimentalBufferContainers) : 0,
|
|
23448
|
-
ExperimentalProxyIp: isSet5(object.ExperimentalProxyIp) ? globalThis.String(object.ExperimentalProxyIp) : void 0,
|
|
23449
23888
|
runtimePerfRecord: isSet5(object.runtimePerfRecord) ? globalThis.Boolean(object.runtimePerfRecord) : false,
|
|
23450
23889
|
schedule: isSet5(object.schedule) ? Schedule.fromJSON(object.schedule) : void 0,
|
|
23451
23890
|
snapshotDebug: isSet5(object.snapshotDebug) ? globalThis.Boolean(object.snapshotDebug) : false,
|
|
@@ -23645,9 +24084,6 @@ var FunctionMessage = {
|
|
|
23645
24084
|
if (message.ExperimentalBufferContainers !== 0) {
|
|
23646
24085
|
obj.ExperimentalBufferContainers = Math.round(message.ExperimentalBufferContainers);
|
|
23647
24086
|
}
|
|
23648
|
-
if (message.ExperimentalProxyIp !== void 0) {
|
|
23649
|
-
obj.ExperimentalProxyIp = message.ExperimentalProxyIp;
|
|
23650
|
-
}
|
|
23651
24087
|
if (message.runtimePerfRecord !== false) {
|
|
23652
24088
|
obj.runtimePerfRecord = message.runtimePerfRecord;
|
|
23653
24089
|
}
|
|
@@ -23794,7 +24230,6 @@ var FunctionMessage = {
|
|
|
23794
24230
|
message.ExperimentalFabricSize = object.ExperimentalFabricSize ?? 0;
|
|
23795
24231
|
message.untrusted = object.untrusted ?? false;
|
|
23796
24232
|
message.ExperimentalBufferContainers = object.ExperimentalBufferContainers ?? 0;
|
|
23797
|
-
message.ExperimentalProxyIp = object.ExperimentalProxyIp ?? void 0;
|
|
23798
24233
|
message.runtimePerfRecord = object.runtimePerfRecord ?? false;
|
|
23799
24234
|
message.schedule = object.schedule !== void 0 && object.schedule !== null ? Schedule.fromPartial(object.schedule) : void 0;
|
|
23800
24235
|
message.snapshotDebug = object.snapshotDebug ?? false;
|
|
@@ -25901,7 +26336,6 @@ function createBaseFunctionData() {
|
|
|
25901
26336
|
webUrlInfo: void 0,
|
|
25902
26337
|
webhookConfig: void 0,
|
|
25903
26338
|
customDomainInfo: [],
|
|
25904
|
-
ExperimentalProxyIp: void 0,
|
|
25905
26339
|
methodDefinitions: {},
|
|
25906
26340
|
methodDefinitionsSet: false,
|
|
25907
26341
|
isClass: false,
|
|
@@ -25980,9 +26414,6 @@ var FunctionData = {
|
|
|
25980
26414
|
for (const v of message.customDomainInfo) {
|
|
25981
26415
|
CustomDomainInfo.encode(v, writer.uint32(98).fork()).join();
|
|
25982
26416
|
}
|
|
25983
|
-
if (message.ExperimentalProxyIp !== void 0) {
|
|
25984
|
-
writer.uint32(194).string(message.ExperimentalProxyIp);
|
|
25985
|
-
}
|
|
25986
26417
|
Object.entries(message.methodDefinitions).forEach(([key, value]) => {
|
|
25987
26418
|
FunctionData_MethodDefinitionsEntry.encode({ key, value }, writer.uint32(202).fork()).join();
|
|
25988
26419
|
});
|
|
@@ -26184,13 +26615,6 @@ var FunctionData = {
|
|
|
26184
26615
|
message.customDomainInfo.push(CustomDomainInfo.decode(reader, reader.uint32()));
|
|
26185
26616
|
continue;
|
|
26186
26617
|
}
|
|
26187
|
-
case 24: {
|
|
26188
|
-
if (tag !== 194) {
|
|
26189
|
-
break;
|
|
26190
|
-
}
|
|
26191
|
-
message.ExperimentalProxyIp = reader.string();
|
|
26192
|
-
continue;
|
|
26193
|
-
}
|
|
26194
26618
|
case 25: {
|
|
26195
26619
|
if (tag !== 202) {
|
|
26196
26620
|
break;
|
|
@@ -26399,7 +26823,6 @@ var FunctionData = {
|
|
|
26399
26823
|
webUrlInfo: isSet5(object.webUrlInfo) ? WebUrlInfo.fromJSON(object.webUrlInfo) : void 0,
|
|
26400
26824
|
webhookConfig: isSet5(object.webhookConfig) ? WebhookConfig.fromJSON(object.webhookConfig) : void 0,
|
|
26401
26825
|
customDomainInfo: globalThis.Array.isArray(object?.customDomainInfo) ? object.customDomainInfo.map((e) => CustomDomainInfo.fromJSON(e)) : [],
|
|
26402
|
-
ExperimentalProxyIp: isSet5(object.ExperimentalProxyIp) ? globalThis.String(object.ExperimentalProxyIp) : void 0,
|
|
26403
26826
|
methodDefinitions: isObject2(object.methodDefinitions) ? Object.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
|
|
26404
26827
|
acc[key] = MethodDefinition.fromJSON(value);
|
|
26405
26828
|
return acc;
|
|
@@ -26484,9 +26907,6 @@ var FunctionData = {
|
|
|
26484
26907
|
if (message.customDomainInfo?.length) {
|
|
26485
26908
|
obj.customDomainInfo = message.customDomainInfo.map((e) => CustomDomainInfo.toJSON(e));
|
|
26486
26909
|
}
|
|
26487
|
-
if (message.ExperimentalProxyIp !== void 0) {
|
|
26488
|
-
obj.ExperimentalProxyIp = message.ExperimentalProxyIp;
|
|
26489
|
-
}
|
|
26490
26910
|
if (message.methodDefinitions) {
|
|
26491
26911
|
const entries = Object.entries(message.methodDefinitions);
|
|
26492
26912
|
if (entries.length > 0) {
|
|
@@ -26592,7 +27012,6 @@ var FunctionData = {
|
|
|
26592
27012
|
message.webUrlInfo = object.webUrlInfo !== void 0 && object.webUrlInfo !== null ? WebUrlInfo.fromPartial(object.webUrlInfo) : void 0;
|
|
26593
27013
|
message.webhookConfig = object.webhookConfig !== void 0 && object.webhookConfig !== null ? WebhookConfig.fromPartial(object.webhookConfig) : void 0;
|
|
26594
27014
|
message.customDomainInfo = object.customDomainInfo?.map((e) => CustomDomainInfo.fromPartial(e)) || [];
|
|
26595
|
-
message.ExperimentalProxyIp = object.ExperimentalProxyIp ?? void 0;
|
|
26596
27015
|
message.methodDefinitions = Object.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
|
|
26597
27016
|
if (value !== void 0) {
|
|
26598
27017
|
acc[key] = MethodDefinition.fromPartial(value);
|
|
@@ -61191,6 +61610,14 @@ var ModalClientDefinition = {
|
|
|
61191
61610
|
responseStream: false,
|
|
61192
61611
|
options: {}
|
|
61193
61612
|
},
|
|
61613
|
+
endpointGetInfo: {
|
|
61614
|
+
name: "EndpointGetInfo",
|
|
61615
|
+
requestType: EndpointGetInfoRequest,
|
|
61616
|
+
requestStream: false,
|
|
61617
|
+
responseType: EndpointGetInfoResponse,
|
|
61618
|
+
responseStream: false,
|
|
61619
|
+
options: {}
|
|
61620
|
+
},
|
|
61194
61621
|
endpointGetLifecycle: {
|
|
61195
61622
|
name: "EndpointGetLifecycle",
|
|
61196
61623
|
requestType: EndpointGetLifecycleRequest,
|
|
@@ -62842,6 +63269,12 @@ var QueueFullError = class extends Error {
|
|
|
62842
63269
|
this.name = "QueueFullError";
|
|
62843
63270
|
}
|
|
62844
63271
|
};
|
|
63272
|
+
var ResourceExhaustedError = class extends Error {
|
|
63273
|
+
constructor(message) {
|
|
63274
|
+
super(message);
|
|
63275
|
+
this.name = "ResourceExhaustedError";
|
|
63276
|
+
}
|
|
63277
|
+
};
|
|
62845
63278
|
var SandboxFilesystemError = class extends Error {
|
|
62846
63279
|
constructor(message) {
|
|
62847
63280
|
super(message);
|
|
@@ -63370,6 +63803,16 @@ var CloudBucketMount2 = class {
|
|
|
63370
63803
|
});
|
|
63371
63804
|
}
|
|
63372
63805
|
};
|
|
63806
|
+
function buildCloudBucketMountProtos(mounts) {
|
|
63807
|
+
return Object.entries(mounts ?? {}).map(([mountPath, mount]) => {
|
|
63808
|
+
if (!mount) {
|
|
63809
|
+
throw new InvalidError(
|
|
63810
|
+
`CloudBucketMount mounted at "${mountPath}" must not be null or undefined`
|
|
63811
|
+
);
|
|
63812
|
+
}
|
|
63813
|
+
return mount.toProto(mountPath);
|
|
63814
|
+
});
|
|
63815
|
+
}
|
|
63373
63816
|
|
|
63374
63817
|
// src/secret.ts
|
|
63375
63818
|
import { ClientError as ClientError2, Status as Status2 } from "nice-grpc";
|
|
@@ -63403,7 +63846,7 @@ var SecretService = class {
|
|
|
63403
63846
|
"secret_name",
|
|
63404
63847
|
name
|
|
63405
63848
|
);
|
|
63406
|
-
return new Secret(resp.secretId, name);
|
|
63849
|
+
return new Secret(resp.secretId, name, void 0, resp.metadata?.keys);
|
|
63407
63850
|
} catch (err) {
|
|
63408
63851
|
if (err instanceof ClientError2 && err.code === Status2.NOT_FOUND)
|
|
63409
63852
|
throw new NotFoundError(err.details);
|
|
@@ -63502,16 +63945,20 @@ var Secret = class {
|
|
|
63502
63945
|
// constructed already-hydrated (e.g. from fromName), and not consulted again
|
|
63503
63946
|
// once secretId is set.
|
|
63504
63947
|
#hydrator;
|
|
63948
|
+
// Names of the env vars a server-side Secret defines, as reported by the
|
|
63949
|
+
// control plane on fromName. Undefined when unknown.
|
|
63950
|
+
#keys;
|
|
63505
63951
|
// Caches the single in-flight (or successfully completed) hydration so the
|
|
63506
63952
|
// ephemeral Secret is created at most once, even if multiple callers hydrate
|
|
63507
63953
|
// the same Secret concurrently. Cleared on failure so a transient error
|
|
63508
63954
|
// doesn't permanently break the Secret; subsequent calls can retry.
|
|
63509
63955
|
#hydratePromise;
|
|
63510
63956
|
/** @ignore */
|
|
63511
|
-
constructor(secretId, name, hydrator) {
|
|
63957
|
+
constructor(secretId, name, hydrator, keys) {
|
|
63512
63958
|
this.#secretId = secretId;
|
|
63513
63959
|
this.name = name;
|
|
63514
63960
|
this.#hydrator = hydrator;
|
|
63961
|
+
this.#keys = keys !== void 0 ? new Set(keys) : void 0;
|
|
63515
63962
|
}
|
|
63516
63963
|
/** The ID of the server-side Secret, or an empty string if not yet hydrated. */
|
|
63517
63964
|
get secretId() {
|
|
@@ -63527,6 +63974,16 @@ var Secret = class {
|
|
|
63527
63974
|
get _hydrator() {
|
|
63528
63975
|
return this.#hydrator;
|
|
63529
63976
|
}
|
|
63977
|
+
/**
|
|
63978
|
+
* Names of the env vars this server-side Secret defines, or `undefined` if
|
|
63979
|
+
* unknown (e.g. for lazy fromObject Secrets or Secrets constructed by id).
|
|
63980
|
+
*
|
|
63981
|
+
* @internal
|
|
63982
|
+
* @hidden
|
|
63983
|
+
*/
|
|
63984
|
+
get _keys() {
|
|
63985
|
+
return this.#keys;
|
|
63986
|
+
}
|
|
63530
63987
|
/**
|
|
63531
63988
|
* Lazily create the ephemeral server-side Secret backing a fromObject Secret
|
|
63532
63989
|
* and populate {@link Secret#secretId secretId}. A no-op once secretId is set
|
|
@@ -63594,6 +64051,9 @@ function splitEnvDictAndResolvableSecrets(secrets) {
|
|
|
63594
64051
|
if (hydrator !== void 0) {
|
|
63595
64052
|
Object.assign(envDict, hydrator.envDict);
|
|
63596
64053
|
} else {
|
|
64054
|
+
for (const key of secret?._keys ?? []) {
|
|
64055
|
+
delete envDict[key];
|
|
64056
|
+
}
|
|
63597
64057
|
resolvable.push(secret);
|
|
63598
64058
|
}
|
|
63599
64059
|
}
|
|
@@ -65289,7 +65749,8 @@ function createBaseTaskContainerCreateRequest() {
|
|
|
65289
65749
|
secretIds: [],
|
|
65290
65750
|
volumeMounts: [],
|
|
65291
65751
|
networkAccess: void 0,
|
|
65292
|
-
ptyInfo: void 0
|
|
65752
|
+
ptyInfo: void 0,
|
|
65753
|
+
memoryReserveConsumeMib: void 0
|
|
65293
65754
|
};
|
|
65294
65755
|
}
|
|
65295
65756
|
var TaskContainerCreateRequest = {
|
|
@@ -65324,6 +65785,9 @@ var TaskContainerCreateRequest = {
|
|
|
65324
65785
|
if (message.ptyInfo !== void 0) {
|
|
65325
65786
|
PTYInfo.encode(message.ptyInfo, writer.uint32(90).fork()).join();
|
|
65326
65787
|
}
|
|
65788
|
+
if (message.memoryReserveConsumeMib !== void 0) {
|
|
65789
|
+
writer.uint32(96).uint32(message.memoryReserveConsumeMib);
|
|
65790
|
+
}
|
|
65327
65791
|
return writer;
|
|
65328
65792
|
},
|
|
65329
65793
|
decode(input, length) {
|
|
@@ -65406,6 +65870,13 @@ var TaskContainerCreateRequest = {
|
|
|
65406
65870
|
message.ptyInfo = PTYInfo.decode(reader, reader.uint32());
|
|
65407
65871
|
continue;
|
|
65408
65872
|
}
|
|
65873
|
+
case 12: {
|
|
65874
|
+
if (tag !== 96) {
|
|
65875
|
+
break;
|
|
65876
|
+
}
|
|
65877
|
+
message.memoryReserveConsumeMib = reader.uint32();
|
|
65878
|
+
continue;
|
|
65879
|
+
}
|
|
65409
65880
|
}
|
|
65410
65881
|
if ((tag & 7) === 4 || tag === 0) {
|
|
65411
65882
|
break;
|
|
@@ -65428,7 +65899,8 @@ var TaskContainerCreateRequest = {
|
|
|
65428
65899
|
secretIds: globalThis.Array.isArray(object?.secretIds) ? object.secretIds.map((e) => globalThis.String(e)) : [],
|
|
65429
65900
|
volumeMounts: globalThis.Array.isArray(object?.volumeMounts) ? object.volumeMounts.map((e) => VolumeMount.fromJSON(e)) : [],
|
|
65430
65901
|
networkAccess: isSet6(object.networkAccess) ? NetworkAccess.fromJSON(object.networkAccess) : void 0,
|
|
65431
|
-
ptyInfo: isSet6(object.ptyInfo) ? PTYInfo.fromJSON(object.ptyInfo) : void 0
|
|
65902
|
+
ptyInfo: isSet6(object.ptyInfo) ? PTYInfo.fromJSON(object.ptyInfo) : void 0,
|
|
65903
|
+
memoryReserveConsumeMib: isSet6(object.memoryReserveConsumeMib) ? globalThis.Number(object.memoryReserveConsumeMib) : void 0
|
|
65432
65904
|
};
|
|
65433
65905
|
},
|
|
65434
65906
|
toJSON(message) {
|
|
@@ -65469,6 +65941,9 @@ var TaskContainerCreateRequest = {
|
|
|
65469
65941
|
if (message.ptyInfo !== void 0) {
|
|
65470
65942
|
obj.ptyInfo = PTYInfo.toJSON(message.ptyInfo);
|
|
65471
65943
|
}
|
|
65944
|
+
if (message.memoryReserveConsumeMib !== void 0) {
|
|
65945
|
+
obj.memoryReserveConsumeMib = Math.round(message.memoryReserveConsumeMib);
|
|
65946
|
+
}
|
|
65472
65947
|
return obj;
|
|
65473
65948
|
},
|
|
65474
65949
|
create(base) {
|
|
@@ -65491,6 +65966,7 @@ var TaskContainerCreateRequest = {
|
|
|
65491
65966
|
message.volumeMounts = object.volumeMounts?.map((e) => VolumeMount.fromPartial(e)) || [];
|
|
65492
65967
|
message.networkAccess = object.networkAccess !== void 0 && object.networkAccess !== null ? NetworkAccess.fromPartial(object.networkAccess) : void 0;
|
|
65493
65968
|
message.ptyInfo = object.ptyInfo !== void 0 && object.ptyInfo !== null ? PTYInfo.fromPartial(object.ptyInfo) : void 0;
|
|
65969
|
+
message.memoryReserveConsumeMib = object.memoryReserveConsumeMib ?? void 0;
|
|
65494
65970
|
return message;
|
|
65495
65971
|
}
|
|
65496
65972
|
};
|
|
@@ -68788,6 +69264,41 @@ import {
|
|
|
68788
69264
|
Status as Status6
|
|
68789
69265
|
} from "nice-grpc";
|
|
68790
69266
|
|
|
69267
|
+
// src/server_warnings.ts
|
|
69268
|
+
var SERVER_WARNING_HEADER = "x-modal-warning";
|
|
69269
|
+
var SERVER_WARNING_REGISTRY_LIMIT = 2048;
|
|
69270
|
+
function logServerWarnings(logger2, trailer, seen) {
|
|
69271
|
+
const joined = trailer.get(SERVER_WARNING_HEADER);
|
|
69272
|
+
if (typeof joined !== "string") return;
|
|
69273
|
+
for (const encoded of joined.split(",")) {
|
|
69274
|
+
let message;
|
|
69275
|
+
try {
|
|
69276
|
+
message = decodeURIComponent(encoded.trim());
|
|
69277
|
+
} catch {
|
|
69278
|
+
message = encoded.trim();
|
|
69279
|
+
}
|
|
69280
|
+
if (seen.size > SERVER_WARNING_REGISTRY_LIMIT) {
|
|
69281
|
+
seen.clear();
|
|
69282
|
+
}
|
|
69283
|
+
if (seen.has(message)) continue;
|
|
69284
|
+
seen.add(message);
|
|
69285
|
+
logger2.warn(message);
|
|
69286
|
+
}
|
|
69287
|
+
}
|
|
69288
|
+
function serverWarningMiddleware(logger2) {
|
|
69289
|
+
const seen = /* @__PURE__ */ new Set();
|
|
69290
|
+
return async function* serverWarningMiddleware2(call, options) {
|
|
69291
|
+
const { onTrailer, ...restOptions } = options;
|
|
69292
|
+
return yield* call.next(call.request, {
|
|
69293
|
+
...restOptions,
|
|
69294
|
+
onTrailer: (trailer) => {
|
|
69295
|
+
logServerWarnings(logger2, trailer, seen);
|
|
69296
|
+
onTrailer?.(trailer);
|
|
69297
|
+
}
|
|
69298
|
+
});
|
|
69299
|
+
};
|
|
69300
|
+
}
|
|
69301
|
+
|
|
68791
69302
|
// src/config.ts
|
|
68792
69303
|
import { warn } from "node:console";
|
|
68793
69304
|
import { readFileSync } from "node:fs";
|
|
@@ -68879,7 +69390,7 @@ function getProfile(profileName) {
|
|
|
68879
69390
|
const ms = Math.round(parsed * 1e3);
|
|
68880
69391
|
return parsed > 0 && ms === 0 ? 1 : ms;
|
|
68881
69392
|
})(),
|
|
68882
|
-
sandboxV2: process.env["MODAL_SANDBOX_V2"] ? parseBooleanFlag(process.env["MODAL_SANDBOX_V2"]) : parseBooleanFlag(profileData.sandbox_v2)
|
|
69393
|
+
sandboxV2: process.env["MODAL_SANDBOX_V2"] ? parseBooleanFlag(process.env["MODAL_SANDBOX_V2"]) : profileData.sandbox_v2 !== void 0 ? parseBooleanFlag(profileData.sandbox_v2) : true
|
|
68883
69394
|
};
|
|
68884
69395
|
return profile;
|
|
68885
69396
|
}
|
|
@@ -69101,7 +69612,7 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
|
|
|
69101
69612
|
options.metadata ??= new Metadata();
|
|
69102
69613
|
options.metadata.set("authorization", `Bearer ${self.jwt}`);
|
|
69103
69614
|
return yield* call.next(call.request, options);
|
|
69104
|
-
});
|
|
69615
|
+
}).use(serverWarningMiddleware(logger2));
|
|
69105
69616
|
this.factory = factory;
|
|
69106
69617
|
this.stub = factory.create(TaskCommandRouterDefinition, this.channel);
|
|
69107
69618
|
this.armIdleTimer();
|
|
@@ -70840,7 +71351,11 @@ var MAIN_CONTAINER_NAME = "main";
|
|
|
70840
71351
|
var CONTAINER_WAIT_POLL_TIMEOUT_SECONDS = 10;
|
|
70841
71352
|
var CONTROL_PLANE_SIDECAR_CREATE_ENV_VAR = "MODAL_USE_CONTROL_PLANE_SIDECAR_CREATE";
|
|
70842
71353
|
function useControlPlaneSidecarCreate(sandboxId) {
|
|
70843
|
-
|
|
71354
|
+
if (getSandboxVersion(sandboxId) !== "V2" /* V2 */) {
|
|
71355
|
+
return false;
|
|
71356
|
+
}
|
|
71357
|
+
const value = process.env[CONTROL_PLANE_SIDECAR_CREATE_ENV_VAR];
|
|
71358
|
+
return value === void 0 || parseBooleanFlag(value);
|
|
70844
71359
|
}
|
|
70845
71360
|
function validateSidecarName(name) {
|
|
70846
71361
|
if (name === "") {
|
|
@@ -70905,14 +71420,44 @@ var SidecarService = class {
|
|
|
70905
71420
|
const command = params?.command ?? [];
|
|
70906
71421
|
validateExecArgs(command);
|
|
70907
71422
|
validateWorkdir(params?.workdir);
|
|
71423
|
+
if (params?.experimentalMemoryReserveConsumeMiB !== void 0 && (!Number.isInteger(params.experimentalMemoryReserveConsumeMiB) || params.experimentalMemoryReserveConsumeMiB <= 0)) {
|
|
71424
|
+
throw new InvalidError(
|
|
71425
|
+
`experimentalMemoryReserveConsumeMiB must be a positive integer number of MiB, got: ${params.experimentalMemoryReserveConsumeMiB}`
|
|
71426
|
+
);
|
|
71427
|
+
}
|
|
71428
|
+
const viaControlPlane = useControlPlaneSidecarCreate(
|
|
71429
|
+
this.#access.sandboxId
|
|
71430
|
+
);
|
|
71431
|
+
const cloudBucketMountEntries = Object.entries(
|
|
71432
|
+
params?.cloudBucketMounts ?? {}
|
|
71433
|
+
);
|
|
71434
|
+
if (cloudBucketMountEntries.length > 0) {
|
|
71435
|
+
if (getSandboxVersion(this.#access.sandboxId) !== "V2" /* V2 */) {
|
|
71436
|
+
throw new InvalidError(
|
|
71437
|
+
"cloudBucketMounts are not supported in sidecars of V1 Sandboxes. A Sandbox is V1 when it has a GPU or MODAL_SANDBOX_V2=0 is set; contact Modal support for more information"
|
|
71438
|
+
);
|
|
71439
|
+
}
|
|
71440
|
+
if (!viaControlPlane) {
|
|
71441
|
+
throw new InvalidError(
|
|
71442
|
+
`cloudBucketMounts are not supported in sidecars when ${CONTROL_PLANE_SIDECAR_CREATE_ENV_VAR}=0 is set; unset it to use them`
|
|
71443
|
+
);
|
|
71444
|
+
}
|
|
71445
|
+
}
|
|
70908
71446
|
validateEnvVarKeys(params?.env ?? {});
|
|
70909
71447
|
const [envDict, resolvableSecrets] = splitEnvDictAndResolvableSecrets(
|
|
70910
71448
|
params?.secrets ?? []
|
|
70911
71449
|
);
|
|
70912
71450
|
Object.assign(envDict, params?.env ?? {});
|
|
70913
|
-
await
|
|
71451
|
+
await hydrateSandboxSecrets(
|
|
71452
|
+
this.#access.client,
|
|
71453
|
+
resolvableSecrets,
|
|
71454
|
+
params?.cloudBucketMounts
|
|
71455
|
+
);
|
|
70914
71456
|
const secretIds = collectSecretIds(resolvableSecrets);
|
|
70915
71457
|
const volumeMounts = buildSidecarVolumeMounts(params?.volumes);
|
|
71458
|
+
const cloudBucketMounts = buildCloudBucketMountProtos(
|
|
71459
|
+
params?.cloudBucketMounts
|
|
71460
|
+
);
|
|
70916
71461
|
const ptyInfo = params?.pty ? defaultSandboxPTYInfo() : void 0;
|
|
70917
71462
|
const networkAccess = buildOutboundNetworkAccess(
|
|
70918
71463
|
false,
|
|
@@ -70921,7 +71466,7 @@ var SidecarService = class {
|
|
|
70921
71466
|
);
|
|
70922
71467
|
let resp;
|
|
70923
71468
|
try {
|
|
70924
|
-
if (
|
|
71469
|
+
if (viaControlPlane) {
|
|
70925
71470
|
const ephemeralSecrets = Object.keys(envDict).length > 0 ? StringMap.create({ contents: envDict }) : void 0;
|
|
70926
71471
|
resp = await this.#access.client.cpClient.sandboxContainerCreateV2(
|
|
70927
71472
|
SandboxContainerCreateV2Request.create({
|
|
@@ -70933,8 +71478,12 @@ var SidecarService = class {
|
|
|
70933
71478
|
workdir: params?.workdir ?? void 0,
|
|
70934
71479
|
secretIds,
|
|
70935
71480
|
volumeMounts,
|
|
71481
|
+
cloudBucketMounts,
|
|
70936
71482
|
networkAccess,
|
|
70937
|
-
ptyInfo
|
|
71483
|
+
ptyInfo,
|
|
71484
|
+
resources: params?.experimentalMemoryReserveConsumeMiB !== void 0 ? Resources.create({
|
|
71485
|
+
memoryMb: params.experimentalMemoryReserveConsumeMiB
|
|
71486
|
+
}) : void 0
|
|
70938
71487
|
}),
|
|
70939
71488
|
ephemeralSecrets
|
|
70940
71489
|
})
|
|
@@ -70952,7 +71501,8 @@ var SidecarService = class {
|
|
|
70952
71501
|
secretIds,
|
|
70953
71502
|
volumeMounts,
|
|
70954
71503
|
networkAccess,
|
|
70955
|
-
ptyInfo
|
|
71504
|
+
ptyInfo,
|
|
71505
|
+
memoryReserveConsumeMib: params?.experimentalMemoryReserveConsumeMiB
|
|
70956
71506
|
})
|
|
70957
71507
|
);
|
|
70958
71508
|
}
|
|
@@ -71363,6 +71913,14 @@ var SB_LOGS_INITIAL_DELAY_MS = 10;
|
|
|
71363
71913
|
var SB_LOGS_DELAY_FACTOR = 2;
|
|
71364
71914
|
var SB_LOGS_MAX_RETRIES = 10;
|
|
71365
71915
|
var SB_LOGS_TASK_ID_TIMEOUT_SECONDS = 0.5;
|
|
71916
|
+
var SANDBOX_SCHEDULING_TIMEOUT_MS = 21 * 60 * 1e3;
|
|
71917
|
+
var GET_TASK_ID_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
71918
|
+
function isTransientTaskIDLookupError(err) {
|
|
71919
|
+
if (!(err instanceof ClientError11)) {
|
|
71920
|
+
return false;
|
|
71921
|
+
}
|
|
71922
|
+
return err.code === Status11.UNAVAILABLE || err.code === Status11.DEADLINE_EXCEEDED || err.code === Status11.INTERNAL;
|
|
71923
|
+
}
|
|
71366
71924
|
var TTL_NO_EXPIRY_SENTINEL = -1;
|
|
71367
71925
|
var CUSTOMER_SUPPLIED_ENCRYPTION_KEY_MIN_LENGTH = 16;
|
|
71368
71926
|
var CUSTOMER_SUPPLIED_ENCRYPTION_KEY_MAX_LENGTH = 512;
|
|
@@ -71562,9 +72120,9 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
|
|
|
71562
72120
|
const volumeMounts = params.volumes ? Object.entries(params.volumes).map(
|
|
71563
72121
|
([mountPath, volume]) => volumeToMountProto(mountPath, volume)
|
|
71564
72122
|
) : [];
|
|
71565
|
-
const cloudBucketMounts =
|
|
71566
|
-
|
|
71567
|
-
)
|
|
72123
|
+
const cloudBucketMounts = buildCloudBucketMountProtos(
|
|
72124
|
+
params.cloudBucketMounts
|
|
72125
|
+
);
|
|
71568
72126
|
const openPorts = [];
|
|
71569
72127
|
if (params.encryptedPorts) {
|
|
71570
72128
|
openPorts.push(
|
|
@@ -71796,7 +72354,9 @@ var SandboxService = class {
|
|
|
71796
72354
|
"sandbox_id",
|
|
71797
72355
|
createResp.sandboxId
|
|
71798
72356
|
);
|
|
71799
|
-
|
|
72357
|
+
const sb = new Sandbox2(this.#client, createResp.sandboxId);
|
|
72358
|
+
await sb._waitForScheduling(SANDBOX_SCHEDULING_TIMEOUT_MS);
|
|
72359
|
+
return sb;
|
|
71800
72360
|
}
|
|
71801
72361
|
/**
|
|
71802
72362
|
* Create a new {@link Sandbox} using the experimental V2 backend.
|
|
@@ -72238,7 +72798,7 @@ function buildTaskSnapshotDirectoryRequestProto(taskId, path2, snapshotId, ttlSe
|
|
|
72238
72798
|
containerId
|
|
72239
72799
|
});
|
|
72240
72800
|
}
|
|
72241
|
-
var Sandbox2 = class
|
|
72801
|
+
var Sandbox2 = class {
|
|
72242
72802
|
#client;
|
|
72243
72803
|
sandboxId;
|
|
72244
72804
|
#appId;
|
|
@@ -72539,15 +73099,15 @@ var Sandbox2 = class _Sandbox {
|
|
|
72539
73099
|
}
|
|
72540
73100
|
return this.#client.cpClient.sandboxWait(req);
|
|
72541
73101
|
}
|
|
72542
|
-
#sandboxGetTaskId(
|
|
73102
|
+
#sandboxGetTaskId(timeoutSecs, options) {
|
|
72543
73103
|
const req = SandboxGetTaskIdRequest.create({
|
|
72544
73104
|
sandboxId: this.sandboxId,
|
|
72545
|
-
timeout
|
|
73105
|
+
timeout: timeoutSecs
|
|
72546
73106
|
});
|
|
72547
73107
|
if (this.#isV2) {
|
|
72548
|
-
return this.#client.cpClient.sandboxGetTaskIdV2(req,
|
|
73108
|
+
return this.#client.cpClient.sandboxGetTaskIdV2(req, options);
|
|
72549
73109
|
}
|
|
72550
|
-
return this.#client.cpClient.sandboxGetTaskId(req,
|
|
73110
|
+
return this.#client.cpClient.sandboxGetTaskId(req, options);
|
|
72551
73111
|
}
|
|
72552
73112
|
#sandboxGetTunnels(timeoutMs) {
|
|
72553
73113
|
const req = { sandboxId: this.sandboxId, timeout: timeoutMs / 1e3 };
|
|
@@ -72571,8 +73131,6 @@ var Sandbox2 = class _Sandbox {
|
|
|
72571
73131
|
}
|
|
72572
73132
|
await this.#client.cpClient.sandboxTerminate(req);
|
|
72573
73133
|
}
|
|
72574
|
-
static #maxGetTaskIdAttempts = 600;
|
|
72575
|
-
// 5 minutes at 500ms intervals
|
|
72576
73134
|
async #getAppId() {
|
|
72577
73135
|
if (this.#appId !== void 0) {
|
|
72578
73136
|
return this.#appId;
|
|
@@ -72593,10 +73151,7 @@ var Sandbox2 = class _Sandbox {
|
|
|
72593
73151
|
}
|
|
72594
73152
|
let resp;
|
|
72595
73153
|
try {
|
|
72596
|
-
resp = await this.#sandboxGetTaskId(
|
|
72597
|
-
void 0,
|
|
72598
|
-
SB_LOGS_TASK_ID_TIMEOUT_SECONDS
|
|
72599
|
-
);
|
|
73154
|
+
resp = await this.#sandboxGetTaskId(SB_LOGS_TASK_ID_TIMEOUT_SECONDS);
|
|
72600
73155
|
} catch (error) {
|
|
72601
73156
|
if (error instanceof ClientError11 && error.code === Status11.DEADLINE_EXCEEDED) {
|
|
72602
73157
|
throw new ExecutionError("Sandbox task ID is not available yet.");
|
|
@@ -72610,28 +73165,92 @@ var Sandbox2 = class _Sandbox {
|
|
|
72610
73165
|
return this.#taskId;
|
|
72611
73166
|
}
|
|
72612
73167
|
async #getTaskId(signal) {
|
|
73168
|
+
return await this.#waitForTaskId(GET_TASK_ID_TIMEOUT_MS, false, signal);
|
|
73169
|
+
}
|
|
73170
|
+
/**
|
|
73171
|
+
* Blocks until the Sandbox has a task. If the wait fails, the Sandbox is
|
|
73172
|
+
* terminated so a queued one cannot start later with no caller. A timeout
|
|
73173
|
+
* surfaces as a ResourceExhaustedError.
|
|
73174
|
+
*
|
|
73175
|
+
* @internal
|
|
73176
|
+
* @hidden
|
|
73177
|
+
*/
|
|
73178
|
+
async _waitForScheduling(timeoutMs) {
|
|
73179
|
+
try {
|
|
73180
|
+
await this.#waitForTaskId(timeoutMs, true);
|
|
73181
|
+
} catch (err) {
|
|
73182
|
+
if (err instanceof ConflictError) {
|
|
73183
|
+
throw err;
|
|
73184
|
+
}
|
|
73185
|
+
try {
|
|
73186
|
+
await this.#sandboxTerminate();
|
|
73187
|
+
} catch (terminateErr) {
|
|
73188
|
+
this.#client.logger.debug(
|
|
73189
|
+
"Failed to terminate unscheduled Sandbox",
|
|
73190
|
+
"sandbox_id",
|
|
73191
|
+
this.sandboxId,
|
|
73192
|
+
"error",
|
|
73193
|
+
terminateErr
|
|
73194
|
+
);
|
|
73195
|
+
}
|
|
73196
|
+
if (err instanceof TimeoutError) {
|
|
73197
|
+
throw new ResourceExhaustedError(
|
|
73198
|
+
"Insufficient capacity to create sandbox."
|
|
73199
|
+
);
|
|
73200
|
+
}
|
|
73201
|
+
throw err;
|
|
73202
|
+
}
|
|
73203
|
+
}
|
|
73204
|
+
/**
|
|
73205
|
+
* Polls until the Sandbox has been assigned a task. Throws a ConflictError
|
|
73206
|
+
* if the Sandbox finished before that happened and a TimeoutError once
|
|
73207
|
+
* timeoutMs elapses. With retryTransient, lookups that fail with a
|
|
73208
|
+
* transient error keep polling until the deadline instead of failing.
|
|
73209
|
+
*/
|
|
73210
|
+
async #waitForTaskId(timeoutMs, retryTransient, signal) {
|
|
72613
73211
|
if (this.#taskId !== void 0) {
|
|
72614
73212
|
return this.#taskId;
|
|
72615
73213
|
}
|
|
72616
|
-
|
|
72617
|
-
|
|
73214
|
+
const deadline = Date.now() + timeoutMs;
|
|
73215
|
+
const timedOut = () => new TimeoutError(
|
|
73216
|
+
`Timed out waiting for task ID for Sandbox ${this.sandboxId}`
|
|
73217
|
+
);
|
|
73218
|
+
const pollIntervalMs = 500;
|
|
73219
|
+
const noTimeLeft = () => deadline - Date.now() <= pollIntervalMs;
|
|
73220
|
+
while (true) {
|
|
73221
|
+
let resp;
|
|
73222
|
+
try {
|
|
73223
|
+
resp = await this.#sandboxGetTaskId(void 0, { signal });
|
|
73224
|
+
} catch (err) {
|
|
73225
|
+
if (signal?.aborted || !isTransientTaskIDLookupError(err)) {
|
|
73226
|
+
throw err;
|
|
73227
|
+
}
|
|
73228
|
+
if (!retryTransient && Date.now() < deadline) {
|
|
73229
|
+
throw err;
|
|
73230
|
+
}
|
|
73231
|
+
if (noTimeLeft()) {
|
|
73232
|
+
if (err instanceof ClientError11 && err.code === Status11.INTERNAL) {
|
|
73233
|
+
throw err;
|
|
73234
|
+
}
|
|
73235
|
+
throw timedOut();
|
|
73236
|
+
}
|
|
73237
|
+
await setTimeout3(pollIntervalMs, void 0, { signal });
|
|
73238
|
+
continue;
|
|
73239
|
+
}
|
|
72618
73240
|
if (resp.taskId) {
|
|
72619
73241
|
this.#taskId = resp.taskId;
|
|
72620
73242
|
return this.#taskId;
|
|
72621
73243
|
}
|
|
72622
73244
|
if (resp.taskResult) {
|
|
72623
|
-
|
|
72624
|
-
|
|
72625
|
-
}
|
|
72626
|
-
throw new Error(
|
|
72627
|
-
`Sandbox ${this.sandboxId} has already completed with result: exception:"${resp.taskResult.exception}"`
|
|
73245
|
+
throw new ConflictError(
|
|
73246
|
+
resp.taskResult.exception || `Sandbox ${this.sandboxId} has already finished`
|
|
72628
73247
|
);
|
|
72629
73248
|
}
|
|
72630
|
-
|
|
73249
|
+
if (noTimeLeft()) {
|
|
73250
|
+
throw timedOut();
|
|
73251
|
+
}
|
|
73252
|
+
await setTimeout3(pollIntervalMs, void 0, { signal });
|
|
72631
73253
|
}
|
|
72632
|
-
throw new Error(
|
|
72633
|
-
`Timed out waiting for task ID for Sandbox ${this.sandboxId}`
|
|
72634
|
-
);
|
|
72635
73254
|
}
|
|
72636
73255
|
async #getOrCreateCommandRouterClient(taskId) {
|
|
72637
73256
|
if (this.#commandRouterClient !== void 0) {
|
|
@@ -73619,7 +74238,7 @@ var AuthTokenManager = class {
|
|
|
73619
74238
|
};
|
|
73620
74239
|
|
|
73621
74240
|
// src/version.ts
|
|
73622
|
-
var SDK_VERSION = "0.
|
|
74241
|
+
var SDK_VERSION = "0.11.0";
|
|
73623
74242
|
function getSDKVersion() {
|
|
73624
74243
|
return SDK_VERSION;
|
|
73625
74244
|
}
|
|
@@ -73891,7 +74510,7 @@ var ModalClient = class {
|
|
|
73891
74510
|
"grpc.keepalive_timeout_ms": 1e4,
|
|
73892
74511
|
"grpc.keepalive_permit_without_calls": 1
|
|
73893
74512
|
});
|
|
73894
|
-
let factory = createClientFactory2().use(this.authMiddleware(profile)).use(this.retryMiddleware()).use(timeoutMiddleware);
|
|
74513
|
+
let factory = createClientFactory2().use(this.authMiddleware(profile)).use(this.retryMiddleware()).use(serverWarningMiddleware(this.logger)).use(timeoutMiddleware);
|
|
73895
74514
|
for (const middleware of this.customMiddleware) {
|
|
73896
74515
|
factory = factory.use(middleware);
|
|
73897
74516
|
}
|
|
@@ -76203,6 +76822,7 @@ export {
|
|
|
76203
76822
|
QueueFullError,
|
|
76204
76823
|
QueueService,
|
|
76205
76824
|
RemoteError,
|
|
76825
|
+
ResourceExhaustedError,
|
|
76206
76826
|
Retries,
|
|
76207
76827
|
Sandbox2 as Sandbox,
|
|
76208
76828
|
SandboxFilesystem,
|