@platforma-sdk/workflow-tengo 5.8.2 → 5.9.0

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.
Files changed (45) hide show
  1. package/dist/tengo/lib/exec.constants.lib.tengo +3 -1
  2. package/dist/tengo/lib/exec.lib.tengo +52 -12
  3. package/dist/tengo/lib/exec.runcmd.lib.tengo +38 -2
  4. package/dist/tengo/lib/feats.lib.tengo +4 -1
  5. package/dist/tengo/tpl/annotations.compute.plj.gz +0 -0
  6. package/dist/tengo/tpl/anonymize.deanonymize.plj.gz +0 -0
  7. package/dist/tengo/tpl/anonymize.impl.plj.gz +0 -0
  8. package/dist/tengo/tpl/check_network.create_workdir_from_storage.plj.gz +0 -0
  9. package/dist/tengo/tpl/check_network.download_blob.plj.gz +0 -0
  10. package/dist/tengo/tpl/check_network.run_hello_world.plj.gz +0 -0
  11. package/dist/tengo/tpl/check_network.run_hello_world_py.plj.gz +0 -0
  12. package/dist/tengo/tpl/check_network.upload_blob.plj.gz +0 -0
  13. package/dist/tengo/tpl/check_network.upload_template.plj.gz +0 -0
  14. package/dist/tengo/tpl/check_network.workdir_type_name_extractor.plj.gz +0 -0
  15. package/dist/tengo/tpl/exec.conda.create-env.plj.gz +0 -0
  16. package/dist/tengo/tpl/exec.delayed-compute-allocation.impl.plj.gz +0 -0
  17. package/dist/tengo/tpl/exec.exec-impl.plj.gz +0 -0
  18. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  19. package/dist/tengo/tpl/exec.load-software.impl.plj.gz +0 -0
  20. package/dist/tengo/tpl/exec.monetization_info.plj.gz +0 -0
  21. package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
  22. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  23. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  24. package/dist/tengo/tpl/exec.python.venv-bin-path.plj.gz +0 -0
  25. package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
  26. package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
  27. package/dist/tengo/tpl/pframes.export-parquet-pcolumn-chunk.plj.gz +0 -0
  28. package/dist/tengo/tpl/pframes.export-pframe-for-ui.plj.gz +0 -0
  29. package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
  30. package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
  31. package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
  32. package/dist/tengo/tpl/pframes.parse-to-json.plj.gz +0 -0
  33. package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
  34. package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
  35. package/dist/tengo/tpl/pframes.slice-data.plj.gz +0 -0
  36. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  37. package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
  38. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  39. package/dist/tengo/tpl/pt.import-dir.plj.gz +0 -0
  40. package/dist/tengo/tpl/pt.workflow-run.plj.gz +0 -0
  41. package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
  42. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  43. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  44. package/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
  45. package/package.json +4 -4
@@ -3,7 +3,8 @@ ll := import("@platforma-sdk/workflow-tengo:ll")
3
3
  ARG_TYPE_STRING := "string"
4
4
  ARG_TYPE_EXPRESSION := "expressionRef"
5
5
  ARG_TYPE_VAR := "variableRef" // TODO: deprecated, remove after 15 Mar 2025
6
- ARG_TYPES := [ARG_TYPE_STRING, ARG_TYPE_EXPRESSION, ARG_TYPE_VAR]
6
+ ARG_TYPE_SECRET := "secret"
7
+ ARG_TYPES := [ARG_TYPE_STRING, ARG_TYPE_EXPRESSION, ARG_TYPE_VAR, ARG_TYPE_SECRET]
7
8
 
8
9
  BATCH_QUEUE := "batch" // special queue in storage controller with no limits
9
10
  HEAVY_QUEUE := "heavy"
@@ -19,6 +20,7 @@ export ll.toStrict({
19
20
  ARG_TYPE_STRING: ARG_TYPE_STRING,
20
21
  ARG_TYPE_EXPRESSION: ARG_TYPE_EXPRESSION,
21
22
  ARG_TYPE_VAR: ARG_TYPE_VAR,
23
+ ARG_TYPE_SECRET: ARG_TYPE_SECRET,
22
24
  ARG_TYPES: ARG_TYPES,
23
25
 
24
26
  BATCH_QUEUE: BATCH_QUEUE,
@@ -18,6 +18,7 @@ oop := import("@platforma-sdk/workflow-tengo:oop")
18
18
  constants := import("@platforma-sdk/workflow-tengo:constants")
19
19
  monetization := import("@platforma-sdk/workflow-tengo:exec.monetization_internal")
20
20
  execConstants := import("@platforma-sdk/workflow-tengo:exec.constants")
21
+ units := import("@platforma-sdk/workflow-tengo:units")
21
22
 
22
23
 
23
24
 
@@ -153,10 +154,6 @@ builder := func() {
153
154
 
154
155
 
155
156
 
156
-
157
-
158
-
159
-
160
157
 
161
158
 
162
159
 
@@ -212,10 +209,6 @@ builder := func() {
212
209
 
213
210
 
214
211
 
215
-
216
-
217
-
218
-
219
212
 
220
213
 
221
214
 
@@ -258,9 +251,56 @@ builder := func() {
258
251
 
259
252
 
260
253
 
261
- secret: func(secretName, envName) {
262
- validation.assertType([secretName, envName], ["string"])
263
- secrets[envName] = "{secrets."+secretName+"}"
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+ secret: func(secretName, ...opts) {
293
+ validation.assertType(secretName, "string")
294
+ validation.assert(secretName != "", "exec.secret(): secret name cannot be empty")
295
+
296
+ envName := secretName
297
+ if len(opts) > 0 {
298
+ envName = opts[0]
299
+ validation.assertType(envName, "string")
300
+ validation.assert(envName != "", "exec.secret(): environment name for secret cannot be empty")
301
+ }
302
+
303
+ secrets[envName] = secretName
264
304
  return self
265
305
  },
266
306
 
@@ -377,7 +417,7 @@ builder := func() {
377
417
 
378
418
  mem: func(amount) {
379
419
  validation.assertType(amount, ["or", "number", "string"], "exec.builder.mem: RAM amount should be a number or string")
380
- ll.assert(is_string(amount) || amount > 0, "exec.builder.mem: amount in bytes should be greater than 0")
420
+ ll.assert(is_string(amount) || amount >= 16 * units.MiB, "exec.builder.mem: amount in bytes should be at least 16MiB")
381
421
  ramRequest = amount
382
422
 
383
423
  return self
@@ -26,7 +26,7 @@ _RTYPE_RUN_COMMAND_REFS := { Name: "RunCommandRefs", Version: "1" }
26
26
 
27
27
  ARG_SCHEMA := {
28
28
  "__options__,closed": true,
29
- "type": "string,regex=string|expressionRef|variableRef",
29
+ "type": "string,regex=string|expressionRef|variableRef|secret",
30
30
  "value": "string"
31
31
  }
32
32
 
@@ -119,7 +119,6 @@ variableArg := func(argTpl) {
119
119
 
120
120
 
121
121
 
122
-
123
122
  expressionArg := func(argTpl) {
124
123
  return {
125
124
  type: constants.ARG_TYPE_EXPRESSION,
@@ -127,6 +126,17 @@ expressionArg := func(argTpl) {
127
126
  }
128
127
  }
129
128
 
129
+
130
+
131
+
132
+
133
+ secretArg := func(secretName) {
134
+ return {
135
+ type: constants.ARG_TYPE_SECRET,
136
+ value: secretName
137
+ }
138
+ }
139
+
130
140
  _createAbstractRunCommandPlan := func(state, returnSelfFn) {
131
141
  self := undefined
132
142
 
@@ -176,6 +186,8 @@ _createAbstractRunCommandPlan := func(state, returnSelfFn) {
176
186
  cmdTyped: func(type, value) {
177
187
  ll.assert(slices.hasElement(constants.ARG_TYPES, type),
178
188
  "runcmd.plan.cmdTyped: unknown type %s, expect: %v", type, constants.ARG_TYPES)
189
+ ll.assert(type != constants.ARG_TYPE_SECRET,
190
+ "runcmd.plan.cmdTyped: 'secret' type is only valid for environment variables")
179
191
 
180
192
  if type == constants.ARG_TYPE_STRING {
181
193
  return self.cmd(value)
@@ -231,6 +243,8 @@ _createAbstractRunCommandPlan := func(state, returnSelfFn) {
231
243
  argTyped: func(type, value) {
232
244
  ll.assert(slices.hasElement(constants.ARG_TYPES, type),
233
245
  "runcmd.plan.argTyped: unknown type %s, expect: %v", type, constants.ARG_TYPES)
246
+ ll.assert(type != constants.ARG_TYPE_SECRET,
247
+ "runcmd.plan.argTyped: 'secret' type is only valid for environment variables")
234
248
 
235
249
  if type == constants.ARG_TYPE_STRING {
236
250
  return self.arg(value)
@@ -327,6 +341,17 @@ _createAbstractRunCommandPlan := func(state, returnSelfFn) {
327
341
  return returnSelfFn()
328
342
  },
329
343
 
344
+
345
+
346
+
347
+
348
+
349
+
350
+ envSecret: func(name, secretName) {
351
+ state.options.envs[name] = secretArg(secretName)
352
+ return returnSelfFn()
353
+ },
354
+
330
355
  envTyped: func(name, type, value) {
331
356
  ll.assert(slices.hasElement(constants.ARG_TYPES, type),
332
357
  "runcmd.plan.envTyped: unknown type %s, expect: %v", type, constants.ARG_TYPES)
@@ -337,6 +362,8 @@ _createAbstractRunCommandPlan := func(state, returnSelfFn) {
337
362
  return self.envExpression(name, value)
338
363
  } else if type == constants.ARG_TYPE_VAR {
339
364
  return self.envVar(name, value)
365
+ } else if type == constants.ARG_TYPE_SECRET {
366
+ return self.envSecret(name, value)
340
367
  }
341
368
 
342
369
  ll.panic("runcmd.plan.envTyped: unknown type %s, expect: %v", type, constants.ARG_TYPES)
@@ -381,6 +408,8 @@ _createAbstractRunCommandPlan := func(state, returnSelfFn) {
381
408
  addPathTyped: func(type, value) {
382
409
  ll.assert(slices.hasElement(constants.ARG_TYPES, type),
383
410
  "runcmd.plan.addPathTyped: unknown type %s, expect: %v", type, constants.ARG_TYPES)
411
+ ll.assert(type != constants.ARG_TYPE_SECRET,
412
+ "runcmd.plan.addPathTyped: 'secret' type is only valid for environment variables")
384
413
 
385
414
  if type == constants.ARG_TYPE_STRING {
386
415
  return self.addPath(value)
@@ -629,6 +658,7 @@ builder := func(workdir, ...initialState) {
629
658
 
630
659
  hasPatternArgs := false
631
660
  hasExpressionArgs := false
661
+ hasSecretArgs := false
632
662
 
633
663
  check := func(arg) {
634
664
  if !ll.isMap(arg) {
@@ -640,6 +670,9 @@ builder := func(workdir, ...initialState) {
640
670
  if arg.type == constants.ARG_TYPE_EXPRESSION {
641
671
  hasExpressionArgs = true
642
672
  }
673
+ if arg.type == constants.ARG_TYPE_SECRET {
674
+ hasSecretArgs = true
675
+ }
643
676
  }
644
677
 
645
678
  check(options.cmd)
@@ -680,6 +713,8 @@ builder := func(workdir, ...initialState) {
680
713
  ll.assert(!hasExpressionArgs || feats.commandExpressions,
681
714
  "runcmd.builder().build: expression arguments must be enabled only if platforma backend supports expressions, found: %v",
682
715
  hasExpressionArgs)
716
+ ll.assert(!hasSecretArgs || feats.secretEnvSupport,
717
+ "runcmd.builder().build: secret arguments must be enabled only if platforma backend supports secret env type")
683
718
 
684
719
  if !is_undefined(allocation) {
685
720
  runRes.getField(_FIELD_ALLOCATION).set(allocation)
@@ -751,5 +786,6 @@ export ll.toStrict({
751
786
  simpleArg: simpleArg,
752
787
  variableArg: variableArg,
753
788
  expressionArg: expressionArg,
789
+ secretArg: secretArg,
754
790
  createRunCommandPlan: createRunCommandPlan
755
791
  })
@@ -65,5 +65,8 @@ export ll.toStrict({
65
65
  hasBlobSize: ll.methodExists(plapi, "getBlobSize"),
66
66
 
67
67
 
68
- isDockerAvailable: _isEnabled("dockerSupport")
68
+ isDockerAvailable: _isEnabled("dockerSupport"),
69
+
70
+
71
+ secretEnvSupport: _isEnabled("secretEnvSupport")
69
72
  })
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/workflow-tengo",
3
- "version": "5.8.2",
3
+ "version": "5.9.0",
4
4
  "description": "Tengo SDK library",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -18,11 +18,11 @@
18
18
  "dependencies": {
19
19
  "@milaboratories/software-pframes-conv": "2.2.9",
20
20
  "@platforma-open/milaboratories.software-small-binaries": "^2.0.1",
21
- "@platforma-open/milaboratories.software-ptexter": "1.2.1",
22
- "@platforma-open/milaboratories.software-ptabler": "1.14.1"
21
+ "@platforma-open/milaboratories.software-ptabler": "1.14.1",
22
+ "@platforma-open/milaboratories.software-ptexter": "1.2.1"
23
23
  },
24
24
  "devDependencies": {
25
- "@platforma-sdk/tengo-builder": "2.4.16"
25
+ "@platforma-sdk/tengo-builder": "2.4.24"
26
26
  },
27
27
  "scripts": {
28
28
  "type-check": "pl-tengo check",