AWS Instance Parameters

Instance parameters are part of the configuration file, but for each provider they are different. Here you can find parameters for an AWS instance:

  • region - AWS region where to run an instance (you can use command spotty aws spot-prices to find the cheapest region).

  • availabilityZone (optional) - AWS availability zone where to run an instance. If a zone is not specified, it will be chosen automatically.

  • subnetId (optional) - AWS subnet ID. If this parameter is set, the “availabilityZone” parameter should be set as well. If it’s not specified, a default subnet will be used.

  • instanceType - a type of the instance to run. You can find more information about types of GPU instances here: Recommended GPU Instances.

  • onDemandInstance (optional) - run On-demand instance instead of a Spot instance. Available values: “true”, “false” (default value is “false”).

  • amiName (optional) - a name of the AMI with NVIDIA Docker (default value is “SpottyAMI”). Use the spotty aws create-ami command to create it. This AMI will be used to run your application inside the Docker container.

  • amiId (optional) - ID of the AMI with NVIDIA Docker. This parameter can be used to run an instance using a shared Spotty AMI.

  • maxPrice (optional) - the maximum price per hour that you are willing to pay for a Spot Instance. By default, it’s the On-demand price for the chosen instance type. Read more here: Spot Instances.

  • rootVolumeSize (optional) - size of the root volume in GB. The root volume will be destroyed once the instance is terminated. Use attached volumes to store the data you need to keep (see “volumes” parameter below).

  • dockerDataRoot (optional) - directory where Docker will store all downloaded and built images. Read more: How to cache a Docker image.

  • volumes (optional) - the list of volumes to attach to the instance:
    • name - a name of the volume. This name should match one of the container’s volumeMounts to have this volume attached to the container’s filesystem.

    • parameters (optional) - parameters of the volume:

      • type (optional) - the volume type. Supported types: “gp2”, “sc1”, “st1” and “standard”. The default value is “gp2”. Read more here: Amazon EBS Volume Types.

      • size (optional) - size of the volume in GB. Size of the volume cannot be less than the size of the existing snapshot but can be increased.

      • deletionPolicy (optional) - what to do with the volume once the instance is terminated using the spotty stop command. Possible values include: “create_snapshot(value by default), “update_snapshot”, “retain” and “delete”. Read more here: Volumes and Deletion Policies.

      • volumeName (optional) - name of the EBS volume. The default name is “{project_name}-{instance_name}-{volume_name}”.

      • mountDir (optional) - directory where the volume will be mounted on the instance. The default directory is “/mnt/{ebs_volume_name}”.

  • localSshPort (optional) - if the local SSH port is specified, the commands spotty ssh, spotty run and spotty sync will do SSH connections to the instance using the IP address and the specified port. It can be useful in case when the instance doesn’t have a public IP address and SSH access is provided through a tunnel to a local port.

  • managedPolicyArns (optional) - a list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the instance role. Read more about Managed Policies here.

  • commands (optional) - commands that should be run on the host OS before a container is started. For example, you could login to Amazon ECR to pull a Docker image from there (Deep Learning Containers Images):
      commands: |
        $(aws ecr get-login --no-include-email --region us-east-2 --registry-ids 763104351884)