Skip to content

Commit

Permalink
Add documentation of jupyterhub#58, selecting the port on the remote …
Browse files Browse the repository at this point in the history
…side

- Closes: jupyterhub#126
  • Loading branch information
rkdarst committed Feb 2, 2019
1 parent 383e8a3 commit c568dee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This package formerly included WrapSpawner and ProfilesSpawner, which provide me
```python
c = get_config()
c.JupyterHub.spawner_class = 'batchspawner.TorqueSpawner'
import batchspawner.api
```
3. Depending on the spawner, additional configuration will likely be needed.

Expand Down Expand Up @@ -52,6 +53,7 @@ to run Jupyter notebooks on an academic supercomputer cluster.

```python
# Select the Torque backend and increase the timeout since batch jobs may take time to start
import batchspawner.api
c.JupyterHub.spawner_class = 'batchspawner.TorqueSpawner'
c.Spawner.http_timeout = 120

Expand Down Expand Up @@ -117,6 +119,7 @@ clusters, as well as an option to run a local notebook directly on the jupyterhu

```python
# Same initial setup as the previous example
import batchspawner.api
c.JupyterHub.spawner_class = 'wrapspawner.ProfilesSpawner'
c.Spawner.http_timeout = 120
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -171,6 +174,10 @@ Added (developer)

Changed

* PR #58 changes logic of port selection, so that it is selected *after* the singleuser server starts. This means that the port number has to be conveyed back to JupyterHub. This requires the following changes:
- `jupyterhub_config.py` *must* explicitely import `batchspawner.api`
- If you override `Spawner.cmd`, note that the default command is now `batchspawner-singleuser`, not the default `jupyterhub-singleuser`. This is to add a hook to report the port number back to the hub.
- If you have installed with `pip install -e`, you will have to re-install so that the new script `batchspawner-singleuser` is added to `$PATH`.
* Update minimum requirements to JupyterHub 0.8.1 and Python 3.4.
* Update Slurm batch script. Now, the single-user notebook is run in a job step, with a wrapper of `srun`. This may need to be removed using `req_srun=''` if you don't want environment variables limited.
* Pass the environment dictionary to the queue and cancel commands as well. This is mostly user environment, but may be useful to these commands as well in some cases. #108, #111 If these envioronment variables were used for authentication as an admin, be aware that there are pre-existing security issues because they may be passed to the user via the batch submit command, see #82.
Expand Down

0 comments on commit c568dee

Please sign in to comment.