Compare commits

...

24 Commits
0.7.0 ... 0.7.1

Author SHA1 Message Date
Min RK
94978ea9e0 release 0.7.1 2017-01-02 13:53:43 +01:00
Min RK
bf6999e439 changelog for 0.7.1 2017-01-02 13:53:43 +01:00
Carol Willing
020ee7378f Merge pull request #916 from rachmaninovquartet/master
Added Toree troubleshooting to docs
2016-12-22 13:56:51 -08:00
Min RK
e4a0569961 Merge pull request #915 from jupyterhub/willingc-patch-1
Update README to clarify docker image contents
2016-12-22 16:43:02 +01:00
Ian Maloney
4ff525d5bd updated docs/source/troubleshooting.md per conversation with @willingc in issue 889 2016-12-21 15:21:50 -05:00
Carol Willing
37a31b01b2 Update README to clarify docker image contents
Addresses #879 and #772 re: confusion about the docker image contents
2016-12-21 10:46:30 -08:00
Carol Willing
1604cb1b0b Merge pull request #914 from minrk/update-bootprint
fix rest-api doc building
2016-12-21 10:29:08 -08:00
Min RK
45702ac18c update bootprint to 0.10
0.8 has stopped working for some reason
2016-12-21 14:51:12 +01:00
Min RK
c81e9d60e4 fix rest-api link
link to REST API, not Python API
2016-12-21 14:51:12 +01:00
Carol Willing
224865b894 Merge pull request #910 from minrk/cleanup-server-token
Avoid cleaning up API tokens for Spawners that will resume
2016-12-20 08:29:06 -08:00
Min RK
3b3bc8224b comment review 2016-12-20 16:41:26 +01:00
Carol Willing
c56dc2ea6f Merge pull request #911 from jjaraalm/master
Update Service Docs

Closes #908
2016-12-19 10:28:30 -08:00
jjaraalm
62202bbb74 Revert "Revert "Update service docs""
This reverts commit 7ba28c0207.
2016-12-19 13:00:48 -05:00
jjaraalm
7ba28c0207 Revert "Update service docs"
This reverts commit 9392a29dad.
2016-12-19 12:59:42 -05:00
jjaraalm
9392a29dad Update service docs
Fixes #908
2016-12-19 12:56:26 -05:00
Min RK
72ab8f99ec Avoid cleaning up API tokens for Spawners that will resume
in which case the previous API token should be left alone.
2016-12-19 10:50:25 +01:00
Min RK
fcf32c7e50 Merge pull request #909 from willingc/update-travis
Add 3.6 to travis
2016-12-19 09:59:47 +01:00
Carol Willing
da451d6552 Add 3.6 to travis 2016-12-18 21:26:52 -08:00
Carol Willing
662b1a4d4a Merge pull request #902 from minrk/redirect-empty-msg
Don't warn about empty next_url
2016-12-09 08:04:56 -08:00
Min RK
732adea997 Don't warn about empty next_url
empty next_url is fine
2016-12-09 15:34:32 +01:00
Carol Willing
7e1dbf3515 Merge pull request #896 from minrk/whitelist-warning
Warn about single-character names in whitelist
2016-12-05 11:16:30 -06:00
Min RK
65b92ec246 Warn about single-character names in whitelist
likely cause is `set('string')` typo instead of `set(['string'])`,
so include that in the error message:

    whitelist contains single-character names: ['i', 'k', 'm', 'n', 'r']; did you mean set(['ikmnr']) instead of set('ikmnr')?
2016-12-05 09:46:52 +01:00
Min RK
dc42ee4779 typo in changelog link 2016-12-02 18:12:28 +01:00
Min RK
c04441c1b2 back to dev 2016-12-02 18:08:03 +01:00
14 changed files with 115 additions and 44 deletions

View File

@@ -2,6 +2,7 @@
language: python language: python
sudo: false sudo: false
python: python:
- 3.6-dev
- 3.5 - 3.5
- 3.4 - 3.4
- 3.3 - 3.3

View File

@@ -131,11 +131,11 @@ Some examples, meant as illustration and testing of this concept:
---- ----
## Docker ## Docker
A ready to go [docker image for JupyterHub](https://hub.docker.com/r/jupyterhub/jupyterhub/) gives a straightforward deployment of JupyterHub. A starter [docker image for JupyterHub](https://hub.docker.com/r/jupyterhub/jupyterhub/) gives a baseline deployment of JupyterHub.
*Note: This `jupyterhub/jupyterhub` docker image is only an image for running the Hub service itself. **Important:** This `jupyterhub/jupyterhub` image contains only the Hub itself, with no configuration. In general, one needs
It does not require the other Jupyter components, such as Notebook installation, which are needed by the single-user servers. to make a derivative image, with at least a `jupyterhub_config.py` setting up an Authenticator and/or a Spawner. To run the
To run the single-user servers, which may be on the same system as the Hub or not, Jupyter Notebook version 4 or greater must be installed.* single-user servers, which may be on the same system as the Hub or not, Jupyter Notebook version 4 or greater must be installed.
#### Starting JupyterHub with docker #### Starting JupyterHub with docker
The JupyterHub docker image can be started with the following command: The JupyterHub docker image can be started with the following command:

View File

@@ -8,7 +8,7 @@
"author": "", "author": "",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"devDependencies": { "devDependencies": {
"bootprint": "^0.8.5", "bootprint": "^0.10.0",
"bootprint-openapi": "^0.17.0" "bootprint-openapi": "^0.17.0"
} }
} }

View File

@@ -9,6 +9,20 @@ command line for details.
## 0.7 ## 0.7
### [0.7.1] - 2016-01-02
#### Added
- `Spawner.will_resume` for signalling that a single-user server is paused instead of stopped.
This is needed for cases like `DockerSpawner.remove_containers = False`,
where the first API token is re-used for subsequent spawns.
- Warning on startup about single-character usernames,
caused by common `set('string')` typo in config.
#### Fixed
- Removed spurious warning about empty `next_url`, which is AOK.
### [0.7.0] - 2016-12-2 ### [0.7.0] - 2016-12-2
#### Added #### Added
@@ -118,8 +132,9 @@ Fix removal of `/login` page in 0.4.0, breaking some OAuth providers.
First preview release First preview release
[Unreleased]: https://github.com/jupyterhub/jupyterhub/compare/0.7.0...HEAD [Unreleased]: https://github.com/jupyterhub/jupyterhub/compare/0.7.1...HEAD
[Unreleased]: https://github.com/jupyterhub/jupyterhub/compare/0.6.1...0.7.0 [0.7.1]: https://github.com/jupyterhub/jupyterhub/compare/0.7.0...0.7.1
[0.7.0]: https://github.com/jupyterhub/jupyterhub/compare/0.6.1...0.7.0
[0.6.1]: https://github.com/jupyterhub/jupyterhub/compare/0.6.0...0.6.1 [0.6.1]: https://github.com/jupyterhub/jupyterhub/compare/0.6.0...0.6.1
[0.6.0]: https://github.com/jupyterhub/jupyterhub/compare/0.5.0...0.6.0 [0.6.0]: https://github.com/jupyterhub/jupyterhub/compare/0.5.0...0.6.0
[0.5]: https://github.com/jupyterhub/jupyterhub/compare/0.4.1...0.5.0 [0.5]: https://github.com/jupyterhub/jupyterhub/compare/0.4.1...0.5.0

View File

@@ -67,4 +67,4 @@ Note: The Swagger specification is being renamed the [OpenAPI Initiative][].
[on swagger's petstore]: http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyterhub/jupyterhub/master/docs/rest-api.yml#!/default [on swagger's petstore]: http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyterhub/jupyterhub/master/docs/rest-api.yml#!/default
[OpenAPI Initiative]: https://www.openapis.org/ [OpenAPI Initiative]: https://www.openapis.org/
[JupyterHub REST API]: ./api/index.html [JupyterHub REST API]: ./_static/rest-api/index.html

View File

@@ -54,7 +54,7 @@ If a service is also to be managed by the Hub, it has a few extra options:
externally. externally.
- If a command is specified for launching the Service, the Service will - If a command is specified for launching the Service, the Service will
be started and managed by the Hub. be started and managed by the Hub.
- `env: dict` - environment variables to add to the current env - `environment: dict` - additional environment variables for the Service.
- `user: str` - the name of a system user to manage the Service. If - `user: str` - the name of a system user to manage the Service. If
unspecified, run as the same user as the Hub. unspecified, run as the same user as the Hub.
@@ -99,7 +99,7 @@ c.JupyterHub.services = [
A Hub-Managed Service may also be configured with additional optional A Hub-Managed Service may also be configured with additional optional
parameters, which describe the environment needed to start the Service process: parameters, which describe the environment needed to start the Service process:
- `env: dict` - additional environment variables for the Service. - `environment: dict` - additional environment variables for the Service.
- `user: str` - name of the user to run the server if different from the Hub. - `user: str` - name of the user to run the server if different from the Hub.
Requires Hub to be root. Requires Hub to be root.
- `cwd: path` directory in which to run the Service, if different from the - `cwd: path` directory in which to run the Service, if different from the

View File

@@ -249,3 +249,26 @@ jupyter kernelspec list
```bash ```bash
jupyterhub --debug jupyterhub --debug
``` ```
## Toree integration with HDFS rack awareness script
The Apache Toree kernel will an issue, when running with JupyterHub, if the standard HDFS
rack awareness script is used. This will materialize in the logs as a repeated WARN:
```bash
16/11/29 16:24:20 WARN ScriptBasedMapping: Exception running /etc/hadoop/conf/topology_script.py some.ip.address
ExitCodeException exitCode=1: File "/etc/hadoop/conf/topology_script.py", line 63
print rack
^
SyntaxError: Missing parentheses in call to 'print'
at `org.apache.hadoop.util.Shell.runCommand(Shell.java:576)`
```
In order to resolve this issue, there are two potential options.
1. Update HDFS core-site.xml, so the parameter "net.topology.script.file.name" points to a custom
script (e.g. /etc/hadoop/conf/custom_topology_script.py). Copy the original script and change the first line point
to a python two installation (e.g. /usr/bin/python).
2. In spark-env.sh add a Python 2 installation to your path (e.g. export PATH=/opt/anaconda2/bin:$PATH).

View File

@@ -454,7 +454,7 @@ class JupyterHub(Application):
'name': 'formgrader', 'name': 'formgrader',
'url': 'http://127.0.0.1:1234', 'url': 'http://127.0.0.1:1234',
'token': 'super-secret', 'token': 'super-secret',
'env': 'environment':
} }
] ]
""" """

View File

@@ -56,6 +56,17 @@ class Authenticator(LoggingConfigurable):
""" """
).tag(config=True) ).tag(config=True)
@observe('whitelist')
def _check_whitelist(self, change):
short_names = [name for name in change['new'] if len(name) <= 1]
if short_names:
sorted_names = sorted(short_names)
single = ''.join(sorted_names)
string_set_typo = "set('%s')" % single
self.log.warning("whitelist contains single-character names: %s; did you mean set([%r]) instead of %s?",
sorted_names[:8], single, string_set_typo,
)
custom_html = Unicode( custom_html = Unicode(
help=""" help="""
HTML form to be overridden by authenticators if they want a custom authentication form. HTML form to be overridden by authenticators if they want a custom authentication form.

View File

@@ -28,7 +28,7 @@ class RootHandler(BaseHandler):
""" """
def get(self): def get(self):
next_url = self.get_argument('next', '') next_url = self.get_argument('next', '')
if not next_url.startswith('/'): if next_url and not next_url.startswith('/'):
self.log.warning("Disallowing redirect outside JupyterHub: %r", next_url) self.log.warning("Disallowing redirect outside JupyterHub: %r", next_url)
next_url = '' next_url = ''
if next_url and next_url.startswith(url_path_join(self.base_url, 'user/')): if next_url and next_url.startswith(url_path_join(self.base_url, 'user/')):

View File

@@ -124,8 +124,8 @@ class Service(LoggingConfigurable):
Only use this if the service should be a subprocess. Only use this if the service should be a subprocess.
If command is not specified, it is assumed to be managed If command is not specified, it is assumed to be managed
by a by a
- env: dict - environment: dict
environment variables to add to the current env Additional environment variables for the service.
- user: str - user: str
The name of a system user to become. The name of a system user to become.
If unspecified, run as the same user as the Hub. If unspecified, run as the same user as the Hub.

View File

@@ -52,6 +52,17 @@ class Spawner(LoggingConfigurable):
authenticator = Any() authenticator = Any()
api_token = Unicode() api_token = Unicode()
will_resume = Bool(False,
help="""Whether the Spawner will resume on next start
Default is False where each launch of the Spawner will be a new instance.
If True, an existing Spawner will resume instead of starting anew
(e.g. resuming a Docker container),
and API tokens in use when the Spawner stops will not be deleted.
"""
)
ip = Unicode('127.0.0.1', ip = Unicode('127.0.0.1',
help=""" help="""
The IP address (or hostname) the single-user server should listen on. The IP address (or hostname) the single-user server should listen on.

View File

@@ -234,6 +234,12 @@ class User(HasTraits):
# prior to 0.7, spawners had to store this info in user.server themselves. # prior to 0.7, spawners had to store this info in user.server themselves.
# Handle < 0.7 behavior with a warning, assuming info was stored in db by the Spawner. # Handle < 0.7 behavior with a warning, assuming info was stored in db by the Spawner.
self.log.warning("DEPRECATION: Spawner.start should return (ip, port) in JupyterHub >= 0.7") self.log.warning("DEPRECATION: Spawner.start should return (ip, port) in JupyterHub >= 0.7")
if spawner.api_token != api_token:
# Spawner re-used an API token, discard the unused api_token
orm_token = orm.APIToken.find(self.db, api_token)
if orm_token is not None:
self.db.delete(orm_token)
self.db.commit()
except Exception as e: except Exception as e:
if isinstance(e, gen.TimeoutError): if isinstance(e, gen.TimeoutError):
self.log.warning("{user}'s server failed to start in {s} seconds, giving up".format( self.log.warning("{user}'s server failed to start in {s} seconds, giving up".format(
@@ -313,10 +319,13 @@ class User(HasTraits):
if self.server: if self.server:
# cleanup server entry from db # cleanup server entry from db
self.db.delete(self.server) self.db.delete(self.server)
self.server = None
if not spawner.will_resume:
# find and remove the API token if the spawner isn't
# going to re-use it next time
orm_token = orm.APIToken.find(self.db, api_token) orm_token = orm.APIToken.find(self.db, api_token)
if orm_token: if orm_token:
self.db.delete(orm_token) self.db.delete(orm_token)
self.server = None
self.db.commit() self.db.commit()
finally: finally:
self.stop_pending = False self.stop_pending = False

View File

@@ -6,7 +6,8 @@
version_info = ( version_info = (
0, 0,
7, 7,
0, 1,
# 'dev',
) )
__version__ = '.'.join(map(str, version_info)) __version__ = '.'.join(map(str, version_info))