SWAN JupyterHub spawner
Project description
SWAN Spawner
Spawner for JupyterHub that enables configuring a session with CVMFS/LCG stacks, support for GPU, oAuth tokens, etc. If Binder is used to configure the Docker image used, it reverts to the default upstream configuration. Works with both Docker and Kubernetes.
Installation
pip3 install swanspawner
Usage
Add to your JupyterHub config file
c.JupyterHub.spawner_class = 'swanspawner.SwanDockerSpawner'
If you deploy with Docker, or
c.JupyterHub.spawner_class = 'swanspawner.SwanKubeSpawner'
If you deploy with Kubernetes.
Jupyter Notebook environment variables set during spawn
env |
---|
ROOT_LCG_VIEW_NAME |
ROOT_LCG_VIEW_PLATFORM |
USER_ENV_SCRIPT |
ROOT_LCG_VIEW_PATH |
USER |
USER_ID |
USER_GID |
HOME |
EOS_PATH_FORMAT |
SERVER_HOSTNAME |
MAX_MEMORY |
JPY_USER |
JPY_COOKIE_NAME |
JPY_BASE_URL |
JPY_HUB_PREFIX |
JPY_HUB_API_URL |
ACCESS_TOKEN |
OAUTH_INSPECTION_ENDPOINT |
Spawn Form configuration
To configure custom form, please set path to config file as below
c.SwanSpawner.options_form_config = '<path>'
High level objects
{
"header": <options header text>,
"options": <array of options objects>
...
}
Options type label
{
"options": [
{
"type": "label",
"label": {
"value": <id of label>,
"text": <displayed text of label>
}
},
...
]
...
}
Options type selection
{
"options": [
{
"type": "selection",
"lcg": {
"value": <id of lcg>,
"text": <displayed text of lcg>
},
"platforms": [
{
"value": <id of platform>,
"text": <displayed text of platform>
}
...
],
"cores": [
{
"value": <id of cores selection>,
"text": <displayed text of cores selection>
}
...
],
"memory": [
{
"value": <id of memory selection>,
"text": <displayed text of memory selection>
}
...
],
"clusters": [
{
"value": <id of cluster>,
"text": <displayed text of cluster>
}
...
]
},
...
]
...
}
An example json file can be seen in options_form_config.json
Mount options
To mount EOS or CVMFS with SwanDockerSpawner (which requires a mount with propagation "shared"), a new configuration was introduced by upstream:
c.SwanSpawner.mounts = [
{
'source': '/eos',
'target': '/eos',
'type': 'bind',
'propagation': 'shared'
},
{
'source': '/cvmfs',
'target': '/cvmfs',
'type': 'bind',
'propagation': 'shared'
}
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file swanspawner-1.1.2.tar.gz
.
File metadata
- Download URL: swanspawner-1.1.2.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e4bc09a0bc6162e99c27fbacfd1dd762ac07f55477b37c940b38b8b9beb0be6 |
|
MD5 | 48c803ee68414ec5242637013fb91b94 |
|
BLAKE2b-256 | 08b654e47ebba6ba3b21b94b6dcaa687d2b8865df5c701e114679eeea5e08fae |
File details
Details for the file swanspawner-1.1.2-py3-none-any.whl
.
File metadata
- Download URL: swanspawner-1.1.2-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62a5860aac74212904d13cc88c01f1991bbf0c1310aafde666b823a662feebf7 |
|
MD5 | 0a9ae5d28aac4dea0605988647015058 |
|
BLAKE2b-256 | c8203d933992dfbed28157e8933c09b0725e17d6ca41a8f260dbab4a6fffcea3 |