@kumori/kdsl 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/deployment_spec.d.ts +1133 -19642
- package/dist/build/deployment_spec.js +14 -13
- package/dist/build/deployment_spec.js.map +1 -1
- package/dist/build/helpers/builtin.js +7 -9
- package/dist/build/helpers/builtin.js.map +1 -1
- package/dist/build/helpers/component.d.ts +2 -2
- package/dist/build/helpers/component.js +28 -28
- package/dist/build/helpers/component.js.map +1 -1
- package/dist/build/helpers/connector.js +4 -5
- package/dist/build/helpers/connector.js.map +1 -1
- package/dist/build/helpers/deployment.d.ts +96 -96
- package/dist/build/helpers/deployment.js +8 -9
- package/dist/build/helpers/deployment.js.map +1 -1
- package/dist/build/helpers/resource.d.ts +4 -4
- package/dist/build/helpers/service.d.ts +1 -1
- package/dist/build/helpers/service.js +29 -32
- package/dist/build/helpers/service.js.map +1 -1
- package/dist/build/helpers/utils.d.ts +8 -0
- package/dist/build/helpers/utils.js +23 -1
- package/dist/build/helpers/utils.js.map +1 -1
- package/dist/build/main.js +51 -2
- package/dist/build/main.js.map +1 -1
- package/dist/build/solution.js +2 -3
- package/dist/build/solution.js.map +1 -1
- package/dist/check/main.js +1 -1
- package/dist/check/main.js.map +1 -1
- package/dist/deployment/gen/deployment-template.kumori +33 -0
- package/dist/deployment/gen/main.d.ts +15 -0
- package/dist/deployment/gen/main.js +158 -0
- package/dist/deployment/gen/main.js.map +1 -0
- package/dist/deployment/gen/types.d.ts +27 -0
- package/dist/deployment/gen/types.js +2 -0
- package/dist/deployment/gen/types.js.map +1 -0
- package/dist/deployment/main.d.ts +8 -0
- package/dist/deployment/main.js +17 -0
- package/dist/deployment/main.js.map +1 -0
- package/dist/index/create/main.js +38 -16
- package/dist/index/create/main.js.map +1 -1
- package/dist/lib/build.js +42 -28
- package/dist/lib/build.js.map +1 -1
- package/dist/lib/check.js +45 -15
- package/dist/lib/check.js.map +1 -1
- package/dist/lib/clean.js +39 -1
- package/dist/lib/deployment.d.ts +35 -0
- package/dist/lib/deployment.js +31 -0
- package/dist/lib/deployment.js.map +1 -0
- package/dist/lib/index-cmd.js +60 -57
- package/dist/lib/index-cmd.js.map +1 -1
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +54 -117
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/logger.js +1 -1
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/mod.js +144 -70
- package/dist/lib/mod.js.map +1 -1
- package/dist/lib/registry.d.ts +4 -4
- package/dist/lib/registry.js +67 -1
- package/dist/lib/registry.js.map +1 -1
- package/dist/main.js +2 -0
- package/dist/main.js.map +1 -1
- package/dist/mod/dependency/main.js +17 -10
- package/dist/mod/dependency/main.js.map +1 -1
- package/dist/mod/download/functions.js +5 -5
- package/dist/mod/download/functions.js.map +1 -1
- package/dist/mod/download/main.js +12 -2
- package/dist/mod/download/main.js.map +1 -1
- package/dist/mod/init/main.js +1 -1
- package/dist/mod/init/main.js.map +1 -1
- package/dist/mod/jsonschema/gen/main.js +14 -7
- package/dist/mod/jsonschema/gen/main.js.map +1 -1
- package/dist/mod/jsonschema/get/main.js +10 -2
- package/dist/mod/jsonschema/get/main.js.map +1 -1
- package/dist/mod/update/main.js +3 -4
- package/dist/mod/update/main.js.map +1 -1
- package/dist/registry/add.d.ts +1 -1
- package/dist/registry/add.js +12 -7
- package/dist/registry/add.js.map +1 -1
- package/dist/util/err-format.js +1 -2
- package/dist/util/err-format.js.map +1 -1
- package/dist/version.js +1 -2
- package/dist/version.js.map +1 -1
- package/out/deployment/gen/deployment-template.kumori +33 -0
- package/out/deployment-template.kumori +33 -0
- package/out/main.cjs +378 -209
- package/package.json +20 -14
- package/out/lib/build.cjs +0 -29
- package/out/lib/check.cjs +0 -16
- package/out/lib/clean.cjs +0 -2
- package/out/lib/index-cmd.cjs +0 -58
- package/out/lib/index.cjs +0 -118
- package/out/lib/mod.cjs +0 -71
- package/out/lib/registry.cjs +0 -2
|
@@ -16,50 +16,30 @@ export declare const CtxParentId: (ctx: SolutionJSONContext) => string;
|
|
|
16
16
|
export declare const WithPath: (ctx: SolutionJSONContext, name: string) => SolutionJSONContext;
|
|
17
17
|
export declare const AddDeployment: (ctx: SolutionJSONContext, dep: V3DeploymentSpec) => {
|
|
18
18
|
name: string;
|
|
19
|
-
config?: {
|
|
20
|
-
resilience: number;
|
|
21
|
-
parameter?: Record<string, any> | undefined;
|
|
22
|
-
resource?: Record<string, {
|
|
23
|
-
port?: string | undefined;
|
|
24
|
-
domain?: string | undefined;
|
|
25
|
-
secret?: string | undefined;
|
|
26
|
-
certificate?: string | undefined;
|
|
27
|
-
ca?: string | undefined;
|
|
28
|
-
volume?: any;
|
|
29
|
-
}> | undefined;
|
|
30
|
-
scale?: ({
|
|
31
|
-
qos?: any;
|
|
32
|
-
hsize?: number | undefined;
|
|
33
|
-
} & {
|
|
34
|
-
detail?: Record<string, ({
|
|
35
|
-
qos?: any;
|
|
36
|
-
hsize?: number | undefined;
|
|
37
|
-
} & /*elided*/ any) | undefined>;
|
|
38
|
-
}) | undefined;
|
|
39
|
-
} | undefined;
|
|
40
19
|
meta?: any;
|
|
20
|
+
up?: string | undefined;
|
|
41
21
|
artifact?: {
|
|
42
|
-
spec: number[];
|
|
43
22
|
ref: {
|
|
44
|
-
domain: string;
|
|
45
23
|
name: string;
|
|
46
24
|
kind: "deployment" | "service" | "component";
|
|
25
|
+
domain: string;
|
|
47
26
|
version: number[];
|
|
48
27
|
module?: string | undefined;
|
|
49
28
|
prerelease?: string | undefined;
|
|
50
29
|
buildmetadata?: string | undefined;
|
|
51
30
|
};
|
|
31
|
+
spec: number[];
|
|
52
32
|
description: {
|
|
53
33
|
builtin: boolean;
|
|
54
34
|
config?: {
|
|
55
35
|
resilience: number;
|
|
56
36
|
parameter?: Record<string, any> | undefined;
|
|
57
37
|
resource?: Record<string, {
|
|
58
|
-
port?: string | undefined;
|
|
59
|
-
domain?: string | undefined;
|
|
60
|
-
secret?: string | undefined;
|
|
61
38
|
certificate?: string | undefined;
|
|
62
39
|
ca?: string | undefined;
|
|
40
|
+
domain?: string | undefined;
|
|
41
|
+
port?: string | undefined;
|
|
42
|
+
secret?: string | undefined;
|
|
63
43
|
volume?: any;
|
|
64
44
|
}> | undefined;
|
|
65
45
|
scale?: ({
|
|
@@ -95,99 +75,40 @@ export declare const AddDeployment: (ctx: SolutionJSONContext, dep: V3Deployment
|
|
|
95
75
|
role?: Record<string, {
|
|
96
76
|
name: string;
|
|
97
77
|
artifact: {
|
|
98
|
-
spec: number[];
|
|
99
78
|
ref: {
|
|
100
|
-
domain: string;
|
|
101
79
|
name: string;
|
|
102
80
|
kind: "deployment" | "service" | "component";
|
|
81
|
+
domain: string;
|
|
103
82
|
version: number[];
|
|
104
83
|
module?: string | undefined;
|
|
105
84
|
prerelease?: string | undefined;
|
|
106
85
|
buildmetadata?: string | undefined;
|
|
107
86
|
};
|
|
87
|
+
spec: number[];
|
|
108
88
|
description?: {
|
|
109
89
|
builtin: boolean;
|
|
110
90
|
size: {
|
|
111
|
-
|
|
91
|
+
mincpu: {
|
|
112
92
|
kind: "storage" | "cpu" | "ram" | "bandwidth";
|
|
113
93
|
size: number;
|
|
114
94
|
unit: string;
|
|
115
95
|
};
|
|
116
|
-
|
|
96
|
+
bandwidth: {
|
|
117
97
|
kind: "storage" | "cpu" | "ram" | "bandwidth";
|
|
118
98
|
size: number;
|
|
119
99
|
unit: string;
|
|
120
100
|
};
|
|
121
101
|
minbandwidth: number;
|
|
122
102
|
};
|
|
123
|
-
code?: Record<string, {
|
|
124
|
-
name: string;
|
|
125
|
-
image: {
|
|
126
|
-
tag: string;
|
|
127
|
-
hub?: {
|
|
128
|
-
name: string;
|
|
129
|
-
secret?: string | undefined;
|
|
130
|
-
} | undefined;
|
|
131
|
-
};
|
|
132
|
-
size?: {
|
|
133
|
-
cpu: {
|
|
134
|
-
kind: "storage" | "cpu" | "ram" | "bandwidth";
|
|
135
|
-
size: number;
|
|
136
|
-
unit: string;
|
|
137
|
-
};
|
|
138
|
-
mincpu: number;
|
|
139
|
-
memory: {
|
|
140
|
-
kind: "storage" | "cpu" | "ram" | "bandwidth";
|
|
141
|
-
size: number;
|
|
142
|
-
unit: string;
|
|
143
|
-
};
|
|
144
|
-
} | undefined;
|
|
145
|
-
entrypoint?: string[] | undefined;
|
|
146
|
-
cmd?: string[] | undefined;
|
|
147
|
-
user?: {
|
|
148
|
-
userid: number;
|
|
149
|
-
groupid: number;
|
|
150
|
-
} | undefined;
|
|
151
|
-
mapping?: {
|
|
152
|
-
env?: Record<string, {
|
|
153
|
-
port?: string | undefined;
|
|
154
|
-
domain?: string | undefined;
|
|
155
|
-
secret?: string | undefined;
|
|
156
|
-
certificate?: string | undefined;
|
|
157
|
-
ca?: string | undefined;
|
|
158
|
-
value?: string | number | boolean | undefined;
|
|
159
|
-
enableTemplate?: boolean | undefined;
|
|
160
|
-
}> | undefined;
|
|
161
|
-
filesystem?: Record<string, {
|
|
162
|
-
volume?: string | undefined;
|
|
163
|
-
path?: string | undefined;
|
|
164
|
-
enableTemplate?: boolean | undefined;
|
|
165
|
-
data?: {
|
|
166
|
-
port?: string | undefined;
|
|
167
|
-
domain?: string | undefined;
|
|
168
|
-
secret?: string | undefined;
|
|
169
|
-
certificate?: string | undefined;
|
|
170
|
-
ca?: string | undefined;
|
|
171
|
-
value?: string | undefined;
|
|
172
|
-
} | undefined;
|
|
173
|
-
format?: "text" | "json" | "yaml" | undefined;
|
|
174
|
-
group?: number | undefined;
|
|
175
|
-
mode?: number | undefined;
|
|
176
|
-
user?: number | undefined;
|
|
177
|
-
rebootOnUpdate?: boolean | undefined;
|
|
178
|
-
}> | undefined;
|
|
179
|
-
} | undefined;
|
|
180
|
-
init?: boolean | undefined;
|
|
181
|
-
}> | undefined;
|
|
182
103
|
config?: {
|
|
183
104
|
resilience: number;
|
|
184
105
|
parameter?: Record<string, any> | undefined;
|
|
185
106
|
resource?: Record<string, {
|
|
186
|
-
port?: string | undefined;
|
|
187
|
-
domain?: string | undefined;
|
|
188
|
-
secret?: string | undefined;
|
|
189
107
|
certificate?: string | undefined;
|
|
190
108
|
ca?: string | undefined;
|
|
109
|
+
domain?: string | undefined;
|
|
110
|
+
port?: string | undefined;
|
|
111
|
+
secret?: string | undefined;
|
|
191
112
|
volume?: any;
|
|
192
113
|
}> | undefined;
|
|
193
114
|
scale?: ({
|
|
@@ -224,6 +145,65 @@ export declare const AddDeployment: (ctx: SolutionJSONContext, dep: V3Deployment
|
|
|
224
145
|
threadability: string;
|
|
225
146
|
iopsintensive: boolean;
|
|
226
147
|
} | undefined;
|
|
148
|
+
code?: Record<string, {
|
|
149
|
+
name: string;
|
|
150
|
+
image: {
|
|
151
|
+
tag: string;
|
|
152
|
+
hub?: {
|
|
153
|
+
name: string;
|
|
154
|
+
secret?: string | undefined;
|
|
155
|
+
} | undefined;
|
|
156
|
+
};
|
|
157
|
+
entrypoint?: string[] | undefined;
|
|
158
|
+
cmd?: string[] | undefined;
|
|
159
|
+
mapping?: {
|
|
160
|
+
env?: Record<string, {
|
|
161
|
+
secret?: string | undefined;
|
|
162
|
+
port?: string | undefined;
|
|
163
|
+
domain?: string | undefined;
|
|
164
|
+
certificate?: string | undefined;
|
|
165
|
+
ca?: string | undefined;
|
|
166
|
+
value?: string | number | boolean | undefined;
|
|
167
|
+
enableTemplate?: boolean | undefined;
|
|
168
|
+
}> | undefined;
|
|
169
|
+
filesystem?: Record<string, {
|
|
170
|
+
data?: {
|
|
171
|
+
secret?: string | undefined;
|
|
172
|
+
port?: string | undefined;
|
|
173
|
+
domain?: string | undefined;
|
|
174
|
+
certificate?: string | undefined;
|
|
175
|
+
ca?: string | undefined;
|
|
176
|
+
value?: string | undefined;
|
|
177
|
+
} | undefined;
|
|
178
|
+
format?: "text" | "json" | "yaml" | undefined;
|
|
179
|
+
group?: number | undefined;
|
|
180
|
+
mode?: number | undefined;
|
|
181
|
+
path?: string | undefined;
|
|
182
|
+
user?: number | undefined;
|
|
183
|
+
rebootOnUpdate?: boolean | undefined;
|
|
184
|
+
volume?: string | undefined;
|
|
185
|
+
enableTemplate?: boolean | undefined;
|
|
186
|
+
}> | undefined;
|
|
187
|
+
} | undefined;
|
|
188
|
+
size?: {
|
|
189
|
+
cpu: {
|
|
190
|
+
kind: "storage" | "cpu" | "ram" | "bandwidth";
|
|
191
|
+
size: number;
|
|
192
|
+
unit: string;
|
|
193
|
+
};
|
|
194
|
+
mincpu: number;
|
|
195
|
+
memory: {
|
|
196
|
+
kind: "storage" | "cpu" | "ram" | "bandwidth";
|
|
197
|
+
size: number;
|
|
198
|
+
unit: string;
|
|
199
|
+
};
|
|
200
|
+
} | undefined;
|
|
201
|
+
user?: {
|
|
202
|
+
userid: number;
|
|
203
|
+
groupid: number;
|
|
204
|
+
} | undefined;
|
|
205
|
+
init?: boolean | undefined;
|
|
206
|
+
}> | undefined;
|
|
227
207
|
probe?: Record<string, {
|
|
228
208
|
liveness?: {
|
|
229
209
|
protocol: {
|
|
@@ -277,11 +257,11 @@ export declare const AddDeployment: (ctx: SolutionJSONContext, dep: V3Deployment
|
|
|
277
257
|
resilience: number;
|
|
278
258
|
parameter?: Record<string, any> | undefined;
|
|
279
259
|
resource?: Record<string, {
|
|
280
|
-
port?: string | undefined;
|
|
281
|
-
domain?: string | undefined;
|
|
282
|
-
secret?: string | undefined;
|
|
283
260
|
certificate?: string | undefined;
|
|
284
261
|
ca?: string | undefined;
|
|
262
|
+
domain?: string | undefined;
|
|
263
|
+
port?: string | undefined;
|
|
264
|
+
secret?: string | undefined;
|
|
285
265
|
volume?: any;
|
|
286
266
|
}> | undefined;
|
|
287
267
|
scale?: ({
|
|
@@ -313,7 +293,27 @@ export declare const AddDeployment: (ctx: SolutionJSONContext, dep: V3Deployment
|
|
|
313
293
|
}> | undefined;
|
|
314
294
|
};
|
|
315
295
|
} | undefined;
|
|
316
|
-
|
|
296
|
+
config?: {
|
|
297
|
+
resilience: number;
|
|
298
|
+
parameter?: Record<string, any> | undefined;
|
|
299
|
+
resource?: Record<string, {
|
|
300
|
+
certificate?: string | undefined;
|
|
301
|
+
ca?: string | undefined;
|
|
302
|
+
domain?: string | undefined;
|
|
303
|
+
port?: string | undefined;
|
|
304
|
+
secret?: string | undefined;
|
|
305
|
+
volume?: any;
|
|
306
|
+
}> | undefined;
|
|
307
|
+
scale?: ({
|
|
308
|
+
qos?: any;
|
|
309
|
+
hsize?: number | undefined;
|
|
310
|
+
} & {
|
|
311
|
+
detail?: Record<string, ({
|
|
312
|
+
qos?: any;
|
|
313
|
+
hsize?: number | undefined;
|
|
314
|
+
} & /*elided*/ any) | undefined>;
|
|
315
|
+
}) | undefined;
|
|
316
|
+
} | undefined;
|
|
317
317
|
};
|
|
318
318
|
/**
|
|
319
319
|
* Convert a deployment artifact to a solution JSON representation.
|
|
@@ -4,7 +4,7 @@ import { ResourceToSolutionJSON } from "./resource.js";
|
|
|
4
4
|
import { isComponentArtifact } from "@kumori/kdsl-lsp/language/generated/ast.js";
|
|
5
5
|
export const CtxId = (ctx) => ctx.path.join(".");
|
|
6
6
|
export const CtxParentId = (ctx) => ctx.path.slice(0, -1).join(".");
|
|
7
|
-
export const WithPath = (ctx, name) => (
|
|
7
|
+
export const WithPath = (ctx, name) => ({ ...ctx, path: [...ctx.path, name] });
|
|
8
8
|
export const AddDeployment = (ctx, dep) => ctx.root.deployments[CtxId(ctx)] = dep;
|
|
9
9
|
/**
|
|
10
10
|
* Convert a deployment artifact to a solution JSON representation.
|
|
@@ -12,8 +12,8 @@ export const AddDeployment = (ctx, dep) => ctx.root.deployments[CtxId(ctx)] = de
|
|
|
12
12
|
* @returns The solution JSON representation.
|
|
13
13
|
*/
|
|
14
14
|
export function DeploymentToSolutionJSON(svcs, nodes, deployment) {
|
|
15
|
-
var _a, _b, _c;
|
|
16
15
|
const root = {
|
|
16
|
+
cspec: "1.0",
|
|
17
17
|
top: deployment.name,
|
|
18
18
|
deployments: {},
|
|
19
19
|
links: [],
|
|
@@ -23,13 +23,12 @@ export function DeploymentToSolutionJSON(svcs, nodes, deployment) {
|
|
|
23
23
|
name: deployment.name,
|
|
24
24
|
meta: deployment.meta,
|
|
25
25
|
config: {
|
|
26
|
-
parameter:
|
|
27
|
-
resource: Object.fromEntries(Object.entries(
|
|
26
|
+
parameter: deployment.config ?? {},
|
|
27
|
+
resource: Object.fromEntries(Object.entries(deployment.resource ?? {})
|
|
28
28
|
.map(([k, v]) => [k, ResourceToSolutionJSON(v)])),
|
|
29
|
-
resilience:
|
|
29
|
+
resilience: deployment.resilience ?? 0,
|
|
30
30
|
scale: {
|
|
31
31
|
detail: (() => {
|
|
32
|
-
var _a;
|
|
33
32
|
if (isComponent(deployment.artifact)) {
|
|
34
33
|
const componentArtifact = ctx.nodes.get(deployment.artifact);
|
|
35
34
|
let componentName = "";
|
|
@@ -42,7 +41,7 @@ export function DeploymentToSolutionJSON(svcs, nodes, deployment) {
|
|
|
42
41
|
return { [componentName]: { hsize: typeof deployment.scale === "number" ? deployment.scale : 1 } };
|
|
43
42
|
}
|
|
44
43
|
if (isService(deployment.artifact)) {
|
|
45
|
-
const roles = Object.entries(
|
|
44
|
+
const roles = Object.entries(deployment.artifact.role ?? {});
|
|
46
45
|
return Object.fromEntries(roles.map(([roleName]) => [
|
|
47
46
|
roleName,
|
|
48
47
|
{
|
|
@@ -61,10 +60,10 @@ export function DeploymentToSolutionJSON(svcs, nodes, deployment) {
|
|
|
61
60
|
},
|
|
62
61
|
artifact: (() => {
|
|
63
62
|
if (isComponent(deployment.artifact)) {
|
|
64
|
-
return ComponentServiceToSolutionJSON(ctx, deployment.artifact);
|
|
63
|
+
return ComponentServiceToSolutionJSON(ctx, deployment.artifact, deployment.scale);
|
|
65
64
|
}
|
|
66
65
|
if (isService(deployment.artifact)) {
|
|
67
|
-
return ServiceToSolutionJSON(ctx, deployment.artifact);
|
|
66
|
+
return ServiceToSolutionJSON(ctx, deployment.artifact, deployment.scale);
|
|
68
67
|
}
|
|
69
68
|
if (isBuiltin(deployment.artifact)) {
|
|
70
69
|
throw new Error("not implemented: handle builtin");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../../src/build/helpers/deployment.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAShF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAwB,EAAU,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC7E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAwB,EAAU,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAChG,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAAwB,EAAE,IAAY,EAAuB,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../../src/build/helpers/deployment.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAShF,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAwB,EAAU,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC7E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAwB,EAAU,EAAE,CAAC,GAAG,CAAC,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|
|
8
8
|
readonly volume: {
|
|
9
9
|
readonly size: number;
|
|
10
|
-
readonly unit: "
|
|
10
|
+
readonly unit: "m" | "k" | "M" | "G" | "T" | "P" | "E" | "Ki" | "Mi" | "Gi" | "Ti" | "Pi" | "Ei";
|
|
11
11
|
readonly kind: "storage";
|
|
12
12
|
readonly type?: undefined;
|
|
13
13
|
};
|
|
@@ -26,7 +26,7 @@ export declare function ResourceToSolutionJSON(resource: Resource): {
|
|
|
26
26
|
} | {
|
|
27
27
|
readonly volume: {
|
|
28
28
|
readonly size: number;
|
|
29
|
-
readonly unit: "
|
|
29
|
+
readonly unit: "m" | "k" | "M" | "G" | "T" | "P" | "E" | "Ki" | "Mi" | "Gi" | "Ti" | "Pi" | "Ei";
|
|
30
30
|
readonly kind: "storage";
|
|
31
31
|
readonly type: "volatile";
|
|
32
32
|
};
|
|
@@ -38,7 +38,7 @@ export declare function ResourceToSolutionJSON(resource: Resource): {
|
|
|
38
38
|
} | {
|
|
39
39
|
readonly volume: {
|
|
40
40
|
readonly size: number;
|
|
41
|
-
readonly unit: "
|
|
41
|
+
readonly unit: "m" | "k" | "M" | "G" | "T" | "P" | "E" | "Ki" | "Mi" | "Gi" | "Ti" | "Pi" | "Ei";
|
|
42
42
|
readonly kind: "storage";
|
|
43
43
|
readonly type: "persistent";
|
|
44
44
|
};
|
|
@@ -50,7 +50,7 @@ export declare function ResourceToSolutionJSON(resource: Resource): {
|
|
|
50
50
|
} | {
|
|
51
51
|
readonly volume: {
|
|
52
52
|
readonly size: number;
|
|
53
|
-
readonly unit: "
|
|
53
|
+
readonly unit: "m" | "k" | "M" | "G" | "T" | "P" | "E" | "Ki" | "Mi" | "Gi" | "Ti" | "Pi" | "Ei";
|
|
54
54
|
readonly kind: "storage";
|
|
55
55
|
readonly type: "nonreplicated";
|
|
56
56
|
};
|
|
@@ -8,7 +8,7 @@ import { SolutionJSONContext } from "./deployment.js";
|
|
|
8
8
|
* @param service The service to convert.
|
|
9
9
|
* @returns The service artifact representation of the service.
|
|
10
10
|
*/
|
|
11
|
-
export declare function ServiceToSolutionJSON(ctx: SolutionJSONContext, service: Service): ServiceArtifact;
|
|
11
|
+
export declare function ServiceToSolutionJSON(ctx: SolutionJSONContext, service: Service, scale?: Record<string, number>): ServiceArtifact;
|
|
12
12
|
/**
|
|
13
13
|
* Converts a service definition into the V3 deployment spec format.
|
|
14
14
|
* @param ctx The solution JSON context.
|
|
@@ -11,8 +11,7 @@ import { ServiceConnectionToSolutionJSON } from "./connector.js";
|
|
|
11
11
|
* @param service The service to convert.
|
|
12
12
|
* @returns The service artifact representation of the service.
|
|
13
13
|
*/
|
|
14
|
-
export function ServiceToSolutionJSON(ctx, service) {
|
|
15
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
14
|
+
export function ServiceToSolutionJSON(ctx, service, scale) {
|
|
16
15
|
const ref = {
|
|
17
16
|
version: [0, 0, 0],
|
|
18
17
|
kind: "service",
|
|
@@ -33,36 +32,36 @@ export function ServiceToSolutionJSON(ctx, service) {
|
|
|
33
32
|
config: {
|
|
34
33
|
resilience: 0,
|
|
35
34
|
scale: {
|
|
36
|
-
detail: Object.fromEntries(Object.entries(
|
|
37
|
-
.map(([roleName]) => [roleName, { hsize: 1 }]))
|
|
35
|
+
detail: Object.fromEntries(Object.entries(service.role ?? {})
|
|
36
|
+
.map(([roleName]) => [roleName, { hsize: scale && typeof scale === "object" && roleName in scale ? scale[roleName] : 1 }]))
|
|
38
37
|
},
|
|
39
|
-
parameter:
|
|
40
|
-
resource: Object.fromEntries(Object.entries(
|
|
38
|
+
parameter: service?.config ?? {},
|
|
39
|
+
resource: Object.fromEntries(Object.entries(service.resource ?? {})
|
|
41
40
|
.map(([k, v]) => [k, ResourceToSolutionJSON(v)])),
|
|
42
41
|
},
|
|
43
42
|
role: {},
|
|
44
|
-
connector: Object.fromEntries(Object.entries(
|
|
43
|
+
connector: Object.fromEntries(Object.entries(service.connect ?? {})
|
|
45
44
|
.map(([k, v]) => [k, ServiceConnectionToSolutionJSON(ctx, service, v)])),
|
|
46
45
|
srv: {
|
|
47
|
-
client: Object.fromEntries(Object.entries(
|
|
46
|
+
client: Object.fromEntries(Object.entries(service.srv?.client ?? {})
|
|
48
47
|
.map(([k, v]) => [k, { protocol: v, inherited: false }])),
|
|
49
|
-
server: Object.fromEntries(Object.entries(
|
|
48
|
+
server: Object.fromEntries(Object.entries(service.srv?.server ?? {}).map(([k, v]) => {
|
|
50
49
|
let value;
|
|
51
50
|
if (typeof v === "string") {
|
|
52
51
|
value = { port: 80, inherited: false, protocol: v, };
|
|
53
52
|
}
|
|
54
53
|
else {
|
|
55
|
-
value =
|
|
54
|
+
value = { ...v, inherited: false, };
|
|
56
55
|
}
|
|
57
56
|
return [k, value];
|
|
58
57
|
})),
|
|
59
|
-
duplex: Object.fromEntries(Object.entries(
|
|
58
|
+
duplex: Object.fromEntries(Object.entries(service.srv?.duplex ?? {}).map(([k, v]) => {
|
|
60
59
|
let value;
|
|
61
60
|
if (typeof v === "string") {
|
|
62
61
|
value = { port: 80, inherited: false, protocol: v, };
|
|
63
62
|
}
|
|
64
63
|
else {
|
|
65
|
-
value =
|
|
64
|
+
value = { ...v, inherited: false, };
|
|
66
65
|
}
|
|
67
66
|
return [k, value];
|
|
68
67
|
})),
|
|
@@ -71,7 +70,7 @@ export function ServiceToSolutionJSON(ctx, service) {
|
|
|
71
70
|
};
|
|
72
71
|
// NOTE: we call ServiceRoleToSolutionJSON after initializing the service
|
|
73
72
|
// artifact because the call may modify the parent service (svc)
|
|
74
|
-
svc.description.role = Object.fromEntries(Object.entries(
|
|
73
|
+
svc.description.role = Object.fromEntries(Object.entries(service.role ?? {})
|
|
75
74
|
.map(([k, v]) => [k, ServiceRoleToSolutionJSON(ctx, k, v, svc)])
|
|
76
75
|
.filter(([, v]) => Maybe.isSome(v))
|
|
77
76
|
.map(([k, v]) => [k, v.value]));
|
|
@@ -84,19 +83,18 @@ export function ServiceToSolutionJSON(ctx, service) {
|
|
|
84
83
|
* @returns The V3 deployment spec representation of the service.
|
|
85
84
|
*/
|
|
86
85
|
export function ServiceV3DeploymentToSolutionJson(ctx, service) {
|
|
87
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
88
86
|
return {
|
|
89
87
|
name: CtxId(ctx),
|
|
90
88
|
up: CtxParentId(ctx),
|
|
91
89
|
meta: {},
|
|
92
90
|
config: {
|
|
93
91
|
resilience: 0,
|
|
94
|
-
scale:
|
|
95
|
-
parameter:
|
|
96
|
-
resource: Object.fromEntries(Object.entries(
|
|
92
|
+
scale: service.config?.scale ?? { hsize: service.config?.scale },
|
|
93
|
+
parameter: service.config?.parameter ?? {},
|
|
94
|
+
resource: Object.fromEntries(Object.entries(service.config?.resource ?? {})
|
|
97
95
|
.map(([k, v]) => [k, ResourceToSolutionJSON(v)])),
|
|
98
96
|
},
|
|
99
|
-
artifact: ServiceToSolutionJSON(ctx, service)
|
|
97
|
+
artifact: ServiceToSolutionJSON(ctx, service, service.config?.scale),
|
|
100
98
|
};
|
|
101
99
|
}
|
|
102
100
|
/**
|
|
@@ -108,16 +106,15 @@ export function ServiceV3DeploymentToSolutionJson(ctx, service) {
|
|
|
108
106
|
* @returns The role JSON representation of the role.
|
|
109
107
|
*/
|
|
110
108
|
export function ServiceRoleToSolutionJSON(ctx, name, role, parent) {
|
|
111
|
-
var _a, _b, _c, _d, _e
|
|
112
|
-
var _p, _q, _r, _s, _t;
|
|
109
|
+
var _a, _b, _c, _d, _e;
|
|
113
110
|
if (isComponent(role.artifact)) {
|
|
114
111
|
return Some({
|
|
115
112
|
name,
|
|
116
113
|
meta: role.meta,
|
|
117
114
|
config: {
|
|
118
115
|
resilience: 0,
|
|
119
|
-
scale: { hsize: 1 },
|
|
120
|
-
parameter:
|
|
116
|
+
scale: { hsize: parent.description.config?.scale?.detail?.[name]?.hsize ?? 1 },
|
|
117
|
+
parameter: role.artifact.config ?? {},
|
|
121
118
|
resource: {},
|
|
122
119
|
},
|
|
123
120
|
artifact: ComponentToSolutionJSON(ctx, role.artifact),
|
|
@@ -134,19 +131,19 @@ export function ServiceRoleToSolutionJSON(ctx, name, role, parent) {
|
|
|
134
131
|
}
|
|
135
132
|
};
|
|
136
133
|
AddDeployment(ctx, DeploymentJSON());
|
|
137
|
-
(
|
|
138
|
-
(
|
|
139
|
-
(
|
|
140
|
-
for (const [, cnx] of Object.entries(
|
|
134
|
+
(_a = parent.description).srv ?? (_a.srv = {});
|
|
135
|
+
(_b = parent.description.srv).server ?? (_b.server = {});
|
|
136
|
+
(_c = parent.description.srv).client ?? (_c.client = {});
|
|
137
|
+
for (const [, cnx] of Object.entries(parent.description.connector ?? {})) {
|
|
141
138
|
// Check for matching client references
|
|
142
139
|
for (const client of cnx.clients) {
|
|
143
140
|
if (client.role !== name) {
|
|
144
141
|
continue;
|
|
145
142
|
}
|
|
146
|
-
const Client =
|
|
143
|
+
const Client = { ...client };
|
|
147
144
|
// parent inherits referenced connections
|
|
148
145
|
const inherited = `${client.role}.${client.channel}`;
|
|
149
|
-
const original = (
|
|
146
|
+
const original = (artifact?.srv?.client ?? {})[client.channel];
|
|
150
147
|
parent.description.srv.server[inherited] = {
|
|
151
148
|
inherited: true,
|
|
152
149
|
protocol: client.channel == "inbound" ? "http" : original,
|
|
@@ -155,7 +152,7 @@ export function ServiceRoleToSolutionJSON(ctx, name, role, parent) {
|
|
|
155
152
|
client.role = "self";
|
|
156
153
|
client.channel = inherited;
|
|
157
154
|
// register links to new deployment
|
|
158
|
-
(
|
|
155
|
+
(_d = ctx.root).links ?? (_d.links = []);
|
|
159
156
|
ctx.root.links.push({
|
|
160
157
|
meta: {},
|
|
161
158
|
s_d: CtxId(ctx),
|
|
@@ -169,17 +166,17 @@ export function ServiceRoleToSolutionJSON(ctx, name, role, parent) {
|
|
|
169
166
|
for (const link of server.links) {
|
|
170
167
|
if (link.role === name) {
|
|
171
168
|
const inherited = `${link.role}.${link.channel}`;
|
|
172
|
-
let original = (
|
|
169
|
+
let original = (artifact?.srv?.server ?? {})[link.channel];
|
|
173
170
|
// Try duplex channel
|
|
174
171
|
if (original === undefined) {
|
|
175
|
-
original = (
|
|
172
|
+
original = (artifact?.srv?.duplex ?? {})[link.channel];
|
|
176
173
|
}
|
|
177
174
|
parent.description.srv.client[inherited] = {
|
|
178
175
|
inherited: true,
|
|
179
176
|
protocol: typeof original === "string" ? original : original.protocol,
|
|
180
177
|
port: typeof original === "object" ? original.port : undefined
|
|
181
178
|
};
|
|
182
|
-
(
|
|
179
|
+
(_e = ctx.root).links ?? (_e.links = []);
|
|
183
180
|
ctx.root.links.push({
|
|
184
181
|
meta: {},
|
|
185
182
|
s_d: CtxParentId(ctx),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/build/helpers/service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAuB,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC3H,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAwB,EAAE,OAAgB
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/build/helpers/service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,WAA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CAAA;gBAC5B,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAA;AACf,CAAC"}
|
|
@@ -20,3 +20,11 @@ export declare function ComponentImageToSolutionJSON(image: string | Image): Ima
|
|
|
20
20
|
* properties based on the resolved module's URL. Returns an empty array if the node or module cannot be resolved.
|
|
21
21
|
*/
|
|
22
22
|
export declare function ReferenceUpdater(KumoriModules: KumoriModules, node: AstNode | undefined): ((ref: Reference) => void)[];
|
|
23
|
+
/**
|
|
24
|
+
* Constructs a reference path string from a given Reference object.
|
|
25
|
+
* The path is formed by concatenating the domain and module properties.
|
|
26
|
+
*
|
|
27
|
+
* @param ref - The Reference object containing domain and module information.
|
|
28
|
+
* @returns A string representing the reference path in the format "domain/module".
|
|
29
|
+
*/
|
|
30
|
+
export declare function GetReferencePath(ref: Reference): string;
|