Skip to main content

Start a remote Kernel via ssh in a slurm job

Project description

Slurm SSH Provisioner

What is this package

This package is a Jupyter Kernel Provisioner.

It uses ssh tunnels to launch a remote kernel in a slurm job and connect to it.

Once configured, on the Jupyter Notebook / Lab interface, you can just select a kernel using this provisioner and it will set up everything accordingly.

Setup

1 - Build a remote wrapper script

This remote wrapper will be called when we want to launch the kernel. Thus, it should:

  • Start a slurm job that will start a kernel (the connection file should be named .../kernel-{slurm_job_id}.json, thus the command inside a batch script could be python -m ipykernel_launcher -f=/tmp/kernel-${SLURM_JOB_ID}.json)
  • Wait for the job to start
  • Return the slurm job id

2 - Setup a kernel

This is the kernel that will use the slurm-ssh-provisioner. It will be displayed in the Notebook / Lab interface.

#~/.local/share/jupyter/kernels/slurm-ssh/kernel.json
{
  "display_name": "Python 3 (Slurm SSH)",
  "language": "python",
  "metadata": {
    "kernel_provisioner": {
      "provisioner_name": "slurm-ssh-provisioner",
      "config": {
        "host": "xxx.xxx.xxx.xxx",
        "username": "debian",
        "first_local_port": 9000,
        "wrapper_cmd": "bash wrapper.sh"
      }
    }
  }
}

3 - Voilà

You should now be able to use this new kernel.

Use jupyter kernelspec list to check your kernel is detected. Use jupyter kernelspec provisioners to check that slurm-ssh-provisioner is installed.

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

jupyter_slurm_ssh_provisioner-0.2.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

jupyter_slurm_ssh_provisioner-0.2.0-py2.py3-none-any.whl (6.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file jupyter_slurm_ssh_provisioner-0.2.0.tar.gz.

File metadata

File hashes

Hashes for jupyter_slurm_ssh_provisioner-0.2.0.tar.gz
Algorithm Hash digest
SHA256 93d8e4f9577b79bce3c6c2fa84d5861ff9a34bf4b0e24dc7f7b9e33cf8d9d981
MD5 ad2a7cb7bc2b1c5e405d65d7d7161a70
BLAKE2b-256 22443e8225a80be042a5b0462fb63bab99bc4e49d466446dcf74befd5cdec46f

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_slurm_ssh_provisioner-0.2.0.tar.gz:

Publisher: python-publish.yml on Ninichus/jupyter_slurm_ssh_provisioner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jupyter_slurm_ssh_provisioner-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_slurm_ssh_provisioner-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a902eb3f24751e7b86bff3f2d7e496642b01ef980d908723fbca736c33886673
MD5 58a1688e0fa2c47867b81d6c8ae32929
BLAKE2b-256 9ec6989510140f1c93eb5caa3f326bf07e3581908f098625ef8e74a410adeb94

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_slurm_ssh_provisioner-0.2.0-py2.py3-none-any.whl:

Publisher: python-publish.yml on Ninichus/jupyter_slurm_ssh_provisioner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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