@genroc/eval-node 0.20.0 → 0.21.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.
- package/README.md +3 -3
- package/dist/worker.js +4 -2
- package/package.json +1 -1
- package/worker.ts +4 -2
package/README.md
CHANGED
|
@@ -78,9 +78,9 @@ export default function (input: Input): Output {
|
|
|
78
78
|
## Running the worker
|
|
79
79
|
|
|
80
80
|
```sh
|
|
81
|
-
docker run -e GENROC_SERVER=http://host:8448
|
|
81
|
+
docker run -e GENROC_SERVER=http://host:8448 ghcr.io/genroc/eval-node:latest
|
|
82
82
|
# or
|
|
83
|
-
GENROC_SERVER=http://localhost:8448
|
|
83
|
+
GENROC_SERVER=http://localhost:8448 npx genroc-eval-node
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
The worker connects to genroc, not the other way round, so it only needs outbound access.
|
|
@@ -89,7 +89,7 @@ The worker connects to genroc, not the other way round, so it only needs outboun
|
|
|
89
89
|
|---|---|---|
|
|
90
90
|
| `GENROC_SERVER` | `http://localhost:8448` | the genroc server |
|
|
91
91
|
| `GENROC_TOKEN` / `GENROC_TOKEN_FILE` | *(none)* | token, or a file holding it, when the server uses `--auth token` |
|
|
92
|
-
| `
|
|
92
|
+
| `PROCESS` / `TASK` | `script-node` / `eval_node` | claim only this process / task id; the defaults are script-node's. Set `PROCESS` for a renamed copy, or `""` to drop a filter; **with both `""`, the worker claims every external task.** |
|
|
93
93
|
| `CONCURRENCY` | `4` | scripts run at once |
|
|
94
94
|
| `LEASE_MS` | `30000` | claim lease, renewed every third of it |
|
|
95
95
|
| `POLL_MS` | `250` | idle poll interval |
|
package/dist/worker.js
CHANGED
|
@@ -22,8 +22,10 @@ const RENEW_MS = Math.max(1_000, Math.floor(LEASE_MS / 3));
|
|
|
22
22
|
// The answer has to land before the task's deadline fires, or a script that overran surfaces as
|
|
23
23
|
// external.timeout ("nobody answered") rather than as its own `timeout`.
|
|
24
24
|
const ANSWER_MARGIN_MS = 250;
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
// script-node's names. A renamed copy needs PROCESS set; an explicit "" drops that filter, and
|
|
26
|
+
// both "" claims every external task, other runtimes' included.
|
|
27
|
+
const PROCESS_FILTER = process.env.PROCESS ?? "script-node";
|
|
28
|
+
const TASK_FILTER = process.env.TASK ?? "eval_node";
|
|
27
29
|
// Large values arrive as refs; a bundle is one object per definition version, fetched once.
|
|
28
30
|
// Refs are content hashes, so the cache never invalidates.
|
|
29
31
|
const objectCache = new Map();
|
package/package.json
CHANGED
package/worker.ts
CHANGED
|
@@ -25,8 +25,10 @@ const RENEW_MS = Math.max(1_000, Math.floor(LEASE_MS / 3));
|
|
|
25
25
|
// The answer has to land before the task's deadline fires, or a script that overran surfaces as
|
|
26
26
|
// external.timeout ("nobody answered") rather than as its own `timeout`.
|
|
27
27
|
const ANSWER_MARGIN_MS = 250;
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
// script-node's names. A renamed copy needs PROCESS set; an explicit "" drops that filter, and
|
|
29
|
+
// both "" claims every external task, other runtimes' included.
|
|
30
|
+
const PROCESS_FILTER = process.env.PROCESS ?? "script-node";
|
|
31
|
+
const TASK_FILTER = process.env.TASK ?? "eval_node";
|
|
30
32
|
|
|
31
33
|
type ObjectEntry = { path: (string | number)[]; ref: string; size: number };
|
|
32
34
|
|