Docs

Container behavior and limits

How a Container is placed on machines, scaled, exposed, and backed up on each platform, and the limits Alien enforces.

Placement

On AWS, Google Cloud, and Azure, replicas run on the machines of a ComputeCluster. If the stack declares none, Alien creates one with a general pool.

When .pool() isn't set, Alien picks the pool in this order:

  1. stateful, when the container has persistent storage.
  2. gpu, when it requests a GPU.
  3. storage, when ephemeral storage is over 200 Gi.
  4. general otherwise.

A stateful replica is placed where its volume lives.

Scaling

CallMinDesiredMax
.replicas(n)nnn, autoscaling off
.minReplicas(n)nn10 × n
.maxReplicas(n) alone11n
.autoScale(cfg)cfg.mincfg.desiredcfg.max

Autoscaling targets 70% CPU and 80% memory unless you set them. It can also scale on in-flight HTTP requests per replica (targetHttpInFlightPerReplica) and on p95 latency (maxHttpP95LatencyMs).

Public endpoints

  • All public endpoints on one container route to the same backend port.
  • HTTP and TCP endpoints can't be mixed on one container.
  • Only one endpoint can use the apex (hostLabel: "@"), and it can't also take wildcard subdomains.
  • Endpoint names are lowercase DNS labels, up to 63 characters.
  • TCP endpoints work on AWS, Google Cloud, Azure, and Local. Kubernetes and Machines refuse them.
PlatformHTTPTCP
AWSApplication Load BalancerNetwork Load Balancer
Google CloudNetwork endpoint groups and a backend service behind an HTTPS proxySame, behind a TCP proxy
AzureApplication GatewayAzure Load Balancer

Volumes

Each ordinal keeps its volume across restarts and replacement. Snapshots are crash-consistent and stay in the customer's account, in the volume's region. They keep being taken when the deployment can't reach Alien.

PlatformVolumeSnapshots
AWSgp3 EBSAmazon Data Lifecycle Manager
Google CloudPersistent DiskCompute Engine snapshot schedule
AzureManaged DisksAzure Disk Backup
KubernetesPersistentVolumeClaim templatesNone. Use the cluster's tooling, such as VolumeSnapshots or Velero.
MachinesNot supported
LocalBind mountsNone

Backup schedule

intervalHours is 1, 2, 4, 6, 8, 12, or 24 (default 24). retentionDays is 1 to 365 (default 7). A volume holds at most 450 snapshots, so hourly backups can be kept for up to 18 days.

Turning backups off keeps existing snapshots until the container is deleted. When the container is deleted, Alien keeps one final snapshot of each volume, unless backups are off.

The volumeBackups.state output is active, disabled, or setupRequired. setupRequired means the deployment's management permissions predate volume backups. The container keeps running without a schedule, and the schedule is applied once the customer's admin reruns initial setup.

Restore

alien deployments restore-volume restores one replica's volume:

  1. Alien snapshots the current volume, so the restore can be undone.
  2. It stops that replica.
  3. It creates a new volume from the snapshot, in the same zone.
  4. It starts the replica on the new volume.

Other replicas keep running. The snapshot must belong to the same deployment and be no larger than the configured size. If a restore fails, retry the deployment or run alien deployments cancel-volume-restore.

Platform checks

Alien refuses these at plan time:

DeclarationRefused on
.egress("internet")Kubernetes, Machines, Local. Also refused without security.profile: "restricted".
.security()Local
.kubernetesSecretMount(), .kubernetesLivenessProbe(), .kubernetesReadinessProbe()Every platform except Kubernetes
Stateful containersMachines
TCP public endpointsKubernetes
Any public endpointMachines (MACHINES_CONTAINER_PUBLIC_ENDPOINT). Serve it from a Daemon with host networking instead.

On AWS, a Worker can link at most 4 Containers that have ports.

Linking a Container that has ports opens them to the linker. On AWS, Google Cloud, and Azure, the plan refuses these links with CONTAINER_NETWORK_SETTINGS_UNSUPPORTED:

  • A Container or Daemon in a different compute cluster from the target.
  • On Google Cloud and Azure, any linker other than a Container or Daemon, such as a Worker.
  • On AWS, a Sandbox without .egress("internet").
  • On AWS, a target that a Worker or Sandbox links and that needs more than 32 load balancer targets: one per distinct port, plus one when it has public endpoints.

Limits

LimitValue
Public backend ports1 per container
Apex endpoints1 per container
Endpoint nameLowercase DNS label, up to 63 characters
GPU count1 to 8
Health check timeout1 to 5 seconds
Stop grace period1 to 86,400 seconds
Backup interval1, 2, 4, 6, 8, 12, or 24 hours
Backup retention1 to 365 days
Snapshots per volume450
Load balancer targets on AWSAt most 32 per container

Changes that replace the resource

Changing any of these after create replaces the container: id, cluster, stateful mode, ports, public endpoints, pool, and persistentStorage.encryptionKey.

On this page