Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multi kernel manager to handle asynchronous start kernel #402

Closed
wants to merge 109 commits into from

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Oct 20, 2018

This is a work in progress to allow asynchronous start of kernels,
typically kernel that will be submitted via job queue and for which you
do not know (yet), the host on which they will be running.

This is work in progress, but I'm suspecting we want to push for async
methods in a lot of place, and there is imho no hard in making them
async as they don't have to yield.

We can't (AFAICT) change start_kernel to be async as this would be a
change of API for our consumers.

takluyver and others added 30 commits October 9, 2017 15:23
MetaKernelFinder -> KernelFinder
Prototype new kernel discovery machinery
The old URL points to a "This page has moved"-page
Updated URL for Jupyter Kernels in other languages
- use IOLoop.current over IOLoop.instance
- drop removed `loop` arg from PeriodicCallback
- deprecate now-unused IOLoopKernelRestarter.loop
- interrupt_mode="signal" is the default and current behaviour
- With interrupt_mode="message", instead of a signal, a
  `interrupt_request` message on the control port will be sent
Additional to the actual signal, send a message on the control port
this should allow ipykernel's wheel-installed specs to specify `python3` or `python2` and prevent
python2 kernels from launching with sys.executable if the Python version is 3.
A simple lead in to the 'kernel nanny' work, this adds a command so you
can do:
jupyter kernel --kernel python
Carreau and others added 14 commits May 18, 2018 10:32
The license requires that all copies of the software include the license.  This makes sure the license is included in the wheels.  See the wheel documentation [here](https://wheel.readthedocs.io/en/stable/#including-the-license-in-the-generated-wheel-file) for more information.
Don't include extra buffers in message signature
This removes special treatment of IPython console so that other kernels can get command-line args. This doesn't allow the passing of flags, but does allow filenames, etc. Once this fix is in place, kernels can get these args via self.parent.extra_args
Allow third-party kernels to get additional args
Remove commented debug statement that used old API.
@Carreau Carreau force-pushed the async-km branch 3 times, most recently from 08054e3 to 8d474c1 Compare October 20, 2018 03:24
This is a work in progress to allow asynchronous start of kernels,
typically kernel that will be submitted via job queue and for which you
do not know (yet), the host on which they will be running.

This is work in progress, but I'm suspecting we want to push for async
methods in a lot of place, and there is imho no hard in making them
async as they don't _have to_ yield.

We can't (AFAICT) change start_kernel to be async as this would be a
change of API for our consumers.
# this looks weird as we are extra indented, but we are
# indeed defining a conditional method depending on the version
# of Python.
MultiKernelManager.start_kernel_async = start_kernel_async
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be

MultiKernelManager.start_kernel = start_kernel_async

Otherwise, it's not clear to me how start_kernel_async() would get invoked - unless there's some python magic happening that is beyond my limited experience.

kevin-bates added a commit to kevin-bates/jupyter_client that referenced this pull request Feb 16, 2019
Inspired by jupyter#402, but needing support for python 2.7, these changes
essentially apply the same model used in Notebook for supporting
coroutines with appropriately placed yield statements in order to
start multiple kernels simultaneously with the same server instance.
kevin-bates added a commit to kevin-bates/jupyter_client that referenced this pull request Feb 19, 2019
Inspired by jupyter#402, but needing support for python 2.7, these changes
essentially apply the same model used in Notebook for supporting
coroutines with appropriately placed yield statements in order to
start (and restart) multiple kernels simultaneously within the same
server instance.
@SylvainCorlay
Copy link
Member

@Carreau this will need a rebase since we now point master to the old 5.x.

Also, there has been some work on async kernel merged since. You may want to update this.

Ping @davidbrochart

@kevin-bates
Copy link
Member

@SylvainCorlay - I think I'd rather see #428 merged over this PR since #428 would provide a path for Notebook to adopt async kernel management (jupyter/notebook#4479). That said, it's been a while since I've visited this stuff.

@kevin-bates
Copy link
Member

FWIW and per my previous comment, I've rebased #428 with master.

@blink1073
Copy link
Contributor

Closing as superseded by #428. Thanks @Carreau for working on this!

@blink1073 blink1073 closed this Jul 30, 2021
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.