Read this overview.
Follow this guide to generate new ssh key.
cat >> ~/.ssh/config <<EOF
Host *
User kostyrev
ServerAliveInterval 30
ServerAliveCountMax 10
EOF
Read about brew and install it.
cd ~/
git clone https://github.com/kostyrev/packer-anaconda.git
cd packer-anaconda
git pull --no-edit origin $(git rev-parse --abbrev-ref HEAD) --rebase --ff-only
Read this guide about pull requests.
make anaconda
Use molecule to verify that packer
will build right AMI with all required packages and modifications.
cp .envrc.dist .envrc
and set appropriate environment variables in it.
AWS_PROFILE
is used to configure aws_access_key_id
and aws_secret_access_key
to access AWS API in some AWS account.
For example, you could name your profile fasten-analytics
and configure it:
mkdir ~/.aws/
cat >> ~/.aws/credentials <<EOF
[fasten-analytics]
aws_access_key_id=AKIAIXXXXXXXXXX
aws_secret_access_key=XXXXXXXXXXX
EOF
TF_VAR_spot_price
is a price you willing to pay for an instance on the spot market.
Gradually increase this value until your request for instance is fulfilled.
Export those environment variables by sourcing .envrc
manually
. .envrc
or
read and setup direnv
.
Note: Use
brew install direnv
on MacOS
Note: Do not forget to execute
direnv allow .
after installing.
Note: Use
brew install terraform
on MacOS
Note: Before creating any resources execute
terraform plan
to verify that terraform will do what you planned it to do.
cd terraform/volume
terraform apply
cd ..
terraform apply
connect to instance
ssh -L 127.0.0.1:8888:127.0.0.1:8888 ubuntu@$(terraform output public_address)
run jupiter
jupyter notebook --port=8888 --no-browser
cd terraform/
terraform destroy
Note: Do not cd into terraform/volume and do not
terraform destroy
in it unless you know what you are doing