@platforma-sdk/workflow-tengo 6.10.5 → 6.11.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 (49) hide show
  1. package/dist/tengo/lib/exec.formula.lib.tengo +8 -0
  2. package/dist/tengo/lib/pt.lib.tengo +34 -0
  3. package/dist/tengo/lib/pt.sizing.lib.tengo +90 -0
  4. package/dist/tengo/tpl/annotations.compute.plj.gz +0 -0
  5. package/dist/tengo/tpl/anonymize.deanonymize.plj.gz +0 -0
  6. package/dist/tengo/tpl/anonymize.impl.plj.gz +0 -0
  7. package/dist/tengo/tpl/check_network.create_workdir_from_storage.plj.gz +0 -0
  8. package/dist/tengo/tpl/check_network.download_blob.plj.gz +0 -0
  9. package/dist/tengo/tpl/check_network.run_hello_world.plj.gz +0 -0
  10. package/dist/tengo/tpl/check_network.run_hello_world_py.plj.gz +0 -0
  11. package/dist/tengo/tpl/check_network.upload_blob.plj.gz +0 -0
  12. package/dist/tengo/tpl/check_network.upload_template.plj.gz +0 -0
  13. package/dist/tengo/tpl/check_network.workdir_type_name_extractor.plj.gz +0 -0
  14. package/dist/tengo/tpl/exec.conda.create-env.plj.gz +0 -0
  15. package/dist/tengo/tpl/exec.delayed-compute-allocation.impl.plj.gz +0 -0
  16. package/dist/tengo/tpl/exec.exec-impl.plj.gz +0 -0
  17. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  18. package/dist/tengo/tpl/exec.load-software.impl.plj.gz +0 -0
  19. package/dist/tengo/tpl/exec.monetization_info.plj.gz +0 -0
  20. package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
  21. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  22. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  23. package/dist/tengo/tpl/exec.python.venv-bin-path.plj.gz +0 -0
  24. package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
  25. package/dist/tengo/tpl/pframes.build-table.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.merge-resource-maps.plj.gz +0 -0
  33. package/dist/tengo/tpl/pframes.parse-to-json.plj.gz +0 -0
  34. package/dist/tengo/tpl/pframes.process-pcolumn-batch-split.plj.gz +0 -0
  35. package/dist/tengo/tpl/pframes.process-pcolumn-batch.plj.gz +0 -0
  36. package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
  37. package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
  38. package/dist/tengo/tpl/pframes.slice-data.plj.gz +0 -0
  39. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  40. package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
  41. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  42. package/dist/tengo/tpl/pt.import-dir.plj.gz +0 -0
  43. package/dist/tengo/tpl/pt.workflow-run.plj.gz +0 -0
  44. package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
  45. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  46. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  47. package/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
  48. package/dist/tengo/tpl/workflow.query-context-filter.plj.gz +0 -0
  49. package/package.json +3 -3
@@ -40,6 +40,8 @@
40
40
 
41
41
 
42
42
 
43
+
44
+
43
45
 
44
46
 
45
47
 
@@ -412,6 +414,12 @@ export {
412
414
 
413
415
 
414
416
 
417
+
418
+
419
+
420
+
421
+
422
+
415
423
  size: func(...args) { return _node(_metric("size", args), undefined) },
416
424
  lineCount: func(...args) { return _node(_metric("lineCount", args), undefined) },
417
425
 
@@ -1,4 +1,6 @@
1
1
  ll := import("@platforma-sdk/workflow-tengo:ll")
2
+ units := import("@platforma-sdk/workflow-tengo:units")
3
+ sizing := import("@platforma-sdk/workflow-tengo:pt.sizing")
2
4
  exp := import("@platforma-sdk/workflow-tengo:pt.expression")
3
5
  util := import("@platforma-sdk/workflow-tengo:pt.util")
4
6
  assets := import("@platforma-sdk/workflow-tengo:assets")
@@ -409,6 +411,7 @@ workflow := func() {
409
411
 
410
412
  cpu := undefined
411
413
  mem := undefined
414
+ memFloor := undefined
412
415
  inputCache := undefined
413
416
  queue := execConstants.MEDIUM_QUEUE
414
417
 
@@ -898,6 +901,36 @@ workflow := func() {
898
901
 
899
902
 
900
903
 
904
+
905
+
906
+
907
+
908
+
909
+
910
+
911
+
912
+
913
+
914
+
915
+ memFloor: func(amount) {
916
+ ll.assert(is_int(amount) && amount > 0,
917
+ "pt.workflow.memFloor: expected a positive number of bytes, got %v", amount)
918
+ ll.assert(amount <= sizing.RAM_CAP_GIB * units.GiB,
919
+ "pt.workflow.memFloor: floor of %v bytes exceeds the %d GiB ceiling of the auto-sized request. Use .mem() for a fixed request above the ceiling.",
920
+ amount, sizing.RAM_CAP_GIB)
921
+ memFloor = amount
922
+ return self
923
+ },
924
+
925
+
926
+
927
+
928
+
929
+
930
+
931
+
932
+
933
+
901
934
  cacheInputs: func(time) {
902
935
  ll.assert(
903
936
  is_int(time),
@@ -997,6 +1030,7 @@ workflow := func() {
997
1030
  queue: queue,
998
1031
  cpu: cpu,
999
1032
  mem: mem,
1033
+ memFloor: memFloor,
1000
1034
  inputCache: inputCache
1001
1035
  }
1002
1036
  ptResult := render.create(workflowRunTpl, runInputs, {
@@ -0,0 +1,90 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+ f := import("@platforma-sdk/workflow-tengo:exec.formula")
27
+ ll := import("@platforma-sdk/workflow-tengo:ll")
28
+ units := import("@platforma-sdk/workflow-tengo:units")
29
+
30
+ RAM_INTERCEPT_GIB := 2
31
+ RAM_SLOPE := 6
32
+ RAM_FLOOR_GIB := 2
33
+ RAM_CAP_GIB := 256
34
+ RAM_STATIC_FALLBACK := "4GiB"
35
+
36
+ CPU_MIN := 2
37
+ CPU_MAX := 8
38
+ CPU_GIB_PER_CORE := 16
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+ ramFormula := func(memFloor) {
48
+ floor := f.gib(RAM_FLOOR_GIB)
49
+ cap := f.gib(RAM_CAP_GIB)
50
+ fallback := RAM_STATIC_FALLBACK
51
+
52
+ if !is_undefined(memFloor) {
53
+
54
+
55
+
56
+ ll.assert(memFloor <= RAM_CAP_GIB * units.GiB,
57
+ "pt.sizing: memFloor (%v bytes) must not exceed the %d GiB ceiling", memFloor, RAM_CAP_GIB)
58
+ floor = f.const(memFloor)
59
+ fallback = memFloor
60
+ }
61
+
62
+ return f.size({ default: 0 }).times(RAM_SLOPE).plus(f.gib(RAM_INTERCEPT_GIB)).
63
+ between(floor, cap).
64
+ staticFallback(fallback)
65
+ }
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+ cpuFormula := func() {
74
+ return f.size({ default: 0 }).dividedByFloor(f.gib(CPU_GIB_PER_CORE)).plus(f.const(CPU_MIN)).
75
+ between(f.const(CPU_MIN), f.const(CPU_MAX)).
76
+ staticFallback(CPU_MIN)
77
+ }
78
+
79
+ export {
80
+ ramFormula: ramFormula,
81
+ cpuFormula: cpuFormula,
82
+
83
+
84
+ RAM_INTERCEPT_GIB: RAM_INTERCEPT_GIB,
85
+ RAM_SLOPE: RAM_SLOPE,
86
+ RAM_FLOOR_GIB: RAM_FLOOR_GIB,
87
+ RAM_CAP_GIB: RAM_CAP_GIB,
88
+ CPU_MIN: CPU_MIN,
89
+ CPU_MAX: CPU_MAX
90
+ }
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": "6.10.5",
3
+ "version": "6.11.0",
4
4
  "description": "Tengo SDK library",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -19,8 +19,8 @@
19
19
  "@milaboratories/pframes-rs-wasip2": "1.1.61",
20
20
  "@milaboratories/software-pframes-conv": "2.2.9",
21
21
  "@platforma-open/milaboratories.software-small-binaries": "^2.1.1",
22
- "@platforma-open/milaboratories.software-ptabler": "2.1.11",
23
- "@platforma-open/milaboratories.software-ptexter": "1.2.4"
22
+ "@platforma-open/milaboratories.software-ptabler": "2.1.12",
23
+ "@platforma-open/milaboratories.software-ptexter": "1.2.5"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@platforma-sdk/tengo-builder": "4.1.0"