A production-grade task management API built with Flask, demonstrating modern DevOps practices including containerization, automated CI/CD pipelines, and comprehensive monitoring.
GitHub Repository
|
| (Webhook)
v
Jenkins CI/CD Pipeline
|
| (Build, Test, Deploy)
v
AWS EC2 Production Environment
|
| (Metrics)
v
Prometheus + Grafana Monitoring Stack
pipeline-lab is a RESTful API application designed to demonstrate enterprise-level DevOps automation practices. The project implements a complete software delivery pipeline from source control to production deployment with real-time monitoring and observability.
Application Layer
- Python 3.11
- Flask Web Framework
- Docker Containerization
Infrastructure & Deployment
- Jenkins CI/CD Pipeline
- AWS EC2 Cloud Infrastructure
- Docker Container Orchestration
- GitHub Webhooks Integration
Monitoring & Observability
- Prometheus Metrics Collection
- Grafana Dashboard Visualization
- Application Performance Monitoring
Development Practices
- Git Version Control with GitFlow
- Automated Testing and Linting
- Infrastructure as Code
- Security Best Practices
- RESTful task management endpoints
- Health check and status monitoring
- Prometheus metrics exposition
- JSON-based request/response handling
- Automated build and deployment pipeline
- Zero-downtime deployments
- Container-based application delivery
- Real-time application monitoring
- Automated testing and code quality checks
| Method | Endpoint | Description | Response |
|---|---|---|---|
| GET | / | Application information | JSON with app details |
| GET | /health | Health check status | JSON with health status |
| GET | /tasks | Retrieve all tasks | JSON array of tasks |
| POST | /tasks | Create new task | JSON with created task |
| GET | /metrics | Prometheus metrics | Prometheus exposition format |
Create a new task:
curl -X POST http://your-domain/tasks \
-H "Content-Type: application/json" \
-d '{"title": "Complete project documentation"}'Retrieve all tasks:
curl http://your-domain/tasksCheck application health:
curl http://your-domain/health- Docker 28.0+
- Python 3.12+
- Git
- Clone the repository:
git clone https://github.com/yourusername/pipeline-lab.git
cd pipeline-lab- Build the Docker image:
docker build -f docker/Dockerfile -t pipeline-lab .- Run the application:
docker run -d -p 5000:5000 --name pipeline-lab pipeline-lab- Verify the deployment:
curl http://localhost:5000/healthThe application is automatically deployed to AWS EC2 through a Jenkins CI/CD pipeline that triggers on code commits to the develop branch.
- Code push to GitHub triggers webhook
- Jenkins pipeline executes automated build and test procedures
- Docker image is created and tagged with build number
- Image is deployed to AWS EC2 production environment
- Health checks verify successful deployment
- Monitoring systems begin collecting application metrics
- Prometheus: http://monitoring-host:9090
- Grafana: http://monitoring-host:3000
The application exposes comprehensive metrics for monitoring and observability:
pipeline-lab_requests_total: HTTP request counter with method and endpoint labelspipeline-lab_request_latency_seconds: Request response time histogrampipeline-lab_tasks_total: Total number of tasks createdpipeline-lab_app_info: Application version and build information
Real-time dashboards provide visibility into:
- Request throughput and response times
- Application health and availability
- Task creation patterns and usage metrics
- System resource utilization
- Automated linting with flake8
- Code review process through pull requests
- Automated testing in CI/CD pipeline
- Security scanning and vulnerability assessment
- Infrastructure as Code principles
- Containerized application deployment
- Automated environment provisioning
- Configuration management through environment variables
- Non-root container execution
- Secure credential management
- Network security group configuration
- SSL/TLS encryption for data in transit
pipeline-lab/
├── src/
│ ├── app.py # Main Flask application
│ └── requirements.txt # Python dependencies
├── docker/
│ └── Dockerfile # Container build instructions
├── Jenkinsfile # CI/CD pipeline definition
└── README.md # Project documentation
The application supports environment-specific configuration through environment variables:
ENVIRONMENT: Deployment environment (development/production)APP_VERSION: Application version identifierBUILD_NUMBER: CI/CD build numberPORT: Application listening port (default: 5000)
The Jenkins pipeline implements the following stages:
- Source Code Checkout: Retrieves latest code from GitHub
- Code Quality Analysis: Executes linting and static analysis
- Automated Testing: Runs application test suite
- Container Build: Creates Docker image with build tagging
- Production Deployment: Deploys container to AWS EC2
- Health Verification: Confirms successful deployment
- Monitoring Integration: Enables metrics collection
This project follows standard software development practices:
- Fork the repository
- Create a feature branch from develop
- Implement changes with appropriate tests
- Submit pull request for code review
- Automated pipeline validates changes
- Merge to develop branch triggers deployment
For technical inquiries and support, please refer to the project documentation or submit issues through the appropriate channels.
This project is licensed under the MIT License.
Shaun Tavitiki