RHOAI tool kit for managing and upgrading RHOAI
Project description
RHOAI Tool Kit
A comprehensive toolkit for managing and upgrading Red Hat OpenShift AI (RHOAI) installations with parallel installation support.
๐ Table of Contents
- Features
- Project Structure
- Installation
- Usage
- Logging
- Configuration
- Development
- Troubleshooting
- Contributing
โจ Features
- Install single or multiple OpenShift operators
- Parallel installation for faster deployments
- Configurable timeouts and retries
- Comprehensive logging system
- Supports:
- Serverless Operator
- Service Mesh Operator
- Authorino Operator
- cert-manager Operator (Kueue dependency)
- RHOAI Operator
- Kueue Operator
- KEDA (Custom Metrics Autoscaler) Operator
- Automatic Dependency Resolution: Installs required operators in correct order
- Smart Validation: Pre-installation compatibility and conflict detection
๐ Project Structure
rhoshift/
โโโ rhoshift/ # Main package directory
โ โโโ __init__.py
โ โโโ main.py # CLI entry point
โ โโโ cli/ # Command-line interface
โ โ โโโ __init__.py
โ โ โโโ args.py # Argument parsing
โ โ โโโ commands.py # Command implementations
โ โโโ logger/ # Logging utilities
โ โ โโโ __init__.py
โ โ โโโ logger.py # Logging configuration
โ โโโ utils/ # Core utilities
โ โโโ __init__.py
โ โโโ constants.py # Constants and configurations
โ โโโ operator.py # Operator management
โ โโโ utils.py # Utility functions
โโโ run_upgrade_matrix.sh # Upgrade matrix execution script
โโโ upgrade_matrix_usage.md # Upgrade matrix documentation
โโโ pyproject.toml # Project dependencies and configuration
โโโ README.md # This document
๐ Components
Core Components
- CLI: Command-line interface for operator management
- Logger: Logging configuration and utilities (logs to
/tmp/rhoshift.log) - Utils: Core utilities and operator management logic
RHOAI Components
- RHOAI Upgrade Matrix: Utilities for testing RHOAI upgrades
- Upgrade Matrix Scripts: Execution and documentation for upgrade testing
Maintenance Scripts
- Cleanup Scripts: Utilities for cleaning up operator installations
- Worker Node Scripts: Utilities for managing worker node configurations
๐ Installation
- Clone the repository:
git clone https://github.com/mwaykole/O.git
cd O
- Install dependencies:
pip install -e .
- Verify installation:
rhoshift --help
๐ง New CLI Options
rhoshift --help
usage: rhoshift [-h] [--serverless] [--servicemesh] [--authorino] [--cert-manager]
[--rhoai] [--kueue] [--keda] [--all] [--cleanup] [--deploy-rhoai-resources]
[--oc-binary OC_BINARY] [--retries RETRIES] [--retry-delay RETRY_DELAY]
[--timeout TIMEOUT] [--rhoai-channel RHOAI_CHANNEL] [--raw RAW]
[--rhoai-image RHOAI_IMAGE] [-v]
Operator Selection:
--cert-manager Install cert-manager Operator
--kueue Install Kueue Operator (auto-installs cert-manager)
--keda Install KEDA (Custom Metrics Autoscaler) Operator
[... other options ...]
๐ป Usage
Basic Commands
# Install single operator
rhoshift --serverless
# Install multiple operators
rhoshift --serverless --servicemesh
# Install cert-manager operator
rhoshift --cert-manager
# Install Kueue operator (automatically installs cert-manager dependency)
rhoshift --kueue
# Install KEDA (Custom Metrics Autoscaler) operator
rhoshift --keda
# Install RHOAI with raw configuration
rhoshift --rhoai --rhoai-channel=<channel> --rhoai-image=<image> --raw=True
# Install RHOAI with Serverless configuration
rhoshift --rhoai --rhoai-channel=<channel> --rhoai-image=<image> --raw=False --all
# Install all operators (including Kueue and KEDA)
rhoshift --all
# Create DSC and DSCI with RHOAI operator installation
rhoshift --rhoai --deploy-rhoai-resources
# Clean up all operators
rhoshift --cleanup
๐ Operator Dependencies & Validation
The tool automatically handles operator dependencies and provides smart validation:
Automatic Dependency Resolution
- Kueue requires cert-manager: Installing Kueue automatically includes cert-manager
- Dependencies are installed in the correct order to prevent failures
- Missing dependencies are automatically detected and added
# This command will install BOTH cert-manager AND Kueue (in correct order)
rhoshift --kueue
# You'll see output like:
# ๐ฆ Auto-adding dependency: cert-manager
# Installing 2 operators in order: cert-manager โ kueue
Smart Validation
- Compatibility Checking: Warns about potential operator conflicts
- Namespace Validation: Detects if operators conflict in shared namespaces
- Pre-Installation Validation: Catches issues before installation starts
# Example validation warnings:
# โ ๏ธ Note: Kueue and KEDA may have resource conflicts. Monitor for admission webhook issues.
# โ ๏ธ Installation order will be adjusted for dependencies: cert-manager โ kueue
Supported Dependencies
| Primary Operator | Required Dependencies |
|---|---|
| Kueue | cert-manager |
Note: When installing Kueue individually (
--kueue), you will see dependency warnings. For automatic dependency installation, use batch mode (--cert-manager --kueue) or install dependencies manually first.
Advanced Options
# Custom oc binary path
rhoshift --serverless --oc-binary /path/to/oc
# Custom timeout (seconds)
rhoshift --all --timeout 900
# Install queue management and auto-scaling operators together
# (cert-manager will be automatically installed as Kueue dependency)
rhoshift --kueue --keda
# Install complete ML/AI stack with queue management
rhoshift --rhoai --kueue --keda --rhoai-channel=stable --rhoai-image=<image>
# Install only cert-manager for other uses
rhoshift --cert-manager
# Verbose output
rhoshift --all --verbose
Upgrade Matrix Testing
To run the upgrade matrix tests, you can use either method:
- Using the shell script:
./run_upgrade_matrix.sh [options] <current_version> <current_channel> <new_version> <new_channel>
- Using the Python command:
run-upgrade-matrix [options] <current_version> <current_channel> <new_version> <new_channel>
Options:
-s, --scenario: Run specific scenario(s) (serverless, rawdeployment, serverless,rawdeployment)--skip-cleanup: Skip cleanup before each scenario--from-image: Custom source image path--to-image: Custom target image path
Example:
# Using shell script
./run_upgrade_matrix.sh -s serverless -s rawdeployment 2.10 stable 2.12 stable
# Using Python command
run-upgrade-matrix -s serverless -s rawdeployment 2.10 stable 2.12 stable
๐ Logging
The toolkit uses a comprehensive logging system:
- Logs are stored in
/tmp/rhoshift.log - Console output shows INFO level and above
- File logging captures DEBUG level and above
- Automatic log rotation (10MB max size, 5 backup files)
- Colored output in supported terminals
To view logs:
tail -f /tmp/rhoshift.log
๐ง Configuration
Environment Variables
LOG_FILE_LEVEL: Set file logging level (default: DEBUG)LOG_CONSOLE_LEVEL: Set console logging level (default: INFO)
Command Options
--oc-binary: Path to oc CLI (default: oc)--retries: Max retry attempts (default: 3)--retry-delay: Delay between retries in seconds (default: 10)--timeout: Command timeout in seconds (default: 300)
๐ ๏ธ Development
Prerequisites
- Python 3.8 or higher
- OpenShift CLI (oc)
- Access to an OpenShift cluster
Running Tests
pytest tests/
๐ Troubleshooting
Common Issues
-
Operator Installation Fails
- Check cluster access:
oc whoami - Verify operator catalog:
oc get catalogsource - Check logs:
tail -f /tmp/rhoshift.log
- Check cluster access:
-
Permission Issues
- Ensure you have cluster-admin privileges
- Check namespace permissions
-
Timeout Errors
- Increase timeout:
--timeout 900 - Check cluster resources
- Increase timeout:
๐ค Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rhoshift-0.1.5.2.tar.gz.
File metadata
- Download URL: rhoshift-0.1.5.2.tar.gz
- Upload date:
- Size: 59.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bdd0aee4185ea06fd29875ac09c8393a69572c33a83f66797e5097eb0be47f9
|
|
| MD5 |
2ef320867ee67846970d1f46734e2bd5
|
|
| BLAKE2b-256 |
ce4ffb15e7d90676e26c865d75a7c1e0e6879e2f3173e49c4c9cf28f17533edf
|
File details
Details for the file rhoshift-0.1.5.2-py3-none-any.whl.
File metadata
- Download URL: rhoshift-0.1.5.2-py3-none-any.whl
- Upload date:
- Size: 48.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31fbcd539d165b0cc7db5376fa4f59fafb8b83bdc9e9a39a7c393cec584d439a
|
|
| MD5 |
bc5b078a29fa36e8e39cb3fa9c59e0d9
|
|
| BLAKE2b-256 |
ec1dfd320313e5bb9c86961ed6e92f97878af437c2820b8d24ac49a4bd6bea00
|