[IPython-User] connecting to remote kernel in 0.11

MinRK benjaminrk@gmail....
Mon Aug 8 13:53:10 CDT 2011


On Mon, Aug 8, 2011 at 05:02, neil rabinowitz <
neil.rabinowitz@merton.ox.ac.uk> wrote:

> further to all this -- i realised that if i'm trying to launch a kernel
> remotely via ssh, i can't simply type "ipython qtconsole" as i don't have a
> display attached (without forwarding an X session or using some other remote
> desktopping).
>
> so: is there a way to initiate a kernel *without* an initial console, but
> that is receptive to attach new consoles? for example, if i simply launch
> ipython, does this create a suitable kernel? and, if so, how do i determine
> the "--existing --shell=..." flags?


We don't have a nice way to start the kernel (until
#687<https://github.com/ipython/ipython/pull/687>is merged), but you
can launch one with the command used by the frontend:

    python -c 'from IPython.zmq.ipkernel import main; main()'

The message explaining how to connect to the kernel is actually printed by
the kernel itself, so it will still appear.

I did discover that the heartbeat port does not get printed correctly (you
will see --hb=0) unless you specify it. This is also fixed in my PR above,
but for now you have to add it to the above command:

    python -c 'from IPython.zmq.ipkernel import main; main()' --hb=12345

So, on your server do:

    python -c 'from IPython.zmq.ipkernel import main; main()' --hb=54321

And on the client, forward your ports and connect as you described in the
cookbook.

But after my two pull requests are merged, it will be:

[server] $> ipython kernel
# copy --existing....
[client] $> ipython qtconsole --ssh=<server-address> --existing...

Or, if the client does not have direct ssh access to the server, but rather
via a third login machine:

[server] $> ipython kernel --ip=0.0.0.0
[client] $> ipython qtconsole --ssh=<login-machine> --ip=<server-ip-address>
--existing...

-MinRK


>
>
> On Mon, Aug 8, 2011 at 12:47 PM, neil rabinowitz <
> neil.rabinowitz@merton.ox.ac.uk> wrote:
>
>> ok, it's on the wiki now:
>> <http://wiki.ipython.org/Cookbook/Connecting_to_a_remote_kernel_via_ssh>
>>
>> i've made it all rst, but this means that the wiki doesn't pick up on
>> headings etc.
>>
>> minrk: is your commit relevant to my use case? if so, do i do anything
>> differently now?
>>
>>
>>
>> On Mon, Aug 8, 2011 at 11:01 AM, Thomas Kluyver <takowl@gmail.com> wrote:
>>
>>> On 8 August 2011 00:13, Fernando Perez <fperez.net@gmail.com> wrote:
>>>
>>>> Note: when editing the wikil, please make the page be all
>>>> reStructuredText by putting the whole page between <rst> tags:
>>>>
>>>> <rst>
>>>> content here...
>>>> </rst>
>>>>
>>>
>>> One small addition to this: if you want to have chunks of highlighted
>>> Python code on a wiki page, put them *outside* the <rst></rst> blocks, and
>>> enclose them with <syntaxhighlight></syntaxhighlight> tags.
>>>
>>> Thomas
>>>
>>
>>
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20110808/9cfd91aa/attachment.html 


More information about the IPython-User mailing list