Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swanspawner-1.2.47.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swanspawner-1.2.47-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file swanspawner-1.2.47.tar.gz.

File metadata

  • Download URL: swanspawner-1.2.47.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for swanspawner-1.2.47.tar.gz
Algorithm Hash digest
SHA256 bebebfca740834b1f0940611238bc3eb76e39ab80778ae33c9dce85afb93998c
MD5 35860b3b5da1e1204b48eb5e7458a397
BLAKE2b-256 1885fe0fb775aaec2f11ec38d920c7c7857d86e83bbabe582b2c33f262ffdb90

See more details on using hashes here.

Provenance

The following attestation bundles were made for swanspawner-1.2.47.tar.gz:

Publisher: release.yml on swan-cern/jupyterhub-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file swanspawner-1.2.47-py3-none-any.whl.

File metadata

  • Download URL: swanspawner-1.2.47-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for swanspawner-1.2.47-py3-none-any.whl
Algorithm Hash digest
SHA256 ba664a2e3f6521120f4c9008eb6fcbfd5ebc5b1ae100a7500a159542982c6f2b
MD5 bdecd6ad7d28a0f65764674c9ba765be
BLAKE2b-256 af7ccdf057c34111c8ff1ef4edf5217b1c571d4000ab5d822f798c7a866ba79a

See more details on using hashes here.

Provenance

The following attestation bundles were made for swanspawner-1.2.47-py3-none-any.whl:

Publisher: release.yml on swan-cern/jupyterhub-extensions

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page