@skyramp/skyramp 0.4.55 → 0.4.57

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.
Binary file
@@ -120,6 +120,8 @@ extern char* buildRequestsWrapper(char* mockDescription);
120
120
  extern char* runTesterStartWrapper(char* namespace, char* address, char* testDescription, GoUint8 generateResult);
121
121
  extern char* runTesterStartWrapperWithGlobalHeaders(char* namespace, char* address, char* testDescription, char* testName, char* globalJsonHeaders, GoUint8 generateResult, GoUint8 isDockerEnv);
122
122
  extern char* runTesterStatusWrapper(char* namespace, char* address);
123
+ extern char* newStartDockerSkyrampWorkerWrapper(char* image, char* tag, GoInt hostPort, char* targetNetworkName);
124
+ extern char* newDeleteDockerSkyrampWorkerWrapper();
123
125
 
124
126
  #ifdef __cplusplus
125
127
  }
Binary file
@@ -120,6 +120,8 @@ extern char* buildRequestsWrapper(char* mockDescription);
120
120
  extern char* runTesterStartWrapper(char* namespace, char* address, char* testDescription, GoUint8 generateResult);
121
121
  extern char* runTesterStartWrapperWithGlobalHeaders(char* namespace, char* address, char* testDescription, char* testName, char* globalJsonHeaders, GoUint8 generateResult, GoUint8 isDockerEnv);
122
122
  extern char* runTesterStatusWrapper(char* namespace, char* address);
123
+ extern char* newStartDockerSkyrampWorkerWrapper(char* image, char* tag, GoInt hostPort, char* targetNetworkName);
124
+ extern char* newDeleteDockerSkyrampWorkerWrapper();
123
125
 
124
126
  #ifdef __cplusplus
125
127
  }
@@ -120,6 +120,8 @@ extern char* buildRequestsWrapper(char* mockDescription);
120
120
  extern char* runTesterStartWrapper(char* namespace, char* address, char* testDescription, GoUint8 generateResult);
121
121
  extern char* runTesterStartWrapperWithGlobalHeaders(char* namespace, char* address, char* testDescription, char* testName, char* globalJsonHeaders, GoUint8 generateResult, GoUint8 isDockerEnv);
122
122
  extern char* runTesterStatusWrapper(char* namespace, char* address);
123
+ extern char* newStartDockerSkyrampWorkerWrapper(char* image, char* tag, GoInt hostPort, char* targetNetworkName);
124
+ extern char* newDeleteDockerSkyrampWorkerWrapper();
123
125
 
124
126
  #ifdef __cplusplus
125
127
  }
Binary file
@@ -120,6 +120,8 @@ extern char* buildRequestsWrapper(char* mockDescription);
120
120
  extern char* runTesterStartWrapper(char* namespace, char* address, char* testDescription, GoUint8 generateResult);
121
121
  extern char* runTesterStartWrapperWithGlobalHeaders(char* namespace, char* address, char* testDescription, char* testName, char* globalJsonHeaders, GoUint8 generateResult, GoUint8 isDockerEnv);
122
122
  extern char* runTesterStatusWrapper(char* namespace, char* address);
123
+ extern char* newStartDockerSkyrampWorkerWrapper(char* image, char* tag, GoInt hostPort, char* targetNetworkName);
124
+ extern char* newDeleteDockerSkyrampWorkerWrapper();
123
125
 
124
126
  #ifdef __cplusplus
125
127
  }
Binary file
Binary file
@@ -120,6 +120,8 @@ extern __declspec(dllexport) char* buildRequestsWrapper(char* mockDescription);
120
120
  extern __declspec(dllexport) char* runTesterStartWrapper(char* namespace, char* address, char* testDescription, GoUint8 generateResult);
121
121
  extern __declspec(dllexport) char* runTesterStartWrapperWithGlobalHeaders(char* namespace, char* address, char* testDescription, char* testName, char* globalJsonHeaders, GoUint8 generateResult, GoUint8 isDockerEnv);
122
122
  extern __declspec(dllexport) char* runTesterStatusWrapper(char* namespace, char* address);
123
+ extern __declspec(dllexport) char* newStartDockerSkyrampWorkerWrapper(char* image, char* tag, GoInt hostPort, char* targetNetworkName);
124
+ extern __declspec(dllexport) char* newDeleteDockerSkyrampWorkerWrapper();
123
125
 
124
126
  #ifdef __cplusplus
125
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyramp/skyramp",
3
- "version": "0.4.55",
3
+ "version": "0.4.57",
4
4
  "description": "module for leveraging skyramp cli functionality",
5
5
  "scripts": {
6
6
  "pack": "npm pack"
@@ -7,7 +7,9 @@ export declare class SkyrampClient {
7
7
  removeLocal(): Promise<void>;
8
8
  removeCluster(clusterName?: string): Promise<void>;
9
9
  mockerApply(namespace: string, address: string, endpoint: Endpoint): Promise<void>;
10
-
10
+ runDockerSkyrampWorker(workerImage:string = WORKER_URL, workerTag:string = WORKER_TAG, hostPost:int = CONTAINER_PORT, targetNetworkName:string =""): Promise<void>
11
+ removeDockerSkyrampWorker() : Promise<void>
12
+
11
13
  mockerApplyFromFile(namespace: string, address: string, filePath: string): Promise<void>;
12
14
  applyMockDescription(namespace: string, address: string, mockYamlContent: string): Promise<void>;
13
15
  testerStart(namespace: string, address: string, scenario: Scenario): Promise<void>;
@@ -15,7 +15,12 @@ const credResponseType = koffi.struct({
15
15
  error: 'char*',
16
16
  });
17
17
 
18
+ WORKER_URL = "public.ecr.aws/j1n2c2p2/rampup/worker"
19
+ WORKER_TAG = "latest"
20
+ CONTAINER_PORT = 35142
21
+
18
22
  const { createTestDescriptionFromScenario, getYamlBytes, readDataFromFile } = require('../utils');
23
+ // k8s related
19
24
  const applyLocalWrapper = lib.func('applyLocalWrapper', 'string', []);
20
25
  const addKubeconfigWrapper = lib.func('addKubeconfigWrapper', 'string', ['string', 'bool', 'string', 'string']);
21
26
  const deleteSkyrampWorkerWrapper = lib.func('deleteSkyrampWorkerWrapper', 'string', ['string'])
@@ -23,7 +28,12 @@ const deploySkyrampWorkerWrapper = lib.func('deploySkyrampWorkerWrapper', 'strin
23
28
  const getKubeConfigPath = lib.func('getKubeConfigPath', 'string', []);
24
29
  const removeLocalWrapper = lib.func('removeLocalWrapper', 'string', []);
25
30
  const removeClusterFromConfigWrapper = lib.func('removeClusterFromConfigWrapper', 'string', ['string']);
31
+ // docker related
32
+ const newStartDockerSkyrampWorkerWrapper = lib.func('newStartDockerSkyrampWorkerWrapper', 'string', ['string', 'string', 'int', 'string']);
33
+ const newDeleteDockerSkyrampWorkerWrapper = lib.func('newDeleteDockerSkyrampWorkerWrapper', 'string', []);
34
+ // tester related
26
35
  const runTesterStartWrapper = lib.func('runTesterStartWrapper', 'string', ['string', 'string', 'string', 'bool']);
36
+ // mocker related
27
37
  const applyMockDescriptionWrapper = lib.func('applyMockDescriptionWrapper', 'string', ['string', 'string', 'string']);
28
38
  // NPM only: for VS code extension use
29
39
  const initTargetWrapper = lib.func('initTargetWrapper', 'string', ['string']);
@@ -231,6 +241,22 @@ class SkyrampClient {
231
241
  });
232
242
  }
233
243
 
244
+ async runDockerSkyrampWorker(workerImage=WORKER_URL, workerTag=WORKER_TAG, hostPost=CONTAINER_PORT, targetNetworkName) {
245
+ try {
246
+ await newStartDockerSkyrampWorkerWrapper(workerImage, workerTag, hostPost, targetNetworkName);
247
+ } catch (err) {
248
+ throw err;
249
+ }
250
+ }
251
+
252
+ async removeDockerSkyrampWorker() {
253
+ try {
254
+ await newDeleteDockerSkyrampWorkerWrapper();
255
+ } catch (err) {
256
+ throw err;
257
+ }
258
+ }
259
+
234
260
  async mockerApply(namespace, address, endpoint) {
235
261
  try {
236
262
  const yamlContent = getYamlBytes(endpoint.mockDescription);