@platforma-sdk/workflow-tengo 5.5.17 → 5.6.1
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.
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -1
- package/dist/tengo/lib/exec.R.internal.lib.tengo +91 -9
- package/dist/tengo/lib/exec.R.lib.tengo +5 -32
- package/dist/tengo/tpl/annotations.compute.plj.gz +0 -0
- package/dist/tengo/tpl/anonymize.deanonymize.plj.gz +0 -0
- package/dist/tengo/tpl/anonymize.impl.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.create_workdir_from_storage.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.download_blob.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.run_hello_world.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.run_hello_world_py.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.upload_blob.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.upload_template.plj.gz +0 -0
- package/dist/tengo/tpl/check_network.workdir_type_name_extractor.plj.gz +0 -0
- package/dist/tengo/tpl/exec.conda.create-env.plj.gz +0 -0
- package/dist/tengo/tpl/exec.delayed-compute-allocation.impl.plj.gz +0 -0
- package/dist/tengo/tpl/exec.exec-impl.plj.gz +0 -0
- package/dist/tengo/tpl/exec.exec.plj.gz +0 -0
- package/dist/tengo/tpl/exec.load-software.impl.plj.gz +0 -0
- package/dist/tengo/tpl/exec.monetization_info.plj.gz +0 -0
- package/dist/tengo/tpl/exec.monetization_to_json.plj.gz +0 -0
- package/dist/tengo/tpl/exec.python.create-venv.plj.gz +0 -0
- package/dist/tengo/tpl/exec.python.install-deps.plj.gz +0 -0
- package/dist/tengo/tpl/exec.python.venv-bin-path.plj.gz +0 -0
- package/dist/tengo/tpl/ll.get-field.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-multiple-pcolumns.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-parquet-pcolumn-chunk.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-pframe-for-ui.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-pframe.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.export-single-pcolumn.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.import-dir.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.parse-to-json.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.process-pcolumn-data.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.remove-nulls.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.slice-data.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-export-pframe.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-import-if-not-null.plj.gz +0 -0
- package/dist/tengo/tpl/pframes.xsv-import-map.plj.gz +0 -0
- package/dist/tengo/tpl/pt.import-dir.plj.gz +0 -0
- package/dist/tengo/tpl/pt.workflow-run.plj.gz +0 -0
- package/dist/tengo/tpl/waiter.waiter.plj.gz +0 -0
- package/dist/tengo/tpl/workdir.save.plj.gz +0 -0
- package/dist/tengo/tpl/workflow.build-ctx.plj.gz +0 -0
- package/dist/tengo/tpl/workflow.query-anchored.plj.gz +0 -0
- package/package.json +2 -2
- package/dist/tengo/tpl/exec.R.create-renv.plj.gz +0 -0
package/dist/index.cjs
CHANGED
|
@@ -22,7 +22,6 @@ module.exports = { Templates: {
|
|
|
22
22
|
'check_network.download_blob': { type: 'from-file', path: require.resolve('./tengo/tpl/check_network.download_blob.plj.gz') },
|
|
23
23
|
'check_network.upload_blob': { type: 'from-file', path: require.resolve('./tengo/tpl/check_network.upload_blob.plj.gz') },
|
|
24
24
|
'check_network.upload_template': { type: 'from-file', path: require.resolve('./tengo/tpl/check_network.upload_template.plj.gz') },
|
|
25
|
-
'exec.R.create-renv': { type: 'from-file', path: require.resolve('./tengo/tpl/exec.R.create-renv.plj.gz') },
|
|
26
25
|
'exec.conda.create-env': { type: 'from-file', path: require.resolve('./tengo/tpl/exec.conda.create-env.plj.gz') },
|
|
27
26
|
'exec.exec-impl': { type: 'from-file', path: require.resolve('./tengo/tpl/exec.exec-impl.plj.gz') },
|
|
28
27
|
'exec.monetization_info': { type: 'from-file', path: require.resolve('./tengo/tpl/exec.monetization_info.plj.gz') },
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare type TemplateFromFile = { readonly type: "from-file"; readonly path: string; };
|
|
2
|
-
declare type TplName = "ll.get-field" | "pframes.export-parquet-pcolumn-chunk" | "pframes.export-single-pcolumn" | "pframes.import-dir" | "pframes.remove-nulls" | "pt.import-dir" | "waiter.waiter" | "workdir.save" | "workflow.build-ctx" | "workflow.query-anchored" | "anonymize.deanonymize" | "anonymize.impl" | "check_network.workdir_type_name_extractor" | "exec.delayed-compute-allocation.impl" | "exec.monetization_to_json" | "exec.python.install-deps" | "exec.python.venv-bin-path" | "pframes.export-multiple-pcolumns" | "pframes.slice-data" | "check_network.create_workdir_from_storage" | "check_network.download_blob" | "check_network.upload_blob" | "check_network.upload_template" | "exec.
|
|
2
|
+
declare type TplName = "ll.get-field" | "pframes.export-parquet-pcolumn-chunk" | "pframes.export-single-pcolumn" | "pframes.import-dir" | "pframes.remove-nulls" | "pt.import-dir" | "waiter.waiter" | "workdir.save" | "workflow.build-ctx" | "workflow.query-anchored" | "anonymize.deanonymize" | "anonymize.impl" | "check_network.workdir_type_name_extractor" | "exec.delayed-compute-allocation.impl" | "exec.monetization_to_json" | "exec.python.install-deps" | "exec.python.venv-bin-path" | "pframes.export-multiple-pcolumns" | "pframes.slice-data" | "check_network.create_workdir_from_storage" | "check_network.download_blob" | "check_network.upload_blob" | "check_network.upload_template" | "exec.conda.create-env" | "exec.exec-impl" | "exec.monetization_info" | "exec.python.create-venv" | "pframes.parse-to-json" | "exec.load-software.impl" | "exec.exec" | "pt.workflow-run" | "annotations.compute" | "check_network.run_hello_world" | "check_network.run_hello_world_py" | "pframes.xsv-export-pframe" | "pframes.xsv-import-if-not-null" | "pframes.xsv-import-map" | "pframes.process-pcolumn-data" | "pframes.export-pframe" | "pframes.export-pframe-for-ui";
|
|
3
3
|
declare const Templates: Record<TplName, TemplateFromFile>;
|
|
4
4
|
export { Templates };
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,6 @@ export const Templates = {
|
|
|
23
23
|
'check_network.download_blob': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/check_network.download_blob.plj.gz') },
|
|
24
24
|
'check_network.upload_blob': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/check_network.upload_blob.plj.gz') },
|
|
25
25
|
'check_network.upload_template': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/check_network.upload_template.plj.gz') },
|
|
26
|
-
'exec.R.create-renv': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/exec.R.create-renv.plj.gz') },
|
|
27
26
|
'exec.conda.create-env': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/exec.conda.create-env.plj.gz') },
|
|
28
27
|
'exec.exec-impl': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/exec.exec-impl.plj.gz') },
|
|
29
28
|
'exec.monetization_info': { type: 'from-file', path: resolve(import.meta.dirname, './tengo/tpl/exec.monetization_info.plj.gz') },
|
|
@@ -4,8 +4,11 @@ validation := import("@platforma-sdk/workflow-tengo:validation")
|
|
|
4
4
|
path := import("@platforma-sdk/workflow-tengo:path")
|
|
5
5
|
smart := import("@platforma-sdk/workflow-tengo:smart")
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
workdir := import("@platforma-sdk/workflow-tengo:workdir")
|
|
8
8
|
desc := import("@platforma-sdk/workflow-tengo:exec.descriptor")
|
|
9
|
+
pkg := import("@platforma-sdk/workflow-tengo:exec.package")
|
|
10
|
+
runcmd := import("@platforma-sdk/workflow-tengo:exec.runcmd")
|
|
11
|
+
runenv := import("@platforma-sdk/workflow-tengo:exec.runenv")
|
|
9
12
|
|
|
10
13
|
rVenvInputSchema := {
|
|
11
14
|
operationMode: "string",
|
|
@@ -56,23 +59,35 @@ runRPlan := func(refsPrefix, rPkgRef, rRunEnvDescriptor, rVenvRef) {
|
|
|
56
59
|
envExpression("RENV_PATHS_ROOT", renvRootArg).
|
|
57
60
|
envExpression("RENV_PATHS_BINARY", path.join(renvRootArg, "binaries")).
|
|
58
61
|
envExpression("RENV_PATHS_SOURCE", path.join(renvRootArg, "sources")).
|
|
59
|
-
envExpression("RENV_PATHS_CACHE", path.join(renvRootArg, "cache"))
|
|
62
|
+
envExpression("RENV_PATHS_CACHE", path.join(renvRootArg, "cache")).
|
|
63
|
+
envExpression("RENV_PATHS_LOCKFILE", path.join(renvRootArg, "renv.lock"))
|
|
60
64
|
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
envExpression("RENV_PATHS_RENV", path.join(_expr(ARG_VAR_R_VENV), "r-venv")).
|
|
65
|
-
envExpression("RENV_PATHS_LOCKFILE", path.join(_expr(ARG_VAR_R_VENV), "renv.lock"))
|
|
65
|
+
if (is_undefined(rVenvRef)) {
|
|
66
|
+
|
|
67
|
+
rVenvRef = "."
|
|
66
68
|
}
|
|
69
|
+
plan.
|
|
70
|
+
refVar(ARG_VAR_R_VENV, rEnvRefKey, rVenvRef).
|
|
71
|
+
envExpression("RENV_PATHS_RENV", path.join(_expr(ARG_VAR_R_VENV), ".renv"))
|
|
67
72
|
|
|
68
73
|
|
|
69
74
|
|
|
70
75
|
|
|
71
|
-
plan.envExpression("RENV_CONFIG_REPOS_OVERRIDE", path.join(
|
|
76
|
+
plan.envExpression("RENV_CONFIG_REPOS_OVERRIDE", path.join(_expr(ARG_VAR_R), "packages"))
|
|
72
77
|
|
|
73
78
|
return plan
|
|
74
79
|
}
|
|
75
80
|
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
76
91
|
activateRenvInWD := func(wd, queue, computeResources, plan) {
|
|
77
92
|
validation.assertType(wd, validation.reference, "exec.R.activateRenvInWD: <wd> must be a reference to workdir")
|
|
78
93
|
validation.assertType(queue, "string", "exec.R.activateRenvInWD: <queue> must be a string")
|
|
@@ -104,6 +119,71 @@ activateRenvInWD := func(wd, queue, computeResources, plan) {
|
|
|
104
119
|
return activateRenv.build().workdir
|
|
105
120
|
}
|
|
106
121
|
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
createDirForRenv := func(rPkgRef) {
|
|
131
|
+
validation.assertType(rPkgRef, validation.reference, "exec.R.createDirForRenv: <rPkgRef> must be reference to R run environment package")
|
|
132
|
+
|
|
133
|
+
deps := runenv.loadFilesFromPackage(rPkgRef, { "renv.lock": path.join(RENV_ROOT_DIR_NAME, "renv.lock") })
|
|
134
|
+
|
|
135
|
+
wdForRenv := workdir.builder().
|
|
136
|
+
inQueue(pkg.DEFAULT_ALLOCATION_QUEUE).
|
|
137
|
+
cpu(pkg.DEFAULT_ALLOCATION_CPU).
|
|
138
|
+
mem("1MiB").
|
|
139
|
+
addFile("renv.lock", deps["renv.lock"]).
|
|
140
|
+
build()
|
|
141
|
+
|
|
142
|
+
envDirCreator := runenv.saveBuilder(wdForRenv).
|
|
143
|
+
envType("R").
|
|
144
|
+
addPath("renv.lock").
|
|
145
|
+
addPackage("R", rPkgRef)
|
|
146
|
+
|
|
147
|
+
return envDirCreator.build().runEnv()
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
installDepsIntoRenv := func(workdir, queue, computeResources, plan) {
|
|
158
|
+
validation.assertType(workdir, validation.reference, "exec.R.installDepsIntoRenv: <workdir> must be a reference to workdir")
|
|
159
|
+
validation.assertType(queue, "string", "exec.R.installDepsIntoRenv: <queue> must be a string")
|
|
160
|
+
validation.assertType(computeResources,
|
|
161
|
+
["or",
|
|
162
|
+
validation.reference,
|
|
163
|
+
{ "cpu": "number", "ram": ["or", "number", "string"] }
|
|
164
|
+
],
|
|
165
|
+
"exec.R.activateRenvInWD: <computeResources> must be a reference to allocation, or a map with cpu and ram"
|
|
166
|
+
)
|
|
167
|
+
validation.assertType(plan, runcmd.RUN_CMD_PLAN_STATE_OR_OBJECT_SCHEMA, "exec.R.installDepsIntoRenv: <plan> must be a run command plan or state")
|
|
168
|
+
|
|
169
|
+
depsInstaller := runcmd.builder(workdir, plan).
|
|
170
|
+
inQueue(queue).
|
|
171
|
+
cmd("R").
|
|
172
|
+
arg("--no-echo").
|
|
173
|
+
arg("--no-restore").
|
|
174
|
+
arg("-e").arg("renv::restore( clean = TRUE )")
|
|
175
|
+
|
|
176
|
+
if (smart.isReference(computeResources)) {
|
|
177
|
+
depsInstaller.allocation(computeResources)
|
|
178
|
+
} else {
|
|
179
|
+
depsInstaller.
|
|
180
|
+
cpu(computeResources.cpu).
|
|
181
|
+
mem(computeResources.ram)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return depsInstaller.build().workdir
|
|
185
|
+
}
|
|
186
|
+
|
|
107
187
|
export ll.toStrict({
|
|
108
188
|
|
|
109
189
|
ARG_VAR_R : ARG_VAR_R,
|
|
@@ -115,5 +195,7 @@ export ll.toStrict({
|
|
|
115
195
|
|
|
116
196
|
|
|
117
197
|
runRPlan : runRPlan,
|
|
118
|
-
activateRenvInWD : activateRenvInWD
|
|
198
|
+
activateRenvInWD : activateRenvInWD,
|
|
199
|
+
createDirForRenv : createDirForRenv,
|
|
200
|
+
installDepsIntoRenv : installDepsIntoRenv
|
|
119
201
|
})
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
times := import("times")
|
|
2
2
|
|
|
3
3
|
ll := import("@platforma-sdk/workflow-tengo:ll")
|
|
4
|
-
oop := import("@platforma-sdk/workflow-tengo:oop")
|
|
5
4
|
validation := import("@platforma-sdk/workflow-tengo:validation")
|
|
6
|
-
assets := import("@platforma-sdk/workflow-tengo:assets")
|
|
7
5
|
smart := import("@platforma-sdk/workflow-tengo:smart")
|
|
8
|
-
render := import("@platforma-sdk/workflow-tengo:render")
|
|
9
6
|
pkg := import("@platforma-sdk/workflow-tengo:exec.package")
|
|
10
7
|
internal := import("@platforma-sdk/workflow-tengo:exec.R.internal")
|
|
11
8
|
desc := import("@platforma-sdk/workflow-tengo:exec.descriptor")
|
|
12
9
|
|
|
13
|
-
_OUTPUT_RUN_ENV := "runEnv"
|
|
14
|
-
|
|
15
|
-
createRenvTpl := assets.importTemplate("@platforma-sdk/workflow-tengo:exec.R.create-renv")
|
|
16
|
-
|
|
17
10
|
rVenvBuilder := func() {
|
|
18
11
|
self := undefined
|
|
19
12
|
|
|
@@ -139,31 +132,10 @@ rVenvBuilder := func() {
|
|
|
139
132
|
|
|
140
133
|
build: func() {
|
|
141
134
|
archiveRef := pkg.get(rRunEnvDescriptor.registry, rRunEnvDescriptor.package).archive()
|
|
142
|
-
rPkgRef := pkg.install(archiveRef).package()
|
|
143
|
-
|
|
144
|
-
rVenvInputs := {
|
|
145
|
-
operationMode: opMode,
|
|
146
|
-
toolset: toolset,
|
|
147
|
-
dependencies: dependencies,
|
|
148
|
-
software: softwareRef,
|
|
149
|
-
rRunEnvDescriptor: rRunEnvDescriptor,
|
|
150
|
-
R: rPkgRef
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
validation.assertType(rVenvInputs, internal.rVenvInputSchema, "incomplete R runenv configuration")
|
|
154
|
-
tpl := render.create(createRenvTpl, rVenvInputs)
|
|
135
|
+
rPkgRef := pkg.install(archiveRef).package().setCacheDays(1)
|
|
155
136
|
|
|
156
137
|
self := undefined
|
|
157
|
-
self = ll.toStrict(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
venv: func() {
|
|
164
|
-
return tpl.output(_OUTPUT_RUN_ENV, cache)
|
|
165
|
-
},
|
|
166
|
-
|
|
138
|
+
self = ll.toStrict({
|
|
167
139
|
|
|
168
140
|
|
|
169
141
|
|
|
@@ -173,7 +145,7 @@ rVenvBuilder := func() {
|
|
|
173
145
|
|
|
174
146
|
return rPkgRef
|
|
175
147
|
}
|
|
176
|
-
})
|
|
148
|
+
})
|
|
177
149
|
|
|
178
150
|
return self
|
|
179
151
|
}
|
|
@@ -186,5 +158,6 @@ rVenvBuilder := func() {
|
|
|
186
158
|
export ll.toStrict({
|
|
187
159
|
rVenvBuilder : rVenvBuilder,
|
|
188
160
|
runRPlan : internal.runRPlan,
|
|
189
|
-
activateRenvInWD : internal.activateRenvInWD
|
|
161
|
+
activateRenvInWD : internal.activateRenvInWD,
|
|
162
|
+
installDepsIntoRenv : internal.installDepsIntoRenv
|
|
190
163
|
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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.
|
|
3
|
+
"version": "5.6.1",
|
|
4
4
|
"description": "Tengo SDK library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@platforma-open/milaboratories.software-ptexter": "1.2.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@platforma-sdk/tengo-builder": "2.3.
|
|
25
|
+
"@platforma-sdk/tengo-builder": "2.3.9"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"type-check": "pl-tengo check",
|
|
Binary file
|