socialweb.computer

Request and provide VMs on an atproto compute market.

Contributing

socialweb.computer rents VMs between atproto accounts: a requester asks for a VM, bidders bid, and the guest boots on the winner. This repository contains the CLI, the requester, the bidder, the gateways, the guest, and their tests. Everything here is under the Unlicense.

Contents

Repository Layout

Use this table to find where each part lives and which checks to run after changing it. For how the parts fit together, see docs/how-it-works.md and docs/SYSTEM.md.

AreaLocationWhat to Run
CLI (verbs, flags)cmd/socialweb-computerdeploy/check.sh --fast (runs scripts/check-cli-args.sh)
Requesterinternal/market/requesterdeploy/check.sh --fast (its policy spec tests), then the pull
Bidderinternal/market/bidderdeploy/check.sh --fast (its policy spec tests), then the pull
Policyinternal/policyengine, internal/policyactiondeploy/check.sh --fast
SSH gatewayinternal/services/sshserverdeploy/check.sh --fast, then the pull
Kubernetes gatewayinternal/services/gatewayapi, internal/gatewayhttpdeploy/check.sh --fast, then the pull
Guestinternal/guestseed, internal/atproto/cloudinit, internal/guestagenta VM on a local market, then the pull
kcp API typesapi/v1alpha1go generate ./api/..., deploy/check.sh --fast (drift)
Lexiconslexicons/deploy/check.sh --fast (codegen drift)
Mesh, pipesrust/deploy/check.sh --local (cargo test)
Teststests/compositions/NNNN, tests/entries.txt, tests/host, tests/modulesthe pull (the staging suite runs every entry)
CI.knotless/workflows/, scripts/ci-*.shdeploy/check.sh --fast, then the pull
DocsREADME.md, docs/scripts/check-docs.sh
Sitesite/site/build.sh

Running Checks

Make sure Go, jq, and deno are on your PATH, then run the checks from the repository root:

deploy/check.sh --fast      # 5 min: gofmt, codegen drift, go vet for every OS, architecture, docs, CLI args, policy spec tests
scripts/check-docs.sh       # 19 s: every run=gate block of README.md, docs/quickstart*.md, docs/deploy.md, docs/bidder.md
site/build.sh               # 2 s, warm: the site into site/out

To boot a VM from your local build without touching prod, follow docs/quickstart-local.md. The full staging suite runs every entry in tests/entries.txt on a fresh network (about 2 h 40 min) and runs automatically on your pull.

Opening a Pull

Our knotless instance is at https://knotless.socialweb.computer and this repository is knotless://socialweb.computer/socialweb-computer-kcp. Install the CLI, log in at your PDS, fork the repo, push your branch, and create a pull:

curl -fsSL https://knotless.dev/install.sh | sh
export KNOTLESS_APPVIEW=https://knotless.socialweb.computer
U=knotless://socialweb.computer/socialweb-computer-kcp
knotless login <you>                        # OAuth at your own PDS
knotless repo fork $U                       # knotless://<you>/socialweb-computer-kcp
git clone knotless://<you>/socialweb-computer-kcp && cd socialweb-computer-kcp
git checkout -b <branch>                    # change, commit
git push origin <branch>
knotless pull create $U main knotless://<you>/socialweb-computer-kcp <branch> "<title>" -m "<why>"

pull create prints the pull's at:// URI.

Signing In to the Runner

CI runs for your pull rent their VMs as you using your session, so you need to sign in once in a browser. Run this to print the login link for the current CI composition:

P=did:plc:ocnuqjlzgohypj3zoznermms N=socialweb-computer-cicd
pds() { curl -fsSL "https://plc.directory/$1" | jq -r '.service[] | select(.id == "#atproto_pds") | .serviceEndpoint'; }
CID=$(curl -fsSL "$(pds $P)/xrpc/com.atproto.repo.getRecord?repo=$P&collection=com.fedfork.exec.composition&rkey=$N" | jq -r .cid)
echo "https://knotless-runner.socialweb.computer/oauth/composition/$CID/login?handle=<you>&composition=at://$P/com.fedfork.exec.composition/$N"

If you haven't signed in, the pull's check fails and puts this link in its log. Whenever the CI composition changes (which gives it a new <cid>), you'll need to sign in again.

The runner's client-metadata.json for that composition asks for these scopes and nothing else from your account:

ScopeReason
repo:com.publicdomainrelay.temp.market.{rfp,accept,event}, rpc:...market.submit{Rfp,Accept,Event}Ask for a VM, accept a bid, and end the contract
repo:com.publicdomainrelay.temp.compute.vm, ...compute.events.vm.delete, computer.socialweb.vm.keptManage the VM's records
repo:...compute.events.guest.{signalWebRTC,publicKey}, ...badgeBlueKeysReach the guest and check what it signs
repo:...market.association, repo:link.ident.endorsementLet the CI VM's requester rent the staging VMs as your agent, for that contract only
repo:computer.socialweb.ingress.offer, rpc:com.atproto.sync.listReposByCollectionSet up ingress for the run and find bidders

Our secrets never reach a pull's run. Here is how the appview, runner, and bidders coordinate a pull run:

diagram
prod biddersrunnerknotless-runner.socialweb.computerappviewknotless.socialweb.computerYouprod biddersrunnerknotless-runner.socialweb.computerappviewknotless.socialweb.computerYourelease: the checks, the build (no secret, nothing published)test: its requester, your agent, rents 4 staging VMs, runs every entrysign in once (OAuth at your PDS)git push, knotless pull createthe pullrent a build VM as yourent a test VM as youchecks: release, testresult on the pull

Getting Vouched

Bidders only bid for accounts that their operator vouches for, so until you're vouched your runs will fail with no bids received. Ask an operator by opening an issue with your DID using knotless issue create $U "vouch <your did>". The operator writes a vouch for you and you write one for the operator. See docs/quickstart-prod.md for the records and how to read them, and docs/bidder.md for the bidder's side.

CI Workflows

A pull runs checks, builds, and the staging suite under your account, and after a maintainer lands it on main, CI builds, publishes, runs the staging suite again, and promotes to the stable channel:

diagram

main, after the landing

your pull into main, as you

a maintainer lands it

release: checks and build

test: staging suite

release: build and publish

test: staging suite

promote: prod gate, channel stable

If a pull only changes docs or plans, CI skips it with skipped: nothing changed in .... Pushing a new commit to the branch cancels the older run.

Reading Failed Runs

Use knotless run list with the pull's at:// URI to check workflow status and read logs:

P=<the pull's at:// URI>
knotless run list $U --pull $P                              # status, workflow
knotless run list $U --pull $P --workflow release --log     # a log; test: gate: staging: N of 47 PASS

Each RESULT <runbook>:<entry> FAIL line names an entry in tests/entries.txt. See docs/ci-debug.md for more on debugging failed runs.

Contribution Rules

Reviewers hold pulls to these rules (see AGENTS.md for the full set):

Operating Our Deployment

For running and debugging our deployment, see these docs: