ooici/pyon — pull request #192 by daf (2012-11-28 20:20:34+00:00)
Title: Add "manhole" feature to pyon

Containers started with `-n`/`--noshell` now expose a remote interface to be connected to.

### Highlights
- ipython bumped to 0.13
- uses built in ipython remote access: `ipython console --existing manhole-.json`
- can disable the manhole with `-o`/`--nomanhole` which implies `-n`

### Caveats
- ipython internally uses zmq for client/server style model
- requires monkeypatch of zmq device which is not gevent-safe (zmq people have long term goal of making lib safe with gevent instead of gevent_zeromq)
- tab-completion not yet supported

### Future
- fix tab-completion
- make `bin/manhole` because ipython command line syntax is longish

### Example session

###### Terminal 1
```
$ ./bin/pycc -n --rel=res/deploy/examples/hello.yml
pycc: ION Container starter with command line options: Namespace(broker_clean=False, config=[], config_from_directory=False, daemon=False, force_clean=False, immediate=False, logcfg=None, mx=False, no_container=False, nomanhole=False, noshell=True, pidfile=None, proc=None, rel='res/deploy/examples/hello.yml', signalparent=False, sysname=None)
[snip]
[CC-Main 15:16:42 INFO pyon.container.cc:202] Container (ASA-DEVELOPERs-MacBook-Pro_local_15735) started, OK.
[CC-Main 15:16:42 INFO pyon.container.apps: 36] AppManager.start_rel_from_url(rel_url=res/deploy/examples/hello.yml) ...
[IPKernelApp] To connect another client to this kernel, use:
[IPKernelApp] --existing /Users/asadeveloper/Documents/Dev/code/pyon/manhole-15735.json
```

###### Terminal 2
```
$ ./bin/ipython console --existing manhole-15735.json

Python 2.7.3 (default, Sep 12 2012, 10:59:29)
[snip]

In [1]: cc
Out[1]:

In [2]: cc.proc_manager.procs_by_name
Out[2]:
{'hello': ,
'hello1': }

In [3]:
```