Skip to content

๐Ÿ”ฅ CloudOps Automation at Scale ๐Ÿฆ…

๐Ÿฅ‰๐Ÿฅ‰๐Ÿฅ‰๐Ÿฅ‰๐Ÿฅ‰

๐ŸŒŸ You can use CloudOps Automation Runbooks, built on Jupyter Notebooks, to quickly create SRE RunBooks for Runbook Automation and Cloud Infrastructure Management! ๐ŸŒ

๐Ÿ Runbooks PyPI version ๐Ÿฆพ GitHub Container Registry

Nhat-Thanh Nguyen Thanh Nguyen Nhat-Thanh Nguyen

๐Ÿ› ๏ธ Features

  • ๐Ÿฅ‰ โœ…Lightning-Fast Toolchain: Powered by ๐Ÿ“ฆ uv - Next-generation Python dependency and build management, ๐Ÿ’… ruff - Linting and formatting at blazing speed, and ๐Ÿงช pytest - Robust testing framework with coverage reports.
  • ๐Ÿฅˆ โœ…Effortless CI/CD Pipelines: ๐Ÿ› ๏ธ Taskfile Automation - Say goodbye to manual SDLC repetitive tasks, ๐Ÿณ Containerized Workflows โ€“ ๐Ÿ›ก๏ธ Security-first practices and Multi-stage Wolfi-based Docker builds for scalable production-ready environments, and โš™๏ธ Auto-publish to PyPI and GitHub Container Registry (GHCR) with GitHub Actions.
  • ๐Ÿฅ‡ โ˜‘๏ธCloudOps Automation and FinOps Toolkit โ€“ Pre-configured hybrid-cloud workflows and seamlessly integrations (jupyterlab, mkdocs, boto3, moto) for managing cloud infrastructure ๐ŸŒ.
Feature Toolchain Purpose
๐Ÿ› ๏ธ Configuration pyproject.toml Centralized configuration for dependencies, testing, and linting.
๐Ÿงน Task Automation Taskfile Automates repetitive tasks like linting, testing, and publishing.
๐Ÿ“ฆ Python Dependencies uv Lightning-fast dependency resolution, caching, and builds.
๐Ÿ’… Linting & Formatting ruff Enforces code quality standards, auto-formatting, and import sorting.
๐Ÿงช Testing Framework pytest Comprehensive unit tests, integration tests with coverage reporting.
๐Ÿณ Docker Integration Dockerfile + DevContainer Optimized wolfi-based multi-stage builds for CI/CD and local development environments.
๐Ÿฆพ CI/CD Pipelines GitHub Actions Automated builds, tests, and deployments to PyPI and GHCR.
๐Ÿ“ Security Compliance chainguard/wolfi-base + SBOM + Attestations Ensures compliance, vulnerability scanning, and security transparency.

๐Ÿš€ Quick Start

1. Clone the Repository

git clone https://github.com/nnthanh101/runbooks.git
cd runbooks

2. Install Dependencies and Run CI/CD Pipelines

echo "Install Python dependencies using UV"
task install

echo "Run CI/CD pipeline tasks: clean, lint, format, test, and build"
task ci

echo "Publish the project package to PyPI"
task publish

3. Run in DevContainer ๐Ÿณ

  1. Open the project in VSCode.
  2. Install the Remote - Containers extension.
  3. Reopen in Container:
    Command Palette Ctrl+Shift+P โ†’ Reopen in Container.

Project Structure

๐Ÿ›  End-to-end Production-grade project structure for successful ๐Ÿ’Ž CloudOps Automation and Visual Analytics FinOps projects ๐Ÿš€

cloudops-automation/
โ”œโ”€โ”€ .devcontainer/     ## Dev Container configurations
โ”‚   โ””โ”€โ”€ Dockerfile     ## Container image build file
โ”œโ”€โ”€ .github/           ## CI/CD workflows
โ”‚   โ”œโ”€โ”€ workflows/     ## GitHub Actions workflows
โ”‚   โ””โ”€โ”€ templates/     ## Workflow templates
โ”œโ”€โ”€ .vscode/           ## IDE-specific configurations
โ”œโ”€โ”€ config/            ## Configuration files (YAML, JSON)
โ”œโ”€โ”€ data               ๐Ÿ” Where all your raw and processed data files are stored.
โ”‚   โ”œโ”€โ”€ external       <- Data from third-party sources.
โ”‚   โ”œโ”€โ”€ interim        <- Intermediate data that has been transformed.
โ”‚   โ”œโ”€โ”€ processed      <- The final, canonical data sets for modeling.
โ”‚   โ””โ”€โ”€ raw            <- The original, unprocessed, immutable data dump.
โ”‚
โ”œโ”€โ”€ docs               ๐Ÿ““ A default mkdocs project; see mkdocs.org for details
โ”‚   โ”œโ”€โ”€ api/                 ## API documentation
โ”‚   โ”œโ”€โ”€ architecture/        ## Architecture diagrams
โ”‚   โ”œโ”€โ”€ tutorials/           ## Tutorials and guides
โ”‚   โ”œโ”€โ”€ getting-started.md   ## Quickstart guide
โ”‚   โ””โ”€โ”€ index.md             ## Overview documentation
โ”‚
โ”œโ”€โ”€ logs/                    ## Log files for debugging
|
โ”œโ”€โ”€ models             ๐Ÿง  Store your trained and serialized models for easy access and versioning.
โ”‚
โ”œโ”€โ”€ notebooks          ๐Ÿ’ป Jupyter notebooks for experiments and visualization.
โ”‚   โ”œโ”€โ”€ data_exploration.ipynb
โ”‚   โ”œโ”€โ”€ data_preprocessing.ipynb
โ”‚   โ”œโ”€โ”€ model_training.ipynb
โ”‚   โ””โ”€โ”€ model_evaluation.ipynb
โ”‚
โ”œโ”€โ”€ pyproject.toml     <- Project configuration file with package metadata for 
โ”‚                         runbooks and configuration for tools like black
โ”‚
โ”œโ”€โ”€ src/                            ## ๐Ÿงฉ Source code for use in this project.
โ”‚   โ”œโ”€โ”€ runbooks/                   ## Main module for CloudOps Runbooks automation
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py             ## Package initializer
โ”‚   โ”‚   โ”œโ”€โ”€ calculator.py           ## [Python101] Calculator
โ”‚   โ”‚   โ”œโ”€โ”€ config.py
โ”‚   โ”‚   โ”œโ”€โ”€ exceptions.py
โ”‚   โ”‚   โ”œโ”€โ”€ utils.py                ## Utility scripts (logging, configs)
โ”‚   โ”‚   โ””โ”€โ”€ cleanup.py              ## Cleanup automation runbook
โ”‚   โ”œโ”€โ”€ main.py     
โ”œโ”€โ”€ test/                           ## Unit and integration tests
โ”‚   โ”œโ”€โ”€ conftest.py
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ test_calculator.py          ## [Python101] Test cases for calculator
โ”‚   โ”œโ”€โ”€ test_utils.py               ## Test cases for utils
โ”‚   โ””โ”€โ”€ test_exceptions.py         
โ”œโ”€โ”€ templates/                      ## Terraform and CloudFormation templates
โ”œโ”€โ”€ tools/                          ## Developer tools and scripts
โ”œโ”€โ”€ .dockerignore                   ## Docker ignore file
โ”œโ”€โ”€ .env                            ## Environment variables
โ”œโ”€โ”€ .gitignore                      ## Git ignore file
โ”œโ”€โ”€ .python-version                 ## Python version management
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ mkdocs.yml                      # Documentation generator configuration
โ”œโ”€โ”€ README.md          ๐Ÿค Explain your project and its structure for better collaboration.
โ”œโ”€โ”€ references         <- Data dictionaries, manuals, and all other explanatory materials.
โ”‚
โ”œโ”€โ”€ reports            ๐Ÿ“Š Generated analysis (reports, charts, and plots) as HTML, PDF, LaTeX.
โ”‚   โ””โ”€โ”€ figures        <- Generated graphics and figures to be used in reporting
โ”‚
โ”œโ”€โ”€ requirements.txt   ๐Ÿ›  The requirements file for reproducing the analysis environment, for easy environment setup.
โ””โ”€โ”€ Taskfile           <- Taskfile with convenience commands like `task data` or `task train`

Github Container Registry to store and manage Docker and OCI images

  1. Check if the image exists in GitHub Packages:
docker pull ghcr.io/nnthanh101/runbooks:latest
  1. If the image doesn't exist, build and push it:
docker build -t ghcr.io/nnthanh101/runbooks:latest .
docker login ghcr.io -u nnthanh -p GH_TOKEN
docker push ghcr.io/nnthanh101/runbooks:latest
  1. Inspect
docker inspect ghcr.io/nnthanh101/runbooks:latest