Skip to content

Rebase to Alpine 3.24, use distro onnxruntime for the discovery embedding runtime#36

Merged
thelamer merged 1 commit into
linuxserver:masterfrom
IrosTheBeggar:alpine-3.24-onnxruntime
Jul 12, 2026
Merged

Rebase to Alpine 3.24, use distro onnxruntime for the discovery embedding runtime#36
thelamer merged 1 commit into
linuxserver:masterfrom
IrosTheBeggar:alpine-3.24-onnxruntime

Conversation

@IrosTheBeggar

Copy link
Copy Markdown
Contributor

linuxserver.io


  • I have read the contributing guideline and understand that I have made the correct modifications

Description:

Closes #35.

  • Rebase to Alpine 3.24 (both Dockerfiles).
  • Add gcompat and onnxruntime to the runtime packages.
  • After npm install, replace the bundled glibc libonnxruntime.so.1 inside onnxruntime-node with a symlink to the distro's musl build, and remove the bundled CUDA/TensorRT provider libraries (~316 MB) that CPU inference never loads.
  • Changelog entry in readme-vars.yml.

Benefits of this PR and context:

mStream ≥6.16 ships a discovery/recommendation engine whose embedding model runs on onnxruntime-node. That npm package bundles glibc-only binaries, so on this image the worker dies at import (Error loading shared library ld-linux-x86-64.so.2) and the feature can never build its data (#35).

gcompat alone is not enough — the bundled runtime references fortified glibc symbols (__vsnprintf_chk, __memcpy_chk, …) that the shim doesn't implement. But Alpine 3.24's community repo now packages a native musl onnxruntime 1.24.4, the same 1.24 line the npm binding targets. With the distro runtime symlinked in, the only glibc code left is the npm package's thin 384 KB N-API binding, which gcompat handles fine.

Net effect: the recommendation features work, and the image shrinks by ~350 MB (the deleted CUDA/TensorRT libs outweigh the added packages).

The if [ -d … ] guard keeps the build working even if a future mStream release drops the optional onnxruntime-node dependency. If mStream ever moves to a newer onnxruntime line before Alpine does, mStream detects the failed load (as of IrosTheBeggar/mStream#718, in the next release), logs one clear error, and disables the embedding pass — the image itself is never broken by drift.

How Has This Been Tested?

  • Built this Dockerfile (x86_64) locally and ran it with collectDiscoveryData enabled against a small music library: the embedding pass completed real inferences — Discovery-embedding pass complete: 6 embedded, 0 error(s) — and the discovery DB contains 1280-d embeddings + genre predictions.
  • The recipe was first validated clean-room in a plain alpine:3.24 container with the real model (18 MB EffNet ONNX): full inference passes with the system runtime + gcompat; fails without.
  • Confirmed the onnxruntime apk exists for aarch64 at 3.24 as well (onnxruntime-1.24.4-r1 via qemu); the arm64 image itself was not run here and deserves a smoke in your CI.

Source / References:

@thelamer thelamer requested a review from a team July 12, 2026 15:34
@LinuxServer-CI LinuxServer-CI moved this from PRs to PRs Ready For Team Review in Issue & PR Tracker Jul 12, 2026
@github-project-automation github-project-automation Bot moved this from PRs Ready For Team Review to PRs Approved in Issue & PR Tracker Jul 12, 2026
@thelamer thelamer merged commit 3e4d7c9 into linuxserver:master Jul 12, 2026
4 checks passed
@LinuxServer-CI LinuxServer-CI moved this from PRs Approved to Done in Issue & PR Tracker Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

[FEAT] Migrating to a distro with glibc support

3 participants