Skip to main content

anycloud service

Run a long-running HTTP Service. Alias: anycloud serve.

anycloud service [image] [-- command...] [options]

The Service container must listen on 0.0.0.0:$PORT. PORT defaults to 8088 and can be overridden with --env PORT=9000. When the selected VM-backed provider supplies public ingress, the response includes https://<id>.anycloud.sh.

Omitting the image in an interactive terminal opens the GHCR image picker. In CI or another non-interactive shell, pass the image as the first argument.

Options

OptionDescription
-i, --id IDCustom Service ID and URL prefix
-e, --env KEY=VALUEEnvironment value; repeatable
--env-file FILELoad a dotenv file
--secret NAMEInject a named Secret; repeatable
--cluster ID-OR-NAMERun on a Ready Kubernetes cluster
--credentials NAMESelect a compute credential
--region REGIONPin a compute region
--vm-type TYPEExact VM; repeat for an ordered fallback pool
--gpu-type TYPEGPU model/count; repeat for an ordered fallback pool
--disk-size GBRoot disk capacity
--disk-tier TIERmedium, high, or ultra
--zone ZONEAvailability zone
--checkpoint-bucket NAMEExisting bucket mounted at /mnt/checkpoint
--checkpoint-storage-region REGIONCheckpoint bucket region
--gpus VALUEDocker GPU exposure
--shm-size SIZEDocker shared memory
--memory LIMITDocker memory limit
--cpus COUNTDocker CPU limit
--runtime RUNTIMEDocker runtime
--ipc MODEDocker IPC mode
--ulimit VALUEDocker ulimit; repeatable
--bind BIND...Host bind mounts

--spot and input/output buckets are not supported for Services. Checkpoint buckets work on VM-backed Services; the bucket must already exist and remains user-owned. A checkpointed Service requires a selected compute credential, and that same compute identity must have read-write access to the bucket. Separate checkpoint storage credentials are Job-only.

--cluster selects Kubernetes placement instead of VM compute placement. It cannot be combined with credentials, region, VM/GPU type, disk, or zone flags. It creates a Kubernetes Deployment and cluster-internal Service; public Anycloud URLs and checkpoint buckets are not yet supported. The stored cluster identity controls upgrades, termination, and cleanup after API restarts. status reports the persisted lifecycle state, but live Pod health, logs, and exec are not yet supported. See Clusters for cluster creation and placement.

anycloud service ghcr.io/acme/api:v1 \
--id model-api \
--credentials my-aws \
--vm-type t3.medium
anycloud service ghcr.io/acme/api:v1 \
--id model-api \
--cluster production-k8s

anycloud service upgrade

Replace a Service's backing workload while preserving its deployment ID and, when present, public URL:

anycloud service upgrade <id> <image> [-- command...]
anycloud service upgrade model-api ghcr.io/acme/api:v2 \
-- python -m myapp

Upgrade reuses the existing Service configuration. The command accepts the new image and optional container command, not a new set of cloud flags.

The endpoint has downtime while the workload is replaced. When a VM-backed Service has a checkpoint bucket, upgrade stops the workload, completes a final upload, then removes the old VM; the new VM restores the bucket before startup.