@platforma-sdk/workflow-tengo 5.8.3 → 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.
- package/dist/tengo/lib/exec.constants.lib.tengo +3 -1
- package/dist/tengo/lib/exec.lib.tengo +50 -11
- package/dist/tengo/lib/exec.runcmd.lib.tengo +38 -2
- package/dist/tengo/lib/feats.lib.tengo +4 -1
- package/dist/tengo/tpl/annotations.compute.plj.gz +0 -0
- package/dist/tengo/tpl/anonymize.deanonymize.plj.gz +0 -0
- package/dist/tengo/tpl/anonymize.impl.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.create_workdir_from_storage.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.download_blob.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.run_hello_world.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.run_hello_world_py.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.upload_blob.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.upload_template.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.workdir_type_name_extractor.plj.gz +0 -0
- package/dist/tengo/tpl/exec.conda.create-env.plj.gz +0 -0
- package/dist/tengo/tpl/exec.delayed-compute-allocation.impl.plj.gz +0 -0
- package/dist/tengo/tpl/exec.exec-impl.plj.gz +0 -0
- package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
- package/dist/tengo/tpl/exec.load-software.impl.plj.gz +0 -0
- package/dist/tengo/tpl/exec.monetization_info.plj.gz +0 -0
- package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
- package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
- package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
- package/dist/tengo/tpl/exec.python.venv-bin-path.plj.gz +0 -0
- package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-parquet-pcolumn-chunk.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-pframe-for-ui.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.parse-to-json.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.slice-data.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
- package/dist/tengo/tpl/pt.import-dir.plj.gz +0 -0
- package/dist/tengo/tpl/pt.workflow-run.plj.gz +0 -0
- package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
- package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
- package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
- package/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
- 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
|
-
|
|
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,
|
|
@@ -154,10 +154,6 @@ builder := func() {
|
|
|
154
154
|
|
|
155
155
|
|
|
156
156
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
157
|
|
|
162
158
|
|
|
163
159
|
|
|
@@ -213,10 +209,6 @@ builder := func() {
|
|
|
213
209
|
|
|
214
210
|
|
|
215
211
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
212
|
|
|
221
213
|
|
|
222
214
|
|
|
@@ -259,9 +251,56 @@ builder := func() {
|
|
|
259
251
|
|
|
260
252
|
|
|
261
253
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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
|
|
265
304
|
return self
|
|
266
305
|
},
|
|
267
306
|
|
|
@@ -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
|
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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.
|
|
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-
|
|
22
|
-
"@platforma-open/milaboratories.software-
|
|
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.
|
|
25
|
+
"@platforma-sdk/tengo-builder": "2.4.24"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"type-check": "pl-tengo check",
|