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.2.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

swanspawner-1.2.2-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: swanspawner-1.2.2.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for swanspawner-1.2.2.tar.gz
Algorithm Hash digest
SHA256 df6ed32cef0959dbb1c26bcf7333436ed3d3666dc04f2e309d35bb00c007ec91
MD5 113e62fb8efcbe86ec84e245647f0ca8
BLAKE2b-256 fc2a6006073ae6fcbd8d1465e0085349dabb3bee5b8af6c2a4710945bbd36ae4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swanspawner-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for swanspawner-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 18c52a3038a901df7cbf876b6b577a10cf6977058784dcc5c9bdc33cf5bf4012
MD5 67179e5b20731e0dfad3a67e101c4d2a
BLAKE2b-256 9b0849f6f292931e698adc55f5f61bee3d334a84468ed3ca066475b7143a57c1

See more details on using hashes here.

Supported by

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