Skip to main content

=============================== Spotr

Spotr simplifies launching, snapshotting and destroying AWS spot instances.

It's designed for users wanting to use a spot instance as a development box, and persist the state in between sessions.

Quick Start

First, install the library from pip or clone this git repository and install locally:

.. code-block:: sh

$ pip install spotr

.. code-block:: sh

$ pip install -e .

python -m build Next, set up credentials and region (in ~/.aws/config):

.. code-block:: ini

[default]
aws_access_key_id = YOUR_KEY
aws_secret_access_key = YOUR_SECRET
region=us-west-1

Then, launch an instance using:

.. code-block:: sh

$ spotr launch --type p2.xlarge --max-bid .30 --ami ami-4bf20033

List your running spotr instances with:

.. code-block:: sh

$ spotr list

When you're done working, you can save the current state (take a snapshot) using:

.. code-block:: sh

$ spotr snapshot

And then to terminate the instance:

.. code-block:: sh

$ spotr destroy

Next time you launch an instance, leave out the --ami tag and you'll restore the most recent snapshot taken with spotr.

.. code-block:: sh

$ spotr launch --type p2.xlarge --max-bid .30

You can specify default configurations in ~/.spotr/config:

.. code-block:: ini

[config]
max_bid=.30
type=p2.xlarge
ebs_optimized=true
security_group_id=sg-XXXXXXXXXXXXXXX
ami=ami-XXXXXXXXXXXXXXXX
us-west-2a_subnet_id=subnet-XXXXXXXX
us-west-2b_subnet_id=subnet-XXXXXXXX
us-west-2c_subnet_id=subnet-XXXXXXXX
us-west-2d_subnet_id=subnet-XXXXXXXX
iam_instance_profile_arn=arn:aws:iam::XXXXXXXX:instance-profile/instance-profile-role
hosted_zone_id=XXXXXXXXXXX
record_name=subdomain.example.com
user_data=#cloud-config
    runcmd:
        - [ sh, -c, "/bin/bash /opt/dosomethinguseful.sh" ]         

Metadata

Release files for spotr 0.0.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spotr 0.0.16
File Size Uploaded
spotr-0.0.16.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spotr 0.0.16
File Interpreter ABI Platform
spotr-0.0.16-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 23.7 kB

Release files / spotr-0.0.16.tar.gz

Download URL spotr-0.0.16.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a712b46b72838329c3ae5b13e4e0e20b4ac8d7dd0144ca951cec71531d46ff52
BLAKE2b-256 checksum
How to use checksums
ee2aeb013130b16c83bb6248cfeb57d9737613cb64bfb9955917d49f62e7d0da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / spotr-0.0.16-py2.py3-none-any.whl

Download URL spotr-0.0.16-py2.py3-none-any.whl
Size 12.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a364c24f8350d76d572dd30a250399bd707b77a97c95cb74fd7e8c53a6bafd91
BLAKE2b-256 checksum
How to use checksums
50db0ebd2ba3033c9f77d0a24cda6aa12d917b42f4df583d78a351ad6829ef48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.0.16 This release

2 release files

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page