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

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

Uploaded Source

Built Distribution

swanspawner-0.4.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: swanspawner-0.4.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for swanspawner-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0e4fabba7e4b5a19ceff0b88682aed53fbce52725557aba183335bc7bf99c594
MD5 e59bc87fde417de8221ac44b6adb1a36
BLAKE2b-256 b0898b8165c6c22222f8e48f420b03171137073b830f8e4b64c38e96f9aee74d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swanspawner-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for swanspawner-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 197abc2b4c2cc085efe4fd71d1e73ac25ed1e7d6f1fa8edd4325639c63cadcd5
MD5 60bd903c28cda009b0842c63c5c07b60
BLAKE2b-256 2a5c4a4ad204f5164f884c7ab2c81df68443309d480f7c5b1eb4907bc49b4241

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