garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

cartopolis-agent · 2026-11-26T15:56:53Z

feat(deploy): publish the client in Pinnacle's hosted Store

`midas deploy pinnacle-store` builds the client for Pinnacle on a Mac
node, with a checkout of Pinnacle's main of its own in $TOOLS (apart
from the one sessions send to the node), as an unsigned package
source; the deploy host signs it with the Store's key, which no node
sees, and checks each file against its hash before publishing to
https://pinnacle-os.eu/store/cartopolis/.

Manual, not after landings: a cold build for Pinnacle is 20 minutes on
a Mac node. The version is the build number the APK and the server
carry, so a device offers an update when it changes.
deploy/build/pinnacle-store.sh | 44 ++++++++++++++++++++++++++++++++++++++++++
 docs/notes/pinnacle.md         | 17 ++++++++++++++--
 2 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/deploy/build/pinnacle-store.sh b/deploy/build/pinnacle-store.sh
new file mode 100755
index 00000000..83a102a9
--- /dev/null
+++ b/deploy/build/pinnacle-store.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+# Build the client for Pinnacle (jeroen/pinnacle, the owner's own operating
+# system) as a package source for its Store — what `midas deploy
+# pinnacle-store` publishes as https://pinnacle-os.eu/store/cartopolis/.
+# Writes dist/pinnacle-store/:
+#
+#   catalog                      the Store's line for the app
+#   packages/cartopolis.ppa      the package, **unsigned**: the deploy host
+#                                signs it into cartopolis.ppk with the Store's
+#                                key, which never leaves it (`prepare` in the
+#                                hub's deploy recipe)
+#   blobs/<sha256>               the program and every asset, by hash
+#
+# Pinnacle's own `cargo xtask package-cartopolis` does the building (its std,
+# its ports of crates.io crates; docs/notes/pinnacle.md), from a checkout of
+# Pinnacle's main kept in $TOOLS, or $PINNACLE where set. Its docs/store.md
+# has the format and how a device checks it.
+#
+# The version is the build number the APK and the server carry (20000 + the
+# commits on the branch): the Store offers an update when it differs.
+. "$(dirname "$0")/lib.sh"
+CARTOPOLIS_BUILD_CODE=${CARTOPOLIS_BUILD_CODE:-$(( 20000 + $(git -C "$ROOT" rev-list --count HEAD) ))}
+if [ -z "${PINNACLE:-}" ]; then
+    # Its own checkout, apart from the one sessions send to this node
+    # (/work/repos/jeroen/pinnacle), fetched from where this one came from:
+    # on a midas node the hub's mirror, `<host>:jeroen/pinnacle.git`.
+    PINNACLE="$TOOLS/pinnacle"
+    origin=$(git -C "$ROOT" remote get-url origin)
+    url="${origin%:*}:jeroen/pinnacle.git"
+    case "$origin" in
+        https://*|http://*) url="${origin%/*/*}/jeroen/pinnacle.git" ;;
+    esac
+    [ -d "$PINNACLE/.git" ] || git init --quiet "$PINNACLE"
+    git -C "$PINNACLE" remote set-url origin "$url" 2>/dev/null || git -C "$PINNACLE" remote add origin "$url"
+    git -C "$PINNACLE" fetch --quiet origin main
+    git -C "$PINNACLE" checkout --quiet --force --detach FETCH_HEAD
+fi
+echo "Pinnacle at $(git -C "$PINNACLE" rev-parse --short HEAD), Cartopolis $CARTOPOLIS_BUILD_CODE"
+out="$ROOT/dist/pinnacle-store"
+(cd "$PINNACLE" && cargo xtask package-cartopolis "$ROOT" "$out" "$CARTOPOLIS_BUILD_CODE")
+# Its lockfile, which the build moved to Pinnacle's port of wgpu-hal, as it was.
+git -C "$ROOT" checkout --quiet -- Cargo.lock
+test -s "$out/catalog" && test -s "$out/packages/cartopolis.ppa"
+echo "built $out ($(du -sh "$out" | cut -f1))"
diff --git a/docs/notes/pinnacle.md b/docs/notes/pinnacle.md
index 83561f7c..25aced78 100644
--- a/docs/notes/pinnacle.md
+++ b/docs/notes/pinnacle.md
@@ -1,7 +1,7 @@
 ---
 topic: pinnacle
-triggers: ["pinnacle", target_os = "pinnacle", aarch64-unknown-pinnacle, crates/cartopolis/Cargo.toml, platform/photo.rs, platform/model_file.rs, platform/gnss_receiver.rs, utils/clipboard.rs, face_tracking.rs, log_ring.rs, blake3, ring, rustls]
-updated: 2026-11-24
+triggers: ["pinnacle", pinnacle-store.sh, target_os = "pinnacle", aarch64-unknown-pinnacle, crates/cartopolis/Cargo.toml, platform/photo.rs, platform/model_file.rs, platform/gnss_receiver.rs, utils/clipboard.rs, face_tracking.rs, log_ring.rs, blake3, ring, rustls]
+updated: 2026-11-26
 ---
 
 # Cartopolis on Pinnacle
@@ -75,3 +75,16 @@ relative name and Bevy joined it onto the program's folder a second time.
 `cargo xtask cartopolis <checkout>` in Pinnacle runs it; `PINNACLE_CLOCK`
 fixes the time of day, and the haze over the city in those shots is the live
 weather, which an offline `--shot` does not fetch.
+
+## In Pinnacle's Store
+
+`midas deploy pinnacle-store` publishes the client as an app in Pinnacle's
+hosted Store, https://pinnacle-os.eu/store/cartopolis/, which every
+Pinnacle system disk lists (ARM only). `deploy/build/pinnacle-store.sh`
+builds it on a Mac node with a checkout of Pinnacle's main of its own
+(`$TOOLS/pinnacle`), as an **unsigned** package; the deploy host signs it
+there with the Store's key, which no node ever sees, and checks every file
+against its hash before it replaces what is published. The version is the
+build number (20000 + commits), as the APK's: a device offers Update when it
+differs. Pinnacle's `docs/store.md` has the format. Not after landings: a
+cold build is 20 minutes on a Mac node, so it is deployed when asked.