Skip to main content
Version: Latest

Compute configurations

Check your docs version

These docs are for the new Anyscale design. If you started using Anyscale before April 2024, use Version 1.0.0 of the docs. If you're transitioning to Anyscale Preview, see the guide for how to migrate.

A compute configuration defines the virtual hardware used by a cluster. These resources make up the shape of the cluster and the cluster's setup for running applications and workloads in a distributed computing environment. If you are familiar with a Ray cluster.yaml, an Anyscale compute config is a superset of that comprehensive configuration. A compute config allows you to control the following:

  • Instance types: Virtual machine instance types for head and worker nodes.
  • Network settings: Network interfaces, including subnet settings, security groups, regions, and private/public IP options.
  • Storage options: Node-attached storage, including disk types and sizes.
  • Scaling parameters: Minimum and maximum worker node counts to determine scaling behavior based on workload.
  • Spot instance configuration: Spot instances for cost savings, and related enhancements (e.g. fallback to on-demand instances when spot instances are not available).
  • Cloud-specific advanced configurations: Provider-specific configurations, such as advanced networking and service integrations for clouds like AWS or GCP.
  • Auto-select worker nodes: beta feature allows defining the accelerator type in the Ray application. The Anyscale autoscaler selects the correct instances based on availability.

Create a compute config

You can create a compute config with one of three options: the Web UI, CLI, or the Python SDK. The CLI requires a YAML file, which allows you to version control compute configurations over time.

Compute config

Versions

Anyscale supports versioning of compute configs, allowing easy updating of the compute resource requirements for a workload over time.

Cloud specific configurations

note

Cloud specific configurations are only available with customer-hosted Anyscale Clouds.

Managing capacity reservations

Securing certain instance types from cloud providers can sometimes be challenging due to high demand or limited availability. With Anyscale, you can leverage your cloud provider capacity reservations, ensuring the availability of required node types for your workloads. To configure capacity reservations for a specific worker node type, modify the advanced configuration through the Web UI or by editing the compute config YAML file.

To add a reservation with the Web UI, navigate to a worker node and expand the Advanced config section. Under the Instance config tab, input the following JSON, substituting in your specific reservation ID:

{
"CapacityReservationSpecification": {
"CapacityReservationTarget": {
"CapacityReservationId": "RESERVATION_ID"
}
}
}
Expand for a sample YAML file that you can use with the Anyscale CLI/SDK
cloud: CLOUD_NAME
head_node:
instance_type: INSTANCE_TYPE_HEAD
worker_nodes:
- instance_type: INSTANCE_TYPE_ACCELERATED
min_workers: MIN_WORKERS
max_workers: MAX_WORKERS
advanced_instance_config:
CapacityReservationSpecification:
CapacityReservationTarget:
CapacityReservationId: RESERVATION_ID

For additional details on utilizing capacity reservations on AWS, see the AWS Documentation.

Changing the default disk size

The default disk size for all nodes in an Anyscale cluster is 150 GB. You can change the default disk size for the entire cluster or an individual worker node type.

To modify the default disk size from the Web UI, use the Advanced configuration section for the Worker node or the Advanced settings section for the entire cluster. This example increases the default to 500 GB.

{
"BlockDeviceMappings": [
{
"Ebs": {
"VolumeSize": 500,
"VolumeType": "gp3",
"DeleteOnTermination": true
},
"DeviceName": "/dev/sda1"
}
]
}
Expand for a sample YAML file that you can use with the Anyscale CLI/SDK

This sample YAML will modify the disk for all nodes in the Anyscale cluster.

cloud: CLOUD_NAME
head_node:
instance_type: INSTANCE_TYPE_HEAD
worker_nodes:
- instance_type: INSTANCE_TYPE_ACCELERATED
min_workers: MIN_WORKERS
max_workers: MAX_WORKERS
advanced_instance_config:
BlockDeviceMappings:
- Ebs:
- VolumeSize: 500
VolumeType: gp3
DeleteOnTermination: true
DeviceName: "/dev/sda1"