Skip to main content

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

PurposeCLIPython SDKNotes
Pinned compute credential--credentials NAMECloudConfig(credentials=...) or Client(credentials=...)Omit for an eligible saved-credential pool
Region--region REGIONCloudConfig(region=...)Omit for normal multi-region selection
GPU model and count--gpu-type TYPEsubmit(gpu=...), decorator gpu=...Submit-level value, not a CloudConfig field
Exact VM--vm-type TYPECloudConfig(vm_type=...)Mutually exclusive with GPU type
Spot--spotCloudConfig(spot=True)Jobs only
Local compute--localCloudConfig(cloud_provider=CloudType.Local)Requires local Docker capability on the API
Root disk capacity--disk-size GBCloudConfig(disk_size_gb=...)Independent of performance tier
Root disk tier--disk-tier TIERCloudConfig(disk_tier=...)medium, high, or ultra
Availability zone--zone ZONECloudConfig(availability_zone=...)Provider-specific value
Input Bucket--input-bucket NAMEinput=Bucket(...) or input_bucketJobs only; must exist
Output Bucket--output-bucket NAMEoutput=Bucket(...) or output_bucketJobs only; created if needed
Environment-e, --env-fileenv={...}Explicit values override Secret keys
Named Secret--secret NAMEsecrets=[...]Repeatable
Container runtimeDocker flags belowdocker_options={...}Applies after hardware resolution

Credential precedence

Python resolves compute credentials in this order:

  1. An explicit credential object in CloudConfig
  2. A saved credential name passed to CloudConfig or Client
  3. 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 h100 or a100:8.
  • VM selection accepts a provider-specific instance type, such as g6e.xlarge, Standard_NC40ads_H100_v5, or n1-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.
  • --gpus is 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 fieldTypeDescription
credentialsstr | CloudCredentialsSaved name or explicit credential object
cloud_providerCloudTypeInferred from credentials when omitted
vm_typestrExact VM type
spotboolSpot/preemptible capacity; Jobs only
regionstrPinned compute region
availability_zonestrProvider availability zone
disk_size_gbintRoot OS disk capacity
disk_tierDiskTiermedium, high, or ultra
input_bucketstrRead-only Job input at /mnt/input
output_bucketstrJob output at /mnt/output
input_storage_credentialsCloudCredentialsCross-account input identity
input_storage_regionstrCross-account input region
output_storage_credentialsCloudCredentialsCross-account output identity
output_storage_regionstrCross-account output region
checkpoint_storage_credentialsCloudCredentialsCross-account checkpoint identity
checkpoint_storage_regionstrCross-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:

TierIOPSThroughput
medium3,000125 MiB/s
high8,0001,000 MiB/s
ultra16,0001,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

CLIdocker_options keyExample
--gpusgpusall, 2
--shm-sizeshmSize8g
--memorymemory32g
--cpuscpus4
--ipcipchost
--ulimitulimitsrepeatable
--runtimeruntimenvidia
--bindbindsrepeatable 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:

VariableMeaning
DEPLOYMENT_IDThe deployment's unique ID
PORTServer listen port; defaults to 8088

Jobs with Buckets also receive the fixed mount paths /mnt/input, /mnt/output, and /mnt/checkpoint. See Buckets.