Skip to content

Merge divergent Kernel implementations#1630

Merged
ellisonbg merged 69 commits into
ipython:masterfrom
minrk:mergekernel
May 25, 2012
Merged

Merge divergent Kernel implementations#1630
ellisonbg merged 69 commits into
ipython:masterfrom
minrk:mergekernel

Conversation

@minrk
Copy link
Copy Markdown
Member

@minrk minrk commented Apr 19, 2012

Work in progress.

The principal change is to merge the Kernel implementation used in IPython.parallel into that in ipkernel.

Changes involved in that:

  • Use IOLoop/ZMQStreams in the Kernel
  • add apply_request handler
  • allow multiple input streams (control, mux, task)

Related changes along the way:

  • add support for silent in run_cell(). Previously, execute_requests used run_code, which meant it didn't support IPython syntax.
  • parallel execute() uses execute_request instead of apply

Changes still to make:

  • pykernel has been removed, but various related configuration options remain, and should be scrubbed.

I don't know if this code belongs in 0.13 or should go in first thing in 0.14.dev. It's a pretty big change, and test coverage for this code is still relatively poor.

@fperez
Copy link
Copy Markdown
Member

fperez commented Apr 19, 2012

Great, thanks for getting this in motion. I'll start digging into it.

@takluyver
Copy link
Copy Markdown
Member

Re pykernel removal: Am I right that pykernel was our pure-Python kernel, without all the IPython secret sauce? Is there something similar that replaces it? It strikes me as potentially useful, both as an easy to understand example, and as a Python execution server for non-interactive use.

@minrk
Copy link
Copy Markdown
Member Author

minrk commented Apr 19, 2012

It's removed for a few reasons:

  • it s ~never used
  • it is frequently broken
  • it fails to comply with the message spec quite a bit
  • it is almost entirely duplicate code of ipkernel

For use as an example, one can always find it in 0.12.

@takluyver
Copy link
Copy Markdown
Member

OK, that's fair enough.

@minrk
Copy link
Copy Markdown
Member Author

minrk commented Apr 23, 2012

references removed to pykernel from Qt and KernelApp

@minrk
Copy link
Copy Markdown
Member Author

minrk commented Apr 24, 2012

#1647 revealed an issue in streamkernel, which would necessarily conflict quite severely with this, as that file has been removed. So a fix for that is now included.

@minrk
Copy link
Copy Markdown
Member Author

minrk commented May 8, 2012

Test results for commit c1a2747 merged into master
Platform: darwin

  • python2.6: OK (libraries not available: matplotlib pymongo qt tornado wx wx.aui)
  • python2.7: OK
  • python3.2: Failed, log at https://gist.github.com/2631856 (libraries not available: matplotlib pymongo qt tornado wx wx.aui)

Not available for testing: python3.1

@takluyver
Copy link
Copy Markdown
Member

The test does seem to be correctly picking up a stray reference to streamkernel - I don't know why it only appears on Python 3.

https://github.com/minrk/ipython/blob/0c2728a924dcb7bdcbddb07f40ca7545186ee1a5/IPython/parallel/apps/ipengineapp.py#L47

@minrk
Copy link
Copy Markdown
Member Author

minrk commented May 8, 2012

Indeed, apparently I messed up a bit in my last rebase.

@minrk
Copy link
Copy Markdown
Member Author

minrk commented May 8, 2012

Test results for commit fc1af3c merged into master
Platform: darwin

Not available for testing: python3.1

@takluyver
Copy link
Copy Markdown
Member

I don't know what's happening with that test failure - it looks like the file was installed without 2to3 having run.

@minrk
Copy link
Copy Markdown
Member Author

minrk commented May 8, 2012

Yes, I will make a PR against test_pr to fix that. Python 3.2 is re-using the build dir from 2.7, so it skips a bunch of 2to3 and I have to rm -rf build between builds.

@takluyver
Copy link
Copy Markdown
Member

OK - I wonder why I don't see that. Maybe a Linux/Mac difference, but I'm not sure quite how.

@minrk
Copy link
Copy Markdown
Member Author

minrk commented May 8, 2012

Yes, I think it is. The build dir gets a 3.2 suffix on Linux, but not on OS X. Only seems to affect pure-Python packages.

@minrk
Copy link
Copy Markdown
Member Author

minrk commented May 9, 2012

Test results for commit 386ef09 merged into master
Platform: darwin

  • python2.6: OK (libraries not available: matplotlib pymongo qt tornado wx wx.aui)
  • python2.7: OK (libraries not available: matplotlib pymongo tornado wx wx.aui zmq)
  • python3.2: OK (libraries not available: matplotlib pymongo qt tornado wx wx.aui)

Not available for testing:

@minrk
Copy link
Copy Markdown
Member Author

minrk commented May 23, 2012

Okay, it seems to be working now. To confirm, you can do:

$> ipcluster start -n 2
from IPython import parallel
rc = parallel.Client()
dv = rc[:]
dv.block = True
dv.activate()

%px from IPython.parallel import bind_kernel; bind_kernel()
%px %qtconsole

Which sets up your engines as full kernels, and then launches a QtConsole attached to each one.

@ellisonbg
Copy link
Copy Markdown
Member

This is fantastic! Do we want to push this one step further and have
a parallel magic that does this automatically for an engine on the
active direct view?

On Tue, May 22, 2012 at 10:32 PM, Min RK
reply@reply.github.com
wrote:

Okay, it seems to be working now.  To confirm, you can do:

   $> ipcluster start -n 2

from IPython import parallel
rc = parallel.Client()
dv = rc[:]
dv.block = True
dv.activate()

%px from IPython.parallel import bind_kernel; bind_kernel()
%px %qtconsole

Which sets up your engines as full kernels, and then launches a QtConsole attached to each one.


Reply to this email directly or view it on GitHub:
#1630 (comment)

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

@fperez
Copy link
Copy Markdown
Member

fperez commented May 23, 2012

This is indeed all kinds of awesome. Great job, Min!!

@minrk
Copy link
Copy Markdown
Member Author

minrk commented May 25, 2012

This is fantastic! Do we want to push this one step further and have
a parallel magic that does this automatically for an engine on the
active direct view?

I'm not sure. It's a lot more common for engines to be remote than regular IPython kernels, and running %qtconsole on a remote engine (or 100 of them!) would not be desirable. If I were to do this, I would want to open a console on the calling machine, connected to the engine, even if it is remote.

In any case, adding to the parallel magics should probably be done after this and #1732 are both merged.

@ellisonbg
Copy link
Copy Markdown
Member

OK, so I think we can merge this PR right?

On Thu, May 24, 2012 at 5:29 PM, Min RK
reply@reply.github.com
wrote:

This is fantastic!  Do we want to push this one step further and have
a parallel magic that does this automatically for an engine on the
active direct view?

I'm not sure.  It's a lot more common for engines to be remote than regular IPython kernels, and running %qtconsole on a remote engine (or 100 of them!) would not be desirable.  If I were to do this, I would want to open a console on the calling machine, connected to the engine, even if it is remote.

In any case, adding to the parallel magics should probably be done after this and #1732 are both merged.


Reply to this email directly or view it on GitHub:
#1630 (comment)

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

@minrk
Copy link
Copy Markdown
Member Author

minrk commented May 25, 2012

Test results for commit 45a4d04 (can't merge cleanly)
Platform: linux2

  • python2.7: OK (libraries not available: pymongo wx wx.aui)
  • python3.2: OK (libraries not available: matplotlib pymongo qt wx wx.aui)

Not available for testing:

@minrk
Copy link
Copy Markdown
Member Author

minrk commented May 25, 2012

Test results for commit 45a4d04 merged into master
Platform: darwin

  • python2.6: OK (libraries not available: matplotlib pymongo qt tornado wx wx.aui)
  • python2.7: OK (libraries not available: wx wx.aui)
  • python3.2: OK (libraries not available: matplotlib pymongo qt wx wx.aui)

Not available for testing:

also increase timeout for kernel start to 10 seconds
@minrk
Copy link
Copy Markdown
Member Author

minrk commented May 25, 2012

the test_pr script doesn't work on Windows, but I was able to do what it does manually, and I was able to run the parallel test suite on Python2.7 and 3.2 on Windows, as well as basic fiddling with the notebook and qtconsole, so I think we are good to go.

@ellisonbg
Copy link
Copy Markdown
Member

OK, merging!

ellisonbg added a commit that referenced this pull request May 25, 2012
Merge divergent Kernel implementations
@ellisonbg ellisonbg merged commit 6cb2026 into ipython:master May 25, 2012
@fperez
Copy link
Copy Markdown
Member

fperez commented May 25, 2012

Awesome job, @minrk! And thanks to everyone who pitched in. This is a major milestone for the project.

@minrk minrk deleted the mergekernel branch March 31, 2014 23:36
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Merge divergent Kernel implementations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants