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
| Option | Description |
|---|---|
-i, --id ID | Custom Service ID and URL prefix |
-e, --env KEY=VALUE | Environment value; repeatable |
--env-file FILE | Load a dotenv file |
--secret NAME | Inject a named Secret; repeatable |
--cluster ID-OR-NAME | Run on a Ready Kubernetes cluster |
--credentials NAME | Select a compute credential |
--region REGION | Pin a compute region |
--vm-type TYPE | Exact VM; repeat for an ordered fallback pool |
--gpu-type TYPE | GPU model/count; repeat for an ordered fallback pool |
--disk-size GB | Root disk capacity |
--disk-tier TIER | medium, high, or ultra |
--zone ZONE | Availability zone |
--checkpoint-bucket NAME | Existing bucket mounted at /mnt/checkpoint |
--checkpoint-storage-region REGION | Checkpoint bucket region |
--gpus VALUE | Docker GPU exposure |
--shm-size SIZE | Docker shared memory |
--memory LIMIT | Docker memory limit |
--cpus COUNT | Docker CPU limit |
--runtime RUNTIME | Docker runtime |
--ipc MODE | Docker IPC mode |
--ulimit VALUE | Docker 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.