Skip to content

Commit ce0729d

Browse files
authored
Merge pull request #77 from jupyterhub/dev-0.8.1
Merge release branch for 0.8.1 v0.8.1 (bugfix release) * Fix regression: single-user server binding address is overwritten by previous session server address, resulting in failure to start. Issue #76
2 parents 846a900 + cb05332 commit ce0729d

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ clusters, as well as an option to run a local notebook directly on the jupyterhu
139139

140140
## Changelog
141141

142-
### v0.8 (compatible with JupyterHub 0.5.0 through 0.8.1/0.9dev)
142+
### v0.8.1 (bugfix release)
143+
144+
* Fix regression: single-user server binding address is overwritten by previous session server address, resulting in failure to start. Issue #76
145+
146+
### v0.8.0 (compatible with JupyterHub 0.5.0 through 0.8.1/0.9dev)
143147

144148
* SlurmSpawner: Remove `--uid` for (at least) Slurm 17.11 compatibility. If you use `sudo`, this should not be necessary, but because this is security related you should check that user management is as you expect. If your configuration does not use `sudo` then you may need to add the `--uid` option in a custom `batch_script`.
145149
* add base options `req_ngpus` `req_partition` `req_account` and `req_options`
@@ -156,6 +160,7 @@ clusters, as well as an option to run a local notebook directly on the jupyterhu
156160
* WrapSpawner and ProfilesSpawner, which provide mechanisms for runtime configuration of spawners, have been split out and moved to the [`wrapspawner`](https://github.com/jupyterhub/wrapspawner) package
157161
* Enable CI testing via Travis-CI
158162

163+
159164
### v0.3 (tag: jhub-0.3, compatible with JupyterHub 0.3.0)
160165

161166
* initial release containing `TorqueSpawner` and `SlurmSpawner`

batchspawner/batchspawner.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ def _req_keepvars_default(self):
155155
# Will get the raw output of the job status command unless overridden
156156
job_status = Unicode()
157157

158+
# Will get the address of the server as reported by job manager
159+
current_ip = Unicode()
160+
158161
# Prepare substitution variables for templates using req_xyz traits
159162
def get_req_subvars(self):
160163
reqlist = [ t for t in self.trait_names() if t.startswith('req_') ]
@@ -317,17 +320,17 @@ def start(self):
317320
assert self.state_ispending()
318321
yield gen.sleep(self.startup_poll_interval)
319322

320-
self.ip = self.state_gethost()
323+
self.current_ip = self.state_gethost()
321324
if jupyterhub.version_info < (0,7):
322325
# store on user for pre-jupyterhub-0.7:
323326
self.user.server.port = self.port
324-
self.user.server.ip = self.ip
327+
self.user.server.ip = self.current_ip
325328
self.db.commit()
326329
self.log.info("Notebook server job {0} started at {1}:{2}".format(
327-
self.job_id, self.ip, self.port)
330+
self.job_id, self.current_ip, self.port)
328331
)
329332

330-
return self.ip, self.port
333+
return self.current_ip, self.port
331334

332335
@gen.coroutine
333336
def stop(self, now=False):
@@ -347,7 +350,7 @@ def stop(self, now=False):
347350
yield gen.sleep(1.0)
348351
if self.job_id:
349352
self.log.warn("Notebook server job {0} at {1}:{2} possibly failed to terminate".format(
350-
self.job_id, self.ip, self.port)
353+
self.job_id, self.current_ip, self.port)
351354
)
352355

353356
import re

batchspawner/tests/test_spawners.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def check_ip(spawner, value):
5454
if version_info < (0,7):
5555
assert spawner.user.server.ip == value
5656
else:
57-
assert spawner.ip == value
57+
assert spawner.current_ip == value
5858

5959
def test_spawner_start_stop_poll(db, io_loop):
6060
spawner = new_spawner(db=db)
@@ -90,10 +90,8 @@ def test_spawner_state_reload(db, io_loop):
9090
spawner.clear_state()
9191
assert spawner.get_state() == {}
9292
spawner.load_state(state)
93-
if version_info < (0,7):
94-
check_ip(spawner, testhost)
95-
else:
96-
check_ip(spawner, '0.0.0.0')
93+
# We used to check IP here, but that is actually only computed on start(),
94+
# and is not part of the spawner's persistent state
9795
assert spawner.job_id == testjob
9896

9997
def test_submit_failure(db, io_loop):

version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
version_info = (
55
0,
66
8,
7-
0,
8-
# 'rc0', # comment-out this line for a release
7+
1,
8+
# 'dev', # comment-out this line for a release
99
)
1010
__version__ = '.'.join(map(str, version_info))
1111

0 commit comments

Comments
 (0)