@balena/open-balena-api 29.1.3-build-renovate-major-5-chai-e04d2450af8523d387f71da068671c786cce20c4-1 → 29.1.3-build-service-install-as-async-job-16fd84cc4ee52ec92c775d657f87762a3c5c8df2-2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,41 @@
1
1
  import _ from 'lodash';
2
2
  import { sbvrUtils, hooks, permissions } from '@balena/pinejs';
3
- const createReleaseServiceInstalls = async (api, deviceFilterOrIds, releaseFilter) => {
3
+ import { randomUUID } from 'node:crypto';
4
+ // TODO: make us env vars :)
5
+ const CREATE_SERVICE_INSTALLS_ASYNC = true;
6
+ const SERVICE_INSTALLS_CREATE_BATCH_SIZE = 2000;
7
+ const createServiceInstallsAsync = async (api, deviceFilterOrIds, tx) => {
8
+ const deviceIds = Array.isArray(deviceFilterOrIds)
9
+ ? deviceFilterOrIds
10
+ : (await api.get({
11
+ resource: 'device',
12
+ options: {
13
+ $select: 'id',
14
+ $filter: deviceFilterOrIds,
15
+ },
16
+ })).map(({ id }) => id);
17
+ await Promise.all(_.chunk(deviceIds, SERVICE_INSTALLS_CREATE_BATCH_SIZE).map(async (deviceBatch) => {
18
+ return await sbvrUtils.api.tasks.post({
19
+ resource: 'task',
20
+ passthrough: { req: permissions.root, tx },
21
+ body: {
22
+ key: randomUUID(),
23
+ is_executed_by__handler: 'create_service_installs',
24
+ is_executed_with__parameter_set: {
25
+ devices: deviceBatch,
26
+ },
27
+ },
28
+ });
29
+ }));
30
+ };
31
+ const createReleaseServiceInstalls = async (api, deviceFilterOrIds, releaseFilter, tx) => {
4
32
  if (Array.isArray(deviceFilterOrIds) && deviceFilterOrIds.length === 0) {
5
33
  return;
6
34
  }
35
+ if (CREATE_SERVICE_INSTALLS_ASYNC) {
36
+ await createServiceInstallsAsync(api, deviceFilterOrIds, tx);
37
+ return;
38
+ }
7
39
  const services = await api.get({
8
40
  resource: 'service',
9
41
  options: {
@@ -98,14 +130,14 @@ const createReleaseServiceInstalls = async (api, deviceFilterOrIds, releaseFilte
98
130
  }));
99
131
  }));
100
132
  };
101
- const createAppServiceInstalls = async (api, appId, deviceIds) => createReleaseServiceInstalls(api, deviceIds, {
133
+ const createAppServiceInstalls = async (api, appId, deviceIds, tx) => createReleaseServiceInstalls(api, deviceIds, {
102
134
  should_be_running_on__application: {
103
135
  $any: {
104
136
  $alias: 'a',
105
137
  $expr: { a: { id: appId } },
106
138
  },
107
139
  },
108
- });
140
+ }, tx);
109
141
  const deleteServiceInstallsForCurrentApp = (api, newAppId, deviceIds) => api.delete({
110
142
  resource: 'service_install',
111
143
  options: {
@@ -141,7 +173,7 @@ const deleteServiceInstallsForCurrentApp = (api, newAppId, deviceIds) => api.del
141
173
  },
142
174
  });
143
175
  hooks.addPureHook('PATCH', 'resin', 'application', {
144
- POSTRUN: async ({ api, request }) => {
176
+ POSTRUN: async ({ api, request, tx }) => {
145
177
  const affectedIds = request.affectedIds;
146
178
  if (request.values.should_be_running__release != null &&
147
179
  affectedIds.length !== 0) {
@@ -151,7 +183,7 @@ hooks.addPureHook('PATCH', 'resin', 'application', {
151
183
  is_pinned_on__release: null,
152
184
  }, {
153
185
  id: request.values.should_be_running__release,
154
- });
186
+ }, tx);
155
187
  }
156
188
  },
157
189
  });
@@ -164,13 +196,13 @@ hooks.addPureHook('POST', 'resin', 'device', {
164
196
  const rootApi = api.clone({ passthrough: { tx, req: permissions.root } });
165
197
  const app = request.values.belongs_to__application;
166
198
  if (app != null) {
167
- await createAppServiceInstalls(rootApi, app, [deviceId]);
199
+ await createAppServiceInstalls(rootApi, app, [deviceId], tx);
168
200
  }
169
201
  const release = request.values.is_pinned_on__release;
170
202
  if (release != null) {
171
203
  await createReleaseServiceInstalls(api, [deviceId], {
172
204
  id: release,
173
- });
205
+ }, tx);
174
206
  }
175
207
  },
176
208
  });
@@ -185,12 +217,12 @@ hooks.addPureHook('PATCH', 'resin', 'device', {
185
217
  const affectedIds = await sbvrUtils.getAffectedIds(args);
186
218
  if (affectedIds.length !== 0) {
187
219
  await deleteServiceInstallsForCurrentApp(args.api, newAppId, affectedIds);
188
- await createAppServiceInstalls(args.api, newAppId, affectedIds);
220
+ await createAppServiceInstalls(args.api, newAppId, affectedIds, args.tx);
189
221
  }
190
222
  },
191
223
  });
192
224
  hooks.addPureHook('PATCH', 'resin', 'device', {
193
- POSTRUN: async ({ api, request }) => {
225
+ POSTRUN: async ({ api, request, tx }) => {
194
226
  const affectedIds = request.affectedIds;
195
227
  if (request.values.is_pinned_on__release !== undefined &&
196
228
  affectedIds.length !== 0) {
@@ -199,7 +231,7 @@ hooks.addPureHook('PATCH', 'resin', 'device', {
199
231
  if (request.values.is_pinned_on__release != null) {
200
232
  await createReleaseServiceInstalls(api, affectedIds, {
201
233
  id: request.values.is_pinned_on__release,
202
- });
234
+ }, tx);
203
235
  }
204
236
  else {
205
237
  const devices = (await api.get({
@@ -212,7 +244,7 @@ hooks.addPureHook('PATCH', 'resin', 'device', {
212
244
  },
213
245
  }));
214
246
  const devicesByApp = _.groupBy(devices, (d) => d.belongs_to__application.__id);
215
- await Promise.all(Object.keys(devicesByApp).map((appId) => createAppServiceInstalls(api, devicesByApp[appId][0].belongs_to__application.__id, devicesByApp[appId].map((d) => d.id))));
247
+ await Promise.all(Object.keys(devicesByApp).map((appId) => createAppServiceInstalls(api, devicesByApp[appId][0].belongs_to__application.__id, devicesByApp[appId].map((d) => d.id), tx)));
216
248
  }
217
249
  }
218
250
  },
@@ -232,19 +264,19 @@ const addSystemAppServiceInstallHooks = (fieldName) => {
232
264
  });
233
265
  await createReleaseServiceInstalls(rootApi, [deviceId], {
234
266
  id: releaseId,
235
- });
267
+ }, tx);
236
268
  }
237
269
  },
238
270
  });
239
271
  hooks.addPureHook('PATCH', 'resin', 'device', {
240
- POSTRUN: async ({ api, request }) => {
272
+ POSTRUN: async ({ api, request, tx }) => {
241
273
  const affectedIds = request.affectedIds;
242
274
  const releaseId = request.values[fieldName];
243
275
  // Create supervisor/hostApp service installs when the supervisor/hostApp is pinned on device update
244
276
  if (releaseId != null && affectedIds.length !== 0) {
245
277
  await createReleaseServiceInstalls(api, affectedIds, {
246
278
  id: releaseId,
247
- });
279
+ }, tx);
248
280
  }
249
281
  },
250
282
  });
@@ -1 +1 @@
1
- {"version":3,"file":"service-installs.js","sourceRoot":"","sources":["../../../../src/features/ci-cd/hooks/service-installs.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI/D,MAAM,4BAA4B,GAAG,KAAK,EACzC,GAA+B,EAC/B,iBAAuD,EACvD,aAAsC,EACtB,EAAE;IAClB,IAAI,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxE,OAAO;IACR,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC;QAC9B,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE;YACR,OAAO,EAAE,IAAI;YACb,OAAO,EAAE;gBACR,kBAAkB,EAAE;oBACnB,IAAI,EAAE;wBACL,MAAM,EAAE,GAAG;wBACX,KAAK,EAAE;4BACN,CAAC,EAAE;gCACF,mBAAmB,EAAE;oCACpB,IAAI,EAAE;wCACL,MAAM,EAAE,KAAK;wCACb,KAAK,EAAE;4CACN,GAAG,EAAE;gDACJ,OAAO,EAAE;oDACR,IAAI,EAAE;wDACL,MAAM,EAAE,GAAG;wDACX,KAAK,EAAE,EAAE,CAAC,EAAE,aAAa,EAAE;qDAC3B;iDACD;6CACD;yCACD;qCACD;iCACD;6BACD;yBACD;qBACD;iBACD;aACD;SACD;KACD,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO;IACR,CAAC;IACD,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EA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+BAA+B,CAAC,SAAS,CAAC,CAAC;AAC5C,CAAC"}
1
+ {"version":3,"file":"service-installs.js","sourceRoot":"","sources":["../../../../src/features/ci-cd/hooks/service-installs.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG/D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,4BAA4B;AAC5B,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAC3C,MAAM,kCAAkC,GAAG,IAAI,CAAC;AAEhD,MAAM,0BAA0B,GAAG,KAAK,EACvC,GAA+B,EAC/B,iBAAuD,EACvD,EAAM,EACU,EAAE;IAClB,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC;QACjD,CAAC,CAAC,iBAAiB;QACnB,CAAC,CAAC,CACA,MAAM,GAAG,CAAC,GAAG,CAAC;YACb,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE;gBACR,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,iBAAiB;aAC1B;SACD,CAAC,CACF,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IAExB,MAAM,OAAO,CAAC,GAAG,CAChB,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,kCAAkC,CAAC,CAAC,GAAG,CACzD,KAAK,EAAE,WAAW,EAAE,EAAE;QACrB,OAAO,MAAM,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YACrC,QAAQ,EAAE,MAAM;YAChB,WAAW,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE;YAC1C,IAAI,EAAE;gBACL,GAAG,EAAE,UAAU,EAAE;gBACjB,uBAAuB,EAAE,yBAAyB;gBAClD,+BAA+B,EAAE;oBAChC,OAAO,EAAE,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CACvB,EAAE,CAAC;IACZ,+BAA+B,CAAC,SAAS,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1 @@
1
+ import './service-installs.js';
@@ -0,0 +1,2 @@
1
+ import './service-installs.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/features/ci-cd/tasks/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export type CreateServiceInstallsTaskParams = {
2
+ devices: number[];
3
+ };
@@ -0,0 +1,162 @@
1
+ import { tasks, sbvrUtils, permissions } from '@balena/pinejs';
2
+ import { randomUUID } from 'node:crypto';
3
+ const schema = {
4
+ type: 'object',
5
+ properties: {
6
+ devices: {
7
+ type: 'array',
8
+ items: { type: 'number' },
9
+ },
10
+ },
11
+ required: ['devices'],
12
+ };
13
+ const { api } = sbvrUtils;
14
+ // TODO: make me an env var :)
15
+ const MAX_JOB_TIME_MS = 30 * 1000;
16
+ tasks.addTaskHandler('create_service_installs', async (options) => {
17
+ try {
18
+ const totalSiCreated = await createServiceInstalls(options.params);
19
+ console.info(`[service-install-task] Created ${totalSiCreated} service installs`);
20
+ return {
21
+ status: 'succeeded',
22
+ };
23
+ }
24
+ catch (e) {
25
+ console.error(`[service-install-task] Error creating service installs: ${e}`);
26
+ return {
27
+ error: `${e}`,
28
+ status: 'failed',
29
+ };
30
+ }
31
+ }, schema);
32
+ const createServiceInstalls = async ({ devices, }) => {
33
+ const startTime = Date.now();
34
+ // TODO: There must be a way to do a single query for it...
35
+ const releaseExpand = {
36
+ $select: 'id',
37
+ $expand: {
38
+ contains__image: {
39
+ $select: 'id',
40
+ $expand: {
41
+ image: {
42
+ $select: 'is_a_build_of__service',
43
+ },
44
+ },
45
+ },
46
+ },
47
+ };
48
+ const deviceWithServices = await api.resin.get({
49
+ resource: 'device',
50
+ passthrough: { req: permissions.rootRead },
51
+ options: {
52
+ $select: 'id',
53
+ $expand: {
54
+ should_be_running__release: releaseExpand,
55
+ should_be_managed_by__release: releaseExpand,
56
+ should_be_operated_by__release: releaseExpand,
57
+ },
58
+ $filter: {
59
+ id: { $in: devices },
60
+ },
61
+ },
62
+ });
63
+ const serviceIds = [
64
+ ...new Set(deviceWithServices.flatMap((device) => [
65
+ ...device.should_be_running__release,
66
+ ...device.should_be_managed_by__release,
67
+ ...device.should_be_operated_by__release,
68
+ ].flatMap((release) => release.contains__image.flatMap((image) => image.image.map((img) => img.is_a_build_of__service.__id))))),
69
+ ];
70
+ const missingServiceFilters = serviceIds.map((serviceId) => ({
71
+ $not: {
72
+ service_install: {
73
+ $any: {
74
+ $alias: 'si',
75
+ $expr: {
76
+ si: {
77
+ installs__service: serviceId,
78
+ },
79
+ },
80
+ },
81
+ },
82
+ },
83
+ }));
84
+ if (missingServiceFilters.length === 0) {
85
+ console.info('[service-install-task] No service installs to create');
86
+ return 0;
87
+ }
88
+ const devicesToAddServiceInstalls = await api.resin.get({
89
+ resource: 'device',
90
+ passthrough: { req: permissions.rootRead },
91
+ options: {
92
+ $select: 'id',
93
+ $expand: {
94
+ service_install: {
95
+ $select: 'installs__service',
96
+ $filter: {
97
+ installs__service: { $in: serviceIds },
98
+ },
99
+ },
100
+ },
101
+ $filter: {
102
+ id: { $in: devices },
103
+ ...(missingServiceFilters.length === 1
104
+ ? missingServiceFilters[0]
105
+ : {
106
+ $or: missingServiceFilters,
107
+ }),
108
+ },
109
+ },
110
+ });
111
+ // hmmm should we really go one device at a time or Promise.all?
112
+ // This is already batched at one level, does it make sense to batch it again?
113
+ const tx = await sbvrUtils.db.transaction();
114
+ const remainingDevices = new Set(devices);
115
+ let totalSiCreated = 0;
116
+ for (const device of devicesToAddServiceInstalls) {
117
+ // TODO maybe we need to do a improved diff here?
118
+ // e.g keep the mean device time and this become
119
+ // if (Date.now() - startTime > MAX_JOB_TIME_MS - meanDeviceTime)
120
+ // but I am probably overthinking it
121
+ if (Date.now() - startTime > MAX_JOB_TIME_MS) {
122
+ // TODO: better error handling
123
+ await api.tasks.post({
124
+ resource: 'task',
125
+ passthrough: { req: permissions.root, tx },
126
+ body: {
127
+ key: randomUUID(),
128
+ is_executed_by__handler: 'create_service_installs',
129
+ is_executed_with__parameter_set: {
130
+ devices: Array.from(remainingDevices),
131
+ },
132
+ },
133
+ });
134
+ await tx.end();
135
+ console.info('[service-install-task] Task took too long. Created a new task for the remaining devices');
136
+ return totalSiCreated;
137
+ }
138
+ // Use existingServiceIds as a Set for faster lookups on the follow up filter
139
+ const existingServiceIds = new Set(device.service_install.map((si) => si.installs__service.__id));
140
+ const deviceServiceIds = serviceIds.filter((sid) => !existingServiceIds.has(sid));
141
+ // TODO, we need to handle in case it fails.
142
+ // Maybe something smart is that if a specific device fails
143
+ // we create a new task with only the failures
144
+ await Promise.all(deviceServiceIds.map(async (serviceId) => {
145
+ // Create a service_install for this pair of service and device
146
+ await api.resin.post({
147
+ resource: 'service_install',
148
+ passthrough: { req: permissions.root, tx },
149
+ body: {
150
+ device: device.id,
151
+ installs__service: serviceId,
152
+ },
153
+ options: { returnResource: false },
154
+ });
155
+ }));
156
+ totalSiCreated += deviceServiceIds.length;
157
+ remainingDevices.delete(device.id);
158
+ }
159
+ await tx.end();
160
+ return totalSiCreated;
161
+ };
162
+ //# sourceMappingURL=service-installs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-installs.js","sourceRoot":"","sources":["../../../../src/features/ci-cd/tasks/service-installs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,MAAM,GAAG;IACd,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACX,OAAO,EAAE;YACR,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SACzB;KACD;IACD,QAAQ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AAI,CACX,yFAAyF,CACzF,CAAC;YACF,OAAO,cAAc,CAAC;QACvB,CAAC;QAED,6EAA6E;QAC7E,MAAM,kBAAkB,GAAG,IAAI,GAAG,CACjC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAC7D,CAAC;QACF,MAAM,gBAAgB,GAAG,UAAU,CAAC,MAAM,CACzC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,CACrC,CAAC;QAEF,4CAA4C;QAC5C,2DAA2D;QAC3D,8CAA8C;QAC9C,MAAM,OAAO,CAAC,GAAG,CAChB,gBAAgB,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE;YACxC,+DAA+D;YAC/D,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBACpB,QAAQ,EAAE,iBAAiB;gBAC3B,WAAW,EAAE,EAAE,GAAG,EAAE,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE;gBAC1C,IAAI,EAAE;oBACL,MAAM,EAAE,MAAM,CAAC,EAAE;oBACjB,iBAAiB,EAAE,SAAS;iBAC5B;gBACD,OAAO,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE;aAClC,CAAC,CAAC;QACJ,CAAC,CAAC,CACF,CAAC;QAEF,cAAc,IAAI,gBAAgB,CAAC,MAAM,CAAC;QAC1C,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC;IACf,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC"}
@@ -25,15 +25,23 @@ function buildAppFromRelease(device, application, release, config) {
25
25
  const image = ipr.image[0];
26
26
  const si = device.service_install.find(({ service }) => service.__id === image.is_a_build_of__service[0].id);
27
27
  const svc = image.is_a_build_of__service[0];
28
- if (si == null) {
29
- throw new Error(`Could not find service install for device: '${application.id}', image: '${image?.id}', service: '${JSON.stringify(svc)}', service installs: '${JSON.stringify(device.service_install)}'`);
30
- }
28
+ // if (si == null) {
29
+ // throw new Error(
30
+ // `Could not find service install for device: '${
31
+ // application.id
32
+ // }', image: '${image?.id}', service: '${JSON.stringify(
33
+ // svc,
34
+ // )}', service installs: '${JSON.stringify(device.service_install)}'`,
35
+ // );
36
+ // }
31
37
  const environment = {};
32
38
  varListInsert(ipr.image_environment_variable, environment);
33
39
  varListInsert(application.application_environment_variable, environment);
34
40
  varListInsert(svc.service_environment_variable, environment);
35
41
  varListInsert(device.device_environment_variable, environment);
36
- varListInsert(si.device_service_environment_variable, environment);
42
+ if (si != null) {
43
+ varListInsert(si.device_service_environment_variable, environment);
44
+ }
37
45
  const labels = {};
38
46
  for (const { label_name, value } of [
39
47
  ...ipr.image_label,
@@ -1 +1 @@
1
- {"version":3,"file":"state-get-v2.js","sourceRoot":"","sources":["../../../../src/features/device-state/routes/state-get-v2.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,yBAAyB,EACzB,qBAAqB,EACrB,SAAS,EACT,6BAA6B,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AA4C1B,SAAS,mBAAmB,CAC3B,MAAsB,EACtB,WAA8D,EAC9D,OAA6D,EAC7D,MAA0B;IAE1B,IAAI,WAAW,GAAc,EAAE,CAAC;IAChC,MAAM,QAAQ,GAA8B,EAAE,C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,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;YACrC,OAAO;QACR,CAAC;QACD,gBAAgB,CAAC,GAAG,EAAE,4BAA4B,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACvB,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,qBAAqB,CACtC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CACnB,MAAM,eAAe,CAAC,CAAC,EAAE,EAAE,EAAE,CAC5B,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAC9C,CACF,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAC1B,MAAsB,EACtB,MAA0B,EACV,EAAE;IAClB,MAAM,cAAc,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAEzD,iEAAiE;IACjE,MAAM,OAAO,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;IAErD,uCAAuC;IACvC,OAAO,OAAO,IAAI,IAAI;QACrB,CAAC,CAAC;YACA,IAAI,EAAE,cAAc,CAAC,QAAQ;YAC7B,QAAQ,EAAE,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;SACX;QACF,CAAC,CAAC,mBAAmB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC"}
1
+ {"version":3,"file":"state-get-v2.js","sourceRoot":"","sources":["../../../../src/features/device-state/routes/state-get-v2.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,yB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;QACF,CAAC,CAAC,mBAAmB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC,CAAC"}
@@ -35,10 +35,18 @@ export function buildAppFromRelease(device, application, release, config, defaul
35
35
  if (device != null) {
36
36
  varListInsert(device.device_environment_variable, environment);
37
37
  const si = serviceInstallFromImage(device, image);
38
- if (si == null) {
39
- throw new Error(`Could not find service install for device or application: '${application.uuid}', image: '${image?.id}', service: '${JSON.stringify(svc)}', service_install: '${JSON.stringify(device.service_install)}'`);
38
+ // if (si == null) {
39
+ // throw new Error(
40
+ // `Could not find service install for device or application: '${
41
+ // application.uuid
42
+ // }', image: '${image?.id}', service: '${JSON.stringify(
43
+ // svc,
44
+ // )}', service_install: '${JSON.stringify(device.service_install)}'`,
45
+ // );
46
+ // }
47
+ if (si != null) {
48
+ varListInsert(si.device_service_environment_variable, environment);
40
49
  }
41
- varListInsert(si.device_service_environment_variable, environment);
42
50
  }
43
51
  const labels = {
44
52
  ...defaultLabels,
@@ -1 +1 @@
1
- {"version":3,"file":"state-get-v3.js","sourceRoot":"","sources":["../../../../src/features/device-state/routes/state-get-v3.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,yBAAyB,EACzB,mBAAmB,EACnB,SAAS,EACT,qBAAqB,EACrB,6BAA6B,EAC7B,eAAe,EACf,uBAAuB,EACvB,aAAa,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAK9C,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AA4F1B,MAAM,UAAU,mBAAmB,CAClC,MAAkC,EAClC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YAAY;YAC/B,GAAG,CAAC,OAAO,IAAI,IAAI,IAAI;gBACtB,QAAQ,EAAE,mBAAmB,CAC5B,MAAM,EACN,WAAW,EACX,OAAO,EACP,MAAM,EACN,aAAa,CACb;aACD,CAAC;SACF;KACD,CAAC;AACH,CAAC,CAAC"}
1
+ {"version":3,"file":"state-get-v3.js","sourceRoot":"","sources":["../../../../src/features/device-state/routes/state-get-v3.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,yBAAyB,EACzB,mBAAmB,EACnB,SAAS,EACT,qBAAqB,EACrB,6BAA6B,EAC7B,eAAe,EACf,uBAAuB,EACvB,aAAa,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAK9C,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AA4F1B,MAAM,UAAU,mBAAmB,CAClC,MAAkC,EAClC,WAAiE,EACjE,OAAwB,EACxB,MAA0B,EAC1B,aAAkC;IAElC,IAAI,WAAW,GAAc,EAAE,CAAC;IAChC,MAAM,QAAQ,GACb,EAAE,CAAC;IAEJ,wDAAwD;IACxD,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACrC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACnC,CAAC;SAAM,CAAC;QACP,IAAI,CAAC;YACJ,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC/C,CAAC;QAAC,MAAM,CAAC;YACR,WAAW,GAAG,EAAE,CAAC;QAClB,CAAC;IACF,CAAC;IAED,KAAK,MAAM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AAsC,EACtC,MAA0B,EAC1B,aAAkC,EACD,EAAE;IACnC,IAAI,WAAgC,CAAC;IACrC,IAAI,OAAwB,CAAC;IAC7B,IAAI,kBAAkB,KAAK,4BAA4B,EAAE,CAAC;QACzD,WAAW,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;QAChD,OAAO,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACP,OAAO,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,OAAO,IAAI,CAAC;QACb,CAAC;QACD,WAAW,GACV,OAGA,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO;QACN,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;YACnB,EAAE,EAAE,WAAW,CAAC,EAAE;YAClB,IAAI,EAAE,WAAW,CAAC,QAAQ;YAC1B,OAAO,EAAE,WAAW,CAAC,OAAO;YAC5B,KAAK,EAAE,WAAW,CAAC,YAAY;YAC/B,GAAG,CAAC,OAAO,IAAI,IAAI,IAAI;gBACtB,QAAQ,EAAE,mBAAmB,CAC5B,MAAM,EACN,WAAW,EACX,OAAO,EACP,MAAM,EACN,aAAa,CACb;aACD,CAAC;SACF;KACD,CAAC;AACH,CAAC,CAAC"}
package/dist/index.js CHANGED
@@ -246,8 +246,11 @@ export async function setup(app, options) {
246
246
  if (options.getNewUserRole) {
247
247
  setRegistrationRoleFunc(options.getNewUserRole);
248
248
  }
249
+ await pine.tasks.setup();
249
250
  await import('./hooks.js');
250
251
  await options.onInitHooks?.(app);
252
+ await import('./tasks.js');
253
+ void pine.tasks.worker?.start();
251
254
  const routes = await import('./routes.js');
252
255
  routes.setup(app, options);
253
256
  await options.onInitRoutes?.(app);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":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C,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE;QAClC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,EAA8B,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC1E,OAAO,MAAO,CAAC;AAChB,CAAC"}
@@ -0,0 +1 @@
1
+ import './features/ci-cd/tasks/index.js';
package/dist/tasks.js ADDED
@@ -0,0 +1,2 @@
1
+ import './features/ci-cd/tasks/index.js';
2
+ //# sourceMappingURL=tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.js","sourceRoot":"","sources":["../src/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,iCAAiC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@balena/open-balena-api",
3
3
  "description": "Internet of things, Made Simple",
4
- "version": "29.1.3-build-renovate-major-5-chai-e04d2450af8523d387f71da068671c786cce20c4-1",
4
+ "version": "29.1.3-build-service-install-as-async-job-16fd84cc4ee52ec92c775d657f87762a3c5c8df2-2",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -136,7 +136,7 @@
136
136
  },
137
137
  "devDependencies": {
138
138
  "@balena/lint": "^9.0.1",
139
- "@types/chai": "^5.0.0",
139
+ "@types/chai": "^4.3.20",
140
140
  "@types/mocha": "^10.0.8",
141
141
  "@types/mockery": "^1.4.33",
142
142
  "@types/sinon": "^17.0.3",
@@ -168,6 +168,6 @@
168
168
  "loader": "ts-node/esm/transpile-only"
169
169
  },
170
170
  "versionist": {
171
- "publishedAt": "2024-10-10T07:52:36.534Z"
171
+ "publishedAt": "2024-10-10T14:05:22.493Z"
172
172
  }
173
173
  }