Skip to content

build: run the services on the official Node binary instead of pkg - #89

Draft
juliusknorr wants to merge 1 commit into
mainfrom
build/drop-pkg
Draft

juliusknorr wants to merge 1 commit into
mainfrom
build/drop-pkg

Conversation

@juliusknorr

@juliusknorr juliusknorr commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Drops pkg. The services now run on the official Node binary (pinned node:26.13.1-bookworm-slim, also used for the build) with their sources and production node_modules as plain files.

  • DocService/docservice, FileConverter/converter, Metrics/metrics, AdminPanel/server/adminpanel are now small sh wrappers at the old paths, so supervisor, systemd and the orchestrated entrypoint stay unchanged
  • .docker/install-runtime.sh writes the installed layout to ${BUILD_ROOT}/server (Dockerfile, e2e and the dev Makefile share it)
  • Node's licence ships as license/NodeJS.license and is listed in 3rd-Party.txt
  • The e2e workflow overlays the new tree on nightly, so it is the end-to-end check for this change

Why: every pkg process idles at ~195 MB before running any app code (stock Node: 44 MB), Node fixes need a pkg rebuild (DocumentServer#467), and pkg's file detection keeps missing modules (DocumentServer#267, DocumentServer#535).

Measured on nightly with this tree overlaid (arm64, 4 CPUs, idle PSS):

Process pkg stock Node
docservice 311 MB 119 MB
converter primary 185 MB 38 MB
converter worker (×4) ~217 MB ~69 MB
total ~1180 MB ~430 MB

Server directory on disk: 765 MB → 581 MB. Editors open, an xlsx→pdf conversion through /converter works, metrics and adminpanel start.

Merge order: must land together with DocumentServer#605 (bundle copies ${BUILD_ROOT}/server) and document-server-package#30 (rpm %attr on server/node).

Not verified locally: deb/rpm builds (dh_strip on foreign-arch prebuilt .node files in node_modules) and the orchestrated image, both need CI.

AI-assisted change, reviewed and tested by me.

Ship the sources with their production node_modules and a pinned Node binary. The service paths (DocService/docservice, ...) become small wrappers, so supervisor, systemd and the orchestrated entrypoint keep working unchanged.

Idle memory per process drops from ~185-311 MB to ~38-119 MB.

Signed-off-by: Julius Knorr <jus@bitgrid.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build process related changes dependencies performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant