This repository contains scripts and such to build an AWS AMI for running a rippled docker container given a specific git hash or tag.
Files are named according to execution order for ease in documenting.
$ export AWS_ACCESS_KEY=FOO
$ export AWS_SECRET_KEY=FOO
$ packer build 00-packer.json
The above commands perform the following:
- Starts up an EC2 instance based on the latest Ubuntu
- Installs ansible
- Runs 01-configure-base-ami.yml, which:
- Installs docker
- Copies 03-ami-boot.yml and rippled.cfg to /root/
- Replaces /etc/rc.local with 02-ami-rc-local.sh
- Installs sumologic collector
- Configures the sumologic collector with private keys from sumo-config.yml
Once the AMI is built, the image will perform the following at boot:
- Download the instance's user data from the AWS API, which is saved as /root/testnet-config.yml
- Runs 03-ami-boot/main.yml, which:
- Pulls latest rippled dockder image
- Installs rippled.cfg to /srv/rippled/rippled.cfg
- Starts the docker image, exporting all ports and mounting /srv/rippled inside the container.
The user data that is downloaded must contain a yaml document. Here is an example:
---
rippled_version: some-git-ref