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

socialweb.computer/socialweb-computer-kcp

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

1 collaborator
0
0

roll-one set: promote on push with the stable copy, john as third prod driver, the orphan guest-requester VM fix

Merged johnandersen777.bsky.social asked to merge into main from socialweb.computer/socialweb-computer-kcp:phase-2
.knotless/workflows/promote.yml+20−8
@@ -1,16 +1,18 @@
# knotless CI: plan 0040's promote, the release of main, alongside its staging test (plan 0040 decision 28: prod gets the
# build before staging has passed it; a roll is green only when both `test` and this are). Runs only when asked until plan 0040 step 15 (its push
# trigger, with paths internal/**, cmd/**, api/**, tests/**, rust/**, deploy/**, scripts/**, go.mod, go.sum, .knotless/**,
# comes back then). After `release` (`after: [release]`: filed without running when release failed or was cancelled; it
# does not wait for `test`, and `test` does not cancel it: `superseded` is only about a newer commit's run), on the `release`
# knotless CI: plan 0040's promote, the release of main, alongside its staging shares (plan 0040 decision 28: prod gets the
# build before staging has passed it; a roll is green only when every test-N and this are). On a push to main that changes
# code (the same paths as test-1 to test-4, so a push that skips one skips both; plan 0040 step 15), and when asked.
# After `release` (`after: [release]`: filed without running when release failed or was cancelled; it does not wait for
# the test-N workflows, and they do not cancel it: `superseded` is only about a newer commit's run), on the `release`
# executor binding (only main's names socialweb-computer-release, whose
# release-workload module holds the socialweb.computer session with the software.release.* scopes; the binding asks for
# no guest requester: the gate signs in as bob and alice, and `promote.sh prepare` exits 1 on a VM that has one and makes
# no guest requester: the gate signs in as bob, alice and john, and `promote.sh prepare` exits 1 on a VM that has one and makes
# the gate's unix user r2): its one step is
# `release <command>`: the module writes the rc's manifest and version and moves channel rc, runs the command on the VM
# with RELEASE_VERSION (the rc), RELEASE_STABLE_VERSION (the stable vT a green writes), RELEASE_URL and RELEASE_SHA256
# (scripts/promote.sh: the prod target, the droplets, the rc operators' heartbeats, the prod gate: every `both` entry of
# tests/entries.txt as prod bob and alice, then the wait for this commit's `test` check: exit 0 only when test is green
# too, so stable never moves on a commit whose staging test is red), then moves stable on exit 0, or moves rc back and runs
# tests/entries.txt as prod bob, alice and john, then the wait for this commit's test-1 to test-4 checks, so stable never moves
# on a commit whose staging gate is red, then the copy of main/<sha>/ to releases/vT/ in the bucket, checked from its
# public URLs: exit 0 only when all of it is green), then moves stable on exit 0, or moves rc back and runs
# `scripts/promote.sh rollback`.
# A cancel or a timeout drops that step mid-run, so `stop` (run after the step, whatever it came to, with the step's env
# and secrets) is the module's `release-rollback`: when this commit's rc is still on channel rc and not stable, rc goes
@@ -28,12 +30,19 @@
# PROD_ALICE_ATPROTO_PASSWORD aliceoa.bsky.social's main password, one line (not an app password: the OAuth sign-ins
# type it). The handle is tests/targets/prod.json's
# PROD_BOB_ATPROTO_PASSWORD bobvmbuilder.bsky.social's main password, one line
# PROD_JOHN_ATPROTO_PASSWORD johnandersen777.bsky.social's main password, one line (owner, 2026-11-18: a third driver)
# PROD_OPS_READ_SECRET the shared secret of the read-only ops routes (GET /xrpc/com.fedfork.exec.ops.*) of
# every prod bidder and the ssh gateway, one line: each host holds the same value in its
# ops-read-secret file (0600; `install bidder --ops-read-secret-file`, docs/SYSTEM.md)
# SPACES_ACCESS_KEY_ID the bucket key (release's, the same two values): the copy of main/<sha>/ to releases/vT/
# SPACES_SECRET_ACCESS_KEY only; scripts/promote.sh takes them out of the environment at its start and gives them
# to scripts/copy-spaces.ts alone
# The release VM reaches no bidder host and holds no kubeconfig (owner, 2026-11-18): the gate's operator-side reads go
# through each bidder's and the ssh gateway's read-only ops routes; the bidders are discovered (scripts/ci-prod-target.sh).
on:
push:
refs: [refs/heads/main]
paths: [internal/**, cmd/**, api/**, tests/**, rust/**, deploy/**, scripts/**, lexicons/**, hack/**, did-key-associator/**, typescript-helpers/**, go.mod, go.sum, Makefile, .knotless/**]
asked:
refs: [refs/heads/main]
runners: [aliceoa.bsky.social]
@@ -45,7 +54,10 @@ secrets:
- ATIRC_AGENT_CONFIG
- PROD_ALICE_ATPROTO_PASSWORD
- PROD_BOB_ATPROTO_PASSWORD
- PROD_JOHN_ATPROTO_PASSWORD
- PROD_OPS_READ_SECRET
- SPACES_ACCESS_KEY_ID
- SPACES_SECRET_ACCESS_KEY
# the prod gate's run dumps (failure, state, redacted logs: no secret), kept passed or failed; the gate's own dir (iroh keys) is not
artifacts: [gate-runs]
stop: release-rollback
.knotless/workflows/release.yml+17−16
@@ -1,23 +1,24 @@
# knotless CI: release is the ONE workflow that compiles anything, and it carries the gate. Its steps: the checks (deploy/check.sh --fast: gofmt, apigen,
# codegen drift, go vet on the host and every cross-OS target, architecture rules, the policy engine specification tests, and a clean tree after; nothing
# is built), the release binaries (linux/amd64, linux/arm64) built ONCE, the amd64 one pushed to ttl.sh for the staging runs (this run's artifact oci/binary.ref),
# the static test host, the wasm test modules and the static meshd of this commit's tests/ and rust/ trees (published to the bucket on main and v* tags, kept as this
# the static test host, the wasm test modules and the static meshd of this commit's tests/ and rust/ trees (published to the bucket on main, kept as this
# run's artifact dist/ elsewhere; skipped when already published for the tree), 0009's page from the commits pinned in tests/compositions/staging/page-tools.json
# (scripts/ci-page.sh: page/<sha256 of the pin>/ in the bucket, dist/ elsewhere, skipped when published), the node downloads by sha256 and the pinned guest image, staged in the
# bucket: downloads/<sha256>/, guest-images/<target>/<pin>/ (content-addressed) and, on main and tags, staging/<sha>/ (the binaries and their manifest).
# `test` runs after this workflow and takes its binary (by digest from ttl.sh) and its test host. Its last steps, on main and v* tags, publish: copy staging/<sha>/
# inside the bucket to main/<sha>/ and main/latest/ (a tag: releases/<tag>/) and check what was published from the public URLs. No other workflow builds a release binary, a test host or a module, and nothing rebuilds
# anything to compare (owner rules: one build; no reproducible-build verification in CI). The bucket key is a sealed secret given only to pushes to main and v*
# tags (`knotless secret set ... --ref`): elsewhere (a branch, a pull) the staging steps are skipped. The caches of the build (scripts/asset-cache-upload.sh,
# scripts/ci-build-cache.sh: restored before a non-tag build, uploaded after one on main and v*) cut what a clean VM rebuilds. 12 vCPU / 16 GB (binding
# kcp-build). CI runs on main and v* tags only (owner rule: no branch CI, no merge-queue CI): a push to main or a v* tag runs it, every main commit is built and
# published; a branch runs it only when asked (`knotless run rerun <url> --ref refs/heads/<branch> --workflow release`). A newer push to main or a v* tag does not
# cancel a release that holds its turn (`superseded: finish`: the newest waits for it; the runner applies it to those refs only).
# bucket: downloads/<sha256>/, guest-images/<target>/<pin>/ (content-addressed) and, on main, staging/<sha>/ (the binaries and their manifest).
# test-1 to test-4 and promote run after this workflow and take its binary (by digest from ttl.sh; promote: main/<sha>/) and its test host. Its last steps, on main,
# publish: copy staging/<sha>/ inside the bucket to main/<sha>/ and main/latest/ and check what was published from the public URLs. No tag is built (plan 0040
# step 15): releases/<version>/ is promote's copy of main/<sha>/ when it moves channel stable (scripts/promote.sh). No other workflow builds a release binary, a
# test host or a module, and nothing rebuilds anything to compare (owner rules: one build; no reproducible-build verification in CI). The bucket key is a sealed
# secret given only to pushes to main (`knotless secret set ... --ref`): elsewhere (a branch, a pull) the staging steps are skipped. The caches of the build
# (scripts/asset-cache-upload.sh, scripts/ci-build-cache.sh: restored before every build, uploaded after one on main) cut what a clean VM rebuilds. 12 vCPU /
# 16 GB (binding kcp-build). CI runs on main only (owner rule: no branch CI, no merge-queue CI): every main commit is built and published; a branch runs it
# only when asked (`knotless run rerun <url> --ref refs/heads/<branch> --workflow release`). A newer push to main does not cancel a release that holds its
# turn (`superseded: finish`: the newest waits for it; the runner applies it to main and v* tags only).
# paths: the test-N workflows' list (scripts/ci-test-workflow.yml.tmpl): a push that changes none of them (docs, plans)
# builds nothing and tests nothing
on:
push:
refs: [refs/heads/main, refs/tags/v*]
refs: [refs/heads/main]
paths: [internal/**, cmd/**, api/**, tests/**, rust/**, deploy/**, scripts/**, lexicons/**, hack/**, did-key-associator/**, typescript-helpers/**, go.mod, go.sum, Makefile, .knotless/**]
asked:
refs: [refs/heads/*]
@@ -55,24 +56,24 @@ steps:
timeout: 90
run: bash scripts/ci-release.sh guest-image
- name: asset cache
on: {refs: [refs/heads/main, refs/tags/v*]}
on: {refs: [refs/heads/main]}
timeout: 15
run: bash scripts/ci-release.sh asset-cache
- name: build cache
on: {refs: [refs/heads/main, refs/tags/v*]}
on: {refs: [refs/heads/main]}
timeout: 15
run: bash scripts/ci-release.sh build-cache
- name: stage
on: {refs: [refs/heads/main, refs/tags/v*]}
on: {refs: [refs/heads/main]}
timeout: 15
run: bash scripts/ci-release.sh stage
- name: publish
on: {refs: [refs/heads/main, refs/tags/v*]}
on: {refs: [refs/heads/main]}
# a newer push cancels a publish before it starts, never once it has (main/latest half written)
finish: true
timeout: 15
run: bash scripts/ci-release.sh publish
- name: the published binaries and guest image
on: {refs: [refs/heads/main, refs/tags/v*]}
on: {refs: [refs/heads/main]}
timeout: 15
run: bash scripts/ci-release.sh verify
.knotless/workflows/test-1.yml+1−1
@@ -8,7 +8,7 @@
# prints its RESULT lines and `gate: staging: K of M PASS (shard 1/4)`; `scripts/ci-staging-total.sh <commit>` reads the 4 workflows and prints the
# total, `gate: staging: N of 43 PASS`. The socialweb-computer is release's linux/amd64 of this commit, pulled by digest from ttl.sh (its artifact
# oci/binary.ref; no credential, so a fork's run works) on the CI VM and on every staging VM (target requester `oci:<ref>@sha256:<digest>`); the test host
# and meshd are release's too (the bucket on main and v* tags, its artifacts dist/ on a branch). Nothing here builds. Runs after `release` on a push to main
# and meshd are release's too (the bucket on main, its artifacts dist/ on a branch). Nothing here builds. Runs after `release` on a push to main
# that changes code (paths below) and on a branch only when asked, each workflow by name (`knotless run rerun knotless://<owner>/socialweb-computer-kcp
# --ref refs/heads/<branch> --workflow test-1`). The run's dump is an artifact (runs/), kept on failure.
on:
.knotless/workflows/test-2.yml+1−1
@@ -8,7 +8,7 @@
# prints its RESULT lines and `gate: staging: K of M PASS (shard 2/4)`; `scripts/ci-staging-total.sh <commit>` reads the 4 workflows and prints the
# total, `gate: staging: N of 43 PASS`. The socialweb-computer is release's linux/amd64 of this commit, pulled by digest from ttl.sh (its artifact
# oci/binary.ref; no credential, so a fork's run works) on the CI VM and on every staging VM (target requester `oci:<ref>@sha256:<digest>`); the test host
# and meshd are release's too (the bucket on main and v* tags, its artifacts dist/ on a branch). Nothing here builds. Runs after `release` on a push to main
# and meshd are release's too (the bucket on main, its artifacts dist/ on a branch). Nothing here builds. Runs after `release` on a push to main
# that changes code (paths below) and on a branch only when asked, each workflow by name (`knotless run rerun knotless://<owner>/socialweb-computer-kcp
# --ref refs/heads/<branch> --workflow test-2`). The run's dump is an artifact (runs/), kept on failure.
on:
.knotless/workflows/test-3.yml+1−1
@@ -8,7 +8,7 @@
# prints its RESULT lines and `gate: staging: K of M PASS (shard 3/4)`; `scripts/ci-staging-total.sh <commit>` reads the 4 workflows and prints the
# total, `gate: staging: N of 43 PASS`. The socialweb-computer is release's linux/amd64 of this commit, pulled by digest from ttl.sh (its artifact
# oci/binary.ref; no credential, so a fork's run works) on the CI VM and on every staging VM (target requester `oci:<ref>@sha256:<digest>`); the test host
# and meshd are release's too (the bucket on main and v* tags, its artifacts dist/ on a branch). Nothing here builds. Runs after `release` on a push to main
# and meshd are release's too (the bucket on main, its artifacts dist/ on a branch). Nothing here builds. Runs after `release` on a push to main
# that changes code (paths below) and on a branch only when asked, each workflow by name (`knotless run rerun knotless://<owner>/socialweb-computer-kcp
# --ref refs/heads/<branch> --workflow test-3`). The run's dump is an artifact (runs/), kept on failure.
on:
.knotless/workflows/test-4.yml+1−1
@@ -8,7 +8,7 @@
# prints its RESULT lines and `gate: staging: K of M PASS (shard 4/4)`; `scripts/ci-staging-total.sh <commit>` reads the 4 workflows and prints the
# total, `gate: staging: N of 43 PASS`. The socialweb-computer is release's linux/amd64 of this commit, pulled by digest from ttl.sh (its artifact
# oci/binary.ref; no credential, so a fork's run works) on the CI VM and on every staging VM (target requester `oci:<ref>@sha256:<digest>`); the test host
# and meshd are release's too (the bucket on main and v* tags, its artifacts dist/ on a branch). Nothing here builds. Runs after `release` on a push to main
# and meshd are release's too (the bucket on main, its artifacts dist/ on a branch). Nothing here builds. Runs after `release` on a push to main
# that changes code (paths below) and on a branch only when asked, each workflow by name (`knotless run rerun knotless://<owner>/socialweb-computer-kcp
# --ref refs/heads/<branch> --workflow test-4`). The run's dump is an artifact (runs/), kept on failure.
on:
api/v1alpha1/resources.go+1−1
@@ -41,7 +41,7 @@ var APIResources = []APIResource{
{Name: "Message", Type: "string", JSONPath: ".status.message"},
{Name: "Age", Type: "date", JSONPath: ".metadata.creationTimestamp"},
}},
{Kind: "ComputeVM", Plural: "computevms", Revision: 20, Export: "computevms", Object: ComputeVM{}, PrinterColumns: []PrinterColumn{
{Kind: "ComputeVM", Plural: "computevms", Revision: 21, Export: "computevms", Object: ComputeVM{}, PrinterColumns: []PrinterColumn{
{Name: "Phase", Type: "string", JSONPath: ".status.phase"},
{Name: "Backend", Type: "string", JSONPath: ".spec.backendRef.kind"},
{Name: "GuestIP", Type: "string", JSONPath: ".status.addresses.guest"},
api/v1alpha1/types_computevm.go+10−0
@@ -49,6 +49,8 @@ type ComputeVMSpec struct {
AssociationExpiresAt string `json:"associationExpiresAt,omitempty"`
AssociationContracts []ComputeVMAssociationContract `json:"associationContracts,omitempty"`
HostPorts []int32 `json:"hostPorts,omitempty" apigen:"listType=set"`
Sandbox *ComputeVMSandbox `json:"sandbox,omitempty"`
@@ -184,6 +186,14 @@ type ComputeVMRelease struct {
RequestedAt string `json:"requestedAt"`
Request *commonv1.StrongRef `json:"request,omitempty"`
Reason string `json:"reason,omitempty"`
}
type ComputeVMAssociationContract struct {
Accept commonv1.StrongRef `json:"accept"`
Receipt string `json:"receipt"`
}
type ComputeVMGuestLogin struct {
api/v1alpha1/zz_generated.deepcopy.go+22−0
@@ -2649,6 +2649,23 @@ func (in *ComputeVMAddresses) DeepCopy() *ComputeVMAddresses {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ComputeVMAssociationContract) DeepCopyInto(out *ComputeVMAssociationContract) {
*out = *in
out.Accept = in.Accept
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComputeVMAssociationContract.
func (in *ComputeVMAssociationContract) DeepCopy() *ComputeVMAssociationContract {
if in == nil {
return nil
}
out := new(ComputeVMAssociationContract)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ComputeVMContract) DeepCopyInto(out *ComputeVMContract) {
*out = *in
@@ -2963,6 +2980,11 @@ func (in *ComputeVMSpec) DeepCopyInto(out *ComputeVMSpec) {
*out = new(ComputeVMRelease)
(*in).DeepCopyInto(*out)
}
if in.AssociationContracts != nil {
in, out := &in.AssociationContracts, &out.AssociationContracts
*out = make([]ComputeVMAssociationContract, len(*in))
copy(*out, *in)
}
if in.HostPorts != nil {
in, out := &in.HostPorts, &out.HostPorts
*out = make([]int32, len(*in))
deploy/apiresourceschema-revisions.txt+1−0
@@ -712,3 +712,4 @@ v1alpha1-52.marketbidders.socialweb.computer sha256:6119b5c2601a5ec9402eedb89ea5
v1alpha1-41.marketnetworks.socialweb.computer sha256:1b156325884bf60a50369bbadb8840f06c45358df30547052f2f719aaca6a70b
v1alpha1-42.marketnetworks.socialweb.computer sha256:08fe5ac110df99a82bcf00ac13f5af6d64e339723f6ed28c40c708172f3f1f97
v1alpha1-18.pds.socialweb.computer sha256:58c211cf5b47ead76b6757da6c74f269ec36a6ad91a908c43bde5130fa24f63d
v1alpha1-21.computevms.socialweb.computer sha256:8a47a95de62a8339c26201bf16bc4388379b2c759a0a533d28458de617ab6d4c
deploy/computevm-apiexport.yaml+1−1
deploy/computevm-apiresourceschema.yaml+23−1
deploy/obligations.txt+1−0
docs/acceptance/0005-guest-requester-association.md+10−1
docs/plans/0040-findings.md+123−0
docs/plans/0040-release-pipeline.md+13−1
docs/plans/0041-after-the-pipeline.md+7−0
docs/protocol/lexicons-market.md+1−1
docs/protocol/market.md+2−1
docs/security/proposed-controls.md+11−0
docs/ARCHITECTURE.md+17−1
docs/bidder.md+24−4
docs/ci-debug.md+31−11
docs/deploy.md+3−2
internal/atproto/market/nsid.go+1−0
internal/computevm/provider.go+3−0
internal/market/bidder/association.go+112−0
internal/market/bidder/bidder.go+1−0
internal/market/bidder/kinds.go+4−0
internal/market/bidder/provision.go+1−0
internal/policyengine/trust/association.go+3−3
internal/policyengine/trust/trust.go+2−2
lexicons/com/publicdomainrelay/temp/compute/events/vm/terminated.json+1−1
scripts/ci-prod-target.sh+3−3
scripts/ci-release.sh+5−15
scripts/ci-test-workflow.yml.tmpl+1−1
scripts/ci-test-workflows.sh+2−1
scripts/oauth-signin.ts+1−1
scripts/promote.sh+73−11
tests/compositions/staging/README.md+2−1
tests/host/src/main.rs+7−0
tests/host/src/more.rs+64−0
tests/host/src/swc.rs+24−4
tests/modules/acc-0005/src/lib.rs+79−1
tests/modules/acc-0014/src/lib.rs+13−1
tests/modules/staging/src/lib.rs+29−0
tests/targets/prod.json+2−1
tests/testkit/src/requester.rs+145−70
tests/testkit/src/target.rs+8−4
tests/testkit/README.md+5−2
AGENTS.md+21−12