swanspawner


Nameswanspawner JSON
Version 1.2.0 PyPI version JSON
download
home_pagehttps://github.com/swan-cern/jupyterhub-extensions
SummarySWAN JupyterHub spawner
upload_time2024-04-24 13:01:17
maintainerNone
docs_urlNone
authorSWAN Admins
requires_pythonNone
licenseAGPL-3.0
keywords jupyterhub spawner swan cern
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```bash
pip3 install swanspawner
```

## Usage

Add to your JupyterHub config file

```python
c.JupyterHub.spawner_class = 'swanspawner.SwanDockerSpawner'
```

If you deploy with Docker, or

```python
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

```python
c.SwanSpawner.options_form_config = '<path>'
```

High level objects 

```json
{
 "header": <options header text>,
 "options": <array of options objects>
...
}
```

Options type label

```json
{
 "options": [
    {
      "type": "label",
      "label": {
        "value": <id of label>,
        "text": <displayed text of label>
      }
    },
    ...
]
...
}
```

Options type selection

```json
{
 "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:

```python
c.SwanSpawner.mounts = [
    {
        'source': '/eos',
        'target': '/eos',
        'type': 'bind',
        'propagation': 'shared'
    },
    {
        'source': '/cvmfs',
        'target': '/cvmfs',
        'type': 'bind',
        'propagation': 'shared'
    }
]
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/swan-cern/jupyterhub-extensions",
    "name": "swanspawner",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "JupyterHub, Spawner, SWAN, CERN",
    "author": "SWAN Admins",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/76/c5/2e23baf31a38c6bd9e34b2f08d0badeea72f81b43b884646647fa9f831a7/swanspawner-1.2.0.tar.gz",
    "platform": "Linux",
    "description": "# SWAN Spawner\n\nSpawner for JupyterHub that enables configuring a session with CVMFS/LCG stacks, support for GPU, oAuth tokens, etc. \nIf Binder is used to configure the Docker image used, it reverts to the default upstream configuration.\nWorks with both Docker and Kubernetes.\n\n## Installation\n\n```bash\npip3 install swanspawner\n```\n\n## Usage\n\nAdd to your JupyterHub config file\n\n```python\nc.JupyterHub.spawner_class = 'swanspawner.SwanDockerSpawner'\n```\n\nIf you deploy with Docker, or\n\n```python\nc.JupyterHub.spawner_class = 'swanspawner.SwanKubeSpawner'\n```\n\nIf you deploy with Kubernetes.\n\n## Jupyter Notebook environment variables set during spawn\n\n| env      |\n|  ---     | \n| ROOT_LCG_VIEW_NAME   |\n| ROOT_LCG_VIEW_PLATFORM   |\n| USER_ENV_SCRIPT   |\n| ROOT_LCG_VIEW_PATH   |\n| USER  |\n| USER_ID  |\n| USER_GID  |\n| HOME  |\n| EOS_PATH_FORMAT  |\n| SERVER_HOSTNAME  |\n| MAX_MEMORY  |\n| JPY_USER  |\n| JPY_COOKIE_NAME  |\n| JPY_BASE_URL  |\n| JPY_HUB_PREFIX  |\n| JPY_HUB_API_URL  |\n| ACCESS_TOKEN  |\n| OAUTH_INSPECTION_ENDPOINT  |\n\n## Spawn Form configuration\n\nTo configure custom form, please set path to config file as below\n\n```python\nc.SwanSpawner.options_form_config = '<path>'\n```\n\nHigh level objects \n\n```json\n{\n \"header\": <options header text>,\n \"options\": <array of options objects>\n...\n}\n```\n\nOptions type label\n\n```json\n{\n \"options\": [\n    {\n      \"type\": \"label\",\n      \"label\": {\n        \"value\": <id of label>,\n        \"text\": <displayed text of label>\n      }\n    },\n    ...\n]\n...\n}\n```\n\nOptions type selection\n\n```json\n{\n \"options\": [\n    {\n      \"type\": \"selection\",\n      \"lcg\": {\n        \"value\": <id of lcg>,\n        \"text\": <displayed text of lcg>\n      },\n      \"platforms\": [\n        {\n            \"value\": <id of platform>,\n            \"text\": <displayed text of platform>\n        }\n        ...\n      ],\n      \"cores\": [\n        {\n            \"value\": <id of cores selection>,\n            \"text\": <displayed text of cores selection>\n        }\n        ...\n      ],\n      \"memory\": [\n        {\n            \"value\": <id of memory selection>,\n            \"text\": <displayed text of memory selection>\n        }\n        ...\n      ],\n      \"clusters\": [\n        {\n            \"value\": <id of cluster>,\n            \"text\": <displayed text of cluster>\n        }\n        ...\n      ]\n    },\n    ...\n]\n...\n}\n```\nAn example json file can be seen in [options_form_config.json]()\n\n## Mount options\n\nTo mount EOS or CVMFS with SwanDockerSpawner (which requires a mount with propagation \"shared\"), a new configuration was introduced by upstream:\n\n```python\nc.SwanSpawner.mounts = [\n    {\n        'source': '/eos',\n        'target': '/eos',\n        'type': 'bind',\n        'propagation': 'shared'\n    },\n    {\n        'source': '/cvmfs',\n        'target': '/cvmfs',\n        'type': 'bind',\n        'propagation': 'shared'\n    }\n]\n```\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0",
    "summary": "SWAN JupyterHub spawner",
    "version": "1.2.0",
    "project_urls": {
        "Homepage": "https://github.com/swan-cern/jupyterhub-extensions"
    },
    "split_keywords": [
        "jupyterhub",
        " spawner",
        " swan",
        " cern"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae674b3973c5af111159c1222401c98fe69969c49934bdb19f448b5a7b3c904f",
                "md5": "457fd15990e6659b06223c894e3082d7",
                "sha256": "41b098ad397fd62e7fcc7d9c670e272d6e1ffb32682ced9ba0551e6c2f9bf741"
            },
            "downloads": -1,
            "filename": "swanspawner-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "457fd15990e6659b06223c894e3082d7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 14271,
            "upload_time": "2024-04-24T13:01:15",
            "upload_time_iso_8601": "2024-04-24T13:01:15.374621Z",
            "url": "https://files.pythonhosted.org/packages/ae/67/4b3973c5af111159c1222401c98fe69969c49934bdb19f448b5a7b3c904f/swanspawner-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "76c52e23baf31a38c6bd9e34b2f08d0badeea72f81b43b884646647fa9f831a7",
                "md5": "92b52000e5a519f86b035b3f12a50f95",
                "sha256": "9904014d2d07b181d7f724e0106c2462adbd5f32dc75fa3fd31937c64d3a714a"
            },
            "downloads": -1,
            "filename": "swanspawner-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "92b52000e5a519f86b035b3f12a50f95",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13852,
            "upload_time": "2024-04-24T13:01:17",
            "upload_time_iso_8601": "2024-04-24T13:01:17.300845Z",
            "url": "https://files.pythonhosted.org/packages/76/c5/2e23baf31a38c6bd9e34b2f08d0badeea72f81b43b884646647fa9f831a7/swanspawner-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-24 13:01:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "swan-cern",
    "github_project": "jupyterhub-extensions",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "swanspawner"
}
        
Elapsed time: 0.31441s