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

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.57
File Size Uploaded Provenance Actions
swanspawner-1.2.57.tar.gz 30.6 kB With provenance Details for swanspawner-1.2.57.tar.gz

Built distribution (wheel)

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

Total release size: 67.2 kB

Release files / swanspawner-1.2.57.tar.gz

Download URL swanspawner-1.2.57.tar.gz
Size 30.6 kB
Tags Source
SHA-256 checksum
How to use checksums
025123a4326f42b5b65c5f12560fca81819e4ae9f5dab933a95e1981d6a0143c
BLAKE2b-256 checksum
How to use checksums
8a78e9e514780b334ce7587afb3454d8f3e5816f52b0ed8b2a17cb4984738602
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 24, 2026.

Transparency log

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

Download URL swanspawner-1.2.57-py3-none-any.whl
Size 36.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b416ee77bc35eb59d3be6da8184be72e43bcef9b0bb17b6c14a1a5b161b30eee
BLAKE2b-256 checksum
How to use checksums
915cee0ec5a046b015c031e0310749dbc95060afb6842078a1a7f548f1c8a441
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 24, 2026.

Transparency log

Security for swanspawner 1.2.57

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.57.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 24, 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.57 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