@platforma-sdk/workflow-tengo 6.13.0 → 6.14.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 (48) hide show
  1. package/dist/tengo/lib/pt.lib.tengo +33 -7
  2. package/dist/tengo/lib/pt.sizing.lib.tengo +60 -18
  3. package/dist/tengo/tpl/annotations.compute.plj.gz +0 -0
  4. package/dist/tengo/tpl/anonymize.deanonymize.plj.gz +0 -0
  5. package/dist/tengo/tpl/anonymize.impl.plj.gz +0 -0
  6. package/dist/tengo/tpl/check_network.create_workdir_from_storage.plj.gz +0 -0
  7. package/dist/tengo/tpl/check_network.download_blob.plj.gz +0 -0
  8. package/dist/tengo/tpl/check_network.run_hello_world.plj.gz +0 -0
  9. package/dist/tengo/tpl/check_network.run_hello_world_py.plj.gz +0 -0
  10. package/dist/tengo/tpl/check_network.upload_blob.plj.gz +0 -0
  11. package/dist/tengo/tpl/check_network.upload_template.plj.gz +0 -0
  12. package/dist/tengo/tpl/check_network.workdir_type_name_extractor.plj.gz +0 -0
  13. package/dist/tengo/tpl/exec.conda.create-env.plj.gz +0 -0
  14. package/dist/tengo/tpl/exec.delayed-compute-allocation.impl.plj.gz +0 -0
  15. package/dist/tengo/tpl/exec.exec-impl.plj.gz +0 -0
  16. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  17. package/dist/tengo/tpl/exec.load-software.impl.plj.gz +0 -0
  18. package/dist/tengo/tpl/exec.monetization_info.plj.gz +0 -0
  19. package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
  20. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  21. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  22. package/dist/tengo/tpl/exec.python.venv-bin-path.plj.gz +0 -0
  23. package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
  24. package/dist/tengo/tpl/pframes.build-table.plj.gz +0 -0
  25. package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
  26. package/dist/tengo/tpl/pframes.export-parquet-pcolumn-chunk.plj.gz +0 -0
  27. package/dist/tengo/tpl/pframes.export-pframe-for-ui.plj.gz +0 -0
  28. package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
  29. package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
  30. package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
  31. package/dist/tengo/tpl/pframes.merge-resource-maps.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-batch-split.plj.gz +0 -0
  34. package/dist/tengo/tpl/pframes.process-pcolumn-batch.plj.gz +0 -0
  35. package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
  36. package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
  37. package/dist/tengo/tpl/pframes.slice-data.plj.gz +0 -0
  38. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  39. package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
  40. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  41. package/dist/tengo/tpl/pt.import-dir.plj.gz +0 -0
  42. package/dist/tengo/tpl/pt.workflow-run.plj.gz +0 -0
  43. package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
  44. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  45. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  46. package/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
  47. package/dist/tengo/tpl/workflow.query-context-filter.plj.gz +0 -0
  48. package/package.json +3 -3
@@ -412,6 +412,8 @@ workflow := func() {
412
412
  cpu := undefined
413
413
  mem := undefined
414
414
  memFloor := undefined
415
+ memSlope := undefined
416
+ memIntercept := undefined
415
417
  polarsMaxThreads := undefined
416
418
  scratchFreeSpace := undefined
417
419
  inputCache := undefined
@@ -909,6 +911,11 @@ workflow := func() {
909
911
 
910
912
 
911
913
 
914
+
915
+
916
+
917
+
918
+
912
919
  mem: func(amount) {
913
920
  mem = amount
914
921
  return self
@@ -927,6 +934,12 @@ workflow := func() {
927
934
 
928
935
 
929
936
 
937
+ memFloor: func(amount) {
938
+ sizing.assertRamFloor(amount)
939
+ memFloor = amount
940
+ return self
941
+ },
942
+
930
943
 
931
944
 
932
945
 
@@ -934,13 +947,24 @@ workflow := func() {
934
947
 
935
948
 
936
949
 
937
- memFloor: func(amount) {
938
- ll.assert(is_int(amount) && amount > 0,
939
- "pt.workflow.memFloor: expected a positive number of bytes, got %v", amount)
940
- ll.assert(amount <= sizing.RAM_CAP_GIB * units.GiB,
941
- "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.",
942
- amount, sizing.RAM_CAP_GIB)
943
- memFloor = amount
950
+
951
+
952
+ memSlope: func(slope) {
953
+ sizing.assertRamSlope(slope)
954
+ memSlope = slope
955
+ return self
956
+ },
957
+
958
+
959
+
960
+
961
+
962
+
963
+
964
+
965
+ memIntercept: func(amount) {
966
+ sizing.assertRamIntercept(amount)
967
+ memIntercept = amount
944
968
  return self
945
969
  },
946
970
 
@@ -1072,6 +1096,8 @@ workflow := func() {
1072
1096
  cpu: cpu,
1073
1097
  mem: mem,
1074
1098
  memFloor: memFloor,
1099
+ memSlope: memSlope,
1100
+ memIntercept: memIntercept,
1075
1101
  polarsMaxThreads: polarsMaxThreads,
1076
1102
  scratchFreeSpace: scratchFreeSpace,
1077
1103
  inputCache: inputCache
@@ -42,6 +42,13 @@
42
42
 
43
43
 
44
44
 
45
+
46
+
47
+
48
+
49
+
50
+
51
+
45
52
 
46
53
 
47
54
 
@@ -54,11 +61,11 @@ f := import("@platforma-sdk/workflow-tengo:exec.formula")
54
61
  ll := import("@platforma-sdk/workflow-tengo:ll")
55
62
  units := import("@platforma-sdk/workflow-tengo:units")
56
63
 
57
- RAM_INTERCEPT_GIB := 2
58
- RAM_SLOPE := 6
59
- RAM_FLOOR_GIB := 2
60
- RAM_CAP_GIB := 256
61
- RAM_STATIC_FALLBACK := "4GiB"
64
+ RAM_INTERCEPT_GIB := 4
65
+ RAM_INTERCEPT_MIN_GIB := 4
66
+ RAM_SLOPE := 10
67
+ RAM_SLOPE_MIN := 0
68
+ RAM_FLOOR_GIB := 4
62
69
 
63
70
  SCRATCH_PER_READ_FRAME := 16
64
71
  SCRATCH_SORT := 16
@@ -110,25 +117,56 @@ polarsMaxThreadsExpr := func(threads) {
110
117
 
111
118
 
112
119
 
120
+ assertRamSlope := func(slope) {
121
+ ll.assert(is_int(slope) && slope >= RAM_SLOPE_MIN,
122
+ "pt.sizing: memory slope must be an integer of at least %d, got %v", RAM_SLOPE_MIN, slope)
123
+ }
124
+
125
+
126
+
127
+
128
+
129
+
130
+ assertRamIntercept := func(intercept) {
131
+ ll.assert(is_int(intercept) && intercept >= RAM_INTERCEPT_MIN_GIB * units.GiB,
132
+ "pt.sizing: memory intercept must be an integer number of bytes of at least %d GiB, got %v", RAM_INTERCEPT_MIN_GIB, intercept)
133
+ }
113
134
 
114
135
 
115
- ramFormula := func(memFloor) {
116
- floor := f.gib(RAM_FLOOR_GIB)
117
- cap := f.gib(RAM_CAP_GIB)
118
- fallback := RAM_STATIC_FALLBACK
119
136
 
120
- if !is_undefined(memFloor) {
121
137
 
122
138
 
123
139
 
124
- ll.assert(memFloor <= RAM_CAP_GIB * units.GiB,
125
- "pt.sizing: memFloor (%v bytes) must not exceed the %d GiB ceiling", memFloor, RAM_CAP_GIB)
126
- floor = f.const(memFloor)
127
- fallback = memFloor
128
- }
140
+ assertRamFloor := func(floor) {
141
+ ll.assert(is_int(floor) && floor > 0,
142
+ "pt.sizing: memory floor must be a positive integer number of bytes, got %v", floor)
143
+ }
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+ ramFormula := func(opts) {
155
+ ll.assert(is_map(opts), "pt.sizing.ramFormula: expected an options map, got %v", opts)
156
+
157
+ floor := is_undefined(opts.floor) ? RAM_FLOOR_GIB * units.GiB : opts.floor
158
+ slope := is_undefined(opts.slope) ? RAM_SLOPE : opts.slope
159
+ intercept := is_undefined(opts.intercept) ? RAM_INTERCEPT_GIB * units.GiB : opts.intercept
160
+ assertRamFloor(floor)
161
+ assertRamSlope(slope)
162
+ assertRamIntercept(intercept)
163
+
164
+
165
+
166
+ fallback := intercept > floor ? intercept : floor
129
167
 
130
- return f.size({ default: 0 }).times(RAM_SLOPE).plus(f.gib(RAM_INTERCEPT_GIB)).
131
- between(floor, cap).
168
+ return f.size({ default: 0 }).times(slope).plus(f.const(intercept)).
169
+ atLeast(f.const(floor)).
132
170
  staticFallback(fallback)
133
171
  }
134
172
 
@@ -164,6 +202,9 @@ scratchFormula := func(readFrames, writeFrames) {
164
202
 
165
203
  export {
166
204
  ramFormula: ramFormula,
205
+ assertRamSlope: assertRamSlope,
206
+ assertRamIntercept: assertRamIntercept,
207
+ assertRamFloor: assertRamFloor,
167
208
  cpuFormula: cpuFormula,
168
209
  scratchFormula: scratchFormula,
169
210
  polarsMaxThreadsExpr: polarsMaxThreadsExpr,
@@ -175,9 +216,10 @@ export {
175
216
 
176
217
 
177
218
  RAM_INTERCEPT_GIB: RAM_INTERCEPT_GIB,
219
+ RAM_INTERCEPT_MIN_GIB: RAM_INTERCEPT_MIN_GIB,
178
220
  RAM_SLOPE: RAM_SLOPE,
221
+ RAM_SLOPE_MIN: RAM_SLOPE_MIN,
179
222
  RAM_FLOOR_GIB: RAM_FLOOR_GIB,
180
- RAM_CAP_GIB: RAM_CAP_GIB,
181
223
  CPU_MIN: CPU_MIN,
182
224
  CPU_MAX: CPU_MAX,
183
225
  SCRATCH_PER_READ_FRAME: SCRATCH_PER_READ_FRAME,
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.13.0",
3
+ "version": "6.14.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-ptexter": "1.2.6",
23
- "@platforma-open/milaboratories.software-ptabler": "2.1.14"
22
+ "@platforma-open/milaboratories.software-ptabler": "2.1.14",
23
+ "@platforma-open/milaboratories.software-ptexter": "1.2.6"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@platforma-sdk/tengo-builder": "4.1.9"