Skip to main content

Jupyter Port Forwarding Utility

Project description

jupyter-forward

Badges

CI GitHub Workflow Status GitHub Workflow Status Code Coverage Status
Docs Documentation Status
Package Conda PyPI
License License

Overview

Jupyter-forward simplifies the process of running jupyter lab on a remote machine by performing the following tasks on behalf of the users:

  1. Log into a remote cluster/resource via the SSH protocol.
  2. Launch Jupyter Lab on the remote cluster.
  3. Port forward Jupyter Lab session back to your local machine!
  4. Opening the port forwarded Jupyter Lab session into your local browser

Usage

 jupyter-forward --help
Usage: jupyter-forward [OPTIONS] COMMAND [ARGS]...

  Jupyter Lab Port Forwarding Utility

Options:
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or
                        customize the installation.

  --help                Show this message and exit.

Commands:
  end     Stops the running Jupyter Lab server.
  resume  Resumes an already running remote Jupyter Lab session.
  start   Starts Jupyter lab on a remote resource and port forwards session...

Launching Jupyter Lab on a Remote Cluster

jupyter-forward provides functionality to launch a jupyter lab session on a remote cluster via the start command:

 jupyter-forward start --help

Usage: jupyter-forward start [OPTIONS] HOST

  Starts Jupyter lab on a remote resource and port forwards session to local
  machine.

Arguments:
  HOST  [required]

Options:
  --port INTEGER                  The local port the remote notebook server
                                  will be forwarded to. If not specified,
                                  defaults to 8888.  [default: 8888]

  --conda-env TEXT                Name of conda environment on the remote host
                                  that contains jupyter lab

  --notebook-dir TEXT             The directory on the remote host to use for
                                  notebooks

  --port-forwarding / --no-port-forwarding
                                  Whether to set up SSH port forwarding or not
                                  [default: True]

  -i, --identity PATH             Selects a file from which the identity
                                  (private key) for public key authentication
                                  is read.

  -c, --launch-command TEXT       Custom command to run before launching
                                  Jupyter Lab. For instance: "qsub -q regular
                                  -l select=1:ncpus=36,walltime=00:05:00 -A
                                  AABD1115"

  --help                          Show this message and exit.

Note: The start command will prompt you for your password.

Running on a Remote Host's Head Node

For instance, here is how to start a jupyter lab server running on port 9999 on one of Cheyenne's login nodes:

 jupyter-forward start mariecurie@cheyenne.ucar.edu

Running on a Remote Host's Compute Node

To launch jupyter lab on a remote host's compute node, the user needs to specify the --launch-command option. The launch command is meant to submit a job on the remote host's queueing system. Once the job is up and running, jupyter lab is launched on the compute node and the session is port-forwarded to the user's local machine.

Here is a couple examples:

 jupyter-forward start mariecurie@cheyenne.ucar.edu --launch-command "qsub -q regular -l select=1:ncpus=36,walltime=00:05:00 -A AABD1115"
 jupyter-forward start mariecurie@casper.ucar.edu --launch-command "sbatch -A AABD1115 -t 00:05:00"

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-forward-0.0.0.tar.gz (24.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_forward-0.0.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file jupyter-forward-0.0.0.tar.gz.

File metadata

  • Download URL: jupyter-forward-0.0.0.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for jupyter-forward-0.0.0.tar.gz
Algorithm Hash digest
SHA256 a4118a238a578d7c1961ba4c2e1d4e2365d9e011b19e8f263fbcf077bbe1dcd6
MD5 f5700016000d27065efc58bc5dcf2e4d
BLAKE2b-256 6b2c7373fb1bfa3e5fa23716173222c3f087b64415f065878c2baab38eb78e9c

See more details on using hashes here.

File details

Details for the file jupyter_forward-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: jupyter_forward-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for jupyter_forward-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9803639cde1f09067576c1faa43a704e1be2cb8f04cd0d150cd3cfad1aa0d9d1
MD5 37e635cd58971550a32fdc5f7c3d47d8
BLAKE2b-256 1bf3c081e77e65224ce12e1582f28227d997c1d8949286d126d9d6b5b5109d20

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