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
optionsform:
header: <options header text>
enable_customenv_form: <boolean>
enable_generate_url_form: <boolean>
enable_network_form: <boolean>
with_rucio: <array of rucio options objects>
lcg_options: <array of lcg options objects>
customenv_options: <array of customenvs options objects>
Options type label
lcg_options:
- type: "label"
label:
value: <id of label>,
text: <displayed text of label>
# ...
Options type selection
lcg_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>
# ...
# ...
customenv_options:
- type: "selection"
builder:
value: <id of builder>
text: <displayed text of builder>
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 yaml file can be seen in options_form_config.yaml
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'
}
]
Metadata
Release files for swanspawner 1.2.50
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swanspawner-1.2.50.tar.gz | 25.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swanspawner-1.2.50-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 54.2 kB
Release files / swanspawner-1.2.50.tar.gz
| Download URL | swanspawner-1.2.50.tar.gz |
|---|---|
| Size | 25.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52ae4710805e99018e3e46892530ce08a53417fbb2596c91da3410b717a8ed4c
|
|
BLAKE2b-256 checksum How to use checksums |
ddb3627fb98dacf1b9c530c9bed70da8e112f6113eac659eadb1f688a50f14c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.
Transparency logRelease files / swanspawner-1.2.50-py3-none-any.whl
| Download URL | swanspawner-1.2.50-py3-none-any.whl |
|---|---|
| Size | 28.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f753a0e0004e69e56397b576cd492907d11c2a1a45743894df36f5b6064b0c4
|
|
BLAKE2b-256 checksum How to use checksums |
f422d81888486cb72cf680e565f2c0b66aa61318bcd2fcbd210638ff581c6f80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.
Transparency log