Skip to content

Latest commit

 

History

History
111 lines (82 loc) · 4.43 KB

README.md

File metadata and controls

111 lines (82 loc) · 4.43 KB

Pool Classifier

CI codecov Python 3.14+ Code style: Ruff

Pool Classifier is a Cloud Run service and Flask dashboard for monitoring Taskcluster worker pools. It periodically classifies recent task results, matches task logs against failure patterns, and surfaces pool health, alerting workers, success rates, and unclassified failures.

The Python package remains named worker_health for compatibility after the repository extraction. Those package-path references are vestigial.

Quick start

uv sync --group dev
./pc_db.sh init
./pc_start.sh

The launcher starts the stable dashboard at http://localhost:18080/ and the auto-reloading UI at http://localhost:18081/. Ctrl-C stops both. A Taskcluster token is required at ~/.tc_token; see the development guide for its format and the complete local workflow.

To launch the production-style Gunicorn server directly, use:

uv run pool-classifier
PORT=8090 uv run pool-classifier

It binds to 0.0.0.0:8080 by default. PORT, POOL_CLASSIFIER_HOST, GUNICORN_WORKERS, GUNICORN_THREADS, and GUNICORN_TIMEOUT configure the same defaults as the Cloud Run container; command-line options take precedence.

Preview a task classification

Use the read-only task-classifier command to compare the current working-tree patterns with patterns at a Git ref for one Taskcluster task:

uv run task-classifier TASK_ID
uv run task-classifier TASK_ID --run 0 --base-ref origin/main

TASK_ID is required. --run selects a terminal run (the newest terminal run is the default); --base-ref selects the baseline pattern revision (default: HEAD). --provisioner, --worker-type, and --poll-interval use the same defaults as the polling classifier, and --no-color disables terminal colors. The command only fetches task data and prints a comparison; it does not update classification storage or patterns.

The debug UI renders current detail-page code with snapshots disabled. pc_fetch_data.sh sends scan requests to the stable instance on port 18080. Set PC_PORT to launch just one instance.

PC_PORT=18080 ./pc_start.sh
PC_PORT=18081 POOL_CLASSIFIER_DISABLE_DASHBOARD_SNAPSHOTS=1 ./pc_start.sh

Documentation

Development

Run the PostgreSQL-backed suite with a terminal coverage report locally:

scripts/run_local_postgres_tests.sh --cov=worker_health --cov-report=term-missing

CI enforces 65% overall coverage, publishes coverage.xml as a workflow artifact, and reports coverage to Codecov.

Operations

API reference

Design and history

Repository layout

worker_health/
  pool_classifier.py                  # Taskcluster polling and classification
  pool_classifier_web/                # Flask app, storage, migrations, and Terraform
tests/                                # pytest suite
scripts/                              # test, build, benchmark, and maintenance helpers