tensorlake 0.5.143 → 0.5.145

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 (77) hide show
  1. package/README.md +11 -159
  2. package/applications.cjs +3 -0
  3. package/applications.d.cts +1 -0
  4. package/applications.d.ts +1 -0
  5. package/applications.js +1 -0
  6. package/index.cjs +3 -0
  7. package/index.d.cts +1 -0
  8. package/index.d.ts +1 -0
  9. package/index.js +1 -0
  10. package/package.json +25 -68
  11. package/bin/function-executor.js +0 -8
  12. package/bin/tensorlake-create-sandbox-image.js +0 -9
  13. package/bin/tensorlake-deploy.cjs +0 -8
  14. package/bin/tensorlake-import-sandbox-image.js +0 -9
  15. package/bin/tensorlake-typescript-function-runner.js +0 -8
  16. package/dist/applications/index.cjs +0 -4821
  17. package/dist/applications/index.cjs.map +0 -1
  18. package/dist/applications/index.d.cts +0 -130
  19. package/dist/applications/index.d.ts +0 -130
  20. package/dist/applications/index.js +0 -4782
  21. package/dist/applications/index.js.map +0 -1
  22. package/dist/function-agent/main.cjs +0 -1838
  23. package/dist/function-agent/main.cjs.map +0 -1
  24. package/dist/function-agent/main.d.cts +0 -3
  25. package/dist/function-agent/main.d.ts +0 -3
  26. package/dist/function-agent/main.js +0 -1825
  27. package/dist/function-agent/main.js.map +0 -1
  28. package/dist/function-executor/main.cjs +0 -4944
  29. package/dist/function-executor/main.cjs.map +0 -1
  30. package/dist/function-executor/main.d.cts +0 -4
  31. package/dist/function-executor/main.d.ts +0 -4
  32. package/dist/function-executor/main.js +0 -4902
  33. package/dist/function-executor/main.js.map +0 -1
  34. package/dist/index.cjs +0 -10184
  35. package/dist/index.cjs.map +0 -1
  36. package/dist/index.d.cts +0 -2431
  37. package/dist/index.d.ts +0 -2431
  38. package/dist/index.js +0 -10108
  39. package/dist/index.js.map +0 -1
  40. package/dist/native-worker.cjs +0 -278
  41. package/dist/native-worker.cjs.map +0 -1
  42. package/dist/native-worker.d.cts +0 -2
  43. package/dist/native-worker.d.ts +0 -2
  44. package/dist/native-worker.js +0 -276
  45. package/dist/native-worker.js.map +0 -1
  46. package/dist/remote-CNJ9TmcQ.d.cts +0 -283
  47. package/dist/remote-dblFxKug.d.ts +0 -283
  48. package/dist/sandbox-image-ChzWDeZy.d.cts +0 -357
  49. package/dist/sandbox-image-ChzWDeZy.d.ts +0 -357
  50. package/dist/sandbox-image.cjs +0 -1992
  51. package/dist/sandbox-image.cjs.map +0 -1
  52. package/dist/sandbox-image.d.cts +0 -1
  53. package/dist/sandbox-image.d.ts +0 -1
  54. package/dist/sandbox-image.js +0 -1987
  55. package/dist/sandbox-image.js.map +0 -1
  56. package/lib/libc.cjs +0 -61
  57. package/lib/libc.d.cts +0 -1
  58. package/lib/runtime.cjs +0 -155
  59. package/runtime/function-executor/manifest.json +0 -59
  60. package/runtime/function-executor/package/bin/function-executor.js +0 -8
  61. package/runtime/function-executor/package/dist/function-executor/main.js +0 -4902
  62. package/runtime/function-executor/package/dist/function-executor/main.js.map +0 -1
  63. package/runtime/function-executor/package/dist/native-worker.cjs +0 -278
  64. package/runtime/function-executor/package/dist/native-worker.cjs.map +0 -1
  65. package/runtime/function-executor/package/npm-shrinkwrap.json +0 -475
  66. package/runtime/function-executor/package/package.json +0 -22
  67. package/runtime/function-executor/package/proto/README.md +0 -18
  68. package/runtime/function-executor/package/proto/tensorlake/function_executor/proto/function_executor.proto +0 -613
  69. package/runtime/function-executor/package/proto/tensorlake/function_executor/proto/status.proto +0 -42
  70. package/runtime/typescript-function-runner/manifest.json +0 -44
  71. package/runtime/typescript-function-runner/package/bin/tensorlake-typescript-function-runner.js +0 -8
  72. package/runtime/typescript-function-runner/package/dist/function-agent/main.js +0 -1825
  73. package/runtime/typescript-function-runner/package/dist/function-agent/main.js.map +0 -1
  74. package/runtime/typescript-function-runner/package/dist/native-worker.cjs +0 -278
  75. package/runtime/typescript-function-runner/package/dist/native-worker.cjs.map +0 -1
  76. package/runtime/typescript-function-runner/package/npm-shrinkwrap.json +0 -580
  77. package/runtime/typescript-function-runner/package/package.json +0 -25
package/lib/runtime.cjs DELETED
@@ -1,155 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { detectLinuxLibc } = require("./libc.cjs");
4
- const fs = require("node:fs");
5
- const path = require("node:path");
6
- const { spawnSync } = require("node:child_process");
7
-
8
- const NATIVE_PACKAGES = {
9
- "darwin-arm64": "tensorlake-native-darwin-arm64",
10
- "linux-arm64": "tensorlake-native-linux-arm64-gnu",
11
- "linux-arm64-musl": "tensorlake-native-linux-arm64-musl",
12
- "linux-x64": "tensorlake-native-linux-x64-gnu",
13
- "linux-x64-musl": "tensorlake-native-linux-x64-musl",
14
- "win32-x64": "tensorlake-native-win32-x64",
15
- };
16
-
17
- function packageRoot() {
18
- return path.resolve(__dirname, "..");
19
- }
20
-
21
- function baseTargetId(platform = process.platform, arch = process.arch) {
22
- return `${platform}-${arch}`;
23
- }
24
-
25
- let cachedLinuxLibc;
26
-
27
- function linuxLibcFamily(options = {}) {
28
- if (options.libc === "gnu" || options.libc === "musl") {
29
- return options.libc;
30
- }
31
- if (options.report != null) {
32
- return options.report.header?.glibcVersionRuntime ? "gnu" : "musl";
33
- }
34
- if (cachedLinuxLibc != null) return cachedLinuxLibc;
35
-
36
- cachedLinuxLibc = detectLinuxLibc(fs);
37
- return cachedLinuxLibc;
38
- }
39
-
40
- function packageTargetId(platform = process.platform, arch = process.arch, options = {}) {
41
- const targetId = baseTargetId(platform, arch);
42
- if (platform !== "linux") {
43
- return targetId;
44
- }
45
- if (!options.libc && !options.report && platform !== process.platform) {
46
- return targetId;
47
- }
48
- return linuxLibcFamily(options) === "musl" ? `${targetId}-musl` : targetId;
49
- }
50
-
51
- function nativeTargetId(platform = process.platform, arch = process.arch, options = {}) {
52
- return packageTargetId(platform, arch, options);
53
- }
54
-
55
- function nativeBindingPath(options = {}) {
56
- const platform = options.platform ?? process.platform;
57
- const arch = options.arch ?? process.arch;
58
- const root = options.packageRoot ?? packageRoot();
59
- return path.join(
60
- root,
61
- "dist",
62
- "native",
63
- nativeTargetId(platform, arch, options),
64
- "tensorlake-node.node",
65
- );
66
- }
67
-
68
- function nativePackageName(platform = process.platform, arch = process.arch, options = {}) {
69
- return NATIVE_PACKAGES[nativeTargetId(platform, arch, options)];
70
- }
71
-
72
- function loadNative() {
73
- const targetId = nativeTargetId();
74
- const bindingPath = nativeBindingPath();
75
- if (fs.existsSync(bindingPath)) {
76
- return require(bindingPath);
77
- }
78
-
79
- const packageName = nativePackageName();
80
- if (!packageName) {
81
- throw new Error(
82
- `Tensorlake does not provide a native binding for ${targetId}.`,
83
- );
84
- }
85
-
86
- let packageEntry;
87
- try {
88
- packageEntry = require.resolve(packageName);
89
- } catch (cause) {
90
- throw new Error(
91
- `Missing native binding package ${packageName} for ${targetId}. Reinstall tensorlake without omitting optional dependencies, and install dependencies on the machine where they will run.`,
92
- { cause },
93
- );
94
- }
95
- return require(packageEntry);
96
- }
97
-
98
- function exitWithSpawnResult(result) {
99
- if (result.error) {
100
- console.error(result.error.message);
101
- process.exit(1);
102
- }
103
- process.exit(result.status ?? 1);
104
- }
105
-
106
- function findPython() {
107
- const candidates =
108
- process.platform === "win32"
109
- ? [
110
- { command: "py", prefix: ["-3"] },
111
- { command: "python", prefix: [] },
112
- ]
113
- : [
114
- { command: "python3", prefix: [] },
115
- { command: "python", prefix: [] },
116
- ];
117
-
118
- for (const candidate of candidates) {
119
- const probe = spawnSync(candidate.command, [...candidate.prefix, "--version"], {
120
- stdio: "ignore",
121
- env: process.env,
122
- });
123
- if (!probe.error && probe.status === 0) {
124
- return candidate;
125
- }
126
- }
127
-
128
- return null;
129
- }
130
-
131
- function runPythonModule(moduleName, helpText) {
132
- const python = findPython();
133
- if (!python) {
134
- console.error(helpText);
135
- process.exit(1);
136
- }
137
-
138
- const result = spawnSync(
139
- python.command,
140
- [...python.prefix, "-m", moduleName, ...process.argv.slice(2)],
141
- {
142
- stdio: "inherit",
143
- env: process.env,
144
- },
145
- );
146
- exitWithSpawnResult(result);
147
- }
148
-
149
- module.exports = {
150
- loadNative,
151
- nativeTargetId,
152
- nativeBindingPath,
153
- nativePackageName,
154
- runPythonModule,
155
- };
@@ -1,59 +0,0 @@
1
- {
2
- "format_version": 1,
3
- "sdk_version": "0.5.143",
4
- "minimum_node_major": 24,
5
- "package_name": "@tensorlake/function-executor-runtime",
6
- "runtime_id": "sha256:394b942396f6f70c29d6a2fe2b5d6a1135c36585c54f0459768263c1fbf19da5",
7
- "files": {
8
- "package/bin/function-executor.js": {
9
- "sha256": "0191f54ac8d3f30ce710cf30f9c58a585710412fcf6b7e3433e9f287b9abf45c",
10
- "size": 209,
11
- "mode": 493
12
- },
13
- "package/dist/function-executor/main.js": {
14
- "sha256": "cd1a7e2b6fa321a9a5e90c5a2a7224260db3a6089cd524eef6c0a7ad45e2ccec",
15
- "size": 184156,
16
- "mode": 420
17
- },
18
- "package/dist/function-executor/main.js.map": {
19
- "sha256": "65925818755291214a05bed199c46aa6ad25204961b78bd6ef3e63049b08f325",
20
- "size": 409026,
21
- "mode": 420
22
- },
23
- "package/dist/native-worker.cjs": {
24
- "sha256": "2915ec528014ecfedbefe167c9139f46f390f6c937b92718595afb4347ad0985",
25
- "size": 10870,
26
- "mode": 420
27
- },
28
- "package/dist/native-worker.cjs.map": {
29
- "sha256": "4e5246d7fc4f28c17f795c413f27bfa51d93c738d79bf8a702a44d768511255e",
30
- "size": 17217,
31
- "mode": 420
32
- },
33
- "package/npm-shrinkwrap.json": {
34
- "sha256": "02e8af2325899ac567b53e189f2484f2320eaf24462d2fa05527bb10b2562cda",
35
- "size": 17965,
36
- "mode": 420
37
- },
38
- "package/package.json": {
39
- "sha256": "50ed7630c71b83e90e7d2ad797ed3e8c0dbf37a90dd392a43c590a3796ba9ae3",
40
- "size": 516,
41
- "mode": 420
42
- },
43
- "package/proto/README.md": {
44
- "sha256": "c2d6da5e218926ea46d5efab56c931ac096a98b0ee695c7d21a26867a11948c7",
45
- "size": 901,
46
- "mode": 420
47
- },
48
- "package/proto/tensorlake/function_executor/proto/function_executor.proto": {
49
- "sha256": "d020277a118973ef7f8839752e4d50c74f635b3f6501e64103f47ce6078117fd",
50
- "size": 23670,
51
- "mode": 420
52
- },
53
- "package/proto/tensorlake/function_executor/proto/status.proto": {
54
- "sha256": "789cde8a3953307306854d9fbbf48f8661c7534172aa9f4064ac7641755b231b",
55
- "size": 1927,
56
- "mode": 420
57
- }
58
- }
59
- }
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { main } from "../dist/function-executor/main.js";
4
-
5
- main(process.argv.slice(2)).catch((error) => {
6
- process.stderr.write(`${error?.stack ?? error}\n`);
7
- process.exitCode = 1;
8
- });