Skip to main content

Cluster Compute Configs

Cluster compute configs specify the resources your cluster will use. Cluster compute configs are optional, since Anyscale has defaults for all the values that the compute template can specify. Nevertheless, sometimes it's useful to specify some of the configs to override the default the values.

You might be familiar with Ray's cluster.yaml, which specifies a large number of configs in a single file. Cluster compute configs are subset of this file.


The following is a fully-specified example of Cluster compute:

cloud: my-cloud # You may specify `cloud_id` instead
max_workers: 20
- us-west-2a
name: head_node_type
instance_type: m5.2xlarge
- name: cpu_worker
instance_type: m5.4xlarge
min_workers: 2
max_workers: 10
- name: gpu_worker
instance_type: g4dn.4xlarge

Note that you can specify the following in your cluster compute configs:

  • A cloud, which defaults to your default cloud (set by an organization owner for the entire organization). On the SDK, this can only be specified as cloud_id. On the CLI, you may specify cloud (the cloud name) instead. The SDK example below show how to resolve a cloud into a cloud_id.
  • A maximum number of worker nodes to launch (defaults to infinity)
  • A head node type, which defaults to m5.2xlarge on AWS or n2-standard-8 on GCP.
  • A list of worker node types, which by default includes:
    • A CPU node type, which defaults to m5.4xlarge on AWS or n2-standard-16 on GCP.
    • A GPU node type, which defaults to g4dn.4xlarge on AWS or n1-standard-16-nvidia-tesla-t4-1 on GCP.
  • AWS-specific configs, which are supported properties that will be passed directly to AWS when starting the instances (supported only when bringing your own cloud).

When specifying instance types, you may specify any instance type supported by Anyscale as detailed on this page. In addition to the instance type, node types allow you to specify:

  • The node type name, which is used in logs.
  • Spot instance usage, which defaults to false (supported only for worker node types when bringing your own AWS cloud).
  • A minimum and maximum number of workers, which default to 0 and infinity respectively (supported only for worker node types).

The advanced AWS-specific configuration (aws block) is passed directly to the EC2 API when creating instances. You can use this to configure special parameters for your instances such as EBS disk size, security groups, and the subnet it resides in. We support the fields listed in the example, and the settings are applied to all instances launched for your cluster.

Please use caution when setting advanced AWS-specific configuration! Incorrect settings may cause your cluster to fail. The content of these fields is not validated before being passed to AWS.

Creating a cluster compute

You can use your cluster configs definition to create a cluster compute using the CLI, the Python SDK and the HTTP API:

anyscale cluster-compute create my_compute_configs.yaml --name my-cluster-compute

For more information, you can check the full reference of the CLI, Python SDK and the HTTP API.

You can also create a cluster compute in the Web UI by navigating to "Configurations > Cluster compute configs > Create a new config" to create a cluster compute config. You can also create one on the fly when you create a new cluster.

Create a new cluster compute in the configurations page