Skip to main content

Documentation Index

Fetch the complete documentation index at: https://ray-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

The AWS provider uses your local AWS credentials to launch and manage EC2 instances.

Credentials

aws configure
The launcher uses the default profile and region; override with provider.aws_credentials and provider.region.

Cluster config

cluster_name: ray-aws
provider:
  type: aws
  region: us-west-2
  availability_zone: us-west-2a,us-west-2b
auth:
  ssh_user: ubuntu
max_workers: 16
available_node_types:
  head:
    node_config:
      InstanceType: m5.xlarge
      ImageId: ami-0abcdef1234567890   # Deep Learning AMI or your own
      BlockDeviceMappings:
        - DeviceName: /dev/sda1
          Ebs: { VolumeSize: 100 }
  cpu-worker:
    min_workers: 1
    max_workers: 16
    node_config:
      InstanceType: c5.4xlarge
      InstanceMarketOptions:
        MarketType: spot                 # use spot instances
  gpu-worker:
    min_workers: 0
    max_workers: 4
    node_config:
      InstanceType: g5.2xlarge
    resources: {}
head_node_type: head
setup_commands:
  - pip install -U "ray[default]==2.43.0"

Bring up the cluster

ray up aws-cluster.yaml

Best practices

  • Use a custom AMI with Ray, CUDA, and your dependencies pre-installed for faster boot.
  • Spot instances are great for stateless workloads; use on-demand for the head.
  • Set availability_zone to multiple zones to widen the spot-instance pool.

Next steps

GCP

Google Cloud equivalent.

Autoscaling

Tune scale-up and scale-down.