feat(releaseupdate): transactional self-update through archied (#1633)

archied update install verifies the release zip, checks every binary
reports the release, pulls the agent image by digest, backs up the
database in-process and stages the binaries before handing off to
archied update watchdog in its own process. The watchdog restarts units
in release order, requires archied healthy for 120s and otherwise rolls
back binaries and image policy, restoring the database only when a
migration ran. Boot recovery resumes the frozen watchdog.

Deletes scripts/archie-update-install, scripts/archie-update-watchdog,
the updater's --from-source and --auto, CommandInstaller,
ScriptInstaller and the update-image and update-topology subcommands.
This commit is contained in:
sam authored and GitHub committed 2026-10-12 03:21:02 +11:00
1 parent 23f87c4cea
commit 417d379ede
33 files changed
+1754 -1114

No files matched your search

+4 -5
View File
@@ -89,8 +89,8 @@ fi
mkdir -p "${ARCHIE_CONFIG_DIR}" "${ARCHIE_DATA_DIR}" "${ARCHIE_BIN_DIR}"
# 2. Binaries. STAGE ends up holding the binaries, release.json and the
# updater scripts, whichever way they were obtained.
# 2. Binaries. STAGE ends up holding the binaries and release.json, whichever
# way they were obtained.
TMP="$(mktemp -d)"
trap 'rm -rf "${TMP}"' EXIT
@@ -111,7 +111,7 @@ if [ "${FROM_SOURCE}" = true ]; then
for cmd in $(jq -er '.required_topology.units | join(" ")' "${SRC_DIR}/release.json"); do
(cd "${SRC_DIR}" && go build -ldflags "${LDFLAGS}" -o "${STAGE}/${cmd}" "./cmd/${cmd}")
done
cp "${SRC_DIR}/release.json" "${SRC_DIR}"/scripts/archie-update-* "${STAGE}/"
cp "${SRC_DIR}/release.json" "${STAGE}/"
else
if [ -z "${VERSION}" ]; then
tag="$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" | sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p')"
@@ -137,8 +137,7 @@ TOPOLOGY_UNITS="$(tr -d '\n' <"${STAGE}/release.json" | sed -n 's/.*"units": *\[
for cmd in ${TOPOLOGY_UNITS}; do
install -m755 "${STAGE}/${cmd}" "${ARCHIE_BIN_DIR}/${cmd}"
done
install -m755 "${STAGE}"/archie-update-* "${ARCHIE_BIN_DIR}/"
echo " Installed ${TOPOLOGY_UNITS} and the updater to ${ARCHIE_BIN_DIR}/"
echo " Installed ${TOPOLOGY_UNITS} to ${ARCHIE_BIN_DIR}/"
# 3. Configuration. archied setup asks every question and writes config.toml
# plus any secrets to the env file beside it; this script asks nothing itself.