A Kernel Proxy to restart your kernels in place.
Project description
In Place restarter
A Jupyter kernel proxy which can be useful for inplace restart.
In hpc system for example you might not want to go back through the scheduler. it might be useful to restart in place.
This install a proxy kernel which will forward all the messages to the
underlying kernel, but intercept the %restart
magic to kill and restart the
underlying kernel.
Installing:
$ pip install inplace_restarter
It is recommended to install this in all the environment you want this to work on; if not the original kernelspecs need to refer to the full path of the python environment you wish to use.
Usage
You can use the subcommands
list
to list all the kernels and whether inplace_restarter is installed for them.install
/remove
followed by kernelspec names to install/remove inplace restarted from those.wiz[ard]
, when prompt_toolkit is installed; this will open a dialog box, to let you select the kernels on which to install/remove inplace restarter.
$ python -m inplace_restarter list
In place restarting installed on:
✓ 'atk'
Use:python -m inplace_restarter remove [name,[name...]] to remove
In place restarting installable on:
- 'python3'
- 'mpl'
- 'sns'
Use:python -m inplace_restarter install [name,[name...]] to install
Unknown kernel types, does not know how to install:
✘ 'bash'
✘ 'ir'
✘ 'julia-0.6'
Gotchas:
Automatic install supposes that the kernelspec path on all the system this will be used is the same. This is made to not "Pollute" the kernelspec list; otherwise you will get 2x the number of kernelspec. one to launch the proxy and one to launch the inner kernel.
Usage with remote_ikernel
This should be installable on existing remote_ikernel
spec without further
modifications; Note that on %restart
this will close all the ssh connections
and re-establish them.
Note that it might be possible to install remote_ikernel
on an existing
inplace_restarter
installation in which case the ssh connection will not be
reestablished, and only the remote process will be restarted. Note that this
might be more difficult to deploy due to internal remote_ikernel specifics and
that careful consideration as to whether path involved are with respect to the
local or remote machine working directories, which remote_ikernel might not be
able to properly guess.
how to it modify the kernelspecs ?
inplace restart save the current argument of the kernelspec in a new fields and replace them with the command to start itself.
When started by jupyter; it will attempt to guess what kernel.json
was used,
extract original command to start the kernel, and introduce itself as a Proxy
between the original client and kernel. When it receives the command for an
inplace restart, it will kill the underlying kernel and start a new one, leaving
original connections to the clients.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file inplace_restarter-0.0.3.tar.gz
.
File metadata
- Download URL: inplace_restarter-0.0.3.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52a9da519d30c42479b9856bf7e5e780ec6d2959bd861945d95e18cbe01bad90 |
|
MD5 | 42798f5a5d9e44872f144a4234697c9d |
|
BLAKE2b-256 | b8bf3e7dbf86370b7bd45bd8681cca52e466bb0d235e1d3d5d4ce805a48c2190 |
File details
Details for the file inplace_restarter-0.0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: inplace_restarter-0.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cfb7e01ca7a1bb05489f9c373b99a3a7da03347ab84996448f72303020b97e0 |
|
MD5 | 062490d82940a19872dd1b14e0756950 |
|
BLAKE2b-256 | b91cea1e7790691dec852752ca47cd10e3b4dfcf02274be4eba64bf0693f6a35 |