Skip to main content

Start a remote Kernel via http in a slurm job, and connect to it with ssh tunnels

Project description

Slurm HTTP Provisioner

What is this package

This package is a Jupyter Kernel Provisioner.

It uses an http(s) api to launch a remote kernel in a slurm job and ssh tunnels to 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

See the example file

2 - Setup a kernel

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

#~/.local/share/jupyter/kernels/slurm-http/kernel.json
{
  "display_name": "Python 3 (Slurm HTTP)",
  "language": "python",
  "metadata": {
    "kernel_provisioner": {
      "provisioner_name": "slurm-http-provisioner",
      "config": {
        "url": "http://example.com",
        "api_key": "1234",
        "secret": "123456789",
        "username": "debian",
        "hostname": "xxx.xxx.xxx.xxx"
      }
    }
  }
}

See the example file

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-http-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_http_provisioner-0.2.1.tar.gz (6.9 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_http_provisioner-0.2.1-py2.py3-none-any.whl (6.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file jupyter_slurm_http_provisioner-0.2.1.tar.gz.

File metadata

File hashes

Hashes for jupyter_slurm_http_provisioner-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a284ad9cdb2e61b4c75beab1b7a84fbfcbd205bbc3eebc51a3c030b68777c358
MD5 fca18a6f99ca3f60d9576e940fb298fa
BLAKE2b-256 417221306d28fa234908811b7ee14c66681e7cee8e25ae02bd29d69a9a9179f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_slurm_http_provisioner-0.2.1.tar.gz:

Publisher: python-publish.yml on Ninichus/jupyter_slurm_http_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_http_provisioner-0.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_slurm_http_provisioner-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c160d4cf54c8606c67fba26b9edf059a619a4e9abbe1d4fc38eb2f9f4bd08ba3
MD5 402c2a0a8001a96680080c72ba5ba4e4
BLAKE2b-256 a9460f83cfd317f7af7923932f08fb87bf492e4e3e1508ae75467684ae194dbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_slurm_http_provisioner-0.2.1-py2.py3-none-any.whl:

Publisher: python-publish.yml on Ninichus/jupyter_slurm_http_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