GCP Instance Parameters

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

  • zone - GCP zone where to run an instance.

  • machineType - a type of the instance to run. You can find a list of predefined machine types here: Machine Types. If you in doubt what to use, just go for n1-standard-1. To attach GPUs to the selected machine type, use the gpu parameter (see the details below).

  • gpu (optional) - a dictionary with keys type and count:
    • type - a type of GPU to attach to the instance. Read more about GPUs and their availabily in different zones here: GPUs on Compute Engine.
    • count (optional) - a number of GPUs that should be attached to the instance. The default value is 1. See here a number of GPUs that you can attach to different machine types: Valid numbers of GPUs for each machine type.
  • onDemandInstance (optional) - run an on-demand instance instead of a preemptible one (available values are “true” or “false”). By default, this value is “false”, so Spotty will be running a preemptible instance. Note: be aware that GCP terminates preemptible instances in 24 hours. Read more about Preemptible VMs here.

  • imageName (optional) - a name of the image with NVIDIA Docker in the current GCP project. You can use the spotty gcp create-image command to create it. By default, the command will create an image with the name “spotty”. This image will be used to run your application inside the Docker container. If you didn’t create your own image, see the behaviour of the imageUrl parameter.

  • imageUrl (optional) - a URL of the image with NVIDIA Docker. You can use this parameter to work with an image from another GCP project. If this parameter is not specified and you didn’t create your own image (see the imageName parameter), Spotty will be using the projects/spotty-cloud/global/images/family/spotty image provided by the Spotty project.

  • bootDiskSize (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 that you need to keep (see the 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:

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

      • deletionPolicy (optional) - what to do with the disk 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: Disks and Deletion Policies.

        (!) Note: Deletion Policies are not implemented yet, so your disks will always retain.

      • diskName (optional) - name of the disk. The default name is “{project_name}-{instance_name}-{volume_name}”.

      • mountDir (optional) - directory where the disk will be mounted on the instance. The default directory is “/mnt/{disk_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.

  • commands (optional) - commands that should be run on the host OS before a container is started.