socialweb.computer

Request and provide VMs on an atproto compute market.

lexicons and xrpc

lexicon

com.publicdomainrelay.temp.compute.vm

record key any

A requested virtual machine: the payload of a compute RFP.

definitions: #image #location

record

fieldtypedescription
role *string
The VM name within the requester's contract.
kindstring
What the bidder runs for this request: a firecracker virtual machine (the default when absent), or a deno sandbox that runs user_data as its program and reports its output as a guest event.
knownValues ["vm","deno"]
cpusinteger
vCPUs for the VM; the requester writes 2 unless the contract says otherwise, and the bidder takes 2 when absent.
minimum 1
memstring
Guest memory size, such as 4G; the requester writes 4G unless the contract says otherwise, and the bidder takes 4G when absent.
nestedVirtboolean
The VM must run VMs of its own; only a bidder whose offering sets nestedVirt runs it.
diskstring
Disk size, such as 50G (the requester always writes 50G). A requester image's kernel and rootfs together fit in it.
image#image
networkstring
Network transfer allowance, such as 500G; the requester writes none and the bidder ignores it today.
location#location
Where the VM should run; the requester writes none and the bidder ignores it today.
user_datastring
cloud-init user data.
netboolean
kind deno: the program reaches the public internet (never loopback, link-local or private ranges). A bidder runs it only for its owner: the requester is the bidder's DID, its operator, or associated to that operator.
expiresAtstring datetime
When the requester wants the VM ended. The bidder ends it then (it may end it earlier by its own policy) and refuses an RFP whose expiresAt has passed; without it, the bidder ends the VM 24 h after the accept.
createdAtstring datetime

#image object

kind vm: a requester-chosen VM image the bidder boots instead of its own pinned one; only a bidder whose offering sets images runs it.

fieldtypedescription
url *string uri
An https base URL of a directory holding image.json, the kernel and the rootfs that image.json names.
maxLength 2048
sha256 *string
The hex sha256 of that image.json; the bidder checks it before it reads the file.
minLength 64 maxLength 64

#location object

fieldtypedescription
countrystring
regionstring

used in

How it works, Compute Contract Flow - Complete Architecture Map, flow: one compute contract, end to end, guest-events: events under a receipt, identity: signatures, key claims, associations, sign-in, protocol: the atproto protocol of socialweb-computer, lexicons-market: one row per lexicon, market: the RFP flow, policy: policy records, attached policies, tangled-vouch, The protocol spec, From zero to a signed contract, Four signed hops, one verifiable contract., A marketplace made of records., A provisioned workload never holds a long-lived secret, Compute Contracts - Pre-Alpha

raw schema: lexicons/com/publicdomainrelay/temp/compute/vm.json
{
  "lexicon": 1,
  "id": "com.publicdomainrelay.temp.compute.vm",
  "description": "A requested virtual machine: the payload of a compute RFP.",
  "defs": {
    "main": {
      "type": "record",
      "key": "any",
      "record": {
        "type": "object",
        "required": [
          "role"
        ],
        "properties": {
          "role": {
            "type": "string",
            "description": "The VM name within the requester's contract."
          },
          "kind": {
            "type": "string",
            "knownValues": [
              "vm",
              "deno"
            ],
            "description": "What the bidder runs for this request: a firecracker virtual machine (the default when absent), or a deno sandbox that runs user_data as its program and reports its output as a guest event."
          },
          "cpus": {
            "type": "integer",
            "minimum": 1,
            "description": "vCPUs for the VM; the requester writes 2 unless the contract says otherwise, and the bidder takes 2 when absent."
          },
          "mem": {
            "type": "string",
            "description": "Guest memory size, such as 4G; the requester writes 4G unless the contract says otherwise, and the bidder takes 4G when absent."
          },
          "nestedVirt": {
            "type": "boolean",
            "description": "The VM must run VMs of its own; only a bidder whose offering sets nestedVirt runs it."
          },
          "disk": {
            "type": "string",
            "description": "Disk size, such as 50G (the requester always writes 50G). A requester image's kernel and rootfs together fit in it."
          },
          "image": {
            "type": "ref",
            "ref": "#image"
          },
          "network": {
            "type": "string",
            "description": "Network transfer allowance, such as 500G; the requester writes none and the bidder ignores it today."
          },
          "location": {
            "type": "ref",
            "ref": "#location",
            "description": "Where the VM should run; the requester writes none and the bidder ignores it today."
          },
          "user_data": {
            "type": "string",
            "description": "cloud-init user data."
          },
          "net": {
            "type": "boolean",
            "description": "kind deno: the program reaches the public internet (never loopback, link-local or private ranges). A bidder runs it only for its owner: the requester is the bidder's DID, its operator, or associated to that operator."
          },
          "expiresAt": {
            "type": "string",
            "format": "datetime",
            "description": "When the requester wants the VM ended. The bidder ends it then (it may end it earlier by its own policy) and refuses an RFP whose expiresAt has passed; without it, the bidder ends the VM 24 h after the accept."
          },
          "createdAt": {
            "type": "string",
            "format": "datetime"
          }
        }
      }
    },
    "image": {
      "type": "object",
      "description": "kind vm: a requester-chosen VM image the bidder boots instead of its own pinned one; only a bidder whose offering sets images runs it.",
      "required": [
        "url",
        "sha256"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "maxLength": 2048,
          "description": "An https base URL of a directory holding image.json, the kernel and the rootfs that image.json names."
        },
        "sha256": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "description": "The hex sha256 of that image.json; the bidder checks it before it reads the file."
        }
      }
    },
    "location": {
      "type": "object",
      "properties": {
        "country": {
          "type": "string"
        },
        "region": {
          "type": "string"
        }
      }
    }
  }
}