Project — Production DevOps Automation Platform (Capstone)¶
Capstone for Python for DevOps — a production-minded automation platform teammates can extend.
Project Overview¶
Goal: Ship a packaged automation platform with shared libraries and plugin commands that default to dry-run for anything destructive.
Must include:
- CLI interface — installable console script (
rebash-opsor similar) - Plugin architecture — discoverable commands
- Cloud inventory — AWS/Azure/GCP via fixtures + optional live read-only
- Kubernetes automation — health / validate (read-only)
- Terraform automation — plan summary wrapper (no apply)
- GitHub automation — repository auditor (read-only)
- Monitoring — REST probe command
- Notifications — Slack dry-run / optional send
- Configuration management — YAML + env overlay
- Logging — structured, redacting secrets
- Testing — pytest with fixtures (no live cloud in CI)
- Packaging — pyproject.toml, versioning
- Documentation — README runbook + architecture
Success criteria: Another engineer can clone, uv sync or pip install -e ., run tests, and execute dry-run commands in under 15 minutes.
Estimated cost: £0 (mocks in CI; optional local Docker/kind for demos).
Goals¶
- One installable console script
- Plugins covering the feature list above
- Shared HTTP client (timeouts + retries)
- Secrets from env / files — never logged
- CI green on lint + pytest without cloud credentials
Stack¶
| Piece | Choice |
|---|---|
| Packaging | pyproject.toml + uv or Poetry |
| CLI | Typer (recommended) or Click |
| HTTP | httpx |
| Platforms | kubernetes client, Docker SDK, Terraform CLI via subprocess |
| Cloud | boto3 / Azure / GCP optional |
| Test | pytest |
| CI | GitHub Actions or GitLab CI |
Prerequisites¶
- Expert: Platform Engineering Framework (recommended)
- Tutorials across modules 12–27, especially Production Engineering Patterns and Security for DevOps Python
- Capstone-oriented labs: CI/CD tool, secrets scanner, cloud inventories
Milestones¶
Milestone 1 — Package skeleton¶
pyproject.toml, [project.scripts], src/ layout, --help, logging helper.
Milestone 2 — Shared libraries¶
Config loader (YAML + env), secrets helper, httpx client wrapper with timeouts/retries.
Milestone 3 — Plugins (dry-run first)¶
| Command | Behaviour |
|---|---|
logs analyse | pathlib/re summary |
inventory cloud | fixture/live read-only |
k8s health | read-only readiness summary |
tf plan-summary | fixture or terraform show -json |
gh audit | fixture or GitHub API |
monitor http | probes / fixtures |
notify slack | dry-run default |
docker dangling | dry-run default |
Milestone 4 — Hardening¶
Secrets scanner in CI, coverage gate, operator runbook, architecture diagram.
Validation¶
uv sync # or pip install -e ".[dev]"
pytest -q
rebash-ops --help
rebash-ops inventory cloud --fixture tests/fixtures/aws.json
rebash-ops notify slack --dry-run --title "capstone" --text "ok"
Production Discussion¶
Treat the platform as an internal product: semver, CHANGELOG, CODEOWNERS, least-privilege tokens, and explicit --apply for mutations. Prefer OIDC federated credentials over long-lived keys.
Related¶
- Course: Python for DevOps
- Interview: Python interview prep
- Quiz: Python for DevOps Engineers Fundamentals