kurtosis-sdk 0.57.3 → 0.57.5
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/build/core/lib/enclaves/enclave_context.d.ts +2 -3
- package/build/core/lib/enclaves/enclave_context.js +27 -25
- package/build/core/lib/enclaves/template_and_data.js +1 -1
- package/build/core/lib/modules/module_context.js +2 -2
- package/build/core/lib/services/container_config.js +2 -2
- package/build/core/lib/services/service.d.ts +0 -7
- package/build/core/lib/services/service.js +0 -14
- package/build/core/lib/services/service_context.js +8 -8
- package/build/engine/lib/kurtosis_context/kurtosis_context.js +8 -8
- package/build/index.d.ts +1 -1
- package/build/kurtosis_version/kurtosis_version.js +1 -1
- package/package.json +1 -1
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
import { Result } from "neverthrow";
|
|
3
3
|
import { ModuleContext, ModuleID } from "../modules/module_context";
|
|
4
4
|
import type { ContainerConfig, FilesArtifactUUID } from "../services/container_config";
|
|
5
|
-
import type { ServiceID } from "../services/service";
|
|
5
|
+
import type { ServiceID, ServiceGUID } from "../services/service";
|
|
6
6
|
import { ServiceContext } from "../services/service_context";
|
|
7
7
|
import type { PartitionConnection } from "./partition_connection";
|
|
8
|
-
import { ServiceInfo as ServiceInfoSimple } from './../services/service';
|
|
9
8
|
import { TemplateAndData } from "./template_and_data";
|
|
10
9
|
import { Readable } from "stream";
|
|
11
10
|
export declare type EnclaveID = string;
|
|
@@ -34,7 +33,7 @@ export declare class EnclaveContext {
|
|
|
34
33
|
repartitionNetwork(partitionServices: Map<PartitionID, Set<ServiceID>>, partitionConnections: Map<PartitionID, Map<PartitionID, PartitionConnection>>, defaultConnection: PartitionConnection): Promise<Result<null, Error>>;
|
|
35
34
|
waitForHttpGetEndpointAvailability(serviceId: ServiceID, port: number, path: string, initialDelayMilliseconds: number, retries: number, retriesDelayMilliseconds: number, bodyText: string): Promise<Result<null, Error>>;
|
|
36
35
|
waitForHttpPostEndpointAvailability(serviceId: ServiceID, port: number, path: string, requestBody: string, initialDelayMilliseconds: number, retries: number, retriesDelayMilliseconds: number, bodyText: string): Promise<Result<null, Error>>;
|
|
37
|
-
getServices(): Promise<Result<
|
|
36
|
+
getServices(): Promise<Result<Map<ServiceID, ServiceGUID>, Error>>;
|
|
38
37
|
getModules(): Promise<Result<Set<ModuleID>, Error>>;
|
|
39
38
|
uploadFiles(pathToArchive: string): Promise<Result<FilesArtifactUUID, Error>>;
|
|
40
39
|
storeWebFiles(url: string): Promise<Result<FilesArtifactUUID, Error>>;
|
|
@@ -24,14 +24,13 @@ const constructor_calls_1 = require("../constructor_calls");
|
|
|
24
24
|
const service_context_1 = require("../services/service_context");
|
|
25
25
|
const port_spec_1 = require("../services/port_spec");
|
|
26
26
|
const api_container_service_pb_1 = require("../../kurtosis_core_rpc_api_bindings/api_container_service_pb");
|
|
27
|
-
const service_1 = require("./../services/service");
|
|
28
27
|
const path = require("path");
|
|
29
28
|
const kurtosis_yaml_1 = require("./kurtosis_yaml");
|
|
30
29
|
// This will always resolve to the default partition ID (regardless of whether such a partition exists in the enclave,
|
|
31
30
|
// or it was repartitioned away)
|
|
32
31
|
const DEFAULT_PARTITION_ID = "";
|
|
33
32
|
exports.KURTOSIS_YAML_FILENAME = "kurtosis.yml";
|
|
34
|
-
// Docs available at https://docs.
|
|
33
|
+
// Docs available at https://docs.kurtosis.com/sdk/#enclavecontext
|
|
35
34
|
class EnclaveContext {
|
|
36
35
|
constructor(backend, pathJoiner, genericTgzArchiver) {
|
|
37
36
|
this.backend = backend;
|
|
@@ -94,11 +93,11 @@ class EnclaveContext {
|
|
|
94
93
|
return (0, neverthrow_1.ok)(enclaveContext);
|
|
95
94
|
});
|
|
96
95
|
}
|
|
97
|
-
// Docs available at https://docs.
|
|
96
|
+
// Docs available at https://docs.kurtosis.com/sdk/#getenclaveid---enclaveid
|
|
98
97
|
getEnclaveId() {
|
|
99
98
|
return this.backend.getEnclaveId();
|
|
100
99
|
}
|
|
101
|
-
// Docs available at https://docs.
|
|
100
|
+
// Docs available at https://docs.kurtosis.com/sdk/#loadmodulestring-moduleid-string-image-string-serializedparams---modulecontext-modulecontext
|
|
102
101
|
loadModule(moduleId, image, serializedParams) {
|
|
103
102
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
103
|
const loadModuleArgs = (0, constructor_calls_1.newLoadModuleArgs)(moduleId, image, serializedParams);
|
|
@@ -110,7 +109,7 @@ class EnclaveContext {
|
|
|
110
109
|
return (0, neverthrow_1.ok)(moduleContext);
|
|
111
110
|
});
|
|
112
111
|
}
|
|
113
|
-
// Docs available at https://docs.
|
|
112
|
+
// Docs available at https://docs.kurtosis.com/sdk/#unloadmodulestring-moduleid
|
|
114
113
|
unloadModule(moduleId) {
|
|
115
114
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
115
|
const unloadModuleArgs = (0, constructor_calls_1.newUnloadModuleArgs)(moduleId);
|
|
@@ -122,7 +121,7 @@ class EnclaveContext {
|
|
|
122
121
|
return (0, neverthrow_1.ok)(null);
|
|
123
122
|
});
|
|
124
123
|
}
|
|
125
|
-
// Docs available at https://docs.
|
|
124
|
+
// Docs available at https://docs.kurtosis.com/sdk/#getmodulecontextstring-moduleid---modulecontext-modulecontext
|
|
126
125
|
getModuleContext(moduleId) {
|
|
127
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
128
127
|
const moduleMapForArgs = new Map();
|
|
@@ -140,6 +139,7 @@ class EnclaveContext {
|
|
|
140
139
|
return (0, neverthrow_1.ok)(moduleCtx);
|
|
141
140
|
});
|
|
142
141
|
}
|
|
142
|
+
// Docs available at https://docs.kurtosis.com/sdk/#runstarlarkscriptstring-serializedstarlarkscript-boolean-dryrun---streamstarlarkrunresponseline-responselines-error-error
|
|
143
143
|
runStarlarkScript(serializedStartosisScript, serializedParams, dryRun) {
|
|
144
144
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
145
|
const args = new api_container_service_pb_1.RunStarlarkScriptArgs();
|
|
@@ -153,6 +153,7 @@ class EnclaveContext {
|
|
|
153
153
|
return (0, neverthrow_1.ok)(scriptRunResult.value);
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
+
// Docs available at https://docs.kurtosis.com/sdk/#runstarlarkpackagestring-packagerootpath-string-serializedparams-boolean-dryrun---streamstarlarkrunresponseline-responselines-error-error
|
|
156
157
|
runStarlarkPackage(packageRootPath, serializedParams, dryRun) {
|
|
157
158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
158
159
|
const args = yield this.assembleRunStarlarkPackageArg(packageRootPath, serializedParams, dryRun);
|
|
@@ -166,6 +167,7 @@ class EnclaveContext {
|
|
|
166
167
|
return (0, neverthrow_1.ok)(packageRunResult.value);
|
|
167
168
|
});
|
|
168
169
|
}
|
|
170
|
+
// Docs available at https://docs.kurtosis.com/sdk/#runremotestarlarkpackagestring-packageid-string-serializedparams-boolean-dryrun---streamstarlarkrunresponseline-responselines-error-error
|
|
169
171
|
runStarlarkRemotePackage(moduleId, serializedParams, dryRun) {
|
|
170
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
171
173
|
const args = new api_container_service_pb_1.RunStarlarkPackageArgs();
|
|
@@ -180,7 +182,7 @@ class EnclaveContext {
|
|
|
180
182
|
return (0, neverthrow_1.ok)(remotePackageRunResult.value);
|
|
181
183
|
});
|
|
182
184
|
}
|
|
183
|
-
// Docs available at https://docs.
|
|
185
|
+
// Docs available at https://docs.kurtosis.com/sdk/#addserviceserviceid-serviceid--containerconfig-containerconfig---servicecontext-servicecontext
|
|
184
186
|
addService(serviceId, containerConfig) {
|
|
185
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
186
188
|
const containerConfigs = new Map();
|
|
@@ -201,7 +203,7 @@ class EnclaveContext {
|
|
|
201
203
|
return (0, neverthrow_1.ok)(serviceCtx);
|
|
202
204
|
});
|
|
203
205
|
}
|
|
204
|
-
// Docs available at https://docs.
|
|
206
|
+
// Docs available at https://docs.kurtosis.com/sdk/#addservicesmapserviceid-containerconfig-containerconfigs---mapserviceid-servicecontext-successfulservices-mapserviceid-error-failedservices
|
|
205
207
|
addServices(containerConfigs) {
|
|
206
208
|
return __awaiter(this, void 0, void 0, function* () {
|
|
207
209
|
const resultAddServicesToPartition = yield this.addServicesToPartition(containerConfigs, DEFAULT_PARTITION_ID);
|
|
@@ -211,7 +213,7 @@ class EnclaveContext {
|
|
|
211
213
|
return (0, neverthrow_1.ok)(resultAddServicesToPartition.value);
|
|
212
214
|
});
|
|
213
215
|
}
|
|
214
|
-
// Docs available at https://docs.
|
|
216
|
+
// Docs available at https://docs.kurtosis.com/sdk/#addservicetopartitionserviceid-serviceid-partitionid-partitionid-containerconfig-containerconfig---servicecontext-servicecontext
|
|
215
217
|
addServiceToPartition(serviceId, partitionId, containerConfig) {
|
|
216
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
217
219
|
const containerConfigs = new Map();
|
|
@@ -232,7 +234,7 @@ class EnclaveContext {
|
|
|
232
234
|
return (0, neverthrow_1.ok)(serviceCtx);
|
|
233
235
|
});
|
|
234
236
|
}
|
|
235
|
-
// Docs available at https://docs.
|
|
237
|
+
// Docs available at https://docs.kurtosis.com/sdk/#addservicestopartitionmapserviceid-containerconfig-containerconfigs-partitionid-partitionid---mapserviceid-servicecontext-successfulservices-mapserviceid-error-failedservices
|
|
236
238
|
addServicesToPartition(containerConfigs, partitionID) {
|
|
237
239
|
return __awaiter(this, void 0, void 0, function* () {
|
|
238
240
|
const failedServicesPool = new Map();
|
|
@@ -317,7 +319,7 @@ class EnclaveContext {
|
|
|
317
319
|
return (0, neverthrow_1.ok)([successfulServices, failedServicesPool]);
|
|
318
320
|
});
|
|
319
321
|
}
|
|
320
|
-
// Docs available at https://docs.
|
|
322
|
+
// Docs available at https://docs.kurtosis.com/sdk/#getservicecontextserviceid-serviceid---servicecontext-servicecontext
|
|
321
323
|
getServiceContext(serviceId) {
|
|
322
324
|
return __awaiter(this, void 0, void 0, function* () {
|
|
323
325
|
const serviceArgMap = new Map();
|
|
@@ -340,7 +342,7 @@ class EnclaveContext {
|
|
|
340
342
|
return (0, neverthrow_1.ok)(serviceContext);
|
|
341
343
|
});
|
|
342
344
|
}
|
|
343
|
-
// Docs available at https://docs.
|
|
345
|
+
// Docs available at https://docs.kurtosis.com/sdk/#removeserviceserviceid-serviceid-uint64-containerstoptimeoutseconds
|
|
344
346
|
removeService(serviceId) {
|
|
345
347
|
return __awaiter(this, void 0, void 0, function* () {
|
|
346
348
|
loglevel_1.default.debug("Removing service '" + serviceId + "'...");
|
|
@@ -353,7 +355,7 @@ class EnclaveContext {
|
|
|
353
355
|
return (0, neverthrow_1.ok)(null);
|
|
354
356
|
});
|
|
355
357
|
}
|
|
356
|
-
// Docs available at https://docs.
|
|
358
|
+
// Docs available at https://docs.kurtosis.com/sdk/#repartitionnetworkmappartitionid-setserviceid-partitionservices-mappartitionid-mappartitionid-partitionconnection-partitionconnections-partitionconnection-defaultconnection
|
|
357
359
|
repartitionNetwork(partitionServices, partitionConnections, defaultConnection) {
|
|
358
360
|
return __awaiter(this, void 0, void 0, function* () {
|
|
359
361
|
if (partitionServices === null) {
|
|
@@ -391,7 +393,7 @@ class EnclaveContext {
|
|
|
391
393
|
return (0, neverthrow_1.ok)(null);
|
|
392
394
|
});
|
|
393
395
|
}
|
|
394
|
-
// Docs available at https://docs.
|
|
396
|
+
// Docs available at https://docs.kurtosis.com/sdk/#waitforhttpgetendpointavailabilityserviceid-serviceid-uint32-port-string-path-string-requestbody-uint32-initialdelaymilliseconds-uint32-retries-uint32-retriesdelaymilliseconds-string-bodytext
|
|
395
397
|
waitForHttpGetEndpointAvailability(serviceId, port, path, initialDelayMilliseconds, retries, retriesDelayMilliseconds, bodyText) {
|
|
396
398
|
return __awaiter(this, void 0, void 0, function* () {
|
|
397
399
|
const availabilityArgs = (0, constructor_calls_1.newWaitForHttpGetEndpointAvailabilityArgs)(serviceId, port, path, initialDelayMilliseconds, retries, retriesDelayMilliseconds, bodyText);
|
|
@@ -403,14 +405,14 @@ class EnclaveContext {
|
|
|
403
405
|
return (0, neverthrow_1.ok)(result);
|
|
404
406
|
});
|
|
405
407
|
}
|
|
406
|
-
// Docs available at https://docs.
|
|
408
|
+
// Docs available at https://docs.kurtosis.com/sdk/#waitforhttppostendpointavailabilityserviceid-serviceid-uint32-port-string-path-string-requestbody-uint32-initialdelaymilliseconds-uint32-retries-uint32-retriesdelaymilliseconds-string-bodytext
|
|
407
409
|
waitForHttpPostEndpointAvailability(serviceId, port, path, requestBody, initialDelayMilliseconds, retries, retriesDelayMilliseconds, bodyText) {
|
|
408
410
|
return __awaiter(this, void 0, void 0, function* () {
|
|
409
411
|
const availabilityArgs = (0, constructor_calls_1.newWaitForHttpPostEndpointAvailabilityArgs)(serviceId, port, path, requestBody, initialDelayMilliseconds, retries, retriesDelayMilliseconds, bodyText);
|
|
410
412
|
return this.backend.waitForHttpPostEndpointAvailability(availabilityArgs);
|
|
411
413
|
});
|
|
412
414
|
}
|
|
413
|
-
// Docs available at https://docs.
|
|
415
|
+
// Docs available at https://docs.kurtosis.com/sdk/#getservices---mapserviceid--serviceguid-serviceids
|
|
414
416
|
getServices() {
|
|
415
417
|
return __awaiter(this, void 0, void 0, function* () {
|
|
416
418
|
const getAllServicesArgMap = new Map();
|
|
@@ -420,14 +422,14 @@ class EnclaveContext {
|
|
|
420
422
|
return (0, neverthrow_1.err)(getServicesResponseResult.error);
|
|
421
423
|
}
|
|
422
424
|
const getServicesResponse = getServicesResponseResult.value;
|
|
423
|
-
const serviceInfos = new
|
|
425
|
+
const serviceInfos = new Map();
|
|
424
426
|
getServicesResponse.getServiceInfoMap().forEach((value, key) => {
|
|
425
|
-
serviceInfos.
|
|
427
|
+
serviceInfos.set(key, value.getServiceGuid());
|
|
426
428
|
});
|
|
427
429
|
return (0, neverthrow_1.ok)(serviceInfos);
|
|
428
430
|
});
|
|
429
431
|
}
|
|
430
|
-
// Docs available at https://docs.
|
|
432
|
+
// Docs available at https://docs.kurtosis.com/sdk/#getmodules---setmoduleid-moduleids
|
|
431
433
|
getModules() {
|
|
432
434
|
return __awaiter(this, void 0, void 0, function* () {
|
|
433
435
|
const getAllModulesArgMap = new Map();
|
|
@@ -444,7 +446,7 @@ class EnclaveContext {
|
|
|
444
446
|
return (0, neverthrow_1.ok)(moduleIds);
|
|
445
447
|
});
|
|
446
448
|
}
|
|
447
|
-
// Docs available at https://docs.
|
|
449
|
+
// Docs available at https://docs.kurtosis.com/sdk/#uploadfilesstring-pathtoupload
|
|
448
450
|
uploadFiles(pathToArchive) {
|
|
449
451
|
return __awaiter(this, void 0, void 0, function* () {
|
|
450
452
|
const archiverResponse = yield this.genericTgzArchiver.createTgzByteArray(pathToArchive);
|
|
@@ -459,7 +461,7 @@ class EnclaveContext {
|
|
|
459
461
|
return (0, neverthrow_1.ok)(uploadResult.value.getUuid());
|
|
460
462
|
});
|
|
461
463
|
}
|
|
462
|
-
// Docs available at https://docs.
|
|
464
|
+
// Docs available at https://docs.kurtosis.com/sdk/#storewebfilesstring-urltodownload
|
|
463
465
|
storeWebFiles(url) {
|
|
464
466
|
return __awaiter(this, void 0, void 0, function* () {
|
|
465
467
|
const args = (0, constructor_calls_1.newStoreWebFilesArtifactArgs)(url);
|
|
@@ -471,7 +473,7 @@ class EnclaveContext {
|
|
|
471
473
|
return (0, neverthrow_1.ok)(storeWebFilesArtifactResponse.getUuid());
|
|
472
474
|
});
|
|
473
475
|
}
|
|
474
|
-
// Docs available at https://docs.
|
|
476
|
+
// Docs available at https://docs.kurtosis.com/sdk/#storeservicefilesserviceid-serviceid-string-absolutefilepathonservicecontainer
|
|
475
477
|
storeServiceFiles(serviceId, absoluteFilepathOnServiceContainer) {
|
|
476
478
|
return __awaiter(this, void 0, void 0, function* () {
|
|
477
479
|
const args = (0, constructor_calls_1.newStoreFilesArtifactFromServiceArgs)(serviceId, absoluteFilepathOnServiceContainer);
|
|
@@ -483,7 +485,7 @@ class EnclaveContext {
|
|
|
483
485
|
return (0, neverthrow_1.ok)(storeFilesArtifactFromServiceResponse.getUuid());
|
|
484
486
|
});
|
|
485
487
|
}
|
|
486
|
-
// Docs available at https://docs.
|
|
488
|
+
// Docs available at https://docs.kurtosis.com/sdk/#pauseserviceserviceid-serviceid
|
|
487
489
|
pauseService(serviceId) {
|
|
488
490
|
return __awaiter(this, void 0, void 0, function* () {
|
|
489
491
|
const pauseServiceArgs = (0, constructor_calls_1.newPauseServiceArgs)(serviceId);
|
|
@@ -495,7 +497,7 @@ class EnclaveContext {
|
|
|
495
497
|
return (0, neverthrow_1.ok)(null);
|
|
496
498
|
});
|
|
497
499
|
}
|
|
498
|
-
// Docs available at https://docs.
|
|
500
|
+
// Docs available at https://docs.kurtosis.com/sdk/#unpauseserviceserviceid-serviceid
|
|
499
501
|
unpauseService(serviceId) {
|
|
500
502
|
return __awaiter(this, void 0, void 0, function* () {
|
|
501
503
|
const unpauseServiceArgs = (0, constructor_calls_1.newUnpauseServiceArgs)(serviceId);
|
|
@@ -507,7 +509,7 @@ class EnclaveContext {
|
|
|
507
509
|
return (0, neverthrow_1.ok)(null);
|
|
508
510
|
});
|
|
509
511
|
}
|
|
510
|
-
// Docs available at https://docs.
|
|
512
|
+
// Docs available at https://docs.kurtosis.com/sdk/#rendertemplatesmapstring-templateanddata-templateanddatabydestinationrelfilepaths
|
|
511
513
|
renderTemplates(templateAndDataByDestinationRelFilepath) {
|
|
512
514
|
return __awaiter(this, void 0, void 0, function* () {
|
|
513
515
|
if (templateAndDataByDestinationRelFilepath.size === 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TemplateAndData = void 0;
|
|
4
|
-
// Docs available at
|
|
4
|
+
// Docs available at ttps://docs.kurtosis.com/sdk#templateanddata
|
|
5
5
|
class TemplateAndData {
|
|
6
6
|
constructor(template, templateData) {
|
|
7
7
|
this.template = template;
|
|
@@ -12,13 +12,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ModuleContext = void 0;
|
|
13
13
|
const neverthrow_1 = require("neverthrow");
|
|
14
14
|
const constructor_calls_1 = require("../constructor_calls");
|
|
15
|
-
// Docs available at https://docs.
|
|
15
|
+
// Docs available at https://docs.kurtosis.com/sdk/#modulecontext
|
|
16
16
|
class ModuleContext {
|
|
17
17
|
constructor(client, moduleId) {
|
|
18
18
|
this.moduleId = moduleId;
|
|
19
19
|
this.client = client;
|
|
20
20
|
}
|
|
21
|
-
// Docs available at https://docs.
|
|
21
|
+
// Docs available at https://docs.kurtosis.com/sdk/#executestring-serializedparams---string-serializedresult
|
|
22
22
|
execute(serializedParams) {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
24
|
const executeModuleArgs = (0, constructor_calls_1.newExecuteModuleArgs)(this.moduleId, serializedParams);
|
|
@@ -6,7 +6,7 @@ const DEFAULT_PRIVATE_IP_ADDR_PLACEHOLDER = "KURTOSIS_PRIVATE_IP_ADDR_PLACEHOLDE
|
|
|
6
6
|
// Config Object
|
|
7
7
|
// ====================================================================================================
|
|
8
8
|
// TODO defensive copy when we're giving back complex objects?????
|
|
9
|
-
// Docs available at https://docs.
|
|
9
|
+
// Docs available at https://docs.kurtosis.com/sdk/#containerconfig
|
|
10
10
|
class ContainerConfig {
|
|
11
11
|
constructor(image, usedPorts, publicPorts, //TODO this is a huge hack to temporarily enable static ports for NEAR until we have a more productized solution
|
|
12
12
|
filesArtifactMountpoints, entrypointOverrideArgs, cmdOverrideArgs, environmentVariableOverrides, cpuAllocationMillicpus, memoryAllocationMegabytes, privateIPAddrPlaceholder) {
|
|
@@ -27,7 +27,7 @@ exports.ContainerConfig = ContainerConfig;
|
|
|
27
27
|
// Builder
|
|
28
28
|
// ====================================================================================================
|
|
29
29
|
// TODO Defensive copies on all these With... functions???
|
|
30
|
-
// Docs available at https://docs.
|
|
30
|
+
// Docs available at https://docs.kurtosis.com/sdk/#containerconfigbuilder
|
|
31
31
|
class ContainerConfigBuilder {
|
|
32
32
|
constructor(image) {
|
|
33
33
|
this.image = image;
|
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
export declare type ServiceID = string;
|
|
2
2
|
export declare type ServiceGUID = string;
|
|
3
|
-
export declare class ServiceInfo {
|
|
4
|
-
private readonly serviceId;
|
|
5
|
-
private readonly serviceGuid;
|
|
6
|
-
constructor(serviceId: ServiceID, serviceGuid: ServiceGUID);
|
|
7
|
-
getServiceId(): ServiceID;
|
|
8
|
-
getServiceGuid(): ServiceGUID;
|
|
9
|
-
}
|
|
@@ -4,17 +4,3 @@
|
|
|
4
4
|
* All Rights Reserved.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ServiceInfo = void 0;
|
|
8
|
-
class ServiceInfo {
|
|
9
|
-
constructor(serviceId, serviceGuid) {
|
|
10
|
-
this.serviceId = serviceId;
|
|
11
|
-
this.serviceGuid = serviceGuid;
|
|
12
|
-
}
|
|
13
|
-
getServiceId() {
|
|
14
|
-
return this.serviceId;
|
|
15
|
-
}
|
|
16
|
-
getServiceGuid() {
|
|
17
|
-
return this.serviceGuid;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.ServiceInfo = ServiceInfo;
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ServiceContext = void 0;
|
|
13
13
|
const neverthrow_1 = require("neverthrow");
|
|
14
14
|
const constructor_calls_1 = require("../constructor_calls");
|
|
15
|
-
// Docs available at https://docs.
|
|
15
|
+
// Docs available at https://docs.kurtosis.com/sdk/#servicecontext
|
|
16
16
|
class ServiceContext {
|
|
17
17
|
constructor(client, serviceId, serviceGuid, privateIpAddress, privatePorts, publicIpAddress, publicPorts) {
|
|
18
18
|
this.client = client;
|
|
@@ -23,31 +23,31 @@ class ServiceContext {
|
|
|
23
23
|
this.publicIpAddress = publicIpAddress;
|
|
24
24
|
this.publicPorts = publicPorts;
|
|
25
25
|
}
|
|
26
|
-
// Docs available at https://docs.
|
|
26
|
+
// Docs available at https://docs.kurtosis.com/sdk/#getserviceid---serviceid
|
|
27
27
|
getServiceID() {
|
|
28
28
|
return this.serviceId;
|
|
29
29
|
}
|
|
30
|
-
// Docs available at https://docs.
|
|
30
|
+
// Docs available at https://docs.kurtosis.com/sdk/#getserviceguid---serviceguid
|
|
31
31
|
getServiceGUID() {
|
|
32
32
|
return this.serviceGuid;
|
|
33
33
|
}
|
|
34
|
-
// Docs available at https://docs.
|
|
34
|
+
// Docs available at https://docs.kurtosis.com/sdk/#getprivateipaddress---string
|
|
35
35
|
getPrivateIPAddress() {
|
|
36
36
|
return this.privateIpAddress;
|
|
37
37
|
}
|
|
38
|
-
// Docs available at https://docs.
|
|
38
|
+
// Docs available at https://docs.kurtosis.com/sdk/#getprivateports---mapportid-portspec
|
|
39
39
|
getPrivatePorts() {
|
|
40
40
|
return this.privatePorts;
|
|
41
41
|
}
|
|
42
|
-
// Docs available at https://docs.
|
|
42
|
+
// Docs available at https://docs.kurtosis.com/sdk/#getmaybepublicipaddress---string
|
|
43
43
|
getMaybePublicIPAddress() {
|
|
44
44
|
return this.publicIpAddress;
|
|
45
45
|
}
|
|
46
|
-
// Docs available at https://docs.
|
|
46
|
+
// Docs available at https://docs.kurtosis.com/sdk/#getpublicports---mapportid-portspec
|
|
47
47
|
getPublicPorts() {
|
|
48
48
|
return this.publicPorts;
|
|
49
49
|
}
|
|
50
|
-
// Docs available at https://docs.
|
|
50
|
+
// Docs available at https://docs.kurtosis.com/sdk/#execcommandliststring-command---int-exitcode-string-logs
|
|
51
51
|
execCommand(command) {
|
|
52
52
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
53
|
const execCommandArgs = (0, constructor_calls_1.newExecCommandArgs)(this.serviceId, command);
|
|
@@ -26,7 +26,7 @@ exports.DEFAULT_GRPC_ENGINE_SERVER_PORT_NUM = 9710;
|
|
|
26
26
|
exports.DEFAULT_GRPC_PROXY_ENGINE_SERVER_PORT_NUM = 9711;
|
|
27
27
|
// Blank tells the engine server to use the default
|
|
28
28
|
const DEFAULT_API_CONTAINER_VERSION_TAG = "";
|
|
29
|
-
// Docs available at https://docs.
|
|
29
|
+
// Docs available at https://docs.kurtosis.com/sdk#kurtosiscontext
|
|
30
30
|
class KurtosisContext {
|
|
31
31
|
constructor(client) {
|
|
32
32
|
this.client = client;
|
|
@@ -69,7 +69,7 @@ class KurtosisContext {
|
|
|
69
69
|
return (0, neverthrow_1.ok)(kurtosisContext);
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
// Docs available at https://docs.
|
|
72
|
+
// Docs available at https://docs.kurtosis.com/sdk#createenclaveenclaveid-enclaveid-boolean-ispartitioningenabled---enclavecontextenclavecontext-enclavecontext
|
|
73
73
|
createEnclave(enclaveId, isPartitioningEnabled) {
|
|
74
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
75
|
const enclaveArgs = (0, constructor_calls_1.newCreateEnclaveArgs)(enclaveId, DEFAULT_API_CONTAINER_VERSION_TAG, API_CONTAINER_LOG_LEVEL, isPartitioningEnabled);
|
|
@@ -91,7 +91,7 @@ class KurtosisContext {
|
|
|
91
91
|
return (0, neverthrow_1.ok)(enclaveContext);
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
// Docs available at https://docs.
|
|
94
|
+
// Docs available at https://docs.kurtosis.com/sdk#getenclavecontextenclaveid-enclaveid---enclavecontextenclavecontext-enclavecontext
|
|
95
95
|
getEnclaveContext(enclaveId) {
|
|
96
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
97
97
|
const getEnclavesResponseResult = yield this.client.getEnclavesResponse();
|
|
@@ -111,7 +111,7 @@ class KurtosisContext {
|
|
|
111
111
|
return (0, neverthrow_1.ok)(newEnclaveContextResult.value);
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
// Docs available at https://docs.
|
|
114
|
+
// Docs available at https://docs.kurtosis.com/sdk#getenclaves---setenclaveid-enclaveids
|
|
115
115
|
getEnclaves() {
|
|
116
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
117
|
const getEnclavesResponseResult = yield this.client.getEnclavesResponse();
|
|
@@ -126,7 +126,7 @@ class KurtosisContext {
|
|
|
126
126
|
return (0, neverthrow_1.ok)(enclaves);
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
// Docs available at https://docs.
|
|
129
|
+
// Docs available at https://docs.kurtosis.com/sdk#stopenclaveenclaveid-enclaveid
|
|
130
130
|
stopEnclave(enclaveId) {
|
|
131
131
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
132
|
const stopEnclaveArgs = (0, constructor_calls_1.newStopEnclaveArgs)(enclaveId);
|
|
@@ -137,7 +137,7 @@ class KurtosisContext {
|
|
|
137
137
|
return (0, neverthrow_1.ok)(null);
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
|
-
// Docs available at https://docs.
|
|
140
|
+
// Docs available at https://docs.kurtosis.com/sdk#destroyenclaveenclaveid-enclaveid
|
|
141
141
|
destroyEnclave(enclaveId) {
|
|
142
142
|
return __awaiter(this, void 0, void 0, function* () {
|
|
143
143
|
const destroyEnclaveArgs = (0, constructor_calls_1.newDestroyEnclaveArgs)(enclaveId);
|
|
@@ -148,7 +148,7 @@ class KurtosisContext {
|
|
|
148
148
|
return (0, neverthrow_1.ok)(null);
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
// Docs available at https://docs.
|
|
151
|
+
// Docs available at https://docs.kurtosis.com/sdk#cleanboolean-shouldcleanall---setenclaveid-removedenclaveids
|
|
152
152
|
clean(shouldCleanAll) {
|
|
153
153
|
return __awaiter(this, void 0, void 0, function* () {
|
|
154
154
|
const cleanArgs = (0, constructor_calls_1.newCleanArgs)(shouldCleanAll);
|
|
@@ -247,7 +247,7 @@ class KurtosisContext {
|
|
|
247
247
|
const doApiVersionsMatch = libraryEngineMajorVersion === runningEngineMajorVersion && libraryEngineMinorVersion === runningEngineMinorVersion;
|
|
248
248
|
if (!doApiVersionsMatch) {
|
|
249
249
|
return (0, neverthrow_1.err)(new Error(`An API version mismatch was detected between the running engine version '${runningEngineSemver.version}' and the engine version this Kurtosis SDK library expects, '${libraryEngineSemver.version}'. You should:\n` +
|
|
250
|
-
` 1) upgrade your Kurtosis CLI to latest using the instructions at https://docs.
|
|
250
|
+
` 1) upgrade your Kurtosis CLI to latest using the instructions at https://docs.kurtosis.com/install#upgrading\n` +
|
|
251
251
|
` 2) use the Kurtosis CLI to restart your engine via 'kurtosis engine restart'\n` +
|
|
252
252
|
` 3) upgrade your Kurtosis SDK library using the instructions at https://github.com/kurtosis-tech/kurtosis-sdk\n`));
|
|
253
253
|
}
|
package/build/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { KURTOSIS_VERSION } from "./kurtosis_version/kurtosis_version";
|
|
2
2
|
export type { FilesArtifactUUID, ContainerConfig } from "./core/lib/services/container_config";
|
|
3
3
|
export { ContainerConfigBuilder } from "./core/lib/services/container_config";
|
|
4
|
-
export type { ServiceID, ServiceGUID
|
|
4
|
+
export type { ServiceID, ServiceGUID } from "./core/lib/services/service";
|
|
5
5
|
export { ServiceContext } from "./core/lib/services/service_context";
|
|
6
6
|
export { PortSpec, PortProtocol } from "./core/lib/services/port_spec";
|
|
7
7
|
export { EnclaveContext } from "./core/lib/enclaves/enclave_context";
|
|
@@ -4,5 +4,5 @@ exports.KURTOSIS_VERSION = void 0;
|
|
|
4
4
|
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
|
|
5
5
|
// This is necessary so that Kurt Core consumers (e.g. modules) will know if they're compatible with the currently-running
|
|
6
6
|
// API container
|
|
7
|
-
exports.KURTOSIS_VERSION = "0.57.
|
|
7
|
+
exports.KURTOSIS_VERSION = "0.57.5";
|
|
8
8
|
// !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kurtosis-sdk",
|
|
3
3
|
"//": "NOTE: DO NOT UPDATE THIS VERSION MANUALLY - IT WILL BE UPDATED DURING THE RELEASE PROCESS!",
|
|
4
|
-
"version": "0.57.
|
|
4
|
+
"version": "0.57.5",
|
|
5
5
|
"main": "./build/index",
|
|
6
6
|
"description": "This repo contains a Typescript client for communicating with the Kurtosis Engine server, which is responsible for creating, managing and destroying Kurtosis Enclaves.",
|
|
7
7
|
"types": "./build/index",
|