socialweb.computer

Request and provide VMs on an atproto compute market.

lexicons and xrpc

lexicon

computer.socialweb.k8s.getJob

query HTTP GET /xrpc/computer.socialweb.k8s.getJob

The gateway reads the status of one batch/v1 Job in the named cluster of the calling account, with the pods it owns and the tail of each container's log, without a kubeconfig. Pairs with kubectlApplyServerSide: apply a Job, then poll this until phase is Succeeded or Failed. Read as the account's own ServiceAccount in that cluster. Requires a service-auth JWT from the caller's own PDS whose lxm is this method.

definitions: #condition #pod #container

parameters

parametertypedescription
cluster *string
The cluster label of the calling account.
namespace *string
The Job's namespace.
name *string
The Job's name.
tailLinesinteger
How many log lines to return per container, from the end. Default 100; 0 returns no logs. Each log is also capped at 64 KiB.
minimum 0 maximum 5000

output

encoding application/json

fieldtypedescription
namespace *string
name *string
uid *string
phase *string
Succeeded: the Complete (or SuccessCriteriaMet) condition is True. Failed: the Failed (or FailureTarget) condition is True. Running: at least one pod is active. Pending otherwise, which includes waiting for a node: a tenant cluster at zero nodes rents a market VM for the Job's pod first.
knownValues ["Pending","Running","Succeeded","Failed"]
active *integer
succeeded *integer
failed *integer
startTimestring datetime
completionTimestring datetime
conditions *array of #condition
pods *array of #pod

errors

errordescription
InvalidRequestA parameter is missing or out of range.
UnauthorizedMissing or invalid service-auth token, or its aud or lxm does not match.
IdentityRevokedThe caller's identity carries a deny record.
ClusterNotFoundThis account has no cluster of that name.
ClusterNotRunningThe control plane is stopped (409). Call controlPlaneUp first.
ClusterInitializingThe control plane is coming up (429, Retry-After). Retry.
ClusterDrainingThe cluster is being deleted (409).
ClusterUnavailableThe gateway could not get a credential for the cluster or the cluster did not answer (503).
ObjectNotFoundNo Job of that name in that namespace (404).
ApplyConflictThe apiserver answered 409 for the read (409); the gateway maps it as for an apply.
KubernetesErrorThe apiserver refused the read; message is the apiserver's message.
InternalError500: a failure the gateway maps to no named error.

#condition object

fieldtypedescription
type *string
status *string
reasonstring
messagestring

#pod object

fieldtypedescription
name *string
phase *string
nodestring
containers *array of #container

#container object

fieldtypedescription
name *string
state *string
knownValues ["Waiting","Running","Terminated"]
reasonstring
exitCodeinteger
logstring
The last tailLines lines of the container's log (at most 64 KiB).
logErrorstring
Why the log could not be read, when it could not.

used in

no page of these docs names it yet.

raw schema: lexicons/computer/socialweb/k8s/getJob.json
{
  "lexicon": 1,
  "id": "computer.socialweb.k8s.getJob",
  "defs": {
    "main": {
      "type": "query",
      "description": "The gateway reads the status of one batch/v1 Job in the named cluster of the calling account, with the pods it owns and the tail of each container's log, without a kubeconfig. Pairs with kubectlApplyServerSide: apply a Job, then poll this until phase is Succeeded or Failed. Read as the account's own ServiceAccount in that cluster. Requires a service-auth JWT from the caller's own PDS whose lxm is this method.",
      "parameters": {
        "type": "params",
        "required": [
          "cluster",
          "namespace",
          "name"
        ],
        "properties": {
          "cluster": {
            "type": "string",
            "description": "The cluster label of the calling account."
          },
          "namespace": {
            "type": "string",
            "description": "The Job's namespace."
          },
          "name": {
            "type": "string",
            "description": "The Job's name."
          },
          "tailLines": {
            "type": "integer",
            "minimum": 0,
            "maximum": 5000,
            "description": "How many log lines to return per container, from the end. Default 100; 0 returns no logs. Each log is also capped at 64 KiB."
          }
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "type": "object",
          "required": [
            "namespace",
            "name",
            "uid",
            "phase",
            "active",
            "succeeded",
            "failed",
            "conditions",
            "pods"
          ],
          "properties": {
            "namespace": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "uid": {
              "type": "string"
            },
            "phase": {
              "type": "string",
              "knownValues": [
                "Pending",
                "Running",
                "Succeeded",
                "Failed"
              ],
              "description": "Succeeded: the Complete (or SuccessCriteriaMet) condition is True. Failed: the Failed (or FailureTarget) condition is True. Running: at least one pod is active. Pending otherwise, which includes waiting for a node: a tenant cluster at zero nodes rents a market VM for the Job's pod first."
            },
            "active": {
              "type": "integer"
            },
            "succeeded": {
              "type": "integer"
            },
            "failed": {
              "type": "integer"
            },
            "startTime": {
              "type": "string",
              "format": "datetime"
            },
            "completionTime": {
              "type": "string",
              "format": "datetime"
            },
            "conditions": {
              "type": "array",
              "items": {
                "type": "ref",
                "ref": "#condition"
              }
            },
            "pods": {
              "type": "array",
              "items": {
                "type": "ref",
                "ref": "#pod"
              }
            }
          }
        }
      },
      "errors": [
        {
          "name": "InvalidRequest",
          "description": "A parameter is missing or out of range."
        },
        {
          "name": "Unauthorized",
          "description": "Missing or invalid service-auth token, or its aud or lxm does not match."
        },
        {
          "name": "IdentityRevoked",
          "description": "The caller's identity carries a deny record."
        },
        {
          "name": "ClusterNotFound",
          "description": "This account has no cluster of that name."
        },
        {
          "name": "ClusterNotRunning",
          "description": "The control plane is stopped (409). Call controlPlaneUp first."
        },
        {
          "name": "ClusterInitializing",
          "description": "The control plane is coming up (429, Retry-After). Retry."
        },
        {
          "name": "ClusterDraining",
          "description": "The cluster is being deleted (409)."
        },
        {
          "name": "ClusterUnavailable",
          "description": "The gateway could not get a credential for the cluster or the cluster did not answer (503)."
        },
        {
          "name": "ObjectNotFound",
          "description": "No Job of that name in that namespace (404)."
        },
        {
          "name": "ApplyConflict",
          "description": "The apiserver answered 409 for the read (409); the gateway maps it as for an apply."
        },
        {
          "name": "KubernetesError",
          "description": "The apiserver refused the read; message is the apiserver's message."
        },
        {
          "name": "InternalError",
          "description": "500: a failure the gateway maps to no named error."
        }
      ]
    },
    "condition": {
      "type": "object",
      "required": [
        "type",
        "status"
      ],
      "properties": {
        "type": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    },
    "pod": {
      "type": "object",
      "required": [
        "name",
        "phase",
        "containers"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "phase": {
          "type": "string"
        },
        "node": {
          "type": "string"
        },
        "containers": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#container"
          }
        }
      }
    },
    "container": {
      "type": "object",
      "required": [
        "name",
        "state"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "knownValues": [
            "Waiting",
            "Running",
            "Terminated"
          ]
        },
        "reason": {
          "type": "string"
        },
        "exitCode": {
          "type": "integer"
        },
        "log": {
          "type": "string",
          "description": "The last tailLines lines of the container's log (at most 64 KiB)."
        },
        "logError": {
          "type": "string",
          "description": "Why the log could not be read, when it could not."
        }
      }
    }
  }
}