deis/deis — pull request #2203 by aledbf (2014-10-21 04:32:14+00:00)
Title: WIP: feat(builder) replace boot with go and add use the data store to reuse sshd

This introduces the use of deis-store to backup and restore the ssh configuration of the builder so if the deis-builder is scheduled in other host the ssh keys will be the same. This is not yet ready to merge but I want to hear opinions about this.

*Running output:*
```console
$ docker run --rm -p 2223:22 --volumes-from=deis-builder-data -e EXTERNAL_PORT=2223 -e HOST=$COREOS_PRIVATE_IPV4 --privileged
waiting for missing etcd keys...
waiting for missing etcd keys...
restoring SSH keys from the store...
loading cedarish...
building slugbuilder and slugrunner...
Server listening on 0.0.0.0 port 22.
Server listening on :: port 22.
deis-builder running...
```

To provide more info the app use visionmedia go-debug to be able to use DEBUG using `-e DEBUG=*`

```console
$ docker run --rm -p 2223:22 --volumes-from=deis-builder-data -e EXTERNAL_PORT=2223 -e HOST=$COREOS_PRIVATE_IPV4 --privileged
03:40:38.656 6us 5us builder:boot - Starting deis-builder...
03:40:38.660 3ms 3ms builder:boot - returning default value "4001" for key "ETCD_PORT"
03:40:38.660 3us 3us builder:boot - returning default value "/deis/builder" for key "ETCD_PATH"
03:40:38.660 3us 3us builder:boot - returning default value "btrfs" for key "STORAGE_DRIVER"
waiting for missing etcd keys...
waiting for missing etcd keys...
03:40:50.684 12s 12s builder:store - Connecting to the store deis-store.local.deisapp.com (fake name)
03:40:50.684 104us 104us builder:store - connecting to ceph store
03:40:50.941 256ms 256ms builder:store - checking if there is a backup of the ssh files in the store
restoring SSH keys from the store...
2014/10/21 03:40:51 105: Key already exists (/deis/builder/users) [26577]
03:40:51.483 12s 12s builder:boot - Waiting for docker daemon to be available...
03:40:51.485 2ms 2ms builder:boot - starting docker daemon...
03:40:52.752 1s 1s builder:boot - checking for cedarish...
loading cedarish...
building slugbuilder and slugrunner...
03:42:16.323 83s 83s builder:boot - building image deis/slugbuilder...
03:45:37.262 200s 200s builder:boot - building image deis/slugrunner...
03:48:13.535 156s 156s builder:boot - starting ssh server...
Server listening on 0.0.0.0 port 22.
03:48:13.717 181ms 181ms builder:boot - docker daemon started...
Server listening on :: port 22.
deis-builder running...
```

After the first run:

```console
$ docker run --rm -p 2223:22 --volumes-from=deis-builder-data -e EXTERNAL_PORT=2223 -e HOST=$COREOS_PRIVATE_IPV4 --privileged
waiting for missing etcd keys...
waiting for missing etcd keys...
restoring SSH keys from the store...
2014/10/21 03:49:01 105: Key already exists (/deis/builder/users) [30103]
cedarish already loaded
building slugbuilder and slugrunner...
Server listening on 0.0.0.0 port 22.
deis-builder running...
Server listening on :: port 22.
```

this requires #2131