diff --git a/README.md b/README.md index 8c3c512..68405ba 100644 --- a/README.md +++ b/README.md @@ -119,10 +119,12 @@ cloudron --server my.inference.coop --token "$CLOUDRON_TOKEN" update \ `./release.sh release` runs this same sequence with both traps handled — it refuses to build from a dirty tree, always passes `--no-cache`, writes the tag -into the manifest before deploying, then runs the verification block. `build` -needs docker, so it runs on whoever's machine has it (deliberately not the agent -VM); `verify`, `volume` and `pin`/`deploy` need only `CLOUDRON_TOKEN`. -`./release.sh verify` is safe to run any time. +into the manifest before deploying, then runs the verification block. Builds are +remote (the registry's BuildKit does the work), so the only requirement is a +registry login on the host running the command; `verify`, `volume` and +`pin`/`deploy` need only `CLOUDRON_TOKEN`. `./release.sh verify` is safe to run +any time. If `build` reports no registry login, it prints both ways to bootstrap +one (a narrow app password scoped to the registry app, or the CLI device flow). Rollback: repoint `CloudronManifest.json.dockerImage` to the previous tag (every build is tagged `20261019-`; the base image diff --git a/release.sh b/release.sh index 8266764..4b63cac 100755 --- a/release.sh +++ b/release.sh @@ -39,9 +39,28 @@ cr() { cloudron --server "$SERVER" --token "$CLOUDRON_TOKEN" "$@"; } manifest_tag() { python3 -c "import json;print(json.load(open('$MANIFEST'))['dockerImage'].rsplit(':',1)[-1])"; } cmd_build() { - command -v docker >/dev/null || die "no docker on this host — builds run where docker + the registry login live, not on the agent VM" + # Builds are REMOTE: the CLI uploads the build context and the registry's + # BuildKit does the work (no docker on the caller). What is required is a + # registry login for this user on this host — see the check below. local tag="${TAG:-$(date -u +%Y%m%d)-$(git rev-parse --short HEAD)}" [ -z "$(git status --porcelain)" ] || die "working tree is dirty — commit first, the tag carries the git sha" + if ! cloudron builder info >/dev/null 2>&1; then + die "no registry build config on this host (this is the only blocker to ./release.sh build)" + fi + if grep -qi "not logged in" <<<"$(cloudron builder info 2>&1 || true)"; then + cat >&2 <<'MSG' +release.sh: this host has no registry login, so it cannot start a remote build. + Bootstrap it one of two ways: + a) narrow: in the Cloudron dashboard, mint an app password for registry-bot + scoped to the registry app (c257ba3c-6737-4375-ad51-ea19586bf3f0), put it on + this host, then write into ~/.cloudron.json: + {"builder": {"kind":"registry","type":"remote","url":"https://registry.inference.coop", + "username":"registry-bot","token":""}} + b) broad: `cloudron login my.inference.coop` (device flow — a human with + dashboard access confirms a code), then `cloudron builder login`. +MSG + exit 1 + fi printf 'building %s:%s (base %s)\n' "$REGISTRY_REPO" "$tag" "$BASE_IMAGE" cloudron builder build --no-cache --repository "$REGISTRY_REPO" --tag "$tag" || die "build failed" printf '\nbuilt tag: %s\nnext: ./release.sh pin %s\n' "$tag" "$tag"