Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration branch for next release #112

Merged
merged 36 commits into from
Aug 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5201449
Add reservation option.
Jun 15, 2018
370af5b
Fix spacing.
Petraea Jun 15, 2018
bf48b92
Update exec_prefix handling: template this separate from batch command.
rkdarst Jun 18, 2018
e956082
Add prologue and epilogue options to other spawners
rkdarst Jun 20, 2018
afbf5d3
Add SPAWNERS.md, a list of specific info on spawners
rkdarst Jun 20, 2018
72ac758
Add keepvars_extra to whitelist more environment.
rkdarst Jun 20, 2018
359fc35
Add tests for req_keepvars and req_keepvars_extra
rkdarst Jun 21, 2018
05a747e
ENH (minor): bool() instead of True/False, import, a bit more consist…
yarikoptic Jul 5, 2018
9165b0e
RF: consistency for SlurmSpawner - removed dated __doc__ and placed b…
yarikoptic Jul 5, 2018
35f0919
RF(minor): remove not needed \ for newline continuation within functi…
yarikoptic Jul 5, 2018
6546ca9
RF: revert back to if ... return True else return False
yarikoptic Jul 9, 2018
5a9d6e8
RF: another removal of trailing \
yarikoptic Jul 9, 2018
9a00bee
run_command: Increase debugging output in case of error
rkdarst Jun 20, 2018
a23b3d4
run_command: Fix possible deadlock
rkdarst Jun 20, 2018
c6b34a9
Travis: update for jupyterhub 9.0.1 and python 3.7
rkdarst Jul 31, 2018
1b4f03d
Merge branches 'travis_jh9.0.1', 'run_command_deadlock', 'run_command…
rkdarst Aug 2, 2018
327d9bd
Travis: update for jupyterhub 9.0.1 and python 3.7
rkdarst Jul 31, 2018
fa11cb1
Pin jsonschema=2.6.0 to fix test errors
rkdarst Aug 2, 2018
61a4a0b
Merge branch 'travis_jh9.0.1' into dev
rkdarst Aug 3, 2018
228107e
Pass the environment dict to all commands (query and cancel)
rkdarst Aug 3, 2018
14287ac
Merge branch 'env_dict_to_commands' into dev
rkdarst Aug 6, 2018
a696601
SPAWNERS.md: update SlurmSpawner and general info.
rkdarst Aug 7, 2018
b8d43de
Merge branch 'spawner_detail' into dev
rkdarst Aug 7, 2018
8633785
Merge remote-tracking branch 'upstream/pr/100' into dev
rkdarst Aug 7, 2018
02c33a6
SlurmSpawner: Add reservation option to batch script
rkdarst Aug 7, 2018
81ff85a
SlurmSpawner: add test for reservation option
rkdarst Aug 7, 2018
46fc2bd
Merge branch 'slurm_reservation' into dev
rkdarst Aug 7, 2018
4cf3732
Update changelog for release
rkdarst Aug 7, 2018
c91dc0b
Merge branch 'changelog' into dev
rkdarst Aug 7, 2018
b9f71ab
get_env: clarify documentation and security risk
rkdarst Aug 8, 2018
d4e21f4
Spawner detail list: updates from code review
rkdarst Aug 8, 2018
5192b98
Merge branches 'env_dict_to_commands' and 'spawner_detail' into dev
rkdarst Aug 8, 2018
594ba77
README.md: Typo fix
rkdarst Aug 8, 2018
2045a9b
Merge branch 'spawner_detail' into dev
rkdarst Aug 8, 2018
21af0af
Changelog: Split into sections by topic.
rkdarst Aug 8, 2018
755f4fe
Merge branch 'changelog' into dev
rkdarst Aug 8, 2018
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
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,32 @@
language: python
sudo: false
python:
- 3.7-dev
- 3.6
- 3.5
- 3.4
env:
- JHUB_VER=0.7.2
- JHUB_VER=0.8.1
- JHUB_VER=0.9.0b2
- JHUB_VER=0.9.1
matrix:
include:
- python: 3.7-dev
env: JHUB_VER=0.9.0b2
- python: 3.6
env: JHUB_VER=master
exclude:
- python: 3.4
env: JHUB_VER=0.9.0b2
env: JHUB_VER=0.9.1
allow_failures:
- env: JHUB_VER=master
- python: 3.7-dev

before_install:
- npm install -g configurable-http-proxy
- git clone --quiet --depth 1 https://github.com/minrk/travis-wheels travis-wheels
- git clone --quiet --branch $JHUB_VER https://github.com/jupyter/jupyterhub.git jupyterhub
install:
# Don't let requirements pull in tornado 5 yet except for jupyterhub master
- if [ $JHUB_VER != "master" -a $JHUB_VER != "0.9.0b2" ]; then pip install "tornado<5.0"; fi
- if [ $JHUB_VER != "master" -a $JHUB_VER != "0.9.1" ]; then pip install "tornado<5.0"; fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to update the comment here to add clarity that 0.9.0 and later should install tornado>=5.0. This line should be updated as well.

- pip install jsonschema!=3.0.0a1 # issue #110, remove later
- pip install --pre -f travis-wheels/wheelhouse -r jupyterhub/dev-requirements.txt
- pip install --pre -e jupyterhub

Expand Down
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ This package formerly included WrapSpawner and ProfilesSpawner, which provide me

## Batch Spawners

For information on the specific spawners, see [SPAWNERS.md](SPAWNERS.md).

### Overview

This file contains an abstraction layer for batch job queueing systems (`BatchSpawnerBase`), and implements
Expand Down Expand Up @@ -82,6 +84,19 @@ to run Jupyter notebooks on an academic supercomputer cluster.
c.TorqueSpawner.state_exechost_exp = r'int-\1.mesabi.xyz.edu'
```

### Security

Unless otherwise stated for a specific spawner, assume that spawners
*do* evaluate shell environment for users and thus the [security
requiremnts of JupyterHub security for untrusted
users](https://jupyterhub.readthedocs.io/en/stable/reference/websecurity.html)
are not fulfilled because some (most?) spawners *do* start a user
shell which will execute arbitrary user environment configuration
(``.profile``, ``.bashrc`` and the like) unless users do not have
access to their own cluster user account. This is something which we
are working on.


## Provide different configurations of BatchSpawner

### Overview
Expand Down Expand Up @@ -141,11 +156,33 @@ clusters, as well as an option to run a local notebook directly on the jupyterhu

### dev (requires minimum JupyterHub 0.7.2 and Python 3.4)

Added (user)

* Add Jinja2 templating as an option for all scripts and commands. If '{{' or `{%` is used anywhere in the string, it is used as a jinja2 template.
* 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 if you don't want environment variables limited.
* Add new option exec_prefix, which defaults to `sudo -E -u {username}`. This replaces explicit `sudo` in every batch command - changes in local commands may be needed.
* New option: `req_keepvars_extra`, which allows keeping extra variables in addition to what is defined by JupyterHub itself (addition of variables to keep instead of replacement). #99
* Add `req_prologue` and `req_epilogue` options to scripts which are inserted before/after the main jupyterhub-singleuser command, which allow for generic setup/cleanup without overriding the entire script. #96
* SlurmSpawner: add the `req_reservation` option. #

Added (developer)

* Add many more tests.
* Add a new page `SPAWNERS.md` which information on specific spawners. Begin trying to collect a list of spawner-specific contacts. #97

Changed

* 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.

Fixed

* Improve debugging on failed submission by raising errors including error messages from the commands. #106
* Many other non-user or developer visible changes. #107 #106 #100
* In Travis CI, blacklist jsonschema=3.0.0a1 because it breaks tests

Removed


### v0.8.1 (bugfix release)

Expand Down
60 changes: 60 additions & 0 deletions SPAWNERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Notes on specific spawners

## `TorqueSpawner`

Maintainers:


## `MoabSpawner`

Subclass of TorqueSpawner

Maintainers:


## `SlurmSpawner`

Maintainers: @rkdarst

This spawner enforces the environment if `srun` is used to wrap the
spawner command, which is the default. If you *do* want user
environment to be used, set `req_srun=''`. However, this is not
perfect: there is still a bash shell begun as the user which could run
arbitrary startup, define shell aliases for `srun`, etc.

Use of `srun` is required to gracefully terminate.


## `GridengineSpawner`

Maintainers:


## `CondorSpawner`

Maintainers:


## `LsfSpawner`

Maintainers:


# Checklist for making spawners

Please document each of these things under the spawner list above, -
even if it is "OK", we need to track status of all spawners. If it is
a bug, users really need to know.

- Does your spawner read shell environment before starting? (See
[Jupyterhub
Security](https://jupyterhub.readthedocs.io/en/stable/reference/websecurity.html).

- Does your spawner send SIGTERM to the jupyterhub-singleuser process
before SIGKILL? It should, so that the process can terminate
gracefully. Add `echo "terminated gracefully"` to the end of the
batch script - if you see this in your singleuser server output, you
know that you DO receive SIGTERM and terminate gracefully. If your
batch system can not automatically send SIGTERM before SIGKILL, PR
#75 might help here, ask for it to be finished.

Loading