# An unique identifier for the head node and workers of this cluster.
cluster_name: sgd-coco-pytorch

# The maximum number of workers nodes to launch in addition to the head
# node. This takes precedence over min_workers. min_workers default to 0.
min_workers: 1
initial_workers: 1
max_workers: 1

target_utilization_fraction: 0.9
# Cloud-provider specific configuration.
provider:
    type: aws
    region: us-east-1
    availability_zone: us-east-1c

# How Ray will authenticate with newly launched nodes.
auth:
    ssh_user: ubuntu


head_node:
    InstanceType: p3.8xlarge
    ImageId: ami-0698bcaf8bd9ef56d
    InstanceMarketOptions:
        MarketType: spot
    BlockDeviceMappings:
        - DeviceName: /dev/sda1
          Ebs:
              VolumeSize: 300


worker_nodes:
    InstanceType: p3.8xlarge
    ImageId: ami-0698bcaf8bd9ef56d
    InstanceMarketOptions:
        MarketType: spot
    BlockDeviceMappings:
        - DeviceName: /dev/sda1
          Ebs:
              VolumeSize: 300

setup_commands:
    # This replaces the standard anaconda Ray installation
    - ray || pip install -U https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-1.2.0.dev0-cp36-cp36m-manylinux2014_x86_64.whl
    # Uncomment this and the filemount to update the Ray installation with your local Ray code
    # - rm -rf ./anaconda3/lib/python3.6/site-packages/ray/util/sgd/
    # - cp -rf ~/sgd ./anaconda3/lib/python3.6/site-packages/ray/util/
    - pip install -q tqdm

    # Installing this without -U to make sure we don't replace the existing Ray installation
    - pip install ray[rllib]
    - pip install -U ipdb torch torchvision pycocotools
    # Install Apex if needed.
    - git clone https://github.com/NVIDIA/apex; cd apex && pip install -v --no-cache-dir  ./ || true


file_mounts: {
    # # This should point to ray/python/ray/util/sgd.
    # ~/sgd: ../../../../sgd,
}
