Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ clusters, as well as an option to run a local notebook directly on the jupyterhu

## Changelog

### v0.8 (compatible with JupyterHub 0.5.0 through 0.8.1/0.9dev)
### 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

### v0.8.0 (compatible with JupyterHub 0.5.0 through 0.8.1/0.9dev)

* 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`.
* add base options `req_ngpus` `req_partition` `req_account` and `req_options`
Expand All @@ -156,6 +160,7 @@ clusters, as well as an option to run a local notebook directly on the jupyterhu
* 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
* Enable CI testing via Travis-CI


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

* initial release containing `TorqueSpawner` and `SlurmSpawner`
Expand Down
13 changes: 8 additions & 5 deletions batchspawner/batchspawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ def _req_keepvars_default(self):
# Will get the raw output of the job status command unless overridden
job_status = Unicode()

# Will get the address of the server as reported by job manager
current_ip = Unicode()

# Prepare substitution variables for templates using req_xyz traits
def get_req_subvars(self):
reqlist = [ t for t in self.trait_names() if t.startswith('req_') ]
Expand Down Expand Up @@ -317,17 +320,17 @@ def start(self):
assert self.state_ispending()
yield gen.sleep(self.startup_poll_interval)

self.ip = self.state_gethost()
self.current_ip = self.state_gethost()
if jupyterhub.version_info < (0,7):
# store on user for pre-jupyterhub-0.7:
self.user.server.port = self.port
self.user.server.ip = self.ip
self.user.server.ip = self.current_ip
self.db.commit()
self.log.info("Notebook server job {0} started at {1}:{2}".format(
self.job_id, self.ip, self.port)
self.job_id, self.current_ip, self.port)
)

return self.ip, self.port
return self.current_ip, self.port

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

import re
Expand Down
8 changes: 3 additions & 5 deletions batchspawner/tests/test_spawners.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def check_ip(spawner, value):
if version_info < (0,7):
assert spawner.user.server.ip == value
else:
assert spawner.ip == value
assert spawner.current_ip == value

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

def test_submit_failure(db, io_loop):
Expand Down
4 changes: 2 additions & 2 deletions version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
version_info = (
0,
8,
0,
# 'rc0', # comment-out this line for a release
1,
# 'dev', # comment-out this line for a release
)
__version__ = '.'.join(map(str, version_info))