@platforma-sdk/workflow-tengo 5.25.0 → 6.0.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/exec.lib.tengo +49 -0
  2. package/dist/tengo/lib/workdir.lib.tengo +40 -12
  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 +4 -4
@@ -65,6 +65,10 @@ builder := func() {
65
65
 
66
66
  filesToWrite := {}
67
67
 
68
+
69
+
70
+ writableFiles := {}
71
+
68
72
  dirsToCreate := {}
69
73
 
70
74
 
@@ -769,12 +773,22 @@ builder := func() {
769
773
 
770
774
 
771
775
 
776
+
777
+
778
+
779
+
780
+
781
+
782
+
772
783
  addFile: func(fileName, file, ...opts) {
773
784
  ll.assert(is_string(fileName), "exec.builder().addFile: fileName must be a string")
774
785
  ll.assert(smart.isReference(file), "exec.builder().addFile: file must be a reference")
775
786
 
776
787
  fileName = path.canonize(fileName)
777
788
  filesToAdd[fileName] = file
789
+ if len(opts) > 0 && ll.isMap(opts[0]) && opts[0].writable == true {
790
+ sets.add(writableFiles, fileName)
791
+ }
778
792
  monetization.addOptionalArg(mnz, fileName, opts...)
779
793
  return self
780
794
  },
@@ -784,6 +798,7 @@ builder := func() {
784
798
 
785
799
 
786
800
 
801
+
787
802
  addFiles: func(filesMap, ...opts) {
788
803
  ll.assert(ll.isMap(filesMap), "exec.builder().addFiles: filesMap must be map of file names to file resources")
789
804
  maps.forEach(filesMap, func(fileName, file) {
@@ -804,6 +819,13 @@ builder := func() {
804
819
 
805
820
 
806
821
 
822
+
823
+
824
+
825
+
826
+
827
+
828
+
807
829
 
808
830
 
809
831
 
@@ -823,6 +845,9 @@ builder := func() {
823
845
  fileName = path.canonize(fileName)
824
846
 
825
847
  filesToWrite[fileName] = data
848
+ if len(opts) > 0 && ll.isMap(opts[0]) && opts[0].writable == true {
849
+ sets.add(writableFiles, fileName)
850
+ }
826
851
  monetization.addOptionalArg(mnz, fileName, opts...)
827
852
 
828
853
  return self
@@ -833,6 +858,24 @@ builder := func() {
833
858
 
834
859
 
835
860
 
861
+
862
+
863
+
864
+
865
+
866
+ writeFiles: func(filesMap, ...opts) {
867
+ ll.assert(ll.isMap(filesMap), "exec.builder().writeFiles: filesMap must be map of file names to contents")
868
+ maps.forEach(filesMap, func(fileName, data) {
869
+ self.writeFile(fileName, data, opts...)
870
+ })
871
+ return self
872
+ },
873
+
874
+
875
+
876
+
877
+
878
+
836
879
  mkDir: func(dir) {
837
880
  dir = path.canonize(dir)
838
881
  dirsToCreate = sets.add(dirsToCreate, dir)
@@ -1051,6 +1094,12 @@ builder := func() {
1051
1094
  assetCache: assetCache
1052
1095
  }
1053
1096
 
1097
+
1098
+
1099
+ if len(writableFiles) > 0 {
1100
+ pureExecInputs.writableFiles = slices.fromSet(writableFiles)
1101
+ }
1102
+
1054
1103
  if (is_int(ramRequest)) {
1055
1104
  ramRequest = string(ramRequest) + "b"
1056
1105
  }
@@ -55,11 +55,11 @@ createV2 := func(allocationRef) {
55
55
 
56
56
 
57
57
 
58
- _getFileFillRule := func(filePath, extension) {
58
+ _getFileFillRule := func(filePath, extension, writable) {
59
59
  return {
60
60
  type: "file",
61
61
  path: filePath,
62
- permissions: 0o400,
62
+ permissions: writable ? 0o600 : 0o400,
63
63
  pathKey: filePath,
64
64
  blobKey: filePath,
65
65
  copyOptional: false,
@@ -93,11 +93,11 @@ _getArchiveFillRule := func(dstDir, whatToExtract, archiveBlobKey) {
93
93
 
94
94
 
95
95
 
96
- _getValueFillRule := func(filePath) {
96
+ _getValueFillRule := func(filePath, writable) {
97
97
  return {
98
98
  type: "value",
99
99
  path: filePath,
100
- permissions: 0o400,
100
+ permissions: writable ? 0o600 : 0o400,
101
101
  pathKey: filePath,
102
102
  valueKey: filePath
103
103
  }
@@ -133,6 +133,10 @@ _fill := func() {
133
133
  values := {}
134
134
  dirs := {}
135
135
 
136
+
137
+
138
+ writableFiles := {}
139
+
136
140
  queue := undefined
137
141
  cpu := undefined
138
142
  ram := undefined
@@ -248,13 +252,24 @@ _fill := func() {
248
252
 
249
253
 
250
254
 
251
- addFile: func(fileName, fileResource) {
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+ addFile: func(fileName, fileResource, ...opts) {
252
264
  validation.assertType(fileName, "string")
253
265
  validation.assertType(fileResource, validation.reference)
254
266
 
255
267
  files[fileName] = fileResource
256
268
  blobs[fileName] = fileResource
257
269
  self._addDirs(fileName)
270
+ if len(opts) > 0 && ll.isMap(opts[0]) && opts[0].writable == true {
271
+ sets.add(writableFiles, fileName)
272
+ }
258
273
 
259
274
  return self
260
275
  },
@@ -264,8 +279,11 @@ _fill := func() {
264
279
 
265
280
 
266
281
 
267
- addFiles: func(fileMap) {
268
- maps.forEach(fileMap, self.addFile)
282
+
283
+ addFiles: func(fileMap, ...opts) {
284
+ maps.forEach(fileMap, func(fileName, fileResource) {
285
+ self.addFile(fileName, fileResource, opts...)
286
+ })
269
287
  return self
270
288
  },
271
289
 
@@ -275,10 +293,17 @@ _fill := func() {
275
293
 
276
294
 
277
295
 
278
- writeFile: func(fileName, contentRef) {
296
+
297
+
298
+
299
+
300
+ writeFile: func(fileName, contentRef, ...opts) {
279
301
  validation.assertType(fileName, "string")
280
302
  values[fileName] = contentRef
281
303
  self._addDirs(fileName)
304
+ if len(opts) > 0 && ll.isMap(opts[0]) && opts[0].writable == true {
305
+ sets.add(writableFiles, fileName)
306
+ }
282
307
 
283
308
  return self
284
309
  },
@@ -288,8 +313,11 @@ _fill := func() {
288
313
 
289
314
 
290
315
 
291
- writeFiles: func(contentRefMap) {
292
- maps.forEach(contentRefMap, self.writeFile)
316
+
317
+ writeFiles: func(contentRefMap, ...opts) {
318
+ maps.forEach(contentRefMap, func(fileName, contentRef) {
319
+ self.writeFile(fileName, contentRef, opts...)
320
+ })
293
321
  return self
294
322
  },
295
323
 
@@ -360,10 +388,10 @@ _fill := func() {
360
388
  rules = append(rules, _getDirFillRule(dir))
361
389
  }
362
390
  for fileName, _ in files {
363
- rules = append(rules, _getFileFillRule(fileName, path.getExtension(fileName)))
391
+ rules = append(rules, _getFileFillRule(fileName, path.getExtension(fileName), sets.hasElement(writableFiles, fileName)))
364
392
  }
365
393
  for fileName, _ in values {
366
- rules = append(rules, _getValueFillRule(fileName))
394
+ rules = append(rules, _getValueFillRule(fileName, sets.hasElement(writableFiles, fileName)))
367
395
  }
368
396
 
369
397
  for blobKey, directories in zipExtractions {
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.25.0",
3
+ "version": "6.0.0",
4
4
  "description": "Tengo SDK library",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -16,14 +16,14 @@
16
16
  "./dist/**/*"
17
17
  ],
18
18
  "dependencies": {
19
- "@milaboratories/pframes-rs-wasip2": "1.1.35",
19
+ "@milaboratories/pframes-rs-wasip2": "1.1.37",
20
20
  "@milaboratories/software-pframes-conv": "2.2.9",
21
21
  "@platforma-open/milaboratories.software-small-binaries": "^2.0.3",
22
- "@platforma-open/milaboratories.software-ptabler": "1.16.1",
22
+ "@platforma-open/milaboratories.software-ptabler": "2.0.0",
23
23
  "@platforma-open/milaboratories.software-ptexter": "1.2.2"
24
24
  },
25
25
  "devDependencies": {
26
- "@platforma-sdk/tengo-builder": "3.0.0"
26
+ "@platforma-sdk/tengo-builder": "3.0.5"
27
27
  },
28
28
  "scripts": {
29
29
  "type-check": "pl-tengo check",