jh-config-manager


Namejh-config-manager JSON
Version 0.0.1 PyPI version JSON
download
home_pageNone
SummaryDynamic JupyterHub config manager service.
upload_time2025-07-30 13:49:41
maintainerNone
docs_urlNone
authorPitt Center for Research Computing and Data
requires_python>=3.9
licenseGPL-3.0-only
keywords pitt crc jupyter jupyterhub jupyterlab configuration manager
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CRC JupyterHub Configuration Manager

`jh_config_manager` is a dynamic configuration manager service for 
[JupyterHub](https://jupyterhub.readthedocs.io/) that monitors and updates virtual environment and module configuration
information. It writes this information to a cache file for use by custom spawners or UI components.

## Features

- Periodically scans a directory for available virtual environments
- Reads a JSON configuration file describing modules
- Writes a unified cache JSON file used by JupyterHub to dynamically populate user options
- Designed to run as a background JupyterHub service

## Installation

Clone the repository and install the package into your virtual environment:

```
git clone <your-repo-url>
cd jh_config_manager
pip install .
```
or through pip:
```
pip install jh-config-manager
```
## Configuration
### Arguments:
- venv_root: Path to the root directory containing virtual environments
- modules_config_file: Path to the JSON file describing modules
- cache_file: Path to the output cache file (used by JupyterHub spawner)
- reload_interval: Number of seconds between scans (default: 30)

### in jupyterhub_config.py:
```python
c.JupyterHub.services = [
    {
        'name': 'jh-config-manager',
        'command': [
            'python', '-m', 'jh_config_manager',
            '--venv_root=/ihome/crc/install/jupyterhub/hub.5.2.1/envs',
            '--modules_config_file=/ihome/crc/install/jupyterhub/modules_config.json',
            '--cache_file=/ihome/crc/install/jupyterhub/config_cache.json',
            '--reload_interval=30'
        ],
    }
]
```

### Example JSON Module Config File:
```json
{
    "amber24": {
        "display_name": "Amber 2024",
        "modules": ["openmpi/4.1.1", "amber/24-jupyterhub"]
    },
    "cuda11.2": {
        "display_name": "CUDA 11.2",
        "modules": ["cuda/11.2"]
    }
}
```

### Example Cache File:
```json
{
  "virtualenvs": ["venv1", "venv2"],
  "modules": {
        "amber24": {
            "display_name": "Amber 2024",
            "modules": ["openmpi/4.1.1", "amber/24-jupyterhub"]
        },
        "cuda11.2": {
            "display_name": "CUDA 11.2",
            "modules": ["cuda/11.2"]
        }
    }
}
```
## Testing
To run the service manually, use the following command:
```
python -m jh_config_manager \
  --venv_root=/your/path/to/envs \
  --modules_config_file=/your/path/to/modules_config.json \
  --cache_file=/your/path/to/output_cache.json \
  --reload_interval=10
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "jh-config-manager",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "Pitt, CRC, Jupyter, JupyterHub, JupyterLab, Configuration, Manager",
    "author": "Pitt Center for Research Computing and Data",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/e1/5b/6d8bc363eb14299298bee6308562c3e58b6175df50493f4b19b24f12f432/jh_config_manager-0.0.1.tar.gz",
    "platform": null,
    "description": "# CRC JupyterHub Configuration Manager\n\n`jh_config_manager` is a dynamic configuration manager service for \n[JupyterHub](https://jupyterhub.readthedocs.io/) that monitors and updates virtual environment and module configuration\ninformation. It writes this information to a cache file for use by custom spawners or UI components.\n\n## Features\n\n- Periodically scans a directory for available virtual environments\n- Reads a JSON configuration file describing modules\n- Writes a unified cache JSON file used by JupyterHub to dynamically populate user options\n- Designed to run as a background JupyterHub service\n\n## Installation\n\nClone the repository and install the package into your virtual environment:\n\n```\ngit clone <your-repo-url>\ncd jh_config_manager\npip install .\n```\nor through pip:\n```\npip install jh-config-manager\n```\n## Configuration\n### Arguments:\n- venv_root: Path to the root directory containing virtual environments\n- modules_config_file: Path to the JSON file describing modules\n- cache_file: Path to the output cache file (used by JupyterHub spawner)\n- reload_interval: Number of seconds between scans (default: 30)\n\n### in jupyterhub_config.py:\n```python\nc.JupyterHub.services = [\n    {\n        'name': 'jh-config-manager',\n        'command': [\n            'python', '-m', 'jh_config_manager',\n            '--venv_root=/ihome/crc/install/jupyterhub/hub.5.2.1/envs',\n            '--modules_config_file=/ihome/crc/install/jupyterhub/modules_config.json',\n            '--cache_file=/ihome/crc/install/jupyterhub/config_cache.json',\n            '--reload_interval=30'\n        ],\n    }\n]\n```\n\n### Example JSON Module Config File:\n```json\n{\n    \"amber24\": {\n        \"display_name\": \"Amber 2024\",\n        \"modules\": [\"openmpi/4.1.1\", \"amber/24-jupyterhub\"]\n    },\n    \"cuda11.2\": {\n        \"display_name\": \"CUDA 11.2\",\n        \"modules\": [\"cuda/11.2\"]\n    }\n}\n```\n\n### Example Cache File:\n```json\n{\n  \"virtualenvs\": [\"venv1\", \"venv2\"],\n  \"modules\": {\n        \"amber24\": {\n            \"display_name\": \"Amber 2024\",\n            \"modules\": [\"openmpi/4.1.1\", \"amber/24-jupyterhub\"]\n        },\n        \"cuda11.2\": {\n            \"display_name\": \"CUDA 11.2\",\n            \"modules\": [\"cuda/11.2\"]\n        }\n    }\n}\n```\n## Testing\nTo run the service manually, use the following command:\n```\npython -m jh_config_manager \\\n  --venv_root=/your/path/to/envs \\\n  --modules_config_file=/your/path/to/modules_config.json \\\n  --cache_file=/your/path/to/output_cache.json \\\n  --reload_interval=10\n```\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-only",
    "summary": "Dynamic JupyterHub config manager service.",
    "version": "0.0.1",
    "project_urls": {
        "Documentation": "https://github.com/pitt-crc/Jupyter-Authenticator",
        "Homepage": "https://github.com/pitt-crc/Jupyter-Authenticator",
        "Repository": "https://github.com/pitt-crc/Jupyter-Authenticator"
    },
    "split_keywords": [
        "pitt",
        " crc",
        " jupyter",
        " jupyterhub",
        " jupyterlab",
        " configuration",
        " manager"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7a760511dece76c7ab159ce2b91651d830b553a73da9d4aa8ae8ac2f3e32e308",
                "md5": "b394f5f274d4aebbe05d12b7cb2b36e1",
                "sha256": "a737c21a4506fa8147ca27c02859fe15e66190e3a5066a63a2fce70696c758d2"
            },
            "downloads": -1,
            "filename": "jh_config_manager-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b394f5f274d4aebbe05d12b7cb2b36e1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 4009,
            "upload_time": "2025-07-30T13:49:40",
            "upload_time_iso_8601": "2025-07-30T13:49:40.108520Z",
            "url": "https://files.pythonhosted.org/packages/7a/76/0511dece76c7ab159ce2b91651d830b553a73da9d4aa8ae8ac2f3e32e308/jh_config_manager-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e15b6d8bc363eb14299298bee6308562c3e58b6175df50493f4b19b24f12f432",
                "md5": "0b86fb418d86d445a0254b8fc5c2c5d6",
                "sha256": "a09c1ca08a4f7870ef5d528033d95f33842d48d18b34507f71b87f6d52479f2e"
            },
            "downloads": -1,
            "filename": "jh_config_manager-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0b86fb418d86d445a0254b8fc5c2c5d6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 2859,
            "upload_time": "2025-07-30T13:49:41",
            "upload_time_iso_8601": "2025-07-30T13:49:41.328196Z",
            "url": "https://files.pythonhosted.org/packages/e1/5b/6d8bc363eb14299298bee6308562c3e58b6175df50493f4b19b24f12f432/jh_config_manager-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-30 13:49:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pitt-crc",
    "github_project": "Jupyter-Authenticator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "jh-config-manager"
}
        
Elapsed time: 0.48708s