ForwardBaseSpawner

ForwardBaseSpawner#

The ForwardBaseSpawner is a base class, which can be used by any Spawner that creats the singleuser notebook server on a remote system. The ForwardBaseSpawner itself cannot start anything. The actual logic of starting / stopping must be implemented in a subclass.

Overview#

The JupyterHub ForwardBaseSpawner offers a variety of useful functions, to enable and manage the communication between JupyterHub and a singleuser notebook servers, which runs on a remote machine. It covers the following functionalities:

  • Manage ssh port forwarding process from JupyterHub to singleuser notebook server

  • Manage ssh port forwarding process from singleuser notebook server to JupyterHub

  • Manage Kubernetes Service Resource to make singleuser notebook server reachable for JupyterHub

  • Adds cancel function. Allows the user to cancel an ongoing spawn process

  • Start process of remote singleuser notebook servers may send their current progress to SpawnEventsAPIHandler, which shows it to the user

  • SetupTunnelAPIHandler allows to define the ssh jump node between JupyterHub and singleuser notebook server during the spawn process

  • ListServersAPIHandler returns all running UserID-servername combinations. Gives remote systems the chance to compare their running servers with the JupyterHub ones

  • SSHNodeRestartedAPIHandler enables a recreation of all port forwarding process to a specific jump node. Required when a jump node was restarted

Note

For more information and the usage have a look at the JupyterHub OutpostSpawner documentation. It’s a subclass of the ForwardBaseSpawner and enables a central JupyterHub to start singleuser notebook-server on multiple remote systems.
You can find a few examples and configurations over there.

Requirements#

At least one JupyterHub running on a Kubernetes Cluster (recommended is the use of Zero2JupyterHub). A subclass of the ForwardBaseSpawner which implements the actual start/stop logic for singleuser notebook servers.

License#

BSD 3-Clause License

Copyright (c) 2023, Forschungszentrum Juelich GmbH

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.