~ knotless Search/
↑↓ move↵ open⇧↵ all results

socialweb.computer/socialweb-computer-kcp

socialweb.computer: a compute market on atproto (kcp)

1 collaborator
0
0

plan 0040 step 2: hand builds only to local/<sha>/; 0020 build A from its own prefix

Merged johnandersen777.bsky.social asked to merge into main from socialweb.computer/socialweb-computer-kcp:step-2
docs/ci-debug.md+3−3
@@ -95,7 +95,7 @@ scripts/swc-heavy.sh scripts/ci-release.sh binaries
( set -a; . "$CI_BUCKET_CREDS"; set +a
scripts/swc-heavy.sh scripts/ci-release.sh test-host # builds and publishes tests/<tree>/, meshd/<tree>/ when absent
scripts/ci-release.sh stage
scripts/ci-release.sh publish # main/<sha>/ only; never main/latest/ by hand
scripts/ci-release.sh publish # local/<sha>/ only (main/<sha>/ is main's CI's)
scripts/ci-release.sh verify )
# 2. test, by hand: the steps of test.yml (the account through its associated requester)
@@ -118,7 +118,7 @@ Differences from CI, and only these:
| account | r2, the CI VM's guest requester (root runs it with `runuser`) | `CI_ACCOUNT` through its associated host requester: no sign-in per run |
| paths | /home/r2, /usr/local/bin, /work/runs, /root | `CI_HOME` |
| artifacts | `KNOTLESS_ARTIFACTS_URL` | the bucket |
| publish | main/<sha>/ and main/latest/ | main/<sha>/ only |
| publish | main/<sha>/ and main/latest/ | local/<sha>/ only (requester spec `local:<sha>`) |
| platforms | linux/amd64, linux/arm64 | `CI_PLATFORMS` |
| freeze TTL | 1800 s on main | `CI_FREEZE_TTL=7200`, ended by hand (SIGTERM) when debugging is done |
@@ -190,7 +190,7 @@ tar -czf - tests/compositions tests/targets tests/modules/*/module.json tests/mo
# processes keep the old file). Only the atproto VM's binary: it is the requester under test and writes guests' user_data
C=$(git rev-parse HEAD); scripts/swc-heavy.sh scripts/build-socialweb-computer.sh --commit $C --platform linux/amd64
P=~/.tmp/ci-hand/pub-$C; mkdir -p $P; cp ~/.tmp/socialweb-computer-build/release/$C/socialweb-computer-linux-amd64 $P/socialweb-computer
(cd $P && sha256sum socialweb-computer > SHA256SUMS); T=hand/$C
(cd $P && sha256sum socialweb-computer > SHA256SUMS); T=local/$C/fix
(set -a; . ~/.spaces_swc_kcp_source; set +a; deno run -A --no-lock scripts/publish-spaces.ts --dir $P --prefix $T)
on atproto "B=/home/stg/stg/socialweb-computer-linux-amd64; curl -fsSo \$B.new https://socialweb-computer-kcp.sfo3.digitaloceanspaces.com/$T/socialweb-computer \
&& echo '$(cut -d' ' -f1 $P/SHA256SUMS) '\$B.new | sha256sum -c --quiet && chmod 0755 \$B.new && chown stg:stg \$B.new && mv \$B.new \$B"
scripts/ci-release.sh+4−2
@@ -154,7 +154,8 @@ step_publish() {
case "$ref" in
refs/tags/*) set -- --to "releases/${ref#refs/tags/}" ;;
refs/heads/main) set -- --to "main/$sha" --to main/latest ;;
*) set -- --to "main/$sha" ;;
# by hand (no CI ref): local/<sha>/ only; main/<sha>/ is main's CI's, so promote never releases a hand build
*) set -- --to "local/$sha" ;;
esac
deno run -A --no-lock scripts/copy-spaces.ts --from "staging/$sha" "$@"
}
@@ -163,7 +164,8 @@ step_verify() {
local at d sum name pin f want size probe
case "$ref" in
refs/tags/*) at="releases/${ref#refs/tags/}" ;;
*) at="main/$sha" ;;
refs/heads/main) at="main/$sha" ;;
*) at="local/$sha" ;;
esac
d="$(mktemp -d)"
curl -sSf -o "$d/STAGED" "$base/staging/$sha/binaries/SHA256SUMS"
scripts/ci-staging-binary.sh+14−0
@@ -28,6 +28,20 @@ if curl -fsI -o /dev/null "$base/main/$sha/binaries/SHA256SUMS"; then
echo "requester $(cat "$spec")"
exit 0
fi
# by hand (no CI run): the hand build of this commit, local/<sha>/ (scripts/ci-release.sh publish with no CI ref)
if [ -z "${KNOTLESS_RUN_REF:-}" ] && curl -fsI -o /dev/null "$base/local/$sha/binaries/SHA256SUMS"; then
echo "binary: local/$sha (a hand build)"
tmp=$(mktemp -d)
curl -fsSL --retry 3 -o "$tmp/$bin" "$base/local/$sha/binaries/$bin"
curl -fsSL --retry 3 "$base/local/$sha/binaries/SHA256SUMS" | grep " $bin\$" > "$tmp/SUMS"
(cd "$tmp" && sha256sum -c --quiet SUMS)
install -D -m 0755 "${own[@]}" "$tmp/$bin" "$out"
rm -rf "$tmp"
echo "local:$sha" > "$spec"
"$out" version | sed -n 1p
echo "requester $(cat "$spec")"
exit 0
fi
ref=
if [ -n "${KNOTLESS_ARTIFACTS_URL:-}" ]; then
ref=$(curl -sf -H "Authorization: Bearer $KNOTLESS_ARTIFACTS_TOKEN" "$KNOTLESS_ARTIFACTS_URL?workflow=release&name=oci/binary.ref" || true)
tests/modules/acc-0020/src/lib.rs+9−5
@@ -88,9 +88,6 @@ fn run_0020(run: Run<Value>) -> Result<Handle, String> {
Err(_) if id == "hb" => Value::Null,
Err(f) => return Ok(f),
};
if id == "ma" && o["exit"] == 7 {
return Ok(s.skip("the installed build has no main/<commit> binary in the bucket (a branch build)"));
}
if o.get("exit").is_some_and(|e| e != 0) {
return Ok(s.fail(format!("{id}: exit {} {}", o["exit"], o["stderr"])));
}
@@ -118,11 +115,18 @@ fn run_0020(run: Run<Value>) -> Result<Handle, String> {
_ => builds[1]["version"].as_str().unwrap_or_default(),
};
if s.is("up") && !running.is_empty() {
let commit = o["value"]["version"]["commit"].as_str().unwrap_or_default().to_string();
let spec = args["requester"].as_str().unwrap_or_default();
let a = match spec.split_once(':') {
Some(("sha", c)) => format!("main/{c}"),
Some(("local", c)) => format!("local/{c}"),
Some(("release", t)) => format!("releases/{t}"),
_ => return Ok(s.fail(format!("build A is the installed build's own bucket prefix: requester {spec:?} has none (sha:, local:, release:)"))),
};
let b = args["b"].as_str().unwrap_or(DEFAULT_B).trim_matches('/').to_string();
s.reading("installed_version", json!(running));
s.reading("build_a", json!(a));
s.set("measure");
let urls = [format!("{BUCKET}/main/{commit}/binaries/socialweb-computer-linux-amd64"), format!("{BUCKET}/{b}/binaries/socialweb-computer-linux-amd64")];
let urls = [format!("{BUCKET}/{a}/binaries/socialweb-computer-linux-amd64"), format!("{BUCKET}/{b}/binaries/socialweb-computer-linux-amd64")];
s.st["urls"] = json!(urls);
h = h.call(root("ma", measure(&urls[0], 0))).call(root("mb", measure(&urls[1], 1)));
return Ok(s.keep(h));
.plans.yaml+2−2
@@ -30,5 +30,5 @@ plans:
now: "not started"
log: "none yet"
waits_on: "step 17"
status: "steps 0, 1 done (promote asked-only; promote.sh --dry-run rehearsed on the release image on main de0b91ee); prod on rc174; no stable"
next: "step 2 (hand builds to local/, 0020 from its own prefix)"
status: "steps 0-2 done (promote asked-only; promote.sh --dry-run rehearsed on the release image on main de0b91ee; hand builds to local/, rehearsed: publish+verify local/de0b91ee, ci-staging-binary local:); prod on rc174; no stable"
next: "step 3 (AGENTS.md: CI table, pipeline as the Flow, landing rule, test as it runs, plans rules, old step refs, dead 0010 links)"