Skip to main content

Dynamic JupyterHub config manager service.

Project description

CRC JupyterHub Configuration Manager

jh_config_manager is a dynamic configuration manager service for JupyterHub 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:

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:

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

{
  "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

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

jh_config_manager-0.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

jh_config_manager-0.0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file jh_config_manager-0.0.1.tar.gz.

File metadata

  • Download URL: jh_config_manager-0.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jh_config_manager-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a09c1ca08a4f7870ef5d528033d95f33842d48d18b34507f71b87f6d52479f2e
MD5 0b86fb418d86d445a0254b8fc5c2c5d6
BLAKE2b-256 e15b6d8bc363eb14299298bee6308562c3e58b6175df50493f4b19b24f12f432

See more details on using hashes here.

File details

Details for the file jh_config_manager-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for jh_config_manager-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a737c21a4506fa8147ca27c02859fe15e66190e3a5066a63a2fce70696c758d2
MD5 b394f5f274d4aebbe05d12b7cb2b36e1
BLAKE2b-256 7a760511dece76c7ab159ce2b91651d830b553a73da9d4aa8ae8ac2f3e32e308

See more details on using hashes here.

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