Sign inSign up

genroc/eval-node

By genroc

•Updated 2 days ago

genroc script-task worker (Node)

Image
0

10K+

genroc/eval-node repository overview

⁠genroc/eval-node

The script-task worker for genroc⁠. It claims TypeScript and JavaScript script tasks from a genroc server's queue and runs each one in a fresh worker thread.

Prototype. Anything may change between versions; pin a version tag for anything you keep.

docker run -e GENROC_SERVER=http://genroc:8448 genroc/eval-node:latest

The worker connects to genroc, not the other way round, so it needs only outbound access and no published ports.

This image only runs scripts. Bundling and typechecking happen on your machine, through the @genroc/eval-node⁠ npm package that genctl apply calls. To scaffold a project with both, run genctl init --eval-node.

⁠Compose

services:
  eval-node:
    image: genroc/eval-node:latest
    environment:
      GENROC_SERVER: http://genroc:8448
    restart: unless-stopped

To run more scripts at once, scale the service or raise CONCURRENCY.

⁠Environment

envdefault
GENROC_SERVERhttp://localhost:8448the genroc server
GENROC_TOKEN_FILE(none)file holding the token, when the server uses --auth
GENROC_TOKEN(none)the token inline; wins over the file
PROCESS / TASKscript-node / eval_nodeclaim 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.
CONCURRENCY4scripts run at once
LEASE_MS30000claim lease, renewed every third of it
POLL_MS250idle poll interval
WORKER_IDevaluator-<pid>the claim holder's name

With auth enabled, create a token that has only the worker permission, and mount it as a file so it stays out of docker inspect:

genctl token create --perms worker --label evaluator -q > worker-token
docker run -e GENROC_SERVER=http://genroc:8448 \
  -e GENROC_TOKEN_FILE=/run/worker-token -v "$PWD/worker-token:/run/worker-token:ro" \
  genroc/eval-node:latest

If the token is rejected, the container exits instead of retrying.

⁠Tags

tagwhat
latestnewest release
0.20.0, 0.20, 0 (for example)a release, pinned to its version, minor or major
edgeevery commit on main

A release tags the genroc server, this image and the @genroc/eval-node package with the same version.

⁠Notes

  • Not a sandbox. Scripts get the container's filesystem, network and environment. Run only code you trust.
  • Memory is not isolated. A script that runs out of memory takes down the whole worker. Run it with restart: unless-stopped.
  • Also on ghcr.io/genroc/eval-node.

Docs: TypeScript evaluation⁠ · Source: https://github.com/genroc/genroc/tree/main/eval-node⁠

Tag summary

Content type

Image

Digest

sha256:b2a187a9e…

Size

59.4 MB

Last updated

3 days ago

docker pull genroc/eval-node