Installation

Alto requires Python 3.8 and above. It can be installed via pip:

$ pip install --upgrade pip
$ pip install alto-dev

Creating your first project

Alto has a powerful CLI that allows users to instantiate, modify, and execute their projects. To initialize your first project, use alto init:

$ alto init

What type of cloud environment do you want to use [ec2]? ec2
What would you like the name of your configuration file to be (default: alto.yml)?

<HH:MM:SS> | INFO | Building configuration file...
<HH:MM:SS> | INFO | Done!

This command builds an Alto configuration file in your current directory. Configuration files are simple YAML files, so don’t worry about having to learn a new domain-specific language.

Running your first project

To run your project on your cloud environment, use the alto build command. Under the hood, this command:

  • Builds the cloud environment according to instructions contained in the configuration file, and
  • Executes your project on the cloud.

Here’s what the build command does when the user wants to run their code on an EC2 instance:

$ alto build -f nomad.yml
<HH:MM:SS> | INFO  | my_cloud_agent[build]  | Created key pair my_cloud_agent
<HH:MM:SS> | INFO  | my_cloud_agent[build]  | Created security group with ID sg-XXXXXXXXXXXXXXXXX in VPC vpc-XXXXXXXXXXXXXXXXX
<HH:MM:SS> | INFO  | my_cloud_agent[build]  | Created EC2 instance with ID i-XXXXXXXXXXXXXXXXX
<HH:MM:SS> | INFO  | my_cloud_agent[build]  | Instance i-XXXXXXXXXXXXXXXXX is pending... checking again in 5 seconds
<HH:MM:SS> | INFO  | my_cloud_agent[build]  | Instance i-XXXXXXXXXXXXXXXXX is pending... checking again in 5 seconds
<HH:MM:SS> | INFO  | my_cloud_agent[build]  | Instance i-XXXXXXXXXXXXXXXXX is pending... checking again in 5 seconds
<HH:MM:SS> | INFO  | my_cloud_agent[build]  | Instance i-XXXXXXXXXXXXXXXXX is pending... checking again in 5 seconds
...
...
<HH:MM:SS> | INFO  | my_cloud_agent[run]    | Done!
<HH:MM:SS> | INFO  | my_cloud_agent[delete] | Deleting key-pair my_cloud_agent at /../../../my_cloud_agent.pem
<HH:MM:SS> | INFO  | my_cloud_agent[delete] | Deleting instance i-XXXXXXXXXXXXXXXXX
<HH:MM:SS> | INFO  | my_cloud_agent[delete] | Deleting security group sg-XXXXXXXXXXXXXXXXX

Alternatively, you could use the alto apply command to first build the cloud environment and then use alto run to actually run the code.

A full description of the CLI commands can be found here.