Skip to main content

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 container image used, it reverts to the default upstream configuration. Requires Kubernetes.

Installation

pip3 install swanspawner

Usage

Add to your JupyterHub config file

c.JupyterHub.spawner_class = "swanspawner.swankubespawner.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

Ticket refresh service

This module includes a swanticketrefresher command intended to be run as a JupyterHub service, that calls bash scripts to check and renew kerberos tokens for the users.

Call the script and specify configuration parameters:

swanticketrefresher --every=600

Configuration parameters:

  • --url: The JupyterHub API URL (default=$JUPYTERHUB_API_URL)
  • --every: The interval (in seconds) for checking tickets (default=600)
  • --hooks_dir: Path to the directory for the krb tickets script (check_ticket.sh) (default="/srv/jupyterhub/culler")

Metadata

Release files for swanspawner 1.2.56

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swanspawner 1.2.56
File Size Uploaded Provenance Actions
swanspawner-1.2.56.tar.gz 30.5 kB With provenance Details for swanspawner-1.2.56.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for swanspawner 1.2.56
File Interpreter ABI Platform Actions
swanspawner-1.2.56-py3-none-any.whl Python 3 none any Details for swanspawner-1.2.56-py3-none-any.whl

Total release size: 67.0 kB

Release files / swanspawner-1.2.56.tar.gz

Download URL swanspawner-1.2.56.tar.gz
Size 30.5 kB
Tags Source
SHA-256 checksum
How to use checksums
92f6ef2f768e470daa51442057658f40f5a27485b0d7b5cd49826bf436a8e84f
BLAKE2b-256 checksum
How to use checksums
cce8fba52d7cde5ee08c94eccffced57880ba1c3c43470b4ad9de4a64a3c99ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Nov 3, 2026.

Transparency log

Release files / swanspawner-1.2.56-py3-none-any.whl

Download URL swanspawner-1.2.56-py3-none-any.whl
Size 36.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f9ccb8473df17c507f4a166b153d5930aacd256e7703b869280658d6582c463
BLAKE2b-256 checksum
How to use checksums
46395ce298663e0b5454e3bd05c6d751af0198f65d51eede3a3e69b241e7b284
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Nov 3, 2026.

Transparency log

Security for swanspawner 1.2.56

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for swanspawner-1.2.56.tar.gz

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 Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.56 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page