@milaboratories/pl-drivers 1.10.3 → 1.10.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pl-drivers",
3
- "version": "1.10.3",
3
+ "version": "1.10.4",
4
4
  "engines": {
5
5
  "node": ">=20"
6
6
  },
@@ -34,10 +34,10 @@
34
34
  "upath": "^2.0.1",
35
35
  "zod": "~3.23.8",
36
36
  "@milaboratories/ts-helpers": "1.4.5",
37
+ "@milaboratories/helpers": "1.6.22",
37
38
  "@milaboratories/pl-client": "2.11.11",
38
- "@milaboratories/pl-tree": "1.7.7",
39
39
  "@milaboratories/pl-model-common": "1.19.13",
40
- "@milaboratories/helpers": "1.6.22",
40
+ "@milaboratories/pl-tree": "1.7.7",
41
41
  "@milaboratories/computable": "2.6.5"
42
42
  },
43
43
  "devDependencies": {
@@ -48,10 +48,10 @@
48
48
  "eslint": "^9.25.1",
49
49
  "typescript": "~5.6.3",
50
50
  "vitest": "^2.1.9",
51
- "@milaboratories/ts-builder": "1.0.5",
51
+ "@milaboratories/eslint-config": "1.0.4",
52
52
  "@milaboratories/build-configs": "1.0.8",
53
- "@milaboratories/ts-configs": "1.0.6",
54
- "@milaboratories/eslint-config": "1.0.4"
53
+ "@milaboratories/ts-builder": "1.0.5",
54
+ "@milaboratories/ts-configs": "1.0.6"
55
55
  },
56
56
  "scripts": {
57
57
  "type-check": "ts-builder types --target node",
@@ -223,6 +223,20 @@ function createWd(tx: PlTransaction): FieldRef {
223
223
  return { resourceId: wd, fieldName: 'workdir' };
224
224
  }
225
225
 
226
+ function requestComputeAllocation(tx: PlTransaction, queue: string, cpu: number, memory: string): FieldRef {
227
+ const quotaID = tx.createEphemeral({ name: 'Quota', version: '1' }, JSON.stringify({
228
+ queue: queue,
229
+ cpuCores: cpu,
230
+ memory: memory,
231
+ }));
232
+
233
+ const reqID = tx.createEphemeral({ name: 'ComputeRequest/executor', version: '1' });
234
+
235
+ tx.setField({ resourceId: reqID, fieldName: 'request' }, quotaID);
236
+
237
+ return { resourceId: reqID, fieldName: 'allocation' };
238
+ }
239
+
226
240
  function createRunCommand(
227
241
  tx: PlTransaction,
228
242
  wdFId: FieldRef,
@@ -230,6 +244,7 @@ function createRunCommand(
230
244
  args: string[],
231
245
  ): FieldRef {
232
246
  const refsId = tx.createStruct({ name: 'RunCommandRefs', version: '1' });
247
+ const allocation = requestComputeAllocation(tx, 'heavy', 1, '1');
233
248
  tx.lock(refsId);
234
249
  const cmdData = {
235
250
  type: 'string',
@@ -242,14 +257,13 @@ function createRunCommand(
242
257
  };
243
258
  });
244
259
  const optsData = {
245
- queueName: 'heavy',
246
260
  errorLines: 200,
247
261
  redirectStdout: 'logs.txt',
248
262
  redirectStderr: 'logs.txt',
249
263
  envs: [],
250
264
  };
251
265
 
252
- const runCmdId = tx.createEphemeral({ name: 'RunCommand/executor', version: '1' });
266
+ const runCmdId = tx.createEphemeral({ name: 'RunCommand/executor', version: '2' });
253
267
 
254
268
  const setInputValue = (fName: string, rType: ResourceType, data: unknown) => {
255
269
  const valResId = tx.createValue(rType, jsonToData(data));
@@ -258,6 +272,7 @@ function createRunCommand(
258
272
 
259
273
  tx.setField({ resourceId: runCmdId, fieldName: 'workdirIn' }, wdFId);
260
274
  tx.setField({ resourceId: runCmdId, fieldName: 'refs' }, refsId);
275
+ tx.setField({ resourceId: runCmdId, fieldName: 'allocation' }, allocation);
261
276
  setInputValue('cmd', { name: 'RunCommandCmd', version: '1' }, cmdData);
262
277
  setInputValue('args', { name: 'RunCommandArgs', version: '1' }, argsData);
263
278
  setInputValue('options', { name: 'run-command/options', version: '1' }, optsData);