@balena/compose-parser 0.0.2-build-setup-compose-go-1206dd03ac7e912df0da255a5bbf3d40cb932da1-1
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/LICENSE +201 -0
- package/README.md +111 -0
- package/dist/lib/compose.d.ts +7 -0
- package/dist/lib/compose.js +478 -0
- package/dist/lib/compose.js.map +1 -0
- package/dist/lib/errors.d.ts +27 -0
- package/dist/lib/errors.js +44 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/index.js +12 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/types.d.ts +289 -0
- package/dist/lib/types.js +3 -0
- package/dist/lib/types.js.map +1 -0
- package/install.js +42 -0
- package/lib/compose.ts +832 -0
- package/lib/errors.ts +41 -0
- package/lib/go.mod +23 -0
- package/lib/go.sum +49 -0
- package/lib/index.ts +30 -0
- package/lib/main.go +147 -0
- package/lib/types.ts +318 -0
- package/package.json +70 -0
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VOLUME_CONFIG_DENY_LIST = exports.NETWORK_CONFIG_DENY_LIST = exports.BUILD_CONFIG_DENY_LIST = exports.SERVICE_CONFIG_DENY_LIST = void 0;
|
|
4
|
+
exports.parse = parse;
|
|
5
|
+
exports.toImageDescriptors = toImageDescriptors;
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
const util_1 = require("util");
|
|
8
|
+
const crypto_1 = require("crypto");
|
|
9
|
+
const path = require("path");
|
|
10
|
+
const semver_1 = require("semver");
|
|
11
|
+
const errors_1 = require("./errors");
|
|
12
|
+
const exec = (0, util_1.promisify)(child_process_1.exec);
|
|
13
|
+
async function parse(composeFilePaths) {
|
|
14
|
+
const filePaths = Array.isArray(composeFilePaths)
|
|
15
|
+
? composeFilePaths
|
|
16
|
+
: [composeFilePaths];
|
|
17
|
+
if (filePaths.length === 0) {
|
|
18
|
+
throw new errors_1.ArgumentError('At least one compose file path must be provided');
|
|
19
|
+
}
|
|
20
|
+
const projectName = (0, crypto_1.randomUUID)();
|
|
21
|
+
const fileFlags = filePaths.map((filePath) => `-f ${filePath}`).join(' ');
|
|
22
|
+
const binaryPath = path.join(__dirname, '..', 'bin', 'balena-compose-go');
|
|
23
|
+
const result = await exec(`${binaryPath} ${fileFlags} ${projectName}`, {
|
|
24
|
+
env: process.env,
|
|
25
|
+
}).catch((e) => {
|
|
26
|
+
if (e.stdout !== undefined && e.stderr !== undefined) {
|
|
27
|
+
return e;
|
|
28
|
+
}
|
|
29
|
+
throw e;
|
|
30
|
+
});
|
|
31
|
+
const { stdout, stderr } = result;
|
|
32
|
+
if (stderr) {
|
|
33
|
+
const errorsOrWarnings = toComposeError(stderr);
|
|
34
|
+
const errors = errorsOrWarnings.filter((e) => ['error', 'fatal', 'panic'].includes(e.level));
|
|
35
|
+
if (errors.length > 0) {
|
|
36
|
+
throw errors[0];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const parsedResult = JSON.parse(stdout);
|
|
40
|
+
return normalize(parsedResult, filePaths[0]);
|
|
41
|
+
}
|
|
42
|
+
function toComposeError(stderr) {
|
|
43
|
+
const errors = [];
|
|
44
|
+
const lines = stderr.split('\n').filter((line) => line.trim() !== '');
|
|
45
|
+
lines.forEach((line) => {
|
|
46
|
+
try {
|
|
47
|
+
const parsed = JSON.parse(line);
|
|
48
|
+
if (parsed.message) {
|
|
49
|
+
errors.push(new errors_1.ComposeError(parsed.message, parsed.level ?? 'error', parsed.name));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
console.warn(`Could not parse stderr line as JSON: ${line}`);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return errors;
|
|
57
|
+
}
|
|
58
|
+
function normalize(rawComposition, composeFilePath) {
|
|
59
|
+
const composition = {
|
|
60
|
+
services: {},
|
|
61
|
+
};
|
|
62
|
+
if (rawComposition.name) {
|
|
63
|
+
removeProjectName(rawComposition, rawComposition.name);
|
|
64
|
+
}
|
|
65
|
+
if (rawComposition.secrets || rawComposition.configs) {
|
|
66
|
+
throw new errors_1.ValidationError('Top-level secrets and/or configs are not supported');
|
|
67
|
+
}
|
|
68
|
+
if (rawComposition.services) {
|
|
69
|
+
for (const [serviceName, service] of Object.entries(rawComposition.services)) {
|
|
70
|
+
composition.services[serviceName] = normalizeService(service, composeFilePath, serviceName);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (rawComposition.networks) {
|
|
74
|
+
composition.networks = {};
|
|
75
|
+
for (const [networkName, network] of Object.entries(rawComposition.networks)) {
|
|
76
|
+
composition.networks[networkName] = normalizeNetwork(network);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (rawComposition.volumes) {
|
|
80
|
+
composition.volumes = {};
|
|
81
|
+
for (const [volumeName, volume] of Object.entries(rawComposition.volumes)) {
|
|
82
|
+
composition.volumes[volumeName] = normalizeVolume(volume);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return composition;
|
|
86
|
+
}
|
|
87
|
+
function removeProjectName(obj, projectName) {
|
|
88
|
+
const stack = [obj];
|
|
89
|
+
while (stack.length > 0) {
|
|
90
|
+
const current = stack.pop();
|
|
91
|
+
for (const [key, value] of Object.entries(current)) {
|
|
92
|
+
if (typeof value === 'object' && value) {
|
|
93
|
+
stack.push(value);
|
|
94
|
+
}
|
|
95
|
+
else if (typeof value === 'string' && value.includes(projectName)) {
|
|
96
|
+
delete current[key];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.SERVICE_CONFIG_DENY_LIST = [
|
|
102
|
+
'blkio_config',
|
|
103
|
+
'configs',
|
|
104
|
+
'cpu_count',
|
|
105
|
+
'cpu_percent',
|
|
106
|
+
'cpu_period',
|
|
107
|
+
'credential_spec',
|
|
108
|
+
'deploy',
|
|
109
|
+
'develop',
|
|
110
|
+
'external_links',
|
|
111
|
+
'gpus',
|
|
112
|
+
'isolation',
|
|
113
|
+
'links',
|
|
114
|
+
'logging',
|
|
115
|
+
'mem_swappiness',
|
|
116
|
+
'memswap_limit',
|
|
117
|
+
'oom_kill_disable',
|
|
118
|
+
'platform',
|
|
119
|
+
'pull_policy',
|
|
120
|
+
'runtime',
|
|
121
|
+
'scale',
|
|
122
|
+
'secrets',
|
|
123
|
+
'stdin_open',
|
|
124
|
+
'storage_opt',
|
|
125
|
+
];
|
|
126
|
+
const OOM_SCORE_ADJ_WARN_THRESHOLD = -900;
|
|
127
|
+
const bindMountByLabel = [
|
|
128
|
+
['io.balena.features.balena-socket', ['/var/run/docker.sock']],
|
|
129
|
+
['io.balena.features.balena-socket', ['/var/run/balena-engine.sock']],
|
|
130
|
+
['io.balena.features.dbus', ['/run/dbus']],
|
|
131
|
+
['io.balena.features.sysfs', ['/sys']],
|
|
132
|
+
['io.balena.features.procfs', ['/proc']],
|
|
133
|
+
['io.balena.features.kernel-modules', ['/lib/modules']],
|
|
134
|
+
['io.balena.features.firmware', ['/lib/firmware']],
|
|
135
|
+
[
|
|
136
|
+
'io.balena.features.journal-logs',
|
|
137
|
+
['/var/log/journal', '/run/log/journal', '/etc/machine-id'],
|
|
138
|
+
],
|
|
139
|
+
];
|
|
140
|
+
const allowedBindMounts = bindMountByLabel.flatMap(([_, appliedBindMounts]) => appliedBindMounts);
|
|
141
|
+
function normalizeService(rawService, composeFilePath, serviceName) {
|
|
142
|
+
const service = { ...rawService };
|
|
143
|
+
for (const field of exports.SERVICE_CONFIG_DENY_LIST) {
|
|
144
|
+
if (field in service) {
|
|
145
|
+
throw new errors_1.ServiceError(`service.${field} is not allowed`, serviceName);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (rawService.build) {
|
|
149
|
+
service.build = normalizeServiceBuild(rawService.build, composeFilePath, serviceName);
|
|
150
|
+
}
|
|
151
|
+
if (service.labels) {
|
|
152
|
+
validateLabels(service.labels, serviceName);
|
|
153
|
+
}
|
|
154
|
+
if (service.network_mode?.match(/^container:.*$/)) {
|
|
155
|
+
throw new errors_1.ServiceError('service.network_mode container:${containerId} is not allowed', serviceName);
|
|
156
|
+
}
|
|
157
|
+
if (service.pid?.match(/^container:.*$/)) {
|
|
158
|
+
throw new errors_1.ServiceError('service.pid container:${containerId} is not allowed', serviceName);
|
|
159
|
+
}
|
|
160
|
+
if (service.security_opt?.some((opt) => !opt.match('no-new-privileges'))) {
|
|
161
|
+
throw new errors_1.ServiceError('Only no-new-privileges is allowed for service.security_opt', serviceName);
|
|
162
|
+
}
|
|
163
|
+
if (service.volumes_from?.some((v) => v.match(/^container:.*$/))) {
|
|
164
|
+
throw new errors_1.ServiceError('service.volumes_from which references a containerId is not allowed', serviceName);
|
|
165
|
+
}
|
|
166
|
+
if (service.entrypoint === null) {
|
|
167
|
+
delete service.entrypoint;
|
|
168
|
+
}
|
|
169
|
+
if (service.ports) {
|
|
170
|
+
service.ports = longToShortSyntaxPorts(service.ports);
|
|
171
|
+
}
|
|
172
|
+
if (service.depends_on) {
|
|
173
|
+
service.depends_on = longToShortSyntaxDependsOn(service.depends_on);
|
|
174
|
+
}
|
|
175
|
+
if (service.devices) {
|
|
176
|
+
service.devices = longToShortSyntaxDevices(service.devices, serviceName);
|
|
177
|
+
}
|
|
178
|
+
if (service.volumes) {
|
|
179
|
+
const v = service.volumes;
|
|
180
|
+
const labels = allowedBindMountsToLabels(v);
|
|
181
|
+
if (labels.length > 0) {
|
|
182
|
+
service.labels = {
|
|
183
|
+
...service.labels,
|
|
184
|
+
...Object.fromEntries(labels.map((label) => [label, '1'])),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
const { shortSyntaxVolumes, shortSyntaxTmpfs } = longToShortSyntaxVolumes(v, serviceName);
|
|
188
|
+
if (shortSyntaxVolumes.length > 0) {
|
|
189
|
+
service.volumes = shortSyntaxVolumes;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
delete service.volumes;
|
|
193
|
+
}
|
|
194
|
+
if (shortSyntaxTmpfs.length > 0) {
|
|
195
|
+
service.tmpfs = [...(service.tmpfs ?? []), ...shortSyntaxTmpfs];
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
if (service.image && service.build) {
|
|
199
|
+
service.build.tags = [...(service.build.tags ?? []), service.image];
|
|
200
|
+
}
|
|
201
|
+
delete service.env_file;
|
|
202
|
+
delete service.label_file;
|
|
203
|
+
if (service.expose) {
|
|
204
|
+
console.warn('service.expose is informational only. Removing from the composition');
|
|
205
|
+
delete service.expose;
|
|
206
|
+
}
|
|
207
|
+
if (service.oom_score_adj &&
|
|
208
|
+
service.oom_score_adj <= OOM_SCORE_ADJ_WARN_THRESHOLD) {
|
|
209
|
+
console.warn(`service.oom_score_adj values under ${OOM_SCORE_ADJ_WARN_THRESHOLD} may break device functionality`);
|
|
210
|
+
}
|
|
211
|
+
if (service.container_name) {
|
|
212
|
+
console.warn('service.container_name is not supported. Removing from the composition');
|
|
213
|
+
delete service.container_name;
|
|
214
|
+
}
|
|
215
|
+
return service;
|
|
216
|
+
}
|
|
217
|
+
exports.BUILD_CONFIG_DENY_LIST = [
|
|
218
|
+
'additional_contexts',
|
|
219
|
+
'cache_to',
|
|
220
|
+
'dockerfile_inline',
|
|
221
|
+
'entitlements',
|
|
222
|
+
'isolation',
|
|
223
|
+
'network',
|
|
224
|
+
'no_cache',
|
|
225
|
+
'platforms',
|
|
226
|
+
'privileged',
|
|
227
|
+
'pull',
|
|
228
|
+
'secrets',
|
|
229
|
+
'ssh',
|
|
230
|
+
'tags',
|
|
231
|
+
'ulimits',
|
|
232
|
+
];
|
|
233
|
+
function normalizeServiceBuild(rawServiceBuild, composeFilePath, serviceName) {
|
|
234
|
+
const build = { ...rawServiceBuild };
|
|
235
|
+
for (const field of exports.BUILD_CONFIG_DENY_LIST) {
|
|
236
|
+
if (field in build) {
|
|
237
|
+
throw new errors_1.ServiceError(`service.build.${field} is not allowed`, serviceName);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (build.labels) {
|
|
241
|
+
validateLabels(build.labels, serviceName);
|
|
242
|
+
}
|
|
243
|
+
if (build.context) {
|
|
244
|
+
if (build.context.endsWith('.git')) {
|
|
245
|
+
throw new errors_1.ServiceError(`service.build.context cannot be a remote context`, serviceName);
|
|
246
|
+
}
|
|
247
|
+
build.context =
|
|
248
|
+
path.relative(path.dirname(composeFilePath), build.context) || '.';
|
|
249
|
+
}
|
|
250
|
+
return build;
|
|
251
|
+
}
|
|
252
|
+
const NAMESPACED_LABEL_ERROR_MESSAGE = 'labels cannot use the "io.balena.private" namespace';
|
|
253
|
+
function validateLabels(labels, serviceName) {
|
|
254
|
+
for (const [name, value] of Object.entries(labels)) {
|
|
255
|
+
if (name.startsWith('io.balena.private')) {
|
|
256
|
+
if (serviceName) {
|
|
257
|
+
throw new errors_1.ServiceError(NAMESPACED_LABEL_ERROR_MESSAGE, serviceName);
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
throw new errors_1.ValidationError(NAMESPACED_LABEL_ERROR_MESSAGE);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
if (name.startsWith(contractRequirementLabelPrefix)) {
|
|
264
|
+
const ctype = name.replace(contractRequirementLabelPrefix, '');
|
|
265
|
+
if (ctype in supportedContractRequirementLabels) {
|
|
266
|
+
supportedContractRequirementLabels[ctype].validate(value, name);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
function longToShortSyntaxPorts(ports) {
|
|
272
|
+
const shortSyntaxPorts = [];
|
|
273
|
+
const ignoredFields = ['name', 'app_protocol', 'mode'];
|
|
274
|
+
for (const port of ports) {
|
|
275
|
+
if (typeof port === 'string') {
|
|
276
|
+
shortSyntaxPorts.push(port);
|
|
277
|
+
}
|
|
278
|
+
else if (typeof port === 'object') {
|
|
279
|
+
for (const field of ignoredFields) {
|
|
280
|
+
if (field in port) {
|
|
281
|
+
console.warn(`service.ports.${field} is not supported. Removing from the composition`);
|
|
282
|
+
delete port[field];
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
shortSyntaxPorts.push((port.host_ip ? `${port.host_ip}:` : '') +
|
|
286
|
+
`${port.published ? `${port.published}:` : ''}${port.target}` +
|
|
287
|
+
(port.protocol !== 'tcp' ? `/${port.protocol}` : ''));
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return shortSyntaxPorts;
|
|
291
|
+
}
|
|
292
|
+
function longToShortSyntaxDependsOn(dependsOn) {
|
|
293
|
+
const shortSyntaxDependsOn = [];
|
|
294
|
+
for (const [serviceName, dependsOnConfig] of Object.entries(dependsOn)) {
|
|
295
|
+
if (dependsOnConfig.condition !== 'service_started' ||
|
|
296
|
+
dependsOnConfig.required !== true) {
|
|
297
|
+
throw new errors_1.ServiceError(`Long syntax depends_on ${JSON.stringify(dependsOnConfig)} ` +
|
|
298
|
+
`for service "${serviceName}" or a definition that generates ` +
|
|
299
|
+
'a long syntax depends_on config is not yet supported, ' +
|
|
300
|
+
'using short syntax to express dependency', serviceName);
|
|
301
|
+
}
|
|
302
|
+
if (dependsOnConfig.required !== false) {
|
|
303
|
+
shortSyntaxDependsOn.push(serviceName);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return shortSyntaxDependsOn;
|
|
307
|
+
}
|
|
308
|
+
function longToShortSyntaxDevices(devices, serviceName) {
|
|
309
|
+
const shortSyntaxDevices = [];
|
|
310
|
+
const CDIRegex = new RegExp('^(?!/)');
|
|
311
|
+
for (const deviceConfig of devices) {
|
|
312
|
+
if (CDIRegex.test(deviceConfig.source) ||
|
|
313
|
+
CDIRegex.test(deviceConfig.target)) {
|
|
314
|
+
throw new errors_1.ServiceError(`devices config with CDI syntax is not allowed`, serviceName);
|
|
315
|
+
}
|
|
316
|
+
shortSyntaxDevices.push(`${deviceConfig.source}:${deviceConfig.target}:${deviceConfig.permissions}`);
|
|
317
|
+
}
|
|
318
|
+
return shortSyntaxDevices;
|
|
319
|
+
}
|
|
320
|
+
function allowedBindMountsToLabels(volumes) {
|
|
321
|
+
const labels = [];
|
|
322
|
+
bindMountByLabel.forEach(([label, appliedBindMounts]) => {
|
|
323
|
+
if (appliedBindMounts.every((m) => volumes.some((v) => v.source && v.source === m))) {
|
|
324
|
+
labels.push(label);
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
return labels;
|
|
328
|
+
}
|
|
329
|
+
function longToShortSyntaxVolumes(volumes, serviceName) {
|
|
330
|
+
const shortSyntaxVolumes = [];
|
|
331
|
+
const shortSyntaxTmpfs = [];
|
|
332
|
+
for (const v of volumes) {
|
|
333
|
+
if (v.source && allowedBindMounts.includes(v.source)) {
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
if (['bind', 'image', 'npipe', 'cluster'].includes(v.type)) {
|
|
337
|
+
throw new errors_1.ServiceError(`service.volumes cannot be of type "${v.type}"`, serviceName);
|
|
338
|
+
}
|
|
339
|
+
const isLongSyntaxTmpfs = v.type === 'tmpfs' && v.tmpfs && Object.keys(v.tmpfs).length > 0;
|
|
340
|
+
const isLongSyntaxVolume = v.type === 'volume' && v.volume && Object.keys(v.volume).length > 0;
|
|
341
|
+
if (isLongSyntaxTmpfs || isLongSyntaxVolume) {
|
|
342
|
+
throw new errors_1.ServiceError(`long syntax service.volumes are not supported`, serviceName);
|
|
343
|
+
}
|
|
344
|
+
if (v.type === 'volume' && (!v.source || !v.target)) {
|
|
345
|
+
throw new errors_1.ServiceError(`service.volumes ${JSON.stringify(v)} must specify source and target`, serviceName);
|
|
346
|
+
}
|
|
347
|
+
if (v.type === 'volume') {
|
|
348
|
+
shortSyntaxVolumes.push(`${v.source}:${v.target}${v.read_only ? ':ro' : ''}`);
|
|
349
|
+
}
|
|
350
|
+
else if (v.type === 'tmpfs' && v.target) {
|
|
351
|
+
shortSyntaxTmpfs.push(v.target);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return { shortSyntaxVolumes, shortSyntaxTmpfs };
|
|
355
|
+
}
|
|
356
|
+
exports.NETWORK_CONFIG_DENY_LIST = ['attachable', 'external', 'name'];
|
|
357
|
+
function normalizeNetwork(rawNetwork) {
|
|
358
|
+
const network = { ...rawNetwork };
|
|
359
|
+
for (const field of exports.NETWORK_CONFIG_DENY_LIST) {
|
|
360
|
+
if (field in network) {
|
|
361
|
+
throw new errors_1.ValidationError(`network.${field} is not allowed`);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
if (network.driver && !['bridge', 'default'].includes(network.driver)) {
|
|
365
|
+
throw new errors_1.ValidationError(`Only "bridge" and "default" are supported for network.driver, got "${network.driver}"`);
|
|
366
|
+
}
|
|
367
|
+
if (network.labels) {
|
|
368
|
+
validateLabels(network.labels);
|
|
369
|
+
}
|
|
370
|
+
if (network.driver_opts?.['com.docker.network.bridge.name']) {
|
|
371
|
+
console.warn('com.docker.network.bridge.name network.driver_opt may interfere with device firewall');
|
|
372
|
+
}
|
|
373
|
+
return network;
|
|
374
|
+
}
|
|
375
|
+
exports.VOLUME_CONFIG_DENY_LIST = ['external', 'name'];
|
|
376
|
+
function normalizeVolume(rawVolume) {
|
|
377
|
+
const volume = { ...rawVolume };
|
|
378
|
+
if (volume.driver && !['local', 'default'].includes(volume.driver)) {
|
|
379
|
+
throw new errors_1.ValidationError(`Only "local" and "default" are supported for volume.driver, got "${volume.driver}"`);
|
|
380
|
+
}
|
|
381
|
+
for (const field of exports.VOLUME_CONFIG_DENY_LIST) {
|
|
382
|
+
if (field in volume) {
|
|
383
|
+
throw new errors_1.ValidationError(`volume.${field} is not allowed`);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
if (volume.labels) {
|
|
387
|
+
validateLabels(volume.labels);
|
|
388
|
+
}
|
|
389
|
+
return volume;
|
|
390
|
+
}
|
|
391
|
+
function validateVersionRange(value, label) {
|
|
392
|
+
if ((0, semver_1.validRange)(value) == null) {
|
|
393
|
+
throw new errors_1.ValidationError(`Invalid value for label '${label}'. ` +
|
|
394
|
+
'Expected a valid semver range; ' +
|
|
395
|
+
`got '${value}'`);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
const contractRequirementLabelPrefix = 'io.balena.features.requires.';
|
|
399
|
+
const supportedContractRequirementLabels = {
|
|
400
|
+
'sw.supervisor': {
|
|
401
|
+
validate(value, label) {
|
|
402
|
+
validateVersionRange(value, label);
|
|
403
|
+
},
|
|
404
|
+
transform(value) {
|
|
405
|
+
return { type: 'sw.supervisor', version: value };
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
'sw.l4t': {
|
|
409
|
+
validate(value, label) {
|
|
410
|
+
validateVersionRange(value, label);
|
|
411
|
+
},
|
|
412
|
+
transform(value) {
|
|
413
|
+
return { type: 'sw.l4t', version: value };
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
'hw.device-type': {
|
|
417
|
+
validate() {
|
|
418
|
+
},
|
|
419
|
+
transform(value) {
|
|
420
|
+
return { type: 'hw.device-type', slug: value };
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
'arch.sw': {
|
|
424
|
+
validate(value, label) {
|
|
425
|
+
if (!['aarch64', 'rpi', 'amd64', 'armv7hf', 'i386'].includes(value)) {
|
|
426
|
+
throw new errors_1.ValidationError(`Invalid value for label '${label}'. ` +
|
|
427
|
+
'Expected a valid architecture string ' +
|
|
428
|
+
`got '${value}'`);
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
transform(value) {
|
|
432
|
+
return { type: 'arch.sw', slug: value };
|
|
433
|
+
},
|
|
434
|
+
},
|
|
435
|
+
};
|
|
436
|
+
function toImageDescriptors(c) {
|
|
437
|
+
return Object.entries(c.services).map(([name, service]) => {
|
|
438
|
+
return createImageDescriptor(name, service);
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
function createContractFromLabels(serviceName, labels) {
|
|
442
|
+
const requires = Object.entries(labels ?? {}).flatMap(([key, value]) => {
|
|
443
|
+
if (!key.startsWith(contractRequirementLabelPrefix)) {
|
|
444
|
+
return [];
|
|
445
|
+
}
|
|
446
|
+
key = key.replace(contractRequirementLabelPrefix, '');
|
|
447
|
+
if (!(key in supportedContractRequirementLabels)) {
|
|
448
|
+
return [];
|
|
449
|
+
}
|
|
450
|
+
const parser = supportedContractRequirementLabels[key];
|
|
451
|
+
return [parser.transform(value)];
|
|
452
|
+
});
|
|
453
|
+
if (requires.length === 0) {
|
|
454
|
+
return null;
|
|
455
|
+
}
|
|
456
|
+
return {
|
|
457
|
+
type: 'sw.container',
|
|
458
|
+
slug: `contract-for-${serviceName}`,
|
|
459
|
+
requires,
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
function createImageDescriptor(serviceName, service) {
|
|
463
|
+
const contract = createContractFromLabels(serviceName, service.labels);
|
|
464
|
+
if (service.image && !service.build) {
|
|
465
|
+
return {
|
|
466
|
+
serviceName,
|
|
467
|
+
image: service.image,
|
|
468
|
+
...(contract && { contract }),
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
const build = service.build;
|
|
472
|
+
return {
|
|
473
|
+
serviceName,
|
|
474
|
+
image: build,
|
|
475
|
+
...(contract && { contract }),
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
//# sourceMappingURL=compose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../../lib/compose.ts"],"names":[],"mappings":";;;AAgCA,sBAoDC;AAsrBD,gDAIC;AA9wBD,iDAAiD;AACjD,+BAAiC;AACjC,mCAAoC;AACpC,6BAA6B;AAC7B,mCAAoC;AAEpC,qCAKkB;AAclB,MAAM,IAAI,GAAG,IAAA,gBAAS,EAAC,oBAAQ,CAAC,CAAC;AAO1B,KAAK,UAAU,KAAK,CAC1B,gBAAmC;IAGnC,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,gB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,cAAc;QACpB,IAAI,EAAE,gBAAgB,WAAW,EAAE;QACnC,QAAQ;KACR,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAC7B,WAAmB,EACnB,OAAgB;IAEhB,MAAM,QAAQ,GAAG,wBAAwB,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACvE,IAAI,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrC,OAAO;YACN,WAAW;YACX,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,GAAG,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,CAAC;SAC7B,CAAC;IACH,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAM,CAAC;IAC7B,OAAO;QACN,WAAW;QACX,KAAK,EAAE,KAAK;QACZ,GAAG,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,CAAC;KAC7B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TypedError } from 'typed-error';
|
|
2
|
+
export declare enum ErrorLevel {
|
|
3
|
+
ERROR = "error",
|
|
4
|
+
FATAL = "fatal",
|
|
5
|
+
WARN = "warn",
|
|
6
|
+
INFO = "info",
|
|
7
|
+
DEBUG = "debug"
|
|
8
|
+
}
|
|
9
|
+
export declare class ComposeError extends TypedError {
|
|
10
|
+
message: string;
|
|
11
|
+
level: ErrorLevel;
|
|
12
|
+
name: string;
|
|
13
|
+
constructor(message: string, level?: ErrorLevel, name?: string);
|
|
14
|
+
}
|
|
15
|
+
export declare class ValidationError extends ComposeError {
|
|
16
|
+
message: string;
|
|
17
|
+
constructor(message: string);
|
|
18
|
+
}
|
|
19
|
+
export declare class ServiceError extends ComposeError {
|
|
20
|
+
message: string;
|
|
21
|
+
serviceName: string;
|
|
22
|
+
constructor(message: string, serviceName: string);
|
|
23
|
+
}
|
|
24
|
+
export declare class ArgumentError extends ComposeError {
|
|
25
|
+
message: string;
|
|
26
|
+
constructor(message: string);
|
|
27
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArgumentError = exports.ServiceError = exports.ValidationError = exports.ComposeError = exports.ErrorLevel = void 0;
|
|
4
|
+
const typed_error_1 = require("typed-error");
|
|
5
|
+
var ErrorLevel;
|
|
6
|
+
(function (ErrorLevel) {
|
|
7
|
+
ErrorLevel["ERROR"] = "error";
|
|
8
|
+
ErrorLevel["FATAL"] = "fatal";
|
|
9
|
+
ErrorLevel["WARN"] = "warn";
|
|
10
|
+
ErrorLevel["INFO"] = "info";
|
|
11
|
+
ErrorLevel["DEBUG"] = "debug";
|
|
12
|
+
})(ErrorLevel || (exports.ErrorLevel = ErrorLevel = {}));
|
|
13
|
+
class ComposeError extends typed_error_1.TypedError {
|
|
14
|
+
constructor(message, level = ErrorLevel.ERROR, name = 'ComposeError') {
|
|
15
|
+
super(message);
|
|
16
|
+
this.message = message;
|
|
17
|
+
this.level = level;
|
|
18
|
+
this.name = name;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ComposeError = ComposeError;
|
|
22
|
+
class ValidationError extends ComposeError {
|
|
23
|
+
constructor(message) {
|
|
24
|
+
super(message, ErrorLevel.ERROR, 'ValidationError');
|
|
25
|
+
this.message = message;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.ValidationError = ValidationError;
|
|
29
|
+
class ServiceError extends ComposeError {
|
|
30
|
+
constructor(message, serviceName) {
|
|
31
|
+
super(message, ErrorLevel.ERROR, 'ServiceError');
|
|
32
|
+
this.message = message;
|
|
33
|
+
this.serviceName = serviceName;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.ServiceError = ServiceError;
|
|
37
|
+
class ArgumentError extends ComposeError {
|
|
38
|
+
constructor(message) {
|
|
39
|
+
super(message, ErrorLevel.ERROR, 'ArgumentError');
|
|
40
|
+
this.message = message;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.ArgumentError = ArgumentError;
|
|
44
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../lib/errors.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,IAAY,UAMX;AAND,WAAY,UAAU;IACrB,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,6BAAe,CAAA;AAChB,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AAED,MAAa,YAAa,SAAQ,wBAAU;IAC3C,YACQ,OAAe,EAEf,QAAQ,UAAU,CAAC,KAAK,EACxB,OAAO,cAAc;QAE5B,KAAK,CAAC,OAAO,CAAC,CAAC;QALR,YAAO,GAAP,OAAO,CAAQ;QAEf,UAAK,GAAL,KAAK,CAAmB;QACxB,SAAI,GAAJ,IAAI,CAAiB;IAG7B,CAAC;CACD;AATD,oCASC;AAED,MAAa,eAAgB,SAAQ,YAAY;IAChD,YAAmB,OAAe;QACjC,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;QADlC,YAAO,GAAP,OAAO,CAAQ;IAElC,CAAC;CACD;AAJD,0CAIC;AAED,MAAa,YAAa,SAAQ,YAAY;IAC7C,YACQ,OAAe,EACf,WAAmB;QAE1B,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QAH1C,YAAO,GAAP,OAAO,CAAQ;QACf,gBAAW,GAAX,WAAW,CAAQ;IAG3B,CAAC;CACD;AAPD,oCAOC;AAED,MAAa,aAAc,SAAQ,YAAY;IAC9C,YAAmB,OAAe;QACjC,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;QADhC,YAAO,GAAP,OAAO,CAAQ;IAElC,CAAC;CACD;AAJD,sCAIC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { parse, toImageDescriptors } from './compose';
|
|
2
|
+
import { ServiceError, ValidationError, ArgumentError, ComposeError } from './errors';
|
|
3
|
+
import { Composition, Service, Network, Volume, BuildConfig, ImageDescriptor } from './types';
|
|
4
|
+
export { parse, toImageDescriptors, Composition, Service, Network, Volume, BuildConfig, ImageDescriptor, ComposeError, ServiceError, ValidationError, ArgumentError, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArgumentError = exports.ValidationError = exports.ServiceError = exports.ComposeError = exports.toImageDescriptors = exports.parse = void 0;
|
|
4
|
+
const compose_1 = require("./compose");
|
|
5
|
+
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return compose_1.parse; } });
|
|
6
|
+
Object.defineProperty(exports, "toImageDescriptors", { enumerable: true, get: function () { return compose_1.toImageDescriptors; } });
|
|
7
|
+
const errors_1 = require("./errors");
|
|
8
|
+
Object.defineProperty(exports, "ServiceError", { enumerable: true, get: function () { return errors_1.ServiceError; } });
|
|
9
|
+
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return errors_1.ValidationError; } });
|
|
10
|
+
Object.defineProperty(exports, "ArgumentError", { enumerable: true, get: function () { return errors_1.ArgumentError; } });
|
|
11
|
+
Object.defineProperty(exports, "ComposeError", { enumerable: true, get: function () { return errors_1.ComposeError; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":";;;AAAA,uCAAsD;AAiBrD,sFAjBQ,eAAK,OAiBR;AACL,mGAlBe,4BAAkB,OAkBf;AAjBnB,qCAKkB;AAoBjB,6FAxBA,qBAAY,OAwBA;AACZ,gGAxBA,wBAAe,OAwBA;AACf,8FAxBA,sBAAa,OAwBA;AAHb,6FApBA,qBAAY,OAoBA"}
|