deis/deis — pull request #1837 by johanneswuerbach (2014-09-15 04:56:44+00:00)
Title: WIP: Interactive deis run

**WIP** / **Proof of concept**
The goal of this PR is to provide an interactive deis run and to be able to schedule command running using fleet.

To achieve this I added two components. pty is a container scheduled using fleet. It executes the actual command and provides a tcp socket to read from stdout and write to stdin. In it's ExecStopPost hook it's writes it's host and port into an etcd key.

The other component is pty-proxy, which connects to a pty (using the etcd key) and provides a websocket for the deis client to be able to access the commands in- and output.

Drawing:
```
client run --> controller --> schedules pty with command and unqiue id
unique id <--| |
| host and port in etcd
V
client -- websocket with unique id --> pty-proxy -> (tcp to etcd host and port) -> pty

```

I didn't completely wire it up yet as I didn't had enough time and I would like to use the run scheduling from #1833.

What do you think? Is there anything I'm missing?

PS: Thanks @bacongobbler for the help and some of the code.

Tasks:
- [x] pty component
- [x] pty proxy forwarding the tcp connection
- [ ] change the run scheduling
- [ ] proxy access via router
- [ ] changed deis client