Skip to content

Commit 673072d

Browse files
committed
Add documentation of #58, selecting the port on the remote side
- Closes: #126
1 parent 35b7afd commit 673072d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This package formerly included WrapSpawner and ProfilesSpawner, which provide me
1919
```python
2020
c = get_config()
2121
c.JupyterHub.spawner_class = 'batchspawner.TorqueSpawner'
22+
import batchspawner.api
2223
```
2324
3. Depending on the spawner, additional configuration will likely be needed.
2425

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

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

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

118120
```python
119121
# Same initial setup as the previous example
122+
import batchspawner.api
120123
c.JupyterHub.spawner_class = 'wrapspawner.ProfilesSpawner'
121124
c.Spawner.http_timeout = 120
122125
#------------------------------------------------------------------------------
@@ -171,6 +174,10 @@ Added (developer)
171174

172175
Changed
173176

177+
* 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:
178+
- `jupyterhub_config.py` *must* explicitely import `batchspawner.api`
179+
- 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.
180+
- 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`.
174181
* Update minimum requirements to JupyterHub 0.8.1 and Python 3.4.
175182
* 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.
176183
* 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.

0 commit comments

Comments
 (0)