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.0.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.0-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.0.tar.gz.

File metadata

File hashes

Hashes for jupyter_slurm_http_provisioner-0.2.0.tar.gz
Algorithm Hash digest
SHA256 58ced1cfbd1a32e76830b902785e43b5ff4a934e6f0948d1219adc99e9d3d7b9
MD5 0f37fa12a98c672104004db920a9e2f2
BLAKE2b-256 f1e968ff38bc69e307fb34ef9e26760ce9e51f91a2b66d488ea55ccfc1ad5ec0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jupyter_slurm_http_provisioner-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c4de45c711ae269fbdb285e96a7ec3fb48d3f3f1c61669593edbd49e0c9dbd55
MD5 40533f3f2244a87b067c97054f20c95a
BLAKE2b-256 cb31268e782b9fd4b36fcfda30a83bc6a60c5c88625f227fa061bf25996f053a

See more details on using hashes here.

Provenance

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