@platforma-sdk/workflow-tengo 5.12.1 → 5.13.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.delayed-compute-allocation.lib.tengo +5 -1
  2. package/dist/tengo/lib/exec.lib.tengo +24 -5
  3. package/dist/tengo/lib/exec.limits.lib.tengo +18 -1
  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.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.parse-to-json.plj.gz +0 -0
  32. package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
  33. package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
  34. package/dist/tengo/tpl/pframes.slice-data.plj.gz +0 -0
  35. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  36. package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
  37. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  38. package/dist/tengo/tpl/pt.import-dir.plj.gz +0 -0
  39. package/dist/tengo/tpl/pt.workflow-run.plj.gz +0 -0
  40. package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
  41. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  42. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  43. package/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
  44. package/dist/tengo/tpl/workflow.query-context-filter.plj.gz +0 -0
  45. package/package.json +1 -1
@@ -21,7 +21,8 @@ create := func(workdir, req) {
21
21
  validation.assertType(req, {
22
22
  "queue": "string",
23
23
  "cpu,?": "number",
24
- "ram,?": ["or", "number", "string"]
24
+ "ram,?": ["or", "number", "string"],
25
+ "gpu,?": "number"
25
26
  }, "request must be a valid request")
26
27
 
27
28
  reqMap := { queue: req.queue }
@@ -31,6 +32,9 @@ create := func(workdir, req) {
31
32
  if !is_undefined(req.ram) {
32
33
  reqMap.ram = req.ram
33
34
  }
35
+ if !is_undefined(req.gpu) && req.gpu > 0 {
36
+ reqMap.gpu = req.gpu
37
+ }
34
38
 
35
39
  delayedComputeAllocation := render.createEphemeral(tpl, {
36
40
  request: smart.createJsonResource(reqMap),
@@ -51,6 +51,7 @@ builder := func() {
51
51
  queue := execConstants.HEAVY_QUEUE
52
52
  cpuRequest := undefined
53
53
  ramRequest := undefined
54
+ gpuCount := 0
54
55
 
55
56
  commandName := ""
56
57
  cache := 0
@@ -441,6 +442,20 @@ builder := func() {
441
442
 
442
443
 
443
444
 
445
+
446
+ gpu: func(count) {
447
+ validation.assertType(count, "number", "exec.builder.gpu: count must be a number")
448
+ ll.assert(count > 0, "exec.builder.gpu: count must be greater than 0")
449
+ gpuCount = count
450
+ return self
451
+ },
452
+
453
+
454
+
455
+
456
+
457
+
458
+
444
459
  cache: func(time) {
445
460
  ll.assert(
446
461
  is_int(time),
@@ -1019,12 +1034,16 @@ builder := func() {
1019
1034
  if (is_int(ramRequest)) {
1020
1035
  ramRequest = string(ramRequest) + "b"
1021
1036
  }
1037
+ quotaData := {
1038
+ queue: queue,
1039
+ cpu: cpuRequest,
1040
+ ram: ramRequest
1041
+ }
1042
+ if gpuCount > 0 {
1043
+ quotaData.gpu = gpuCount
1044
+ }
1022
1045
  metaExecInputs := {
1023
- quota: smart.createJsonResource({
1024
- queue: queue,
1025
- cpu: cpuRequest,
1026
- ram: ramRequest
1027
- })
1046
+ quota: smart.createJsonResource(quotaData)
1028
1047
  }
1029
1048
 
1030
1049
 
@@ -51,7 +51,7 @@ quotaBuilder := func() {
51
51
  queue_name := undefined
52
52
  cpu_request := undefined
53
53
  ram_request := undefined
54
-
54
+ gpu_request := undefined
55
55
 
56
56
  self = ll.toStrict({
57
57
 
@@ -104,6 +104,20 @@ quotaBuilder := func() {
104
104
 
105
105
 
106
106
 
107
+
108
+ gpu: func(amount) {
109
+ validation.assertType(amount, ["or", "number", "null"], "exec.quota.builder.gpu: GPU amount should be a number")
110
+ ll.assert(is_undefined(amount) || amount > 0, "exec.quota.builder.gpu: amount should be greater than 0")
111
+ gpu_request = amount
112
+
113
+ return self
114
+ },
115
+
116
+
117
+
118
+
119
+
120
+
107
121
  build: func() {
108
122
  ll.assert(queue_name != "", "exec.quota.builder: queue name is mandatory and could not be empty string")
109
123
 
@@ -116,6 +130,9 @@ quotaBuilder := func() {
116
130
  if !is_undefined(ram_request) {
117
131
  data.memory = ram_request
118
132
  }
133
+ if !is_undefined(gpu_request) && gpu_request > 0 {
134
+ data.gpu = gpu_request
135
+ }
119
136
 
120
137
  return smart.ephemeralBuilder(_RTYPE_QUOTA, json.encode(data)).lockAndBuild()
121
138
  }
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.12.1",
3
+ "version": "5.13.0",
4
4
  "description": "Tengo SDK library",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",