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.3.0.tar.gz (6.5 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.3.0-py2.py3-none-any.whl (6.4 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for jupyter_slurm_http_provisioner-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6f2c08e5c72ecff4cd20a0968ccca7a138c2c5528a41b689175370634cffff2b
MD5 fba3003a414e0c2e69a64630c4cbeead
BLAKE2b-256 564e56f056cbc9c31a42a46ed53666771d92751b7d92120dd96cbcf83d1dca7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_slurm_http_provisioner-0.3.0.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.3.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_slurm_http_provisioner-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fb2e2c5ab437ae7d53fd6662057e457273607b0d90a86e046c87a4fd24844d40
MD5 848e5eda46a9a70de46dcb2e0b3eb4ab
BLAKE2b-256 891829b7eb77ba121075399bb2d62d7fba65dd70059e306508c7bd0ec00a5ab5

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyter_slurm_http_provisioner-0.3.0-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