|
| 1 | +# OpenStack CI Analysis Reporting Toolkit |
| 2 | + |
| 3 | +A portable toolkit for analyzing OpenStack CI job health, performance, and configuration in OpenShift CI infrastructure. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +This toolkit provides comprehensive analysis of OpenStack CI jobs by: |
| 8 | + |
| 9 | +- **Extracting** job inventory from CI configuration files |
| 10 | +- **Fetching** runtime metrics from the [Sippy API](https://sippy.dptools.openshift.org/) |
| 11 | +- **Analyzing** job health, coverage gaps, and optimization opportunities |
| 12 | +- **Comparing** OpenStack pass rates against other cloud platforms (AWS, GCP, Azure, vSphere) |
| 13 | +- **Categorizing** failures by root cause (flaky, product bug, infrastructure, needs triage) |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +- Python 3.6+ |
| 18 | +- PyYAML library |
| 19 | + |
| 20 | +```bash |
| 21 | +pip install pyyaml |
| 22 | +``` |
| 23 | + |
| 24 | +## Quick Start |
| 25 | + |
| 26 | +### Option 1: Using the Shell Script (Recommended) |
| 27 | + |
| 28 | +```bash |
| 29 | +# Clone the release repository (or use existing clone) |
| 30 | +git clone https://github.com/openshift/release.git |
| 31 | +cd release |
| 32 | + |
| 33 | +# Run complete analysis - outputs to current directory |
| 34 | +./path/to/reporting-toolkit/run_analysis.sh |
| 35 | + |
| 36 | +# Or specify custom paths |
| 37 | +./path/to/reporting-toolkit/run_analysis.sh \ |
| 38 | + --config-dir /path/to/release/ci-operator/config \ |
| 39 | + --output-dir /tmp/my-analysis |
| 40 | +``` |
| 41 | + |
| 42 | +### Option 2: Running Scripts Individually |
| 43 | + |
| 44 | +```bash |
| 45 | +# Set your paths |
| 46 | +TOOLKIT=/path/to/reporting-toolkit |
| 47 | +CONFIG_DIR=/path/to/release/ci-operator/config |
| 48 | +OUTPUT_DIR=/tmp/my-analysis |
| 49 | + |
| 50 | +# Phase 1: Data Collection |
| 51 | +python3 $TOOLKIT/extract_openstack_jobs.py --config-dir $CONFIG_DIR --output-dir $OUTPUT_DIR --summary |
| 52 | +python3 $TOOLKIT/fetch_job_metrics.py --output-dir $OUTPUT_DIR |
| 53 | +python3 $TOOLKIT/fetch_extended_metrics.py --output-dir $OUTPUT_DIR |
| 54 | +python3 $TOOLKIT/fetch_comparison_data.py --output-dir $OUTPUT_DIR |
| 55 | + |
| 56 | +# Phase 2: Configuration Analysis |
| 57 | +python3 $TOOLKIT/analyze_redundancy.py --output-dir $OUTPUT_DIR |
| 58 | +python3 $TOOLKIT/analyze_coverage.py --output-dir $OUTPUT_DIR |
| 59 | +python3 $TOOLKIT/analyze_triggers.py --output-dir $OUTPUT_DIR |
| 60 | + |
| 61 | +# Phase 3: Runtime Analysis |
| 62 | +python3 $TOOLKIT/analyze_platform_comparison.py --output-dir $OUTPUT_DIR |
| 63 | +python3 $TOOLKIT/analyze_workflow_passrate.py --output-dir $OUTPUT_DIR |
| 64 | +python3 $TOOLKIT/categorize_failures.py --output-dir $OUTPUT_DIR |
| 65 | +``` |
| 66 | + |
| 67 | +## Scripts |
| 68 | + |
| 69 | +### Data Collection |
| 70 | + |
| 71 | +| Script | Description | |
| 72 | +|--------|-------------| |
| 73 | +| `extract_openstack_jobs.py` | Extracts job inventory from `ci-operator/config/` YAML files | |
| 74 | +| `fetch_job_metrics.py` | Fetches pass rates and run counts from Sippy API | |
| 75 | +| `fetch_extended_metrics.py` | Calculates 14-day combined metrics and trends | |
| 76 | +| `fetch_comparison_data.py` | Fetches platform comparison data from Sippy | |
| 77 | + |
| 78 | +### Configuration Analysis |
| 79 | + |
| 80 | +| Script | Description | |
| 81 | +|--------|-------------| |
| 82 | +| `analyze_redundancy.py` | Identifies duplicate/overlapping jobs | |
| 83 | +| `analyze_coverage.py` | Finds test coverage gaps across releases | |
| 84 | +| `analyze_triggers.py` | Identifies trigger optimization opportunities | |
| 85 | + |
| 86 | +### Runtime Analysis |
| 87 | + |
| 88 | +| Script | Description | |
| 89 | +|--------|-------------| |
| 90 | +| `analyze_platform_comparison.py` | Compares OpenStack vs AWS/GCP/Azure/vSphere | |
| 91 | +| `analyze_workflow_passrate.py` | Analyzes pass rates by workflow/test type | |
| 92 | +| `categorize_failures.py` | Classifies failures by root cause | |
| 93 | + |
| 94 | +## Command Line Options |
| 95 | + |
| 96 | +All scripts support: |
| 97 | +- `--output-dir DIR` - Directory for input/output files (default: script directory) |
| 98 | +- `--help` - Show usage information |
| 99 | + |
| 100 | +Additional options: |
| 101 | +- `extract_openstack_jobs.py`: `--config-dir` for CI config location |
| 102 | +- `fetch_job_metrics.py`: `--force` to refresh cached data |
| 103 | + |
| 104 | +## Output Files |
| 105 | + |
| 106 | +### Reports (Markdown) |
| 107 | + |
| 108 | +| File | Description | |
| 109 | +|------|-------------| |
| 110 | +| `job_metrics_report.md` | Pass rate metrics by release | |
| 111 | +| `extended_metrics_report.md` | 14-day trends and problem jobs | |
| 112 | +| `platform_comparison_report.md` | OpenStack vs other platforms | |
| 113 | +| `workflow_passrate_report.md` | Pass rates by workflow type | |
| 114 | +| `failure_categories_report.md` | Failures by root cause | |
| 115 | +| `coverage_gaps_report.md` | Missing test coverage | |
| 116 | +| `trigger_optimization_report.md` | Trigger pattern improvements | |
| 117 | +| `redundant_jobs_report.md` | Potential job consolidation | |
| 118 | + |
| 119 | +### Data (JSON) |
| 120 | + |
| 121 | +| File | Description | |
| 122 | +|------|-------------| |
| 123 | +| `openstack_jobs_inventory.json` | Complete job inventory | |
| 124 | +| `sippy_jobs_raw.json` | Cached Sippy API data | |
| 125 | +| `extended_metrics.json` | Extended metrics data | |
| 126 | +| `platform_comparison_raw.json` | Platform comparison data | |
| 127 | +| `workflow_passrate_analysis.json` | Workflow analysis data | |
| 128 | +| `failure_categories.json` | Categorized failures | |
| 129 | + |
| 130 | +## Example Output |
| 131 | + |
| 132 | +After running the analysis, you'll see key findings like: |
| 133 | + |
| 134 | +``` |
| 135 | +Platform Comparison: |
| 136 | + 1. vSphere: 80.7% |
| 137 | + 2. AWS: 73.9% |
| 138 | + 3. GCP: 71.2% |
| 139 | + 4. Metal: 69.8% |
| 140 | + 5. Azure: 68.2% |
| 141 | + 6. OpenStack: 50.4% <-- Gap to address |
| 142 | +
|
| 143 | +Failure Categories: |
| 144 | + - Flaky: 41.6% |
| 145 | + - Needs Triage: 36.0% |
| 146 | + - Product Bug: 22.5% |
| 147 | +
|
| 148 | +Critical Workflows (0% pass rate): |
| 149 | + - ccpmso |
| 150 | + - upgrade |
| 151 | + - singlestackv6 |
| 152 | +``` |
| 153 | + |
| 154 | +## Portability |
| 155 | + |
| 156 | +This toolkit is designed to be portable: |
| 157 | + |
| 158 | +1. **No hardcoded paths** - All paths are configurable via command-line options |
| 159 | +2. **Self-contained** - All scripts are in a single directory |
| 160 | +3. **Minimal dependencies** - Only requires Python 3.6+ and PyYAML |
| 161 | + |
| 162 | +To use in another project: |
| 163 | +```bash |
| 164 | +# Copy the toolkit |
| 165 | +cp -r reporting-toolkit /path/to/your/project/ |
| 166 | + |
| 167 | +# Run from anywhere |
| 168 | +/path/to/your/project/reporting-toolkit/run_analysis.sh \ |
| 169 | + --config-dir /path/to/release/ci-operator/config \ |
| 170 | + --output-dir /path/to/output |
| 171 | +``` |
| 172 | + |
| 173 | +## Data Sources |
| 174 | + |
| 175 | +- **CI Configuration**: `ci-operator/config/` in the [openshift/release](https://github.com/openshift/release) repository |
| 176 | +- **Runtime Metrics**: [Sippy API](https://sippy.dptools.openshift.org/) - OpenShift CI analytics platform |
| 177 | + |
| 178 | +## Cluster Profiles Analyzed |
| 179 | + |
| 180 | +The toolkit analyzes jobs using these OpenStack cluster profiles: |
| 181 | +- `openstack-vexxhost` |
| 182 | +- `openstack-vh-mecha-central` |
| 183 | +- `openstack-vh-mecha-az0` |
| 184 | +- `openstack-vh-bm-rhos` |
| 185 | +- `openstack-hwoffload` |
| 186 | +- `openstack-nfv` |
| 187 | + |
| 188 | +## Refreshing Data |
| 189 | + |
| 190 | +Sippy data is cached to avoid repeated API calls. To refresh: |
| 191 | + |
| 192 | +```bash |
| 193 | +# Refresh all data |
| 194 | +./run_analysis.sh --force |
| 195 | + |
| 196 | +# Or refresh just job metrics |
| 197 | +python3 fetch_job_metrics.py --output-dir $OUTPUT_DIR --force |
| 198 | +``` |
| 199 | + |
| 200 | +## Troubleshooting |
| 201 | + |
| 202 | +### "No Sippy data found" |
| 203 | +Run `fetch_job_metrics.py` before analysis scripts that require Sippy data. |
| 204 | + |
| 205 | +### "No job inventory found" |
| 206 | +Run `extract_openstack_jobs.py` before configuration analysis scripts. |
| 207 | + |
| 208 | +### Import error for yaml |
| 209 | +Install PyYAML: `pip install pyyaml` |
| 210 | + |
| 211 | +### Config directory not found |
| 212 | +Ensure the path to `ci-operator/config` is correct. This should point to the config directory in the openshift/release repository. |
| 213 | + |
| 214 | +## For Claude Code Users |
| 215 | + |
| 216 | +See `CLAUDE.md` for detailed instructions on using this toolkit with Claude Code, including: |
| 217 | +- Step-by-step execution guide |
| 218 | +- Creating comprehensive assessment reports |
| 219 | +- Customization options |
| 220 | +- API reference |
| 221 | + |
| 222 | +## License |
| 223 | + |
| 224 | +This toolkit is part of the OpenShift CI infrastructure. See the main repository for license information. |
0 commit comments