mirror of
https://github.com/Screenly/Anthias.git
synced 2026-06-10 17:18:43 -04:00
* chore(build): trim runtime apt deps (drop X11/XCB, VLC on Qt6)
Slim down what lands in the runtime images — most of the apt list was
either builder-only headers, cargo from when Qt+WebView were compiled
in-image, or packages with zero callers in the codebase.
Base list (server, viewer, test):
- Drop build-essential / libffi-dev / libssl-dev / python3-dev
— already installed in the uv-builder stage; the runtime image
COPYs the venv pre-built so headers and the compiler aren't needed.
- Drop python3-pil, python3-simplejson, ifupdown, net-tools — no
imports / no callers anywhere in the tree.
- Drop mplayer (~50 MB) and swap lib.utils.url_fails to ffprobe,
which already ships via the ffmpeg package. Adds a 15s timeout so
a stuck RTSP handshake can't hang the API request.
- Swap libcec-dev → libcec6 (the runtime SONAME the cec Python
wheel built in uv-builder dlopens at import).
- Rewrite bin/wait.py to use `ip route` (iproute2, default in
trixie) so net-tools' `route` isn't needed.
Viewer extras:
- Move `vlc` into the Qt5-only branch. MediaPlayerProxy
(viewer/media_player.py) only routes pi2/pi3 through
VLCMediaPlayer; pi4-64 / pi5 / x86 use mpv. Saves ~80–100 MB on
every Qt6 image, which is most of the fleet.
- Drop the entire X11/XCB family (libx11*, libxcb-* + variants,
libxext-dev, libxi-dev, libxrender-dev, libxss-dev, libxtst-dev).
webview/build_qt{5,6}.sh configures Qt with `-no-xcb -no-xcb-xlib
-qpa eglfs`, the Dockerfile sets QT_QPA_PLATFORM=linuxfb, and mpv
uses --vo=drm — so Qt has no X code path to dlopen.
- Swap libxkbcommon-dev → libxkbcommon0 (still needed by Qt's
eglfs evdev for keyboard layouts, but only the runtime variant).
Follow-ups (need ldd against the unpacked WebView/Qt artifact to
derive the right runtime SONAMEs):
- Replace qt6-base-dev / qt6-webengine-dev with their runtime libs
+ qt6-webengine-data.
- Trim the remaining lib*-dev wall in viewer extras.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(build): rigor-pass fixes (trixie pkg names, missing iproute2, harfbuzz)
Three follow-up fixes from actually building + ldd-checking the
images, not just regenerating the dockerfiles:
1. `libcec6` → `libcec7`. Trixie ships libcec 7.0; my local apt-cache
showed libcec6 only because that host runs Ubuntu, where libcec is
still on 6.0. The cec Python wheel built in uv-builder needs the
real runtime SONAME or it fails at import time on first boot.
2. Add `iproute2` to the base list. Verified `debian:trixie` ships
neither iproute2 nor net-tools by default — the previous code
worked because net-tools was being explicitly installed and bin/
wait.py used `route`. Once net-tools went away, `ip route` had
nothing to run against; bin/wait.py would have CommandNotFound'd
on first boot.
3. Add `libharfbuzz-subset0` to viewer extras. Pre-existing bug
(also missing on master / latest-pi3 in production): the prebuilt
WebView dlopens libharfbuzz-subset.so.0, which qt6-webengine-dev
pulls in transitively on Qt6 boards but nothing brings in on Qt5.
Adding it explicitly costs 200 KB and gives a clean ldd on every
board. Confirmed with ldd against rebuilt pi3/pi4-64/x86 viewer
images — zero missing libs everywhere.
Verified: 121 unit tests pass, smoke tests cover pydbus/cec/ffprobe/
ip-route/mpv/vlc on each platform, url_fails RTSP path executes
ffprobe correctly. Authoritative `docker save` sizes vs production:
pi3 685→594 MB, pi4-64 750→611 MB, x86-viewer 768→623 MB, x86-server
502→355 MB.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(build): address Copilot review on slim-image-deps
- viewer/media_player.py: defer `import vlc` into VLCMediaPlayer so
Qt6 boards don't need libvlc available at module load.
- tools/image_builder/utils.py: fix shared-runtime-set comment to
say libcec7 (matches the actual install in __main__.py).
- tests/test_utils.py: cover the rtsp/rtmp ffprobe branch — success,
non-zero exit, timeout, and CommandNotFound.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
509 B
Python
22 lines
509 B
Python
import time
|
|
|
|
import sh
|
|
|
|
|
|
# Wait for a default route. `ip route` ships in iproute2 (already in
|
|
# the base debian:trixie image); the previous implementation used
|
|
# `route` from net-tools, which was dropped from the runtime apt set.
|
|
def is_routing_up() -> bool:
|
|
try:
|
|
sh.grep('default', _in=sh.ip('route'))
|
|
return True
|
|
except sh.ErrorReturnCode_1:
|
|
return False
|
|
|
|
|
|
for _ in range(1, 30):
|
|
if is_routing_up():
|
|
break
|
|
print('Waiting for to come up...')
|
|
time.sleep(1)
|