|
| 1 | +# .github/workflows/ultimate_stress_test.yml |
| 2 | +name: 🔥 Ultimate Omnipkg Stress Test - Multi-Version Scientific Package Chaos |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + push: |
| 7 | + branches: ['main', 'dev', 'test-stress'] |
| 8 | + schedule: |
| 9 | + - cron: '0 6 * * 1' # Weekly Monday 6AM UTC |
| 10 | + |
| 11 | +jobs: |
| 12 | + omnipkg-ultimate-stress: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + permissions: |
| 15 | + contents: write |
| 16 | + timeout-minutes: 45 |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: 🏁 Checkout Repository |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: 🐍 Set up Python 3.11 (Base Environment) |
| 23 | + uses: actions/setup-python@v4 |
| 24 | + with: |
| 25 | + python-version: '3.11' |
| 26 | + |
| 27 | + - name: 🔧 Install Redis & System Dependencies |
| 28 | + run: | |
| 29 | + sudo apt-get update -qq |
| 30 | + sudo apt-get install -y redis-server build-essential python3-dev |
| 31 | + sudo systemctl start redis-server |
| 32 | + redis-cli ping |
| 33 | + echo "✅ Redis is running" |
| 34 | +
|
| 35 | + - name: 📦 Install omnipkg |
| 36 | + run: | |
| 37 | + python -m pip install --upgrade pip |
| 38 | + pip install -e . |
| 39 | + echo "🚀 omnipkg $(omnipkg --version) installed" |
| 40 | +
|
| 41 | + - name: ⚙️ Configure omnipkg for Non-Interactive Stress Testing |
| 42 | + run: | |
| 43 | + python - << 'EOF' |
| 44 | + import sys |
| 45 | + import site |
| 46 | + import json |
| 47 | + from pathlib import Path |
| 48 | + import os |
| 49 | +
|
| 50 | + site_packages_path = site.getsitepackages()[0] |
| 51 | + python_executable_path = sys.executable |
| 52 | + project_root = Path(os.environ['GITHUB_WORKSPACE']) |
| 53 | +
|
| 54 | + config_data = { |
| 55 | + 'site_packages_path': site_packages_path, |
| 56 | + 'multiversion_base': str(Path(site_packages_path) / '.omnipkg_versions'), |
| 57 | + 'python_executable': python_executable_path, |
| 58 | + 'builder_script_path': str(project_root / 'omnipkg' / 'package_meta_builder.py'), |
| 59 | + 'redis_host': 'localhost', |
| 60 | + 'redis_port': 6379, |
| 61 | + 'redis_key_prefix': 'omnipkg:pkg:', |
| 62 | + 'paths_to_index': [str(Path(python_executable_path).parent), '/usr/local/bin', '/usr/bin', '/bin'], |
| 63 | + 'auto_cleanup': True, |
| 64 | + 'cleanup_threshold_days': 30, |
| 65 | + 'non_interactive': True, |
| 66 | + 'auto_resolve_conflicts': True |
| 67 | + } |
| 68 | +
|
| 69 | + config_dir = Path.home() / '.config' / 'omnipkg' |
| 70 | + config_dir.mkdir(parents=True, exist_ok=True) |
| 71 | + config_path = config_dir / 'config.json' |
| 72 | +
|
| 73 | + with open(config_path, 'w') as f: |
| 74 | + json.dump(config_data, f, indent=2) |
| 75 | +
|
| 76 | + print(f'✅ omnipkg configured for stress testing at {config_path}') |
| 77 | + EOF |
| 78 | +
|
| 79 | + - name: 🚀 Ready to Stress Test |
| 80 | + run: | |
| 81 | + echo "🚀 omnipkg is ready - knowledge base will auto-build as needed" |
| 82 | + echo "✅ Starting stress test with intelligent package manager" |
| 83 | +
|
| 84 | + - name: 🎪 Phase 1 - Built-in Stress Test Demo |
| 85 | + id: builtin_stress |
| 86 | + run: | |
| 87 | + echo "=== PHASE 1: Running omnipkg's built-in stress-test ===" | tee stress_test_phase1.log |
| 88 | + echo "This will demonstrate heavy scientific packages with conflict resolution..." | tee -a stress_test_phase1.log |
| 89 | + |
| 90 | + # Run the built-in stress test |
| 91 | + timeout 900 omnipkg stress-test --yes 2>&1 | tee -a stress_test_phase1.log || true |
| 92 | + |
| 93 | + echo "📊 Phase 1 Complete - Built-in stress test finished" | tee -a stress_test_phase1.log |
| 94 | + echo "Current environment status:" | tee -a stress_test_phase1.log |
| 95 | + omnipkg status --quiet | tee -a stress_test_phase1.log |
| 96 | +
|
| 97 | + - name: 💥 Phase 2 - Multi-Version Package Chaos |
| 98 | + id: multi_version_chaos |
| 99 | + run: | |
| 100 | + echo "=== PHASE 2: Multi-Version Package Installation Chaos ===" | tee stress_test_phase2.log |
| 101 | + echo "Testing omnipkg's version bubbling and conflict resolution..." | tee -a stress_test_phase2.log |
| 102 | + |
| 103 | + # Install conflicting versions of popular packages |
| 104 | + echo "🔥 Installing multiple versions of numpy..." | tee -a stress_test_phase2.log |
| 105 | + omnipkg install numpy==1.21.0 --yes | tee -a stress_test_phase2.log |
| 106 | + omnipkg install numpy==1.22.0 --yes | tee -a stress_test_phase2.log |
| 107 | + omnipkg install numpy==1.23.0 --yes | tee -a stress_test_phase2.log |
| 108 | + |
| 109 | + echo "🔥 Installing multiple versions of requests..." | tee -a stress_test_phase2.log |
| 110 | + omnipkg install requests==2.25.0 --yes | tee -a stress_test_phase2.log |
| 111 | + omnipkg install requests==2.28.0 --yes | tee -a stress_test_phase2.log |
| 112 | + |
| 113 | + echo "🔥 Installing multiple versions of pandas..." | tee -a stress_test_phase2.log |
| 114 | + omnipkg install pandas==1.3.0 --yes | tee -a stress_test_phase2.log |
| 115 | + omnipkg install pandas==2.0.0 --yes | tee -a stress_test_phase2.log |
| 116 | + |
| 117 | + echo "🔥 Installing conflicting Django versions..." | tee -a stress_test_phase2.log |
| 118 | + omnipkg install django==3.2 --yes | tee -a stress_test_phase2.log |
| 119 | + omnipkg install django==4.2 --yes | tee -a stress_test_phase2.log |
| 120 | + |
| 121 | + echo "📊 Multi-version installation complete!" | tee -a stress_test_phase2.log |
| 122 | + omnipkg list | tee -a stress_test_phase2.log |
| 123 | +
|
| 124 | + - name: 🧪 Phase 3 - Scientific Computing Package Mayhem |
| 125 | + id: scientific_mayhem |
| 126 | + run: | |
| 127 | + echo "=== PHASE 3: Scientific Computing Package Installation Mayhem ===" | tee stress_test_phase3.log |
| 128 | + echo "Testing complex dependency resolution with heavy scientific packages..." | tee -a stress_test_phase3.log |
| 129 | + |
| 130 | + # Install scientific packages that often conflict |
| 131 | + echo "🧬 Installing scipy with specific numpy requirements..." | tee -a stress_test_phase3.log |
| 132 | + omnipkg install scipy --yes | tee -a stress_test_phase3.log |
| 133 | + |
| 134 | + echo "📊 Installing matplotlib..." | tee -a stress_test_phase3.log |
| 135 | + omnipkg install matplotlib --yes | tee -a stress_test_phase3.log |
| 136 | + |
| 137 | + echo "🤖 Installing scikit-learn..." | tee -a stress_test_phase3.log |
| 138 | + omnipkg install scikit-learn --yes | tee -a stress_test_phase3.log |
| 139 | + |
| 140 | + echo "🔬 Installing jupyter notebook..." | tee -a stress_test_phase3.log |
| 141 | + omnipkg install jupyter --yes | tee -a stress_test_phase3.log |
| 142 | + |
| 143 | + echo "⚡ Installing numba..." | tee -a stress_test_phase3.log |
| 144 | + omnipkg install numba --yes | tee -a stress_test_phase3.log |
| 145 | + |
| 146 | + echo "📊 Scientific package mayhem complete!" | tee -a stress_test_phase3.log |
| 147 | + omnipkg status | tee -a stress_test_phase3.log |
| 148 | +
|
| 149 | + - name: 🎯 Phase 4 - Complex Version Specification Stress |
| 150 | + id: complex_version_stress |
| 151 | + run: | |
| 152 | + echo "=== PHASE 4: Complex Version Specification Stress Test ===" | tee stress_test_phase4.log |
| 153 | + echo "Testing omnipkg's ability to handle complex version constraints..." | tee -a stress_test_phase4.log |
| 154 | + |
| 155 | + # Test complex version specifications |
| 156 | + echo "🎯 Installing with complex constraints..." | tee -a stress_test_phase4.log |
| 157 | + omnipkg install 'flask>=2.0,<3.0' --yes | tee -a stress_test_phase4.log |
| 158 | + omnipkg install 'click>=7.0,!=7.1.0,<9.0' --yes | tee -a stress_test_phase4.log |
| 159 | + omnipkg install 'jinja2>=3.0.0,<4.0.0' --yes | tee -a stress_test_phase4.log |
| 160 | + |
| 161 | + echo "🔄 Installing packages that will force version bubbling..." | tee -a stress_test_phase4.log |
| 162 | + omnipkg install werkzeug==2.1.0 --yes | tee -a stress_test_phase4.log |
| 163 | + omnipkg install werkzeug==2.3.0 --yes | tee -a stress_test_phase4.log |
| 164 | + |
| 165 | + echo "📊 Complex version specification stress complete!" | tee -a stress_test_phase4.log |
| 166 | + omnipkg list | tee -a stress_test_phase4.log |
| 167 | +
|
| 168 | + - name: 🚀 Phase 5 - Sabotage Environment with pip/uv, Then omnipkg Rescue |
| 169 | + id: sabotage_and_rescue |
| 170 | + run: | |
| 171 | + echo "=== PHASE 5: Environment Sabotage & omnipkg Rescue ===" | tee stress_test_phase5.log |
| 172 | + echo "Testing omnipkg's ability to recover from OTHER tools' failures..." | tee -a stress_test_phase5.log |
| 173 | + |
| 174 | + echo "📸 Current pristine omnipkg environment (before sabotage):" | tee -a stress_test_phase5.log |
| 175 | + omnipkg status | tee -a stress_test_phase5.log |
| 176 | + |
| 177 | + echo "💥 SABOTAGING environment with pip force installs..." | tee -a stress_test_phase5.log |
| 178 | + echo "Installing conflicting versions with pip --force-reinstall to break dependencies..." | tee -a stress_test_phase5.log |
| 179 | + |
| 180 | + # Use pip to force install conflicting versions and break the environment |
| 181 | + pip install --force-reinstall numpy==1.19.5 2>&1 | tee -a stress_test_phase5.log || true |
| 182 | + pip install --force-reinstall requests==2.20.0 2>&1 | tee -a stress_test_phase5.log || true |
| 183 | + pip install --force-reinstall urllib3==1.25.0 2>&1 | tee -a stress_test_phase5.log || true |
| 184 | + |
| 185 | + echo "💀 Environment after pip sabotage:" | tee -a stress_test_phase5.log |
| 186 | + python -c "import numpy; print(f'numpy version: {numpy.__version__}')" 2>&1 | tee -a stress_test_phase5.log || echo "numpy import BROKEN" | tee -a stress_test_phase5.log |
| 187 | + python -c "import requests; print(f'requests version: {requests.__version__}')" 2>&1 | tee -a stress_test_phase5.log || echo "requests import BROKEN" | tee -a stress_test_phase5.log |
| 188 | + omnipkg status 2>&1 | tee -a stress_test_phase5.log || echo "omnipkg detected environment damage" | tee -a stress_test_phase5.log |
| 189 | + |
| 190 | + echo "🚑 OMNIPKG RESCUE OPERATION - Running revert..." | tee -a stress_test_phase5.log |
| 191 | + omnipkg revert --yes 2>&1 | tee -a stress_test_phase5.log |
| 192 | + |
| 193 | + echo "✅ Environment after omnipkg rescue:" | tee -a stress_test_phase5.log |
| 194 | + omnipkg status | tee -a stress_test_phase5.log |
| 195 | + python -c "import numpy; print(f'numpy version after rescue: {numpy.__version__}')" 2>&1 | tee -a stress_test_phase5.log || echo "numpy still broken" | tee -a stress_test_phase5.log |
| 196 | + python -c "import requests; print(f'requests version after rescue: {requests.__version__}')" 2>&1 | tee -a stress_test_phase5.log || echo "requests still broken" | tee -a stress_test_phase5.log |
| 197 | +
|
| 198 | + - name: 📊 Final Environment Analysis |
| 199 | + if: always() |
| 200 | + run: | |
| 201 | + echo "=== FINAL STRESS TEST ANALYSIS ===" | tee final_analysis.log |
| 202 | + echo "Timestamp: $(date)" | tee -a final_analysis.log |
| 203 | + echo "" | tee -a final_analysis.log |
| 204 | + |
| 205 | + echo "🔍 Final omnipkg status:" | tee -a final_analysis.log |
| 206 | + omnipkg status | tee -a final_analysis.log |
| 207 | + echo "" | tee -a final_analysis.log |
| 208 | + |
| 209 | + echo "📦 All installed packages:" | tee -a final_analysis.log |
| 210 | + omnipkg list | tee -a final_analysis.log |
| 211 | + echo "" | tee -a final_analysis.log |
| 212 | + |
| 213 | + echo "🧠 Redis knowledge base stats:" | tee -a final_analysis.log |
| 214 | + redis-cli info keyspace | tee -a final_analysis.log |
| 215 | + redis-cli keys "omnipkg:*" | wc -l | xargs echo "Total omnipkg Redis keys:" | tee -a final_analysis.log |
| 216 | + echo "" | tee -a final_analysis.log |
| 217 | + |
| 218 | + echo "💾 System resource usage:" | tee -a final_analysis.log |
| 219 | + df -h | tee -a final_analysis.log |
| 220 | + free -h | tee -a final_analysis.log |
| 221 | +
|
| 222 | + - name: 📈 Generate Comprehensive Stress Test Report |
| 223 | + if: always() |
| 224 | + run: | |
| 225 | + REPORT_FILE="omnipkg_ultimate_stress_test_report.md" |
| 226 | + |
| 227 | + echo "# 🔥 Omnipkg Ultimate Stress Test Report" > $REPORT_FILE |
| 228 | + echo "" >> $REPORT_FILE |
| 229 | + echo "**Workflow Run:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $REPORT_FILE |
| 230 | + echo "**Test Date:** $(date)" >> $REPORT_FILE |
| 231 | + echo "**Overall Status:** \`${{ job.status }}\`" >> $REPORT_FILE |
| 232 | + echo "" >> $REPORT_FILE |
| 233 | + |
| 234 | + echo "## 🎯 Stress Test Phases" >> $REPORT_FILE |
| 235 | + echo "" >> $REPORT_FILE |
| 236 | + |
| 237 | + echo "### Phase 1: Built-in Stress Test" >> $REPORT_FILE |
| 238 | + echo "**Status:** \`${{ steps.builtin_stress.outcome }}\`" >> $REPORT_FILE |
| 239 | + echo "\`\`\`" >> $REPORT_FILE |
| 240 | + head -50 stress_test_phase1.log 2>/dev/null || echo "Phase 1 log not available" >> $REPORT_FILE |
| 241 | + echo "\`\`\`" >> $REPORT_FILE |
| 242 | + echo "" >> $REPORT_FILE |
| 243 | + |
| 244 | + echo "### Phase 2: Multi-Version Package Chaos" >> $REPORT_FILE |
| 245 | + echo "**Status:** \`${{ steps.multi_version_chaos.outcome }}\`" >> $REPORT_FILE |
| 246 | + echo "\`\`\`" >> $REPORT_FILE |
| 247 | + tail -30 stress_test_phase2.log 2>/dev/null || echo "Phase 2 log not available" >> $REPORT_FILE |
| 248 | + echo "\`\`\`" >> $REPORT_FILE |
| 249 | + echo "" >> $REPORT_FILE |
| 250 | + |
| 251 | + echo "### Phase 3: Scientific Computing Mayhem" >> $REPORT_FILE |
| 252 | + echo "**Status:** \`${{ steps.scientific_mayhem.outcome }}\`" >> $REPORT_FILE |
| 253 | + echo "\`\`\`" >> $REPORT_FILE |
| 254 | + tail -30 stress_test_phase3.log 2>/dev/null || echo "Phase 3 log not available" >> $REPORT_FILE |
| 255 | + echo "\`\`\`" >> $REPORT_FILE |
| 256 | + echo "" >> $REPORT_FILE |
| 257 | + |
| 258 | + echo "### Phase 4: Complex Version Specification Stress" >> $REPORT_FILE |
| 259 | + echo "**Status:** \`${{ steps.complex_version_stress.outcome }}\`" >> $REPORT_FILE |
| 260 | + echo "\`\`\`" >> $REPORT_FILE |
| 261 | + tail -20 stress_test_phase4.log 2>/dev/null || echo "Phase 4 log not available" >> $REPORT_FILE |
| 262 | + echo "\`\`\`" >> $REPORT_FILE |
| 263 | + echo "" >> $REPORT_FILE |
| 264 | + |
| 265 | + echo "### Phase 5: Environment Sabotage & omnipkg Rescue" >> $REPORT_FILE |
| 266 | + echo "**Status:** \`${{ steps.sabotage_and_rescue.outcome }}\`" >> $REPORT_FILE |
| 267 | + echo "" >> $REPORT_FILE |
| 268 | + echo "**Key Point:** omnipkg never breaks environments, so revert only works when OTHER tools mess things up!" >> $REPORT_FILE |
| 269 | + echo "\`\`\`" >> $REPORT_FILE |
| 270 | + tail -30 stress_test_phase5.log 2>/dev/null || echo "Phase 5 log not available" >> $REPORT_FILE |
| 271 | + echo "\`\`\`" >> $REPORT_FILE |
| 272 | + echo "" >> $REPORT_FILE |
| 273 | + |
| 274 | + echo "## 📊 Final Environment Analysis" >> $REPORT_FILE |
| 275 | + echo "\`\`\`" >> $REPORT_FILE |
| 276 | + cat final_analysis.log 2>/dev/null || echo "Final analysis not available" >> $REPORT_FILE |
| 277 | + echo "\`\`\`" >> $REPORT_FILE |
| 278 | + echo "" >> $REPORT_FILE |
| 279 | + |
| 280 | + if [ "${{ job.status }}" == "success" ]; then |
| 281 | + echo "## ✅ Stress Test Conclusion" >> $REPORT_FILE |
| 282 | + echo "**🎉 OMNIPKG SURVIVED THE ULTIMATE STRESS TEST!**" >> $REPORT_FILE |
| 283 | + echo "" >> $REPORT_FILE |
| 284 | + echo "omnipkg successfully handled:" >> $REPORT_FILE |
| 285 | + echo "- ✅ Heavy scientific package installations" >> $REPORT_FILE |
| 286 | + echo "- ✅ Multi-version package coexistence with automatic bubbling" >> $REPORT_FILE |
| 287 | + echo "- ✅ Complex version constraint resolution" >> $REPORT_FILE |
| 288 | + echo "- ✅ Dependency conflict resolution" >> $REPORT_FILE |
| 289 | + echo "- ✅ Survived pip sabotage attempts and successfully rescued the environment" >> $REPORT_FILE |
| 290 | + echo "- ✅ Environment recovery and revert capabilities (when OTHER tools break things)" >> $REPORT_FILE |
| 291 | + echo "" >> $REPORT_FILE |
| 292 | + echo "**🎯 KEY INSIGHT: omnipkg's intelligence means it NEVER breaks environments in the first place!**" >> $REPORT_FILE |
| 293 | + echo "The revert feature only has work to do when inferior tools like pip mess things up." >> $REPORT_FILE |
| 294 | + echo "" >> $REPORT_FILE |
| 295 | + echo "This demonstrates omnipkg's superior intelligence and robustness compared to traditional package managers." >> $REPORT_FILE |
| 296 | + else |
| 297 | + echo "## ❌ Stress Test Issues" >> $REPORT_FILE |
| 298 | + echo "The stress test encountered issues. Review the phase logs above for details." >> $REPORT_FILE |
| 299 | + fi |
| 300 | +
|
| 301 | + - name: 📤 Upload All Stress Test Artifacts |
| 302 | + uses: actions/upload-artifact@v4 |
| 303 | + if: always() |
| 304 | + with: |
| 305 | + name: omnipkg-ultimate-stress-test-results |
| 306 | + path: | |
| 307 | + stress_test_phase*.log |
| 308 | + final_analysis.log |
| 309 | + omnipkg_ultimate_stress_test_report.md |
| 310 | + pre_revert_state.txt |
| 311 | + retention-days: 30 |
| 312 | + |
| 313 | + - name: 🚨 Failure Notification |
| 314 | + if: failure() |
| 315 | + run: | |
| 316 | + echo "🚨 STRESS TEST FAILED - omnipkg encountered issues during the ultimate stress test" |
| 317 | + echo "Check the uploaded artifacts for detailed logs and analysis" |
0 commit comments