0
0
plan 0040 step 5, plan 0046 step 6, findings 84-87
cmd/socialweb-computer/dev.go+3−3
| @@ -263,7 +263,7 @@ func startOrAdoptDevsup(ctx context.Context, a *app, l devinstance.Layout, exe s | ||
if err := os.MkdirAll(l.SupState, 0o700); err != nil { | ||
return nil, devinstance.Devsup{}, err | ||
} | ||
argv := []string{exe, "internal", "devsup", "--state", l.SupState, "--socket", l.Socket, "--instance", l.ID} | ||
argv := []string{exe, "internal", "devsup", "--state", l.SupState, "--socket", l.Socket, "--instance", devinstance.ProcessTag(l)} | ||
if dieWith != 0 { | ||
argv = append(argv, "--die-with", strconv.Itoa(dieWith)) | ||
} | ||
| @@ -880,14 +880,14 @@ func downInstance(ctx context.Context, a *app, l devinstance.Layout, keepState, | ||
r.Swept = rep | ||
} | ||
} | ||
if pids := devsup.KillInstance(l.ID); len(pids) > 0 { | ||
if pids := devsup.KillInstance(devinstance.ProcessTag(l)); len(pids) > 0 { | ||
r.LeftoverKilled = pids | ||
} | ||
if pids := marketnetwork.KillUnder(l.StateDir, 5*time.Second); len(pids) > 0 { | ||
r.LeftoverKilled = append(r.LeftoverKilled, pids...) | ||
} | ||
awaitExit(r.LeftoverKilled, 100*time.Millisecond) | ||
if left := devsup.InstanceProcesses(l.ID); len(left) > 0 { | ||
if left := devsup.InstanceProcesses(devinstance.ProcessTag(l)); len(left) > 0 { | ||
r.Remaining = left | ||
} | ||
if len(r.Remaining) > 0 && retainOnLeftover { | ||
docs/acceptance/0012-infra-quickstart.md+3−0
| @@ -76,6 +76,9 @@ sequenceDiagram | ||
| ||
## Steps | ||
| ||
The composition starts its `run requester` with `-- --bidder-dids <the target's bidders>` (plan 0040 step 5): the list | ||
filters discovery for every rental, a `--with-gateway` node's too; on a market network the network sets them. | ||
| ||
Run every command as `test-0001` (`sudo -n -u test-0001 env HOME=/home/test-0001 XDG_RUNTIME_DIR=/run/user/$(id -u test-0001) ...`). | ||
`k <ws> ...` is the helper of quickstart-local section 3. | ||
| ||
docs/acceptance/0013-mixed-prod.md+3−0
| @@ -88,6 +88,9 @@ sequenceDiagram | ||
| ||
## Steps | ||
| ||
The composition starts its `run requester` with `-- --bidder-dids <the target's bidders>` (plan 0040 step 5): the list | ||
filters discovery for every rental, a `--with-gateway` node's too; on a market network the network sets them. | ||
| ||
`ST` is a NEW owner-only state dir for each run (`ST=~/.tmp/acc13-$(date +%s); mkdir "$ST"; chmod 700 "$ST"`): a | ||
`run requester --name mp` on an existing dir resumes that dir's requester with its old account and session (it logs | ||
`run requester resumes an existing requester`), never a new sign-in. Write each vouch at least 5 | ||
docs/acceptance/0017-owner-release.md+4−1
| @@ -10,7 +10,7 @@ takes the invocation over when the owner exits before the release settled). | ||
| ||
- Code: `cmd/socialweb-computer/request.go` (`carryOn`, `followRelease`, `releaseForOwner`, `runRequestRelease`), | ||
`internal/stack/request/owner.go` | ||
- Test: `tests/compositions/0017` (module `tests/modules/acc-0017`), entries `run`, `killed`, `killedlate`, `half` and `devsup`; prod and staging (they | ||
- Test: `tests/compositions/0017` (module `tests/modules/acc-0017`), entries `run`, `killed`, `killedlate`, `half`, `devsup` and `samename`; prod and staging (they | ||
touch only their own invocation and VM: one 1-vCPU VM each; the owner process is local) | ||
- Last pass: see Evidence | ||
| ||
| @@ -57,6 +57,9 @@ SWC_TARGET=$PWD/targets/prod.json cargo run -p swc-test-host -- compositions/001 | ||
long after it started (devsup keeps stopping bao, core, kcp, front, kine in order and exits) and `dev up` at once; 6 s later the kcp | ||
must answer `/readyz` 200. Every restart must succeed. It touches only its own instance on the test host (a local kcp, about 500 MB); | ||
it runs on prod and dev targets alike and skips when the binary has no `dev up` | ||
8. `samename` (plan 0046 step 6, no VM, no account): the test host runs `dev up --profile quick --instance same<n>` (proc backend) with two | ||
state dirs: both kcps answer `/readyz` 200 on two URLs; `dev down` of the first leaves the second ready. Before, the second took the | ||
first's devsup (one runtime dir per instance name, `$XDG_RUNTIME_DIR/swc/<short>`); now an instance's runtime dir is keyed by its state dir. | ||
| ||
## Evidence | ||
| ||
docs/plans/0040-release-pipeline.md+7−0
| @@ -246,6 +246,13 @@ following. | ||
The gateway's NodeClaim and Infra rentals take a bidder DID allowlist from their spec and pass it to the contract, | ||
filtered as in step 1. Prod acceptance's k8s entries (0012, 0013) name the expected bidders through it. | ||
| ||
As built: the allowlist is the requester's, not each claim's: every rental of a requester (an Infra's, a NodeClaim's) | ||
is a contract of that requester, whose `spec.bidderDids` filters discovery (step 1). The gateway's is `GatewaySpec.bidderDids` | ||
(its spec file), `run requester`'s `-- --bidder-dids` (`option-map.yaml` market-requester, with `--with-gateway` the | ||
nodes' too). 0012 and 0013 start their requester with the target's bidders (`steps::bidder_dids`, the test host's | ||
`requester.start` input `bidderDids`) on a target outside a market network (prod); a network child gets the network's | ||
bidders from the network (`run requester` refuses `--bidder-dids` there). | ||
| ||
### 6. Two compositions | ||
| ||
- `socialweb-computer-cicd`: today's VM rental. Every workflow on every branch and fork uses it. | ||
docs/plans/0044-ci-by-hand.md+4−0
| @@ -388,6 +388,10 @@ everything and exits (finding 5). If its cleanup reports errors (`cleanupErrors` | ||
| 81 | Hand run of 0020 on 347004ce: the installed bidder logs `releasefollow_on` but never sees a channel; prod's hats the same (on rc169, `rc` names rc169, no `releasefollow_seen`). Cause: the bidder's core applies its set with only the `association-watch` optional phase (`marketbidder.go` phases), so `release-channel-watch@<profile>` was never applied and no AtprotoRecordWatch `release-channel` exists. Fix: the phase is always included (a profile without it is skipped by infraSet). Plan 0040 step 4 was never live on prod before this Then the watch, made by hand, is `Failed`: `no accepted ComponentLink allows root:EventStream.../watch-release-channel-... to call root:AtprotoRecordWatch.../release-channel with events.deliver{release-channel}`: the watch sources add a deliver link only for `association` (`compose/streams.go`). Fix 2: the same link for `release-channel` | fixed | | ||
| 82 | main 6fea8416, first promote: `error` 72 s after the step began, the log empty after `==> release`; the check record: `computer.socialweb.cicd.workload.run: RELEASE_ARTIFACTS: EOF while parsing a value at line 1 column 0: ""`. Cause: release-workload ran its jobs through the cicd-workload hook, and a caller sees only a call's last result: cicd-workload streams each read as an interim result and its last (the read that says done) held no output, so the artifacts line never reached release-workload; the atlibs Rust host also shows only the root's interim results (`compose.rs` on_event for stack 1; the JS host shows every instance's: a port-parity gap, plan 0040), so promote's own output would never have reached the log either. Next, untested before: the host refuses a putRecord over a record the module did not create (rc169 and the channels were written by hand) without `anyRecords`. Fix (requester repo 8f33d81): the step loop as the crate machine-job; release-workload drives its own jobs on the process hooks, shows each read, collects the artifacts output; anyRecords for the three software.release collections; `modules/release-workload/test.mjs` (green, red, passthrough) | fixed: promote rerun on c88b4964 read the artifacts and computed rc170 | | ||
| 83 | main c88b4964, promote rerun: `manifest: release-workload may not call com.atproto.repo.putRecord with sessions release`. Cause: release-workload wrote manifests and versions with putRecord, which needs create and update; the release session (`records/release.json`) grants only create on those two collections (they are written once), update on the channels only. The module test held no write to that scope. Fix (requester repo 0fb9833): manifests and versions by createRecord, the channels by putRecord, anyRecords the channels only; test.mjs holds every write to release.json's scope (a putRecord of a version back in fails it). Read ahead: `scripts/promote.sh` restarted swc-ssh-gateway over port 22, the swc ssh gateway itself (the host's sshd is 1997, deploy.sh's SSH_PORT): it would fail after the droplets deploy and again in the rollback; now `-p ${SSH_PORT:-1997}` | fixed | | ||
| 84 | Roll 1's CI test ran long; hat-8's bidder journal (the stall rule: bidders first) showed `the provision of an accept failed` 251 times in 40 min, all one accept of john's (`3n2d5sbvf6x2v`, 2026-11-15 04:17): `finding the bid of the accept: no bid of this bidder matches`. Cause: the bidder refused that accept for capacity (409), the requester kept the record (it never deletes an accept a bidder may still act on), the accept still came in through the stream as a provision intent, and once the Bid passed its TTL the intent could never resolve; a plain error is retried for ever. Fix: no Bid for an accept (or the Bid gone) ends the intent Obsolete, logged once `bidder_accept_obsolete`. Not the long test's cause | fixed; proven when hat-8 logs it once and the failures stop | | ||
| 85 | Roll 1 (main 79a1508b) test: 0013 FAIL `not done in 75 min (phase agent)`; every other entry passed. Read on the frozen network: agent1 (bidder-2, after bidder-1 declined the first accept for capacity) got `guest.agentStart` at 08:44:52.93, 20 ms after its secrets refetch (the secretsUpdated of the agent's mesh key); no `guest.requesterDid`, no `requester_agent_identity`, for 60 min. Cause (read from the code; agent1's journal went with its release at 09:44, before the module's deadline): socialweb-guest-agent starts the identity-only guest requester R2 once, at agentStart, and gives up for good when `/run/socialweb-r2/r2-agent.env` is not mirrored yet (the mirror runs after the refetch, beside the agentStart) or the shared dir is not ready (silently). Fix: an agentStart that finds either not ready is pending, and R2 starts at the next mirror (or once the shared dir is ready). And 0013 fails 10 min after agentStart without the association and the agent identity, while agent1 is held, so its journal is in the run's logs | fixed | | ||
| 86 | Hand cycle 66c4eea7, `up` FAIL: `marketnetwork: the MarketNetwork was not Ready within 20m0s (phase Provisioning: the network's IngressProxy/http on 127.0.0.1:32922: listen tcp 127.0.0.1:32922: bind: address already in use)`. Read on the frozen atproto VM 20 min later: nothing bound 127.0.0.1:32922 (`ss -tan`), the network still Provisioning with that message. Cause: the loopback forwards' bind error (`bindForwards`) was written as status and returned no error (`p.write`), so the root never reconciled again: a moment's conflict (the controller set up again while the old one's forward still held the port, finding 30's class: APIExports served again at 10:30:27) stuck the network for good. Fix: `p.retry` (the runtime's backoff) | fixed | | ||
| 87 | Hand cycle 4c59f2fd, `bidder-2:install` FAIL `error: connection lost`. bidder-2's guest journal (first boot 10:55:58): the install session (sshd[2615], 10:56:27) closed at 10:57:33, the second the guest's `iroh.service` (dumbpipe listen-tcp in front of sshd) exited 0 with `iroh::socket: Endpoint dropped without calling Endpoint::close`, no signal, nothing else logged before it; the unit restarted it at 10:57:38. Why dumbpipe's accept loop returned is in the pinned upstream dumbpipe (open). The module failed the whole run on one dropped session: the VM install (idempotent: getent/id checks, subuid reset, apt, the binary fetched and checked again) now runs again after 10 s on `connection lost`, 3 times at most (`readings.installRetries`) | fixed (the retry); dumbpipe's exit open | | ||
| ||
## Runs | ||
| ||
docs/plans/0046-associated-host-requester.md+7−0
| @@ -41,6 +41,13 @@ associated today: | ||
renames every existing requester's units: an upgrade must stop the old-named units of that state dir first (the | ||
invocation's `requester.json` names its kcp), with no dual naming. Not before the push triggers: one `stg` requester per | ||
host until then. | ||
As built: two parts, both keyed by the instance's state dir. (a) A dev instance's runtime dir (its devsup socket) is | ||
`<runtime root>/<RuntimeKey(state dir)>` (`devinstance.NewLayout`), and its devsup's process tag (`SWC_INSTANCE`, what | ||
`dev down` kills by) is `ProcessTag` = ID plus that key: before, two instances of one name shared the devsup socket | ||
(the second adopted the first's units) and a `dev down` of one killed the other's processes. Unit names (`Short`) stay | ||
by ID. (b) An installed requester's key and layout ID hash `RequesterInstanceDir(state, name)`. No code migration (no | ||
backcompat): a running dev instance is stopped before the binary that moves its socket runs it (hat-8's hand | ||
requesters). Testcase: composition 0017 entry `samename` (fails on a529874b, passes on a44c4af8). | ||
| ||
## Order | ||
| ||
internal/app/marketnetwork/marketnetwork.go+1−1
| @@ -398,7 +398,7 @@ func (p *pass) reconcile(ctx context.Context) (ctlruntime.Result, error) { | ||
} | ||
published.Ingress = netIngress | ||
if err := ctl.bindForwards(snap, leases, o.Spec.BindAddress); err != nil { | ||
return p.write(v1alpha1.ApplicationPhaseProvisioning, err.Error()) | ||
return p.retry(v1alpha1.ApplicationPhaseProvisioning, "", err) | ||
} | ||
bound := boundValue(published, leases, o.Spec.BindAddress) | ||
p.st.Network = &bound | ||
internal/devinstance/devinstance.go+5−1
| @@ -100,6 +100,10 @@ func ID(name, cwd string, env Env) (string, error) { | ||
| ||
func Short(id string) string { return hash8("swc-instance:" + id) } | ||
| ||
func RuntimeKey(stateDir string) string { return hash8("swc-runtime:" + filepath.Clean(stateDir)) } | ||
| ||
func ProcessTag(l Layout) string { return l.ID + "-" + RuntimeKey(l.StateDir) } | ||
| ||
func StateRoot(option string, env Env) (string, error) { | ||
if option != "" { | ||
return filepath.Abs(option) | ||
| @@ -147,7 +151,7 @@ type Layout struct { | ||
func NewLayout(id, stateRoot, runtimeRoot string) (Layout, error) { | ||
short := Short(id) | ||
state := filepath.Join(DevRoot(stateRoot), id) | ||
rt := filepath.Join(runtimeRoot, short) | ||
rt := filepath.Join(runtimeRoot, RuntimeKey(state)) | ||
l := Layout{ | ||
ID: id, Short: short, StateDir: state, RuntimeDir: rt, | ||
Socket: filepath.Join(rt, "sup.sock"), | ||
internal/guestagent/agent.go+2−0
| @@ -60,6 +60,8 @@ type Agent struct { | ||
sharedGID int | ||
| ||
shared bool | ||
| ||
identityPending int64 | ||
} | ||
| ||
func New(cfg Config, log *slog.Logger) (*Agent, error) { | ||