~ 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 steps 4-5 and fixes: exposure handler race, first-start network restart, 0020 build A

Merged johnandersen777.bsky.social asked to merge into main from socialweb.computer/socialweb-computer-kcp:batch-step4-5
cmd/socialweb-computer/bidder.go+1−1
@@ -599,7 +599,7 @@ func (r *bidderRun) standalone(ctx context.Context) int {
vmHandle = ""
}
vals := r.vals.With("instance", instance).With("profile", bootstrap.ProfileQuick).With("handle", vmHandle).With(appRoleOpt, table.RoleBidder)
if spec.Network != nil && r.profile == marketbidder.BidderProfileNetwork {
if spec.Network != nil {
raw, err := json.Marshal(spec.Network)
if err != nil {
return r.a.fail(exitFailed, "run bidder: the network value: %v", err)
deploy/release/rc-operators.json+1−2
@@ -1,7 +1,6 @@
{
"operators": [
{ "handle": "bobvmbuilder.bsky.social", "bidders": ["did:plc:2l2wdry77c7jtucbslstagkj", "did:plc:4vcig7s43z3nyqrnepmcfzqt", "did:plc:7fj5jk5jxadrqtc5txp7xitp"] },
{ "handle": "johnandersen777.bsky.social", "bidders": ["did:plc:7q5lnitxv4meizdon5fmhzrq"] }
{ "handle": "bobvmbuilder.bsky.social", "bidders": ["did:plc:2l2wdry77c7jtucbslstagkj", "did:plc:4vcig7s43z3nyqrnepmcfzqt", "did:plc:7fj5jk5jxadrqtc5txp7xitp", "did:plc:kmccrdloxyziyhvga37tdg67"] }
],
"updateWithin": "10m"
}
docs/plans/0040-release-pipeline.md+44−5
@@ -73,9 +73,10 @@ rc169 (seeded) to rc175 written, channel `rc` -> rc174 (whose promote was cancel
## Operators
`deploy/release/rc-operators.json`: bob's `did:plc:2l2wdry77c7jtucbslstagkj` (hat-8), `did:plc:4vcig7s43z3nyqrnepmcfzqt`
(hat-9), `did:plc:7fj5jk5jxadrqtc5txp7xitp` (hat-10); john's `did:plc:7q5lnitxv4meizdon5fmhzrq` (hat-7), per
`tests/targets/prod.json` (which lacks hat-10).
`deploy/release/rc-operators.json` and `tests/targets/prod.json` list the same four, all bob's (`agent-of`
`did:plc:ocnuqjlzgohypj3zoznermms`): hat-8 `did:plc:2l2wdry77c7jtucbslstagkj`, hat-9 `did:plc:4vcig7s43z3nyqrnepmcfzqt`,
hat-10 `did:plc:7fj5jk5jxadrqtc5txp7xitp`, hat-7 `did:plc:kmccrdloxyziyhvga37tdg67` (installed 2026-11-17; john's
`did:plc:7q5lnitxv4meizdon5fmhzrq` on hat-7 is suspended, its unit disabled, its state kept).
## Entries
@@ -240,8 +241,8 @@ Phase 4, then the rolls:
and publishing libs and compositions.
19. kcp docs and examples, the same standard, for every mode: prod, rc and dev builds, foreground and systemd, bidder,
requester, gateway, the release channels and self-update.
20. One pins source: socialweb.computer's `com.fedfork.exec.pins/atlibs` is a copy of johnandersen777's (the runner takes a
binding's pins only from its owner), so a republish moves john's alone; the pin cascade writes both.
20. One pins source: `scripts/publish-chain.sh` (requester repo) writes john's, alice's and socialweb.computer's
`com.fedfork.exec.pins/atlibs` from one pin set (seen 2026-11-17, step 5); check the three records equal after a publish.
21. Two consecutive green CI rolls (Done when 3), the last step.
## Owner decisions
@@ -298,4 +299,42 @@ Each: what was seen (with the log), the cause, the fix, its proof.
client's 60 s (`policytest.DefaultTimeout`); 342d1bea changed no Go (1 of the last 12 releases). Fix: the harness
default 3 min (the hang tests set their own 2 s; the package's 15 min bounds a real hang). Proof: pending (the next
releases' checks).
- main de0b91ee `test` failed 0006:run and 0008:run (2026-11-17; artifacts `runs/staging-composition-1794946921772/
failure.json`, `knotless-ci run artifacts ... --workflow test --commit de0b91ee`): staging bidder b2 logged one startup
ERROR 27 s after its start, `Reconciler error: the target HTTP handler is not registered`. Cause: the Exposure
controller finds the target's handler, then `Publish` -> `startLocal` looks it up again; the handler gone in between
(the component re-registering at start) came back as a plain error, logged at ERROR and retried. Fix: the sentinel
`exposure.ErrHandlerMissing`; the controller answers it as it does its own first check (Pending, `HandlerMissing`, no
error; the handler's registration re-triggers it). Proof: pending (a staging run with 0006 and 0008 green and no such
line in a bidder's first 10 min).
- main 5f57d6e5 `release` ended `error`: no bidder had a 12-vCPU slot (hat-8 held two build VMs of earlier pushes, hat-7
suspended for step 4): five landings in 30 min. Landings are batched, one per step, when CI is idle.
- The hat-10 entry of `tests/targets/prod.json` (step 4) landed inside 6b5d381a (the policytest timeout commit) by a
`commit -a` with the edit uncommitted in the tree; its content is right (hat-10's kcp read over ssh first).
- hat-7's new bob bidder logged 4 startup ERROR lines at its first start (2026-11-17 13:42:57 PST, its unit's
journal): `Timeout: failed waiting for *v1alpha1.Plc Informer to sync` and the same for `PolicyEngine`. Cause: a
fresh install's core starts without its network value (`run bidder` passed `core-network` only for profile
`market-network`; `CoreConfig.record` never set it), the root apply then brings one (the public PLC default),
`superviseCore` (`internal/devcore`) restarts the component controller manager 2.5 s in, and the cluster engagements
in flight are cancelled: controller-runtime reports the cancelled wait as a Timeout. Later starts read the same
value from the root and do not restart. Fix: `run bidder` passes the spec's network for every profile, and
`CoreConfig.record` carries it. Proof (hat-8, a fresh state dir, `run bidder --profile dev-local --fg`, core.log):
rc174: 1 "network value changed", 6 ERROR; the fix: 0 and 0 (`~/.tmp/probe-before`, `~/.tmp/probe-after2`). hat-7's
running process still holds its 4 lines until its next restart (the next rc).
- `install bidder --handle` without `--bidder-operator-signin` left hat-7's bidder unassociated (its DID claimed bob's
handle); fixed by hand per `docs/bidder.md` "Association" (`identity agent-of add --drop-borrowed-handle`,
`scripts/associate-bidder.ts`): `internal association` roots = bob.
- main 6b5d381a `test`: 16 of 17 passed, 0020:run failed (2026-11-17, the run's log): "build A is the installed
build's own bucket prefix: requester \"path:/home/stg/stg/...\" has none". Cause: step 2 took build A's prefix from
the target's requester spec; inside the staging network the entry's target names the requester by `path:`. The
first guess was not checked against the inner target. Fix: build A is the heartbeat's commit, tried at
`main/<commit>/` then `local/<commit>/` (the first that downloads; neither: FAIL). Proof: pending (the next CI test).
- Step 5 (2026-11-17): `scripts/publish-chain.sh --land` (requester repo 45211c5, atlibs f39c7a7) published requester,
cicd-workload, release-workload and the compositions cicd, release and vm-mcp, and wrote the pins records of john,
alice AND socialweb.computer (verified): CI's bindings resolve the new requester from then on, before any CI run
rehearsed it (the script's header names only john's and alice's record; its body was not read first). Step 20's one
pin source is what the chain already does. Proof of the new requester in CI: pending (the next `release` and `test`).
The chain left `socialweb-computer-vm-mcp.composition.json` on the old requester pin (compose.test failed): the chain
now rebuilds and publishes it (not in pins.json). The requester repo's tests: 510, 0 fail (with the README's
atlibs-agents sibling).
- `scripts/ci-hand-market.sh` uses sudo on the bidder hosts (sudo on the hats is allowed by the owner).
internal/controllers/exposure/controller.go+9−1
@@ -280,7 +280,11 @@ func (c *Controller) Reconcile(ctx context.Context, req ctlruntime.Request, obje
status.Endpoint = ""
reason := "Pending"
var retry error
registered := true
switch {
case errors.Is(err, exposure.ErrHandlerMissing):
reason = "HandlerMissing"
registered = false
case errors.Is(err, exposure.ErrStableHostMismatch):
reason = "StableHostMismatch"
status.Phase = exposurev1alpha1.ExposureFailed
@@ -289,7 +293,11 @@ func (c *Controller) Reconcile(ctx context.Context, req ctlruntime.Request, obje
default:
retry = err
}
conds.Set(&status.Conditions, generation, ConditionHandlerRegistered, true, "HandlerRegistered", "the target handler is registered")
if registered {
conds.Set(&status.Conditions, generation, ConditionHandlerRegistered, true, "HandlerRegistered", "the target handler is registered")
} else {
conds.Set(&status.Conditions, generation, ConditionHandlerRegistered, false, reason, err.Error())
}
conds.Set(&status.Conditions, generation, ConditionReady, false, reason, err.Error())
return ctlruntime.Result{}, errors.Join(retry, c.apply(ctx, req, object, status, nil))
}
internal/exposure/exposure.go+1−1
@@ -307,7 +307,7 @@ func (p *Publisher) startLocal(ctx context.Context, b Binding) (*publication, er
case component.ProtocolHTTP, component.ProtocolWS:
if _, ok := p.handlers.Handler(target, b.Service.Handler); !ok {
_ = listener.Close()
return nil, errors.New("the target HTTP handler is not registered")
return nil, ErrHandlerMissing
}
name := HandlerName(b.Service.Handler)
current := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
internal/exposure/service.go+2−0
@@ -15,6 +15,8 @@ import (
var ErrUnknownProtocol = errors.New("unknown protocol")
var ErrHandlerMissing = errors.New("the target HTTP handler is not registered")
func Target(ref commonv1.ObjectRef, workspace string) (component.Key, error) {
kind := strings.TrimSpace(ref.Kind)
name := strings.TrimSpace(ref.Name)
internal/stack/bidder/core.go+9−0
@@ -2,6 +2,7 @@ package bidder
import (
"context"
"encoding/json"
"fmt"
"log/slog"
"maps"
@@ -83,6 +84,14 @@ func (c CoreConfig) record(l devinstance.Layout) (devinstance.Record, error) {
exes[name] = e
}
vm := c.VM
rec.Network = nil
if c.Spec.Network != nil {
raw, err := json.Marshal(c.Spec.Network)
if err != nil {
return rec, err
}
rec.Network = raw
}
rec.Layout, rec.Profile, rec.Backend, rec.Executables = l, bootstrap.ProfileQuick, hostsvc.BackendSystemdUser, exes
rec.BaseWorkspace, rec.Host, rec.Parent, rec.StandIns, rec.OpenBao, rec.VM = "", false, nil, nil, nil, &vm
return rec, nil
tests/modules/acc-0020/src/lib.rs+10−16
@@ -18,8 +18,9 @@ const AGENT: &str = "journalctl _UID=$(id -u swc-bidder) --no-pager -o cat | gre
const BUCKET: &str = "https://socialweb-computer-kcp.sfo3.digitaloceanspaces.com";
const DEFAULT_B: &str = "main/bce9465bade6221988f5fce9d14301948b957143";
fn measure(url: &str, n: usize) -> String {
format!("f=/root/swc-0020-{n}; curl -fsSL -o $f {url} || exit 7; chmod 0755 $f; printf '%s %s %s\\n' $(sha256sum $f | cut -d' ' -f1) $(stat -c %s $f) $($f version | sed -n 1p | cut -d' ' -f2); rm -f $f")
/// On the host: the first of `urls` that downloads, as `<sha256> <size> <version> <url>`; exit 7 when none does.
fn measure(urls: &[String], n: usize) -> String {
format!("f=/root/swc-0020-{n}; u=; for c in {}; do if curl -fsSL -o $f $c; then u=$c; break; fi; done; [ -n \"$u\" ] || exit 7; chmod 0755 $f; printf '%s %s %s %s\\n' $(sha256sum $f | cut -d' ' -f1) $(stat -c %s $f) $($f version | sed -n 1p | cut -d' ' -f2) $u; rm -f $f", urls.join(" "))
}
fn cid_of(sha256: &str) -> Option<String> {
@@ -115,20 +116,13 @@ 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 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 commit = o["value"]["version"]["commit"].as_str().unwrap_or_default().to_string();
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}/{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)));
let name = "binaries/socialweb-computer-linux-amd64";
let a = [format!("{BUCKET}/main/{commit}/{name}"), format!("{BUCKET}/local/{commit}/{name}")];
h = h.call(root("ma", measure(&a, 0))).call(root("mb", measure(&[format!("{BUCKET}/{b}/{name}")], 1)));
return Ok(s.keep(h));
}
if running.is_empty() || (!want.is_empty() && running != want) {
@@ -152,10 +146,10 @@ fn run_0020(run: Run<Value>) -> Result<Handle, String> {
"ma" | "mb" => {
let k = if id == "ma" { 0 } else { 1 };
let f: Vec<String> = o["stdout"].as_str().unwrap_or_default().split_whitespace().map(String::from).collect();
if f.len() < 3 {
return Ok(s.fail(format!("{id}: no sha256/size/version: {}", o["stdout"])));
if f.len() < 4 {
return Ok(s.fail(format!("{id}: no sha256/size/version/url: {}", o["stdout"])));
}
s.st[format!("b{k}")] = json!({ "url": s.st["urls"][k], "sha256": f[0], "size": f[1].parse::<u64>().unwrap_or(0), "version": f[2] });
s.st[format!("b{k}")] = json!({ "url": f[3], "sha256": f[0], "size": f[1].parse::<u64>().unwrap_or(0), "version": f[2] });
if s.st["b0"].is_object() && s.st["b1"].is_object() {
s.st["builds"] = json!([s.st["b0"].clone(), s.st["b1"].clone()]);
s.reading("builds", s.st["builds"].clone());
tests/targets/prod.json+2−2
@@ -18,8 +18,8 @@
"bidders": [
{
"name": "hat-7",
"did": "did:plc:7q5lnitxv4meizdon5fmhzrq",
"operator": "did:plc:5svqtrhheairglgiiyvutzik",
"did": "did:plc:kmccrdloxyziyhvga37tdg67",
"operator": "did:plc:ocnuqjlzgohypj3zoznermms",
"kcp": {
"kubeconfig": "~/.config/swc-system-tests/kcp/hat-7.kubeconfig",
"via": {
.plans.yaml+2−2
@@ -30,5 +30,5 @@ plans:
now: "not started"
log: "none yet"
waits_on: "step 17"
status: "steps 0-3 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 4 (hat-7 bidder as bob; rc-operators.json and tests/targets/prod.json the same four, hat-10 added)"
status: "steps 0-5 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: "land the batch (exposure, informer, 0020 fixes; step 4), then phase 2 step 6 (no SKIP) on one branch with hand cycles"