@platforma-sdk/workflow-tengo 2.8.1 → 2.8.3

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 (59) hide show
  1. package/dist/tengo/lib/assets.lib.tengo +76 -82
  2. package/dist/tengo/lib/constants.lib.tengo +28 -31
  3. package/dist/tengo/lib/exec.R.internal.lib.tengo +14 -14
  4. package/dist/tengo/lib/exec.R.lib.tengo +158 -167
  5. package/dist/tengo/lib/exec.internal.lib.tengo +222 -234
  6. package/dist/tengo/lib/exec.lib.tengo +647 -714
  7. package/dist/tengo/lib/exec.package.lib.tengo +229 -238
  8. package/dist/tengo/lib/exec.python.internal.lib.tengo +5 -6
  9. package/dist/tengo/lib/exec.python.lib.tengo +138 -146
  10. package/dist/tengo/lib/exec.runcmd.lib.tengo +234 -253
  11. package/dist/tengo/lib/exec.runenv.lib.tengo +88 -92
  12. package/dist/tengo/lib/exec.stream.lib.tengo +36 -40
  13. package/dist/tengo/lib/file.internal.lib.tengo +70 -77
  14. package/dist/tengo/lib/file.lib.tengo +54 -57
  15. package/dist/tengo/lib/ll.lib.tengo +217 -241
  16. package/dist/tengo/lib/maps.lib.tengo +98 -106
  17. package/dist/tengo/lib/objects.lib.tengo +11 -13
  18. package/dist/tengo/lib/oop.lib.tengo +16 -19
  19. package/dist/tengo/lib/path.lib.tengo +116 -125
  20. package/dist/tengo/lib/pframes.constants.lib.tengo +25 -28
  21. package/dist/tengo/lib/pframes.export-pcolumn.lib.tengo +28 -33
  22. package/dist/tengo/lib/pframes.lib.tengo +38 -43
  23. package/dist/tengo/lib/pframes.ll.lib.tengo +70 -73
  24. package/dist/tengo/lib/pframes.pcolumn.lib.tengo +45 -51
  25. package/dist/tengo/lib/pframes.spec.lib.tengo +70 -96
  26. package/dist/tengo/lib/pframes.util.lib.tengo +154 -289
  27. package/dist/tengo/lib/pframes.xsv.lib.tengo +260 -273
  28. package/dist/tengo/lib/render.lib.tengo +65 -76
  29. package/dist/tengo/lib/sets.lib.tengo +61 -68
  30. package/dist/tengo/lib/slices.lib.tengo +169 -180
  31. package/dist/tengo/lib/smart.lib.tengo +956 -1069
  32. package/dist/tengo/lib/test.lib.tengo +129 -161
  33. package/dist/tengo/lib/tpl.lib.tengo +448 -516
  34. package/dist/tengo/lib/tpl.state-await.lib.tengo +226 -241
  35. package/dist/tengo/lib/tpl.util.lib.tengo +4 -9
  36. package/dist/tengo/lib/validation.lib.tengo +334 -379
  37. package/dist/tengo/lib/workdir.lib.tengo +309 -332
  38. package/dist/tengo/lib/workdir.proc.lib.tengo +126 -144
  39. package/dist/tengo/lib/workdir.save.lib.tengo +113 -130
  40. package/dist/tengo/lib/workflow.bobject.lib.tengo +21 -26
  41. package/dist/tengo/lib/workflow.bquery.lib.tengo +140 -166
  42. package/dist/tengo/lib/workflow.constants.lib.tengo +1 -2
  43. package/dist/tengo/lib/workflow.context.lib.tengo +27 -32
  44. package/dist/tengo/lib/workflow.lib.tengo +167 -207
  45. package/dist/tengo/tpl/exec.R.create-renv.plj.gz +0 -0
  46. package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
  47. package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
  48. package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
  49. package/dist/tengo/tpl/pframes.aggregate.plj.gz +0 -0
  50. package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
  51. package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
  52. package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
  53. package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
  54. package/dist/tengo/tpl/pframes.map-pframe.plj.gz +0 -0
  55. package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
  56. package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
  57. package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
  58. package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
  59. package/package.json +8 -8
@@ -13,153 +13,145 @@ runenv := import("@platforma-sdk/workflow-tengo:exec.runenv")
13
13
  _OUTPUT_RUN_ENV := "runEnv"
14
14
 
15
15
  pythonVenvBuilder := func() {
16
- self := undefined
17
-
18
- toolset := "pip"
19
- pythonDescriptor := undefined
20
- softwareRef := undefined
21
- dependencies := undefined
22
- cache := 0
23
-
24
- self = {
25
- useToolset: func(name) {
26
- validation.assertJsonSchema(name, "string",
27
- "exec.python.useToolset: <name> must be valid name of python packaging toolset (pip, pipenv and so on)")
28
- ll.assert(name != "", "exec.python.useToolset: toolset name must not be empty")
29
-
30
- toolset = name
31
- return self
32
- },
33
-
34
- runEnvDescriptor: func(descriptor) {
35
- validation.assertJsonSchema(descriptor, pkg.runEnvDescriptorScheme, "exec.python.runEnvDescriptor: <descriptor> must be run environment specification")
36
- ll.assert(descriptor.type == "python", "exec.python.runEnvDescriptor: not a 'python' run environment: %q", descriptor.type)
37
-
38
- pythonDescriptor = ll.fromStrict(descriptor)
39
- return self
40
- },
41
-
42
- software: func(pkgRef) {
43
- validation.assertJsonSchema(pkgRef, validation.reference, "exec.python.software: <pkgRef> must be a reference to software package")
44
-
45
- softwareRef = pkgRef
46
- return self
47
- },
48
-
49
- dependencies: func(deps) {
50
- validation.assertJsonSchema(deps, { "any": "string" }, "exec.python.dependencies: <deps> must be map of reference file paths")
51
-
52
- dependencies = deps
53
- return self
54
- },
55
-
56
- /**
57
- * Sets the cache time in milliseconds.
58
- *
59
- * @param millis: number
60
- */
61
- cacheMillis: func(millis) {
62
- ll.assert(is_int(millis) && millis > 0, "exec.python.cacheMillis: cache time must be a number of milliseconds")
63
- cache = millis * times.millisecond
64
- return self
65
- },
66
-
67
- /**
68
- * Sets the cache time in seconds.
69
- *
70
- * @param seconds: number
71
- */
72
- cacheSeconds: func(seconds) {
73
- ll.assert(is_int(seconds) && seconds > 0, "exec.python.cacheSeconds: cache time must be a number of seconds")
74
- cache = seconds * times.second
75
- return self
76
- },
77
-
78
- /**
79
- * Sets the cache time in minutes.
80
- *
81
- * @param minutes: number
82
- */
83
- cacheMinutes: func(minutes) {
84
- ll.assert(is_int(minutes) && minutes > 0, "exec.python.cacheMinutes: cache time must be a number of minutes")
85
- cache = minutes * times.minute
86
- return self
87
- },
88
-
89
- /**
90
- * Sets the cache time in hours.
91
- *
92
- * @param hours: number
93
- */
94
- cacheHours: func(hours) {
95
- ll.assert(is_int(hours) && hours > 0, "exec.python.cacheHours: cache time must be a number of hours")
96
- cache = hours * times.hour
97
- return self
98
- },
99
-
100
- /**
101
- * Sets the cache time in days
102
- *
103
- * @param days: number
104
- */
105
- cacheDays: func(days) {
106
- ll.assert(is_int(days) && days > 0, "exec.python.cacheDays: cache time must be a number of days")
107
- cache = days * times.hour * 24
108
- return self
109
- },
110
-
111
- /**
112
- * @deprecated, use cacheMillis, cacheSeconds, cacheMinutes, cacheHours and cacheDays instead.
113
- * Sets the cache time.
114
- *
115
- * @param time: duration - the cache time from 'times' library.
116
- */
117
- cache: func(time) {
118
- ll.assert(
119
- is_int(time),
120
- "exec.python.cache: cache time must be an integer. " +
121
- "Did you forget to import a standard tengo library 'times'?")
122
- cache = time
123
- return self
124
- },
125
-
126
- build: func() {
127
- depsMap := runenv.loadDependencyFiles(softwareRef, dependencies)
128
-
129
- archive := pkg.get(pythonDescriptor.registry, pythonDescriptor.package).archive()
130
- pythonPkg := pkg.install(archive).package()
131
-
132
- pyVenvInputs := {
133
- toolset: toolset,
134
- dependencies: depsMap,
135
- // software: softwareRef,
136
- pythonDescriptor: pythonDescriptor,
137
- python: pythonPkg
138
- }
139
-
140
- validation.assertJsonSchema(pyVenvInputs, internal.pythonVenvInputSchema, "incomplete python runenv configuration")
141
-
142
- tpl := render.create(assets.importTemplate("@platforma-sdk/workflow-tengo:exec.python.create-venv"), pyVenvInputs)
143
-
144
- self := undefined
145
- self = ll.toStrict(oop.inherit(tpl, {
146
- /**
147
- * Python virtual environment with all dependencies installed.
148
- *
149
- * @return venv: smart.field - a reference to the runenv with python venv inside.
150
- */
151
- venv: func() {
152
- return tpl.output(_OUTPUT_RUN_ENV, cache)
153
- }
154
- }))
155
-
156
- return self
157
- }
158
- }
159
-
160
- return self
16
+ self := undefined
17
+
18
+ toolset := "pip"
19
+ pythonDescriptor := undefined
20
+ softwareRef := undefined
21
+ dependencies := undefined
22
+ cache := 0
23
+
24
+ self = {
25
+ useToolset: func(name) {
26
+ validation.assertJsonSchema(name, "string",
27
+ "exec.python.useToolset: <name> must be valid name of python packaging toolset (pip, pipenv and so on)")
28
+ ll.assert(name != "", "exec.python.useToolset: toolset name must not be empty")
29
+
30
+ toolset = name
31
+ return self
32
+ },
33
+
34
+ runEnvDescriptor: func(descriptor) {
35
+ validation.assertJsonSchema(descriptor, pkg.runEnvDescriptorScheme, "exec.python.runEnvDescriptor: <descriptor> must be run environment specification")
36
+ ll.assert(descriptor.type == "python", "exec.python.runEnvDescriptor: not a 'python' run environment: %q", descriptor.type)
37
+
38
+ pythonDescriptor = ll.fromStrict(descriptor)
39
+ return self
40
+ },
41
+
42
+ software: func(pkgRef) {
43
+ validation.assertJsonSchema(pkgRef, validation.reference, "exec.python.software: <pkgRef> must be a reference to software package")
44
+
45
+ softwareRef = pkgRef
46
+ return self
47
+ },
48
+
49
+ dependencies: func(deps) {
50
+ validation.assertJsonSchema(deps, { "any": "string" }, "exec.python.dependencies: <deps> must be map of reference file paths")
51
+
52
+ dependencies = deps
53
+ return self
54
+ },
55
+
56
+
57
+
58
+
59
+
60
+ cacheMillis: func(millis) {
61
+ ll.assert(is_int(millis) && millis > 0, "exec.python.cacheMillis: cache time must be a number of milliseconds")
62
+ cache = millis * times.millisecond
63
+ return self
64
+ },
65
+
66
+
67
+
68
+
69
+
70
+ cacheSeconds: func(seconds) {
71
+ ll.assert(is_int(seconds) && seconds > 0, "exec.python.cacheSeconds: cache time must be a number of seconds")
72
+ cache = seconds * times.second
73
+ return self
74
+ },
75
+
76
+
77
+
78
+
79
+
80
+ cacheMinutes: func(minutes) {
81
+ ll.assert(is_int(minutes) && minutes > 0, "exec.python.cacheMinutes: cache time must be a number of minutes")
82
+ cache = minutes * times.minute
83
+ return self
84
+ },
85
+
86
+
87
+
88
+
89
+
90
+ cacheHours: func(hours) {
91
+ ll.assert(is_int(hours) && hours > 0, "exec.python.cacheHours: cache time must be a number of hours")
92
+ cache = hours * times.hour
93
+ return self
94
+ },
95
+
96
+
97
+
98
+
99
+
100
+ cacheDays: func(days) {
101
+ ll.assert(is_int(days) && days > 0, "exec.python.cacheDays: cache time must be a number of days")
102
+ cache = days * times.hour * 24
103
+ return self
104
+ },
105
+
106
+
107
+
108
+
109
+
110
+
111
+ cache: func(time) {
112
+ ll.assert(
113
+ is_int(time),
114
+ "exec.python.cache: cache time must be an integer. " +
115
+ "Did you forget to import a standard tengo library 'times'?")
116
+ cache = time
117
+ return self
118
+ },
119
+
120
+ build: func() {
121
+ depsMap := runenv.loadDependencyFiles(softwareRef, dependencies)
122
+
123
+ archive := pkg.get(pythonDescriptor.registry, pythonDescriptor.package).archive()
124
+ pythonPkg := pkg.install(archive).package()
125
+
126
+ pyVenvInputs := {
127
+ toolset: toolset,
128
+ dependencies: depsMap,
129
+ pythonDescriptor: pythonDescriptor,
130
+ python: pythonPkg
131
+ }
132
+
133
+ validation.assertJsonSchema(pyVenvInputs, internal.pythonVenvInputSchema, "incomplete python runenv configuration")
134
+
135
+ tpl := render.create(assets.importTemplate("@platforma-sdk/workflow-tengo:exec.python.create-venv"), pyVenvInputs)
136
+
137
+ self := undefined
138
+ self = ll.toStrict(oop.inherit(tpl, {
139
+
140
+
141
+
142
+
143
+ venv: func() {
144
+ return tpl.output(_OUTPUT_RUN_ENV, cache)
145
+ }
146
+ }))
147
+
148
+ return self
149
+ }
150
+ }
151
+
152
+ return self
161
153
  }
162
154
 
163
155
  export ll.toStrict({
164
- venvBuilder : pythonVenvBuilder
156
+ venvBuilder : pythonVenvBuilder
165
157
  })