bfirsh/docker — pull request #7 by nathanleclaire (2014-10-19 20:27:51+00:00)
Title: Ongoing progress with AWS driver for `docker hosts`

```
$ docker hosts create --driver ec2 --no-install kaiju
[info] Security group docker-hosts exists, using...
[info] Creating key pair...
[info] Creating AWS EC2 instance...
[info] Waiting for SSH to become available...
...................................
[info] Provisioning instance...
[info] Setting daemon options to allow connection over TCP...
[info] Restarting docker service to reflect changes...
[info] Tagging instance docker-host-ca14b236d6f1f5658bd604e811a51109b627191a7146816e38e3312216e6a0cf
[info] "kaiju" has been created and is now the active host. Docker commands will now run against that host.
```

Note that this introduces a new vendored dependency: https://github.com/smartystreets/go-aws-auth . It is MIT licensed, and we already have some MIT licensed software vendored, so I assumed it would probably be OK.

This one is really fun, have a play with it and let's discuss the code too. I've still got some cleaning up I'd like to do around decoding the XML in some calls but this is a working v0.0.1 that I wanted to get into peoples' hands ASAP.

ping @bfirsh @cpuguy83 @hopetobelievein PTAL

# History

Make API request to create instance WORK!

Move into subfolder and make schema

Make unmarshalling XML RunInstances response work

Add SSH username

Store InstanceId in driver

Move to hierarchy like:

- /drivers/aws/ec2
- /drivers/aws/ebs

Add skeleton for instance actions

Make instance Remove work!

Genericize easy Instance API calls and implement

Add Error state

Shuffle some stuff around:

- add way to retrieve response from performStandardAction
- start implmenting GetState

Many changes:

- Make environment variables for credentials work
- Describe Instances (status) call now works
- Fix Error state bug
- Tagging instance with name now works correctly

Remove extraneous flush (merge artifact?)

Don't set newly created hosts as active

- There's too much possibility that something will go wrong, lag will
happen etc. Or people writing drivers will bite themselves like me

Implement working public dns / public ip feature

Implement request for Create Key Pair

CreateKeyPairResponse skeleton

Mostly make SSH work

Make SSH and provisioning work

Add SG implementation

Make security group creation and ingress work

A few flourishes around provisioning

- Wait for SSH connection to become available on 22 before provisioning
(prevents races where sshd is not yet started)
- Poll instance state as well to make sure IP Address is set correctly
- Introduce `--no-provision` option to skip default provisioning (useful
if you have rolled your own custom AMI)

Clean up key pair on host rm

Signed-off-by: Nathan LeClaire

Conflicts:
hack/vendor.sh