Skip to main content

Running IPython kernels through batch queues

Project description

Launch IPython/Jupyter kernels on remote systems so that they can be used with local noteboooks.

Kernels start through interactive jobs in batch queue systems (only SGE and SLURM at the moment) or through SSH connections. Once the kernel is started, SSH tunnels are created for the communication ports are so the notebook can talk to the kernel as if it was local.

Commands for managing the kernels are included.

Install with pip install remote_ikernel. Requires IPython version 3.0 or greater and pexpect. Passwordless ssh to the remote machines is also required.

# Install the module ('python setup.py install' also works)

pip install remote_ikernel
# Set up the kernels you'd like to use

remote_ikernel manage
# Add a new kernel running through GrideEngine

remote_ikernel manage --add \
    --kernel_cmd="ipython kernel -f {connection_file}" \
    --name="Python 2.7" --cpus=2 --pe=smp --interface=sge
# Add an SSH connection to a remote machine running IJulia

remote_ikernel manage --add \
    --kernel_cmd="/home/me/julia-79599ada44/bin/julia -i -F /home/me/.julia/v0.3/IJulia/src/kernel.jl {connection_file}" \
    --name="IJulia 0.3.8" --interface=ssh \
    --host=me@remote.machine --workdir='/home/me/Workdir' --language=julia
# Set up kernels for all your local virtual environments that can be run
# from a single notebook server.

remote_ikernel manage --add \
    --kernel_cmd="/home/me/Virtualenvs/dev/bin/ipython kernel -f {connection_file}" \
    --name="Python 2 (venv:dev)" --interface=local

The kernel spec files will be installed so that the new kernel appears in the drop-down list in the notebook.

Changes for v0.2

  • --remote-launch-args can be used to set qlogin parameters or similar.

  • --remote-precmd allows execution of an extra command on the remote host before launching a kernel.

  • Better compatibility with Python 3.

  • Kernel output on terminals with --verbose option for debugging.

  • Connect to a host with ssh, slurm, or local kernels.

  • Changed prefix to rik_.

  • kernel_cmd now requires the {connection_file} argument.

  • remote_ikernel manage --show command to show existing kernels.

  • Specify the working directory on the remote machine with --workdir.

  • kernel-uuid.json is copied to the working director for systems where there is no access to the frontend filesystem.

  • Added compatibility layer to get rid of Jupyter warnings.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

remote_ikernel-0.2.8.tar.gz (9.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

remote_ikernel-0.2.8-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

remote_ikernel-0.2.8-py2-none-any.whl (13.6 kB view details)

Uploaded Python 2

File details

Details for the file remote_ikernel-0.2.8.tar.gz.

File metadata

File hashes

Hashes for remote_ikernel-0.2.8.tar.gz
Algorithm Hash digest
SHA256 d56857965afece827f811095a5458ade502b74046db1482929beb35039f82c25
MD5 6811cd7e65ac4c3a3b55a44ce5bc34f2
BLAKE2b-256 4e35b14b231b73e37fad6818c51cb70615dd06b1a39556a7e7c58882dd8deb0c

See more details on using hashes here.

File details

Details for the file remote_ikernel-0.2.8-py3-none-any.whl.

File metadata

File hashes

Hashes for remote_ikernel-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5d860b0e425eca83fdb04e855f4481e909e8d060b5efe95f4eb93cfc3af5ed30
MD5 0e0244ae88fbc15844360562794e9e19
BLAKE2b-256 412fd57825adc92960cde212b2bd64f40a26efdbb216050c8a4278b35b100ae8

See more details on using hashes here.

File details

Details for the file remote_ikernel-0.2.8-py2-none-any.whl.

File metadata

File hashes

Hashes for remote_ikernel-0.2.8-py2-none-any.whl
Algorithm Hash digest
SHA256 a5904dadf5a85c7d383a6d5421acd314732847028ba4925bf1e17dc22467754e
MD5 8b5c8b447ccdd7a266185bc27e554f4a
BLAKE2b-256 479a04ec97ad7ec8c734fe999ff1aafea45a40ffcd152e87e02c05767967a84a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page