a rough sketch for a communal task orchestrator built on AT
meshlet.md edited
65 lines 3.0 kB view raw view rendered
1(summarized by Claude) 2 3A decentralized, consent-based container orchestration system where commune members contribute compute resources and run each other's workloads. Built on AT infrastructure with mutual trust and fair-share principles. 4 5**Identity Model** 6- **Owner DIDs**: Real people (e.g., `did:plc:alice`) 7- **Meshlet DIDs**: Each meshlet gets its own DID (e.g., `did:plc:alice-mesh`) 8- **Two-way linkage**: 9 - Owner's repo: `commune.scheduler.meshlet { meshletDid: "did:plc:alice-mesh" }` 10 - Meshlet's repo: `commune.scheduler.meshletOwner { ownerDid: "did:plc:alice" }` 11 12**Cluster Formation** 13```bash 14meshlet --did=did:plc:alice-mesh \ # ← this would likely be implicit? maybe this could even just be a did:web:mesh.alice.com 15 --owner=did:plc:alice \ 16 --cluster-members=did:plc:bob,did:plc:carol # owner DIDs 17``` 18 19Cool thing about this is Alice's meshlet can be in multiple clusters -- insofar as the other meshlet nodes recognize her. There can be cluster overlap. 20 21Startup process: 221. For each member owner DID, resolve to their meshlet DID via their `commune.scheduler.meshlet` record 232. Verify mutual membership - check if their meshlet also lists your owner DID 243. Verify meshlet ownership - confirm meshlet→owner linkage 254. Form active cluster with only mutually-verified members 265. Members can participate in multiple overlapping clusters 27 28**Workload Scheduling (Decentralized)** 29 30No central scheduler - consensus via deterministic selection: 31 321. **Workload request**: Alice publishes `commune.scheduler.workload` to her owner repo 33 - Resource requirements (CPU, memory, storage) 34 - Container image 35 - Replica count 36 - Constraints 37 382. **Bid publication**: Meshlets see workload on firehose, evaluate capacity/fairness, publish `commune.scheduler.bid` to their meshlet repos 39 - Time window for bids (e.g., 5 seconds) 40 - Bids include priority score based on fair-share balance 41 423. **Deterministic selection**: All meshlets independently: 43 - Collect all bids from firehose 44 - Run identical selection algorithm (sort by priority + DID, take top N) 45 - Everyone reaches same conclusion about who runs it 46 474. **Execution**: Selected meshlets pull image and start containers 48 495. **Status updates**: Meshlets write `commune.scheduler.workloadStatus` to their repos 50 51**Communication Patterns** 52- **Firehose**: Workload discovery, bid coordination, status updates (all via atproto repos) 53- **XRPC**: Direct meshlet operations 54 - `farm.meshlet.getCapacity` 55 - `farm.meshlet.listWorkloads` 56 - `farm.meshlet.getWorkloadStatus` 57 - `farm.meshlet.deleteWorkload` 58 - etc. for pause/stop/shutdown meshlet etc. 59 60**Open Questions** 61- **Secrets management**: Sealed secrets per meshlet? Shared vault? Secret sharing? 62- **Fair-share accounting**: Local tracking vs distributed ledger? 63- **Failure handling**: What happens when meshlets go offline mid-workload? 64- **Governance**: Handling free-riders, minimum contributions, dispute resolution? 65- **Appview**: What would this look like?