Skip to main content

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

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.2.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.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for jh_config_manager-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c1ce017c7b9f4ddd72d904f52062e8806d1f6b001a5ee9b7a3eb03d9d78f5c13
MD5 7bff74d32f75ca703df3c40a63c29140
BLAKE2b-256 15f64d72bed3c73a375300972c44df5804ef2526c8ed06f8587263bb9d5f97a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jh_config_manager-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e5c14eb6218323d088c2d3959b4b16bfb5a472156f1bd62f4d39a4793a3ee1c1
MD5 ec1aa1d2753261552f4d0f8828aaf782
BLAKE2b-256 fe57cd2cc35b01bb9db2e27ed428dd6717edb72154ce3273fd0ae6777b5f9097

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.0

2 files

0.0.3

2 files

This release

0.0.2 This release

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page