@platforma-sdk/workflow-tengo 4.7.3 → 4.7.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/dist/tengo/lib/pframes.lib.tengo +16 -0
- package/dist/tengo/lib/pframes.xsv-builder.lib.tengo +88 -2
- package/dist/tengo/lib/pframes.xsv-import-file.lib.tengo +54 -6
- package/dist/tengo/lib/pframes.xsv.lib.tengo +24 -1
- 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/exec.R.create-renv.plj.gz +0 -0
- package/dist/tengo/tpl/exec.exec.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-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.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/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 +1 -1
|
@@ -174,6 +174,12 @@ __primitiveValueTypes := { "Int": true, "Long": true, "Float": true, "Double": t
|
|
|
174
174
|
|
|
175
175
|
|
|
176
176
|
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
177
183
|
|
|
178
184
|
|
|
179
185
|
|
|
@@ -236,6 +242,16 @@ processColumn := func(input, bodyTpl, outputs, ...opts) {
|
|
|
236
242
|
passKey: opts.passKey
|
|
237
243
|
}
|
|
238
244
|
|
|
245
|
+
if !is_undefined(opts.cpu) {
|
|
246
|
+
processTemplateParams.cpu = opts.cpu
|
|
247
|
+
}
|
|
248
|
+
if !is_undefined(opts.mem) {
|
|
249
|
+
processTemplateParams.mem = opts.mem
|
|
250
|
+
}
|
|
251
|
+
if !is_undefined(opts.queue) {
|
|
252
|
+
processTemplateParams.queue = opts.queue
|
|
253
|
+
}
|
|
254
|
+
|
|
239
255
|
|
|
240
256
|
|
|
241
257
|
isPotentiallyPartitioned := __primitiveValueTypes[input.spec.valueType]
|
|
@@ -5,6 +5,7 @@ pSpec := import("@platforma-sdk/workflow-tengo:pframes.spec")
|
|
|
5
5
|
pBuilder := import("@platforma-sdk/workflow-tengo:pframes.builder")
|
|
6
6
|
xsv := import("@platforma-sdk/workflow-tengo:pframes.xsv")
|
|
7
7
|
canonical := import("@platforma-sdk/workflow-tengo:canonical")
|
|
8
|
+
execConstants := import("@platforma-sdk/workflow-tengo:exec.constants")
|
|
8
9
|
|
|
9
10
|
xsvFileBuilder := func(xsvType) {
|
|
10
11
|
ll.assert(xsvType == "csv" || xsvType == "tsv", "xsvType must be 'csv' or 'tsv'")
|
|
@@ -19,6 +20,10 @@ xsvFileBuilder := func(xsvType) {
|
|
|
19
20
|
nextSequentialId := 1
|
|
20
21
|
nextPFrameKeyIndex := 1
|
|
21
22
|
|
|
23
|
+
cpu := undefined
|
|
24
|
+
mem := undefined
|
|
25
|
+
queue := undefined
|
|
26
|
+
|
|
22
27
|
getSpecDistiller := func() {
|
|
23
28
|
if is_undefined(distiller) {
|
|
24
29
|
columnsToDistill := []
|
|
@@ -322,6 +327,64 @@ xsvFileBuilder := func(xsvType) {
|
|
|
322
327
|
|
|
323
328
|
|
|
324
329
|
|
|
330
|
+
inHeavyQueue: func() {
|
|
331
|
+
queue = execConstants.HEAVY_QUEUE
|
|
332
|
+
return self
|
|
333
|
+
},
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
inMediumQueue: func() {
|
|
339
|
+
queue = execConstants.MEDIUM_QUEUE
|
|
340
|
+
return self
|
|
341
|
+
},
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
inLightQueue: func() {
|
|
347
|
+
queue = execConstants.LIGHT_QUEUE
|
|
348
|
+
return self
|
|
349
|
+
},
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
inUiQueue: func() {
|
|
355
|
+
queue = execConstants.UI_TASKS_QUEUE
|
|
356
|
+
return self
|
|
357
|
+
},
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
cpu: func(amount) {
|
|
365
|
+
cpu = amount
|
|
366
|
+
return self
|
|
367
|
+
},
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
mem: func(amount) {
|
|
381
|
+
mem = amount
|
|
382
|
+
return self
|
|
383
|
+
},
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
325
388
|
|
|
326
389
|
|
|
327
390
|
|
|
@@ -548,7 +611,19 @@ xsvFileBuilder := func(xsvType) {
|
|
|
548
611
|
}
|
|
549
612
|
|
|
550
613
|
pFrame := _constructPFrameAndDistillSpecs().pFrame
|
|
551
|
-
|
|
614
|
+
|
|
615
|
+
ops := {}
|
|
616
|
+
if !is_undefined(cpu) {
|
|
617
|
+
ops.cpu = cpu
|
|
618
|
+
}
|
|
619
|
+
if !is_undefined(mem) {
|
|
620
|
+
ops.mem = mem
|
|
621
|
+
}
|
|
622
|
+
if !is_undefined(queue) {
|
|
623
|
+
ops.queue = queue
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
return xsv.exportFrame(pFrame, xsvType, currentExportParams, ops)
|
|
552
627
|
},
|
|
553
628
|
|
|
554
629
|
|
|
@@ -586,7 +661,18 @@ xsvFileBuilder := func(xsvType) {
|
|
|
586
661
|
pFrame := buildOutput.pFrame
|
|
587
662
|
uniqueAxes := buildOutput.uniqueAxes
|
|
588
663
|
|
|
589
|
-
|
|
664
|
+
ops := {}
|
|
665
|
+
if !is_undefined(cpu) {
|
|
666
|
+
ops.cpu = cpu
|
|
667
|
+
}
|
|
668
|
+
if !is_undefined(mem) {
|
|
669
|
+
ops.mem = mem
|
|
670
|
+
}
|
|
671
|
+
if !is_undefined(queue) {
|
|
672
|
+
ops.queue = queue
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
tableResource := xsv.exportFrame(pFrame, xsvType, finalExportParams, ops)
|
|
590
676
|
|
|
591
677
|
schema := []
|
|
592
678
|
|
|
@@ -6,6 +6,7 @@ objects := import("@platforma-sdk/workflow-tengo:objects")
|
|
|
6
6
|
util := import("@platforma-sdk/workflow-tengo:pframes.util")
|
|
7
7
|
json := import("json")
|
|
8
8
|
constants := import("@platforma-sdk/workflow-tengo:pframes.constants")
|
|
9
|
+
execConstants := import("@platforma-sdk/workflow-tengo:exec.constants")
|
|
9
10
|
|
|
10
11
|
transposeXsvSw := assets.importSoftware("@platforma-open/milaboratories.software-small-binaries:table-converter")
|
|
11
12
|
pfconvSw := assets.importSoftware("@milaboratories/software-pframes-conv:main")
|
|
@@ -52,6 +53,34 @@ getColumnSpec := func(axesSpec, col) {
|
|
|
52
53
|
|
|
53
54
|
|
|
54
55
|
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
55
84
|
importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
56
85
|
ll.assert(xsvType == "csv" || xsvType == "tsv", "expected one of [tsv, csv] types, found: " + xsvType)
|
|
57
86
|
|
|
@@ -67,7 +96,7 @@ importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
|
67
96
|
|
|
68
97
|
xsvFileName := "file." + xsvType
|
|
69
98
|
|
|
70
|
-
ops := renderOps({ dataOnly: false, splitDataAndSpec: false }, ops...)
|
|
99
|
+
ops := renderOps({ dataOnly: false, splitDataAndSpec: false, queue: execConstants.LIGHT_QUEUE }, ops...)
|
|
71
100
|
|
|
72
101
|
if ops.transpose != undefined {
|
|
73
102
|
|
|
@@ -78,8 +107,17 @@ importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
|
78
107
|
|
|
79
108
|
transposeXsv := exec.builder().
|
|
80
109
|
software(transposeXsvSw).
|
|
81
|
-
printErrStreamToStdout()
|
|
82
|
-
|
|
110
|
+
printErrStreamToStdout()
|
|
111
|
+
|
|
112
|
+
if ops.queue != undefined {
|
|
113
|
+
transposeXsv.setQueue(ops.queue)
|
|
114
|
+
}
|
|
115
|
+
if ops.cpu != undefined {
|
|
116
|
+
transposeXsv.cpu(ops.cpu)
|
|
117
|
+
}
|
|
118
|
+
if ops.mem != undefined {
|
|
119
|
+
transposeXsv.mem(ops.mem)
|
|
120
|
+
}
|
|
83
121
|
|
|
84
122
|
if (tops.separator != undefined) {
|
|
85
123
|
transposeXsv = transposeXsv.arg("-input-separator").arg(tops.separator)
|
|
@@ -126,15 +164,25 @@ importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
|
126
164
|
pfconv := exec.builder().
|
|
127
165
|
software(pfconvSw).
|
|
128
166
|
printErrStreamToStdout().
|
|
129
|
-
inLightQueue().
|
|
130
167
|
arg("importCsv").
|
|
131
168
|
arg(xsvFileName).
|
|
132
169
|
arg("-p").arg("spec.json").
|
|
133
170
|
arg("-o").arg("out").
|
|
134
171
|
addFile(xsvFileName, xsvFile).
|
|
135
172
|
writeFile("spec.json", json.encode(pureSpec)).
|
|
136
|
-
processWorkdir("pf", importDirTpl, pureSpec)
|
|
137
|
-
|
|
173
|
+
processWorkdir("pf", importDirTpl, pureSpec)
|
|
174
|
+
|
|
175
|
+
if ops.queue != undefined {
|
|
176
|
+
pfconv.setQueue(ops.queue)
|
|
177
|
+
}
|
|
178
|
+
if ops.cpu != undefined {
|
|
179
|
+
pfconv.cpu(ops.cpu)
|
|
180
|
+
}
|
|
181
|
+
if ops.mem != undefined {
|
|
182
|
+
pfconv.mem(ops.mem)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
pfconv = pfconv.run()
|
|
138
186
|
|
|
139
187
|
|
|
140
188
|
pf := pfconv.getProcessorResult("pf")
|
|
@@ -80,6 +80,9 @@ getColumnSpec := func(axesSpec, col) {
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
83
86
|
|
|
84
87
|
|
|
85
88
|
|
|
@@ -133,6 +136,9 @@ importFile := func(xsvFile, xsvType, spec, ...ops) {
|
|
|
133
136
|
|
|
134
137
|
|
|
135
138
|
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
136
142
|
|
|
137
143
|
|
|
138
144
|
|
|
@@ -153,11 +159,25 @@ importFileMap := func(xsvMap, xsvType, spec, ...ops) {
|
|
|
153
159
|
pureSpec := decomposedSpec.purifiedCfg
|
|
154
160
|
columnsSpec := decomposedSpec.columnsSpec
|
|
155
161
|
|
|
162
|
+
templateOps := {
|
|
163
|
+
dataOnly: true,
|
|
164
|
+
transpose: ops.transpose
|
|
165
|
+
}
|
|
166
|
+
if !is_undefined(ops.cpu) {
|
|
167
|
+
templateOps.cpu = ops.cpu
|
|
168
|
+
}
|
|
169
|
+
if !is_undefined(ops.mem) {
|
|
170
|
+
templateOps.mem = ops.mem
|
|
171
|
+
}
|
|
172
|
+
if !is_undefined(ops.queue) {
|
|
173
|
+
templateOps.queue = ops.queue
|
|
174
|
+
}
|
|
175
|
+
|
|
156
176
|
r := render.createEphemeral(importXsvMapTpl, {
|
|
157
177
|
xsvMap: xsvMap,
|
|
158
178
|
xsvType: xsvType,
|
|
159
179
|
spec: pureSpec,
|
|
160
|
-
ops:
|
|
180
|
+
ops: templateOps
|
|
161
181
|
})
|
|
162
182
|
|
|
163
183
|
if ops.dataOnly && ops.splitDataAndSpec {
|
|
@@ -257,6 +277,9 @@ isStructuredPfMap := func(pf) {
|
|
|
257
277
|
|
|
258
278
|
|
|
259
279
|
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
260
283
|
|
|
261
284
|
|
|
262
285
|
|
|
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
|