-
Notifications
You must be signed in to change notification settings - Fork 53
AWS Account Quickstart
The purpose of this quickstart is to clearly outline the steps involved in creating an AWS account from scratch, and obtaining the all of the account information and secure access keys necessary for launching NEXT. AWS provides their own getting started guide, so users should refer here for a more in-depth introduction to AWS as desired.
- Key-pair/Identity File - An SSH private key file.
- Key-pair name - Name of private key file on EC2.
-
Go to
http://aws.amazon.com/
and click Sign Up. -
Follow the on-screen instructions until you are logged into the AWS console.
Running the below will get you set up to run NEXT experiments. Each step is described in detail below.
export AWS_ACCESS_KEY_ID=[access-key]
export AWS_SECRET_ACCESS_KEY=[secret-key]
export KEY_FILE=/Users/scott/Classes/security/AWS/next_key_scott.pem # the path to the key
export KEY_PAIR=next_key_scott # the key I downloaded is next_key_scott.pem
export AWS_BUCKET_NAME=[buckid]
Running these commands will get you setup to use NEXT, and prepared to run the examples.
-
Go to the Security Credentials in the dropdown under your name.
-
Click on the Access Keys (Access Key ID and Secret Access Key) tab.
-
Click the create new access key button. In the corresponding pop-up, click show access keys. Write your Access Key ID and Secret Access Key down or save them to a secure location for later reference.
-
Go to the AWS EC2 console.
-
Click on Security Groups in the left navbar.
-
Click Create Key Pair and download your private
.pem
key file. Then use the following command to set the permissions of your private key file so that only you can read it:$ chmod 400 [my_private_key_name].pem
We now have all of the AWS credentials we need to launch NEXT. But before we launch NEXT we need to create an S3 bucket on AWS, where all experiment backups will be stored.
If you haven't already, clone the repo and install the local requirements using:
$ git clone https://github.com/nextml/NEXT.git
$ cd NEXT
$ sudo pip install -r local_requirements.txt
Then set your AWS Access Key ID and Secret Access Key as local environment variables using:
$ export AWS_SECRET_ACCESS_KEY=[your_secret_aws_access_key_here]
$ export AWS_ACCESS_KEY_ID=[your_aws_access_key_id_here]
Now we can use the createbucket
command to create our bucket:
$ cd ec2
$ python next_ec2.py --key-pair=[keypair] --identity-file=[key-file] createbucket [cluster-name]
where:
-
[keypair]
is the name of your EC2 key pair -
[key-file]
is the private.pem
key file for your key pair -
[cluster-name]
is the custom name you create and assign to your cluster
This will print out another environment variable command, export AWS_BUCKET_NAME=[bucket_uid]
.
Once it does, navigate to the S3 Management Console and verify that a bucket named [bucket_uid]
from above created.
Than we run export NEXT_BACKEND_GLOBAL_HOST=[public-dns]
where [public-dns]
can be found at AWS > EC2 > [click on launched instance] > Public DNS
(it's viewable in the footer/menu for the instance).
Once this is done, we are ready to run the examples found in NEXT/examples
.