Configuration
This page is the exact lookup for where and how a Job or Server runs. For decision guidance, start with GPUs & VM Types, Cloud Credentials, and Buckets.
Configuration mappings
| Purpose | CLI | Python SDK | Notes |
|---|---|---|---|
| Pinned compute credential | --credentials NAME | CloudConfig(credentials=...) or Client(credentials=...) | Omit for an eligible saved-credential pool |
| Region | --region REGION | CloudConfig(region=...) | Omit for normal multi-region selection |
| GPU model and count | --gpu-type TYPE | submit(gpu=...), decorator gpu=... | Submit-level value, not a CloudConfig field |
| Exact VM | --vm-type TYPE | CloudConfig(vm_type=...) | Mutually exclusive with GPU type |
| Spot | --spot | CloudConfig(spot=True) | Jobs only |
| Local compute | --local | CloudConfig(cloud_provider=CloudType.Local) | Requires local Docker capability on the API |
| Root disk capacity | --disk-size GB | CloudConfig(disk_size_gb=...) | Independent of performance tier |
| Root disk tier | --disk-tier TIER | CloudConfig(disk_tier=...) | medium, high, or ultra |
| Availability zone | --zone ZONE | CloudConfig(availability_zone=...) | Provider-specific value |
| Input Bucket | --input-bucket NAME | input=Bucket(...) or input_bucket | Jobs only; must exist |
| Output Bucket | --output-bucket NAME | output=Bucket(...) or output_bucket | Jobs only; created if needed |
| Environment | -e, --env-file | env={...} | Explicit values override Secret keys |
| Named Secret | --secret NAME | secrets=[...] | Repeatable |
| Container runtime | Docker flags below | docker_options={...} | Applies after hardware resolution |
Credential precedence
Python resolves compute credentials in this order:
- An explicit credential object in
CloudConfig - A saved credential name passed to
CloudConfigorClient - The sole saved credential, when exactly one exists
from anycloud.types import AWSCredentials, CloudConfig
explicit = CloudConfig(
credentials=AWSCredentials(
accessKeyId="AKIA...",
secretAccessKey="...",
),
)
saved = CloudConfig(credentials="production-aws")
A CLI --credentials value wins over the
ANYCLOUD_CREDENTIALS_NAME environment fallback. If the CLI omits both, the
server can select among eligible saved named credentials; an unpinned compute
configuration must also leave region unpinned.
The Python SDK does not guess when multiple saved credentials exist. Pass
Client(credentials="name") or an explicit CloudConfig.
If a pinned credential fails authentication, the deployment becomes
invalid. With unpinned compute, Anycloud can temporarily block the failed
credential and select another compatible saved credential.
Hardware constraints
gpu / --gpu-type and vm_type / --vm-type are mutually exclusive.
- GPU selection accepts a model with optional count, such as
h100ora100:8. - VM selection accepts a provider-specific instance type, such as
g6e.xlarge,Standard_NC40ads_H100_v5, orn1-standard-8. - Repeating a CLI GPU or VM flag creates an ordered fallback pool. Python SDK submit parameters currently accept one GPU or VM target per Submission.
--gpusis a Docker exposure setting; it does not select the cloud VM.
# Ordered GPU preference
anycloud submit IMAGE \
--gpu-type h100:8 \
--gpu-type a100:8
# Exact VM
anycloud submit IMAGE \
--credentials production-aws \
--vm-type g6e.xlarge
Region pinning disables regional failover. Use it only for residency, debugging, quota work, or another explicit constraint.
CloudConfig fields
| Python field | Type | Description |
|---|---|---|
credentials | str | CloudCredentials | Saved name or explicit credential object |
cloud_provider | CloudType | Inferred from credentials when omitted |
vm_type | str | Exact VM type |
spot | bool | Spot/preemptible capacity; Jobs only |
region | str | Pinned compute region |
availability_zone | str | Provider availability zone |
disk_size_gb | int | Root OS disk capacity |
disk_tier | DiskTier | medium, high, or ultra |
input_bucket | str | Read-only Job input at /mnt/input |
output_bucket | str | Job output at /mnt/output |
input_storage_credentials | CloudCredentials | Cross-account input identity |
input_storage_region | str | Cross-account input region |
output_storage_credentials | CloudCredentials | Cross-account output identity |
output_storage_region | str | Cross-account output region |
checkpoint_storage_credentials | CloudCredentials | Cross-account checkpoint identity |
checkpoint_storage_region | str | Cross-account checkpoint region |
GPU selection is deliberately absent: pass gpu= to Client.submit(),
@anycloud.function(), or @anycloud.serve().
Configuration inheritance
A client-level CloudConfig supplies defaults for its deployments. A
deployment-level configuration takes precedence.
CloudConfig.replace() returns a new configuration with selected changes:
from anycloud.types import CloudConfig
base = CloudConfig(
credentials="production-aws",
spot=True,
disk_size_gb=400,
disk_tier="high",
)
on_demand = base.replace(spot=False)
west = base.replace(region="us-west-2")
Submission.replace() provides the same immutable-variant pattern for
submit_many().
Bucket credential rules
Input, output, and checkpoint storage credentials are independent. When a storage credential is omitted, that Bucket uses compute credentials; setting one Bucket's storage credential does not affect the others.
On the CLI, cross-account storage requires a credential and region:
anycloud submit IMAGE \
--credentials compute-account \
--input-bucket shared-data \
--input-storage-credentials storage-account \
--input-storage-region us-east-1
In Python, a Bucket sourced from another Client carries the storage
identity:
compute = anycloud.Client(credentials="gcp-compute")
storage = anycloud.Client(credentials="aws-storage")
job = compute.submit("IMAGE", input=storage.bucket("shared-data"))
Cross-cloud storage currently supports S3. It uses scoped STS credentials that last up to 36 hours and are not refreshed mid-run.
Root disk tiers
Disk capacity and performance are independent. --disk-size 100 --disk-tier high means a 100 GB root disk at the high tier. medium is the default.
On AWS, tiers map to gp3 root-volume settings:
| Tier | IOPS | Throughput |
|---|---|---|
medium | 3,000 | 125 MiB/s |
high | 8,000 | 1,000 MiB/s |
ultra | 16,000 | 1,000 MiB/s |
On Azure, medium uses Standard storage; high and ultra use Premium SSD.
Azure currently maps ultra to the same Premium tier as high. The VM size
must support Premium storage.
Disk tiers are supported on AWS and Azure. Other providers reject a non-default tier.
Docker runtime options
| CLI | docker_options key | Example |
|---|---|---|
--gpus | gpus | all, 2 |
--shm-size | shmSize | 8g |
--memory | memory | 32g |
--cpus | cpus | 4 |
--ipc | ipc | host |
--ulimit | ulimits | repeatable |
--runtime | runtime | nvidia |
--bind | binds | repeatable host bind |
Anycloud configures GPU access automatically for GPU-backed VMs. --gpus
controls what Docker exposes; it is not normally necessary to specify an
NVIDIA runtime.
Runtime environment
Every workload receives:
| Variable | Meaning |
|---|---|
DEPLOYMENT_ID | The deployment's unique ID |
PORT | Server listen port; defaults to 8088 |
Jobs with Buckets also receive the fixed mount paths /mnt/input,
/mnt/output, and /mnt/checkpoint. See Buckets.