Deploy to the handset from the cluster
Deploy to the handset / build-and-deploy (push) Successful in 2m14s
CI / test (push) Failing after 2m41s

CI builds an arm64 image (compositor, host, chandra-remote, modules) and deploys
the updater pod that installs it on the phone. chandra-remote updates go in live
(SIGUSR2 restarts it in place); the compositor waits for an idle, locked phone or
an approval, and a locked session restarts locked. Host tests: the launcher no
longer draws its label in a narrow panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Opus 5.5 committed 2026-11-29 16:34:12 -08:00
1 parent d2e00b4658
commit 2aa3de5741
14 files changed
+675 -2

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
# Everything the handset runs, built for the phone (linux/arm64), plus the updater that installs it
# (handset.sh). Built by .gitea/workflows/deploy.yaml; build context: the repository.
FROM debian:trixie-slim AS build
RUN apt-get update -q && apt-get install -y -q --no-install-recommends \
bash ca-certificates curl gcc git libc6-dev make pkg-config xz-utils \
libdrm-dev libinput-dev libseat-dev libudev-dev libxkbcommon-dev \
libssl-dev libturbojpeg0-dev libzstd-dev zlib1g-dev
# The compiler the repository is developed with.
ARG MOON_VERSION=0.10.20+65efd5b93
RUN curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash -s -- "$MOON_VERSION"
ENV PATH=/root/.moon/bin:/src/.tools/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WORKDIR /src
COPY scripts/versions.env scripts/setup-toolchain.sh scripts/
RUN bash scripts/setup-toolchain.sh
COPY . .
RUN moon update && bash scripts/build-compositor-wasm.sh && bash scripts/build-modules.sh && bash scripts/build-wasmhost.sh
RUN moon build --target native --release --warn-list -a compositor/authagent
# Static but for glibc: the phone is a rolling distribution whose libcrypto moves on.
RUN gcc -O2 -Wall -Wextra -o build/chandra-remote remote/*.c \
-l:libturbojpeg.a -l:libcrypto.a -l:libzstd.a -l:libz.a -lm -ldl -lpthread
RUN set -eu; live=/payload/live/usr/local session=/payload/session/usr/local; \
install -D -m755 build/chandra-remote $live/bin/chandra-remote; \
for f in index.html manifest.json icon.svg; do install -D -m644 remote/web/$f $live/share/chandra/remote/$f; done; \
install -D -m755 build/wasmhost $session/bin/chandra-host; \
for f in chandra-session chandra-ctl chandra-root; do install -D -m755 session/$f $session/bin/$f; done; \
install -D -m755 _build/native/release/build/compositor/authagent/authagent.exe $session/lib/chandra/chandra-polkit-agent; \
install -D -m644 build/compositor.wasm $session/share/chandra/compositor.wasm; \
for f in build/components/*.wasm; do install -D -m644 $f $session/share/chandra/modules/${f##*/}; done; \
cp -r config wit $session/share/chandra/; \
find /payload -type f | sort
# The gate: the built compositor must start on the built host, take a 1 MB image through
# chandra-remote, and answer for it.
FROM debian:trixie-slim AS smoke
RUN apt-get update -q && apt-get install -y -q --no-install-recommends \
curl python3-minimal libpython3-stdlib libdrm2 libinput10 libseat1 libudev1 libxkbcommon0 xkb-data
COPY --from=build /payload /payload
COPY assets /payload/session/usr/local/share/chandra/assets
COPY handset/smoke.sh /smoke.sh
RUN bash /smoke.sh && touch /smoke-ok
FROM alpine:3.22 AS updater-test
COPY handset /t
RUN sh /t/test_handset.sh && touch /updater-ok
FROM alpine:3.22
# nsenter, to act on the phone
RUN apk add --no-cache util-linux-misc
COPY --from=smoke /smoke-ok /smoke-ok
COPY --from=updater-test /updater-ok /updater-ok
COPY --from=build /payload /payload
COPY handset/handset.sh /usr/local/bin/handset
ARG RELEASE=dev
RUN chmod 755 /usr/local/bin/handset && echo "$RELEASE" > /payload/RELEASE
CMD ["handset", "run"]