Spotty Commands

  • Start an instance:

    spotty start  [-h] [-d] [-c CONFIG] [--dry-run] [INSTANCE_NAME]

    Runs an instance, synchronizes the project with that instance and starts the Docker container.

    Use the --dry-run flag to display the steps that will be performed without actually running them.

  • Stop an instance:

    spotty stop [-h] [-d] [-c CONFIG] [INSTANCE_NAME]

    Terminates the running instance and applies deletion policies for the volumes.

  • Connect to an instance:

    spotty ssh [-h] [-d] [-c CONFIG] [-H] [-s SESSION_NAME] [-l]

    Connects to the running Docker container or to the instance itself. Use the -H flag to connect to the host OS instead of the Docker container.

  • Sync the project with an instance:

    spotty sync [-h] [-d] [-c CONFIG] [--dry-run] [INSTANCE_NAME]

    Synchronizes the project with the running instance. It happens automatically the first time when you start an instance.

  • Download files from an instance:

    spotty download [-h] [-d] [-c CONFIG] -i PATTERN [--dry-run]

    Downloads files from the running instance. The PATTERN parameter has the same format and works in the same way as Include Filters for the aws s3 sync command: see Sync Filters.

  • Run a custom script on an instance:

    spotty run [-h] [-d] [-c CONFIG] [-s SESSION_NAME] [-S] [-l] [-r]
               [-p PARAMETER=VALUE]

    Runs a custom script inside the Docker container (see “scripts” section in Configuration File).

    Use the Ctrl + b, then x combination of keys to kill tmux window with the process.

    Use the Ctrl + b, then d combination of keys to be detached from the SSH session. The script will keep running. Call the spotty run command again to be reattached to the running script. Read more about tmux here: tmux Wiki.

    If you need to run the same script several times in parallel, use the -s parameter to specify a different name for a tmux session.

    To restart a running script, use the -r flag.

    To synchronize the project with the instance before running a script, use the -S flag.

    Scripts can be parametrized. Parameters in a script are indicated by double braces. For example, echo {{msg1}} {{msg2}}. Use the -p parameter to replace script parameters with real values: -p msg1=deep -p msg2=learning. If some script parameters were not provided, they will be replaced with empty strings.

All the commands have the -c parameter to specify a path to the configuration file. By default, Spotty is looking for a spotty.yaml file in the current working directory.