|
| 1 | +Cluster setup and auto-scaling (Experimental) |
| 2 | +============================================= |
| 3 | + |
| 4 | +Quick start |
| 5 | +----------- |
| 6 | + |
| 7 | +First, ensure you have configured your AWS credentials in ``~/.aws/credentials``, |
| 8 | +as described in `the boto docs <http://boto3.readthedocs.io/en/latest/guide/configuration.html>`__. |
| 9 | + |
| 10 | +Then you're ready to go. The provided `ray/python/ray/autoscaler/aws/example.yaml <https://github.com/ray-project/ray/tree/master/python/ray/autoscaler/aws/example.yaml>`__ cluster config file will create a small cluster with a m4.large |
| 11 | +head node (on-demand), and two m4.large `spot workers <https://aws.amazon.com/ec2/spot/>`__. |
| 12 | +Try it out with these commands: |
| 13 | + |
| 14 | +.. code-block:: bash |
| 15 | +
|
| 16 | + # Create or update the cluster |
| 17 | + $ ray create_or_update ray/python/ray/autoscaler/aws/example.yaml |
| 18 | +
|
| 19 | + # Resize the cluster without interrupting running jobs |
| 20 | + $ ray create_or_update ray/python/ray/autoscaler/aws/example.yaml \ |
| 21 | + --max-workers=N --sync-only |
| 22 | +
|
| 23 | + # Teardown the cluster |
| 24 | + $ ray teardown ray/python/ray/autoscaler/aws/example.yaml |
| 25 | +
|
| 26 | +Common configurations |
| 27 | +--------------------- |
| 28 | + |
| 29 | +Note: auto-scaling support is not fully implemented yet (targeted for 0.4.0). |
| 30 | + |
| 31 | +The example configuration above is enough to get started with Ray, but for more |
| 32 | +compute intensive workloads you will want to change the instance types to e.g. |
| 33 | +use GPU or larger compute instance by editing the yaml file. Here are a few common |
| 34 | +configurations: |
| 35 | + |
| 36 | +**GPU single node**: use Ray on a single large GPU instance. |
| 37 | + |
| 38 | +.. code-block:: yaml |
| 39 | +
|
| 40 | + max_workers: 0 |
| 41 | + head_node: |
| 42 | + InstanceType: p2.8xlarge |
| 43 | +
|
| 44 | +**Mixed GPU and CPU nodes**: for RL applications that require proportionally more |
| 45 | +CPU than GPU resources, you can use additional CPU workers with a GPU head node. |
| 46 | + |
| 47 | +.. code-block:: yaml |
| 48 | +
|
| 49 | + max_workers: 10 |
| 50 | + head_node: |
| 51 | + InstanceType: p2.8xlarge |
| 52 | + worker_nodes: |
| 53 | + InstanceType: m4.16xlarge |
| 54 | +
|
| 55 | +**Autoscaling CPU cluster**: use a small head node and have Ray auto-scale |
| 56 | +workers as needed. This can be a cost-efficient configuration for clusters with |
| 57 | +bursty workloads. You can also request spot workers for additional cost savings. |
| 58 | + |
| 59 | +.. code-block:: yaml |
| 60 | +
|
| 61 | + min_workers: 0 |
| 62 | + max_workers: 10 |
| 63 | + head_node: |
| 64 | + InstanceType: m4.large |
| 65 | + worker_nodes: |
| 66 | + InstanceMarketOptions: |
| 67 | + MarketType: spot |
| 68 | + InstanceType: m4.16xlarge |
| 69 | +
|
| 70 | +**Autoscaling GPU cluster**: similar to the autoscaling CPU cluster, but |
| 71 | +with GPU worker nodes instead. |
| 72 | + |
| 73 | +.. code-block:: yaml |
| 74 | +
|
| 75 | + min_workers: 0 |
| 76 | + max_workers: 10 |
| 77 | + head_node: |
| 78 | + InstanceType: m4.large |
| 79 | + worker_nodes: |
| 80 | + InstanceMarketOptions: |
| 81 | + MarketType: spot |
| 82 | + InstanceType: p2.8xlarge |
| 83 | +
|
| 84 | +Additional Cloud providers |
| 85 | +-------------------------- |
| 86 | + |
| 87 | +To use Ray autoscaling on other Cloud providers or cluster management systems, you can implement the ``NodeProvider`` interface |
| 88 | +(~100 LOC) and register it in `node_provider.py <https://github.com/ray-project/ray/tree/master/python/ray/autoscaler/node_provider.py>`__. |
0 commit comments