How pmahindru/ci-cd-final-project works
Project type and purpose
• This is a Python-based microservice template used as a final-project scaffold for a CI/CD course. It provides:
• A simple HTTP API (“service” package, likely using Flask or similar).
• Local setup (bin/setup.sh, virtualenv).
• Automated CI/CD definition (GitHub Actions workflows under .github/workflows, Tekton tasks under .tekton).
• Containerization (Dockerfile).
• Deployment manifest (Procfile for Heroku or similar).
File structure
• Top level:
• GitHub metadata: .github/workflows/workflow.yml
• Tekton pipeline definitions: .tekton/tasks.yml
• Dockerfile, Procfile for container build & deployment
• bin/setup.sh for local dev environment
• requirements.txt & setup.cfg for Python dependencies
• service/: application code (routes.py + common helpers)
• tests/: test suite for route handlers
• No database or external data stores are defined—this is purely an API service.
README for additional insights
• The README is generic template guidance for students. No internal architecture details, but highlights that CI/CD tasks will be exercised via the supplied workflows/pipelines.
a. Main components
1. Developer & Local Machine
• Local codebase + bin/setup.sh (virtualenv)
• Unit tests (pytest)
2. Source Control / Code Repository
• GitHub repo with branch protection, Pull Requests
3. CI/CD Orchestration
• GitHub Actions (trigger on push/PR, defined in .github/workflows/workflow.yml)
• Tekton Tasks (Kubernetes-based pipeline, defined in .tekton/tasks.yml)
4. Container Build & Registry
• Docker build (Dockerfile) → Container image
• Push to Container Registry (Docker Hub, GitHub Container Registry, etc.)
5. Deployment Platform
• Heroku or other PaaS (Procfile)
• Kubernetes or similar (if using Tekton)
6. Running Service
• Python API service (service/routes.py + common modules)
• Exposed REST endpoints
b. Relationships & interactions
• Developer pushes code to GitHub → GitHub Actions triggers → runs tests → if successful, triggers Tekton pipeline
• Tekton orchestrates build & push of Docker image
• Post-build, the image is deployed to the target environment via Procfile or Kubernetes manifest
• Clients send HTTP requests to the deployed service.
c. Architectural patterns & design principles
• Separation of concerns:
• Source code & tests in separate folders
• CI (GitHub Actions) vs CD (Tekton) responsibilities delineated
• Infrastructure as Code:
• Pipelines defined in YAML under .github and .tekton
• Environment provisioning via Dockerfile / Procfile
• Microservice style: single service component exposing HTTP endpoints.
d. Key technologies
• Python, Flask (or similar) for API
• pytest for testing
• GitHub Actions for CI
• Tekton for CD pipeline
• Docker for containerization
• Heroku/Kubernetes for deployment