Update Q3 CI/CD and Q5 monitor documentation with screenshots
هذا الالتزام موجود في:
270
README.md
Normal file
270
README.md
Normal file
@@ -0,0 +1,270 @@
|
|||||||
|
# Ghaymah SRE / DevOps Technical Assessment
|
||||||
|
|
||||||
|
This repository contains my complete submission for the **Ghaymah SRE / DevOps Technical Assessment**, including all required tasks and bonus challenges.
|
||||||
|
|
||||||
|
The project is organized into five independent tasks covering deployment, monitoring, incident analysis, CI/CD, scalability, cloud deployment, and the bonus integration tasks.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# Repository Structure
|
||||||
|
|
||||||
|
```text
|
||||||
|
.
|
||||||
|
├── .github/
|
||||||
|
│ └── workflows/
|
||||||
|
│ └── main.yml
|
||||||
|
├── q1-deploy-monitor/
|
||||||
|
├── q2-postmortem/
|
||||||
|
├── q3-cicd/
|
||||||
|
├── q4-scalability/
|
||||||
|
├── q5-mithal-monitor/
|
||||||
|
├── common-mortakaz/
|
||||||
|
└── common-qabilah/
|
||||||
|
```
|
||||||
|
|
||||||
|
The GitHub Actions workflow used for the CI/CD pipeline is located in:
|
||||||
|
|
||||||
|
```text
|
||||||
|
.github/workflows/main.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# Tasks
|
||||||
|
|
||||||
|
## ✅ Q1 – Deploy & Monitoring
|
||||||
|
|
||||||
|
Deploy a production-ready monitoring application with health checks and monitoring endpoints.
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Dockerized application
|
||||||
|
- Monitoring service
|
||||||
|
- Health endpoint
|
||||||
|
- Metrics endpoint
|
||||||
|
- Deployment configuration
|
||||||
|
|
||||||
|
📂 Folder
|
||||||
|
|
||||||
|
```text
|
||||||
|
q1-deploy-monitor/
|
||||||
|
```
|
||||||
|
|
||||||
|
For implementation details, see the README inside the task folder.
|
||||||
|
|
||||||
|
🌐 Live Demo
|
||||||
|
|
||||||
|
Application
|
||||||
|
|
||||||
|
> https://sre-2be55e4567b8.hosted.ghaymah.systems
|
||||||
|
|
||||||
|
Health Check
|
||||||
|
|
||||||
|
> https://sre-2be55e4567b8.hosted.ghaymah.systems/health
|
||||||
|
|
||||||
|
Metrics
|
||||||
|
|
||||||
|
> https://sre-2be55e4567b8.hosted.ghaymah.systems/api/metrics
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ Q2 – Incident Postmortem
|
||||||
|
|
||||||
|
Root cause analysis and postmortem report for the production incident.
|
||||||
|
|
||||||
|
### Includes
|
||||||
|
|
||||||
|
- Timeline
|
||||||
|
- Root Cause Analysis
|
||||||
|
- Impact Assessment
|
||||||
|
- Corrective Actions
|
||||||
|
- Preventive Actions
|
||||||
|
|
||||||
|
📂 Folder
|
||||||
|
|
||||||
|
```text
|
||||||
|
q2-postmortem/
|
||||||
|
```
|
||||||
|
|
||||||
|
For implementation details, see the README inside the task folder.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ Q3 – CI/CD Pipeline
|
||||||
|
|
||||||
|
Implemented a complete CI/CD workflow that automatically builds and deploys the application.
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- GitHub Actions
|
||||||
|
- Docker Build
|
||||||
|
- Smoke Testing
|
||||||
|
- Automatic Staging Deployment
|
||||||
|
- Manual Approval before Production
|
||||||
|
- Production Deployment using Ghaymah CLI
|
||||||
|
|
||||||
|
📂 Folder
|
||||||
|
|
||||||
|
```text
|
||||||
|
q3-cicd/
|
||||||
|
```
|
||||||
|
|
||||||
|
Workflow Location
|
||||||
|
|
||||||
|
```text
|
||||||
|
.github/workflows/main.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
### CI/CD Pipeline
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### GitHub Actions Results
|
||||||
|
|
||||||
|
| Staging Pipeline | Production Pipeline |
|
||||||
|
|-----------------|---------------------|
|
||||||
|
|  |  |
|
||||||
|
|
||||||
|
For implementation details, see the README inside the task folder.
|
||||||
|
|
||||||
|
🌐 Live Demo
|
||||||
|
|
||||||
|
Production
|
||||||
|
|
||||||
|
> https://exam-api-production-f87c48f822aa.hosted.ghaymah.systems
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ Q4 – Scalability
|
||||||
|
|
||||||
|
Scalability proposal and production architecture improvements.
|
||||||
|
|
||||||
|
### Includes
|
||||||
|
|
||||||
|
- Bottleneck Analysis
|
||||||
|
- Scaling Strategy
|
||||||
|
- High Availability
|
||||||
|
- Load Balancing
|
||||||
|
- Database Improvements
|
||||||
|
- Monitoring Recommendations
|
||||||
|
|
||||||
|
📂 Folder
|
||||||
|
|
||||||
|
```text
|
||||||
|
q4-scalability/
|
||||||
|
```
|
||||||
|
|
||||||
|
For implementation details, see the README inside the task folder.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ Q5 – Mithal Monitor Deployment
|
||||||
|
|
||||||
|
Deploy the monitoring service on Ghaymah Cloud.
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- Docker Deployment
|
||||||
|
- Public HTTPS Endpoint
|
||||||
|
- Health Monitoring
|
||||||
|
- Metrics Collection
|
||||||
|
- Real-Time Monitoring Dashboard
|
||||||
|
|
||||||
|
📂 Folder
|
||||||
|
|
||||||
|
```text
|
||||||
|
q5-mithal-monitor/
|
||||||
|
```
|
||||||
|
|
||||||
|
### Dashboard
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
For implementation details, see the README inside the task folder.
|
||||||
|
|
||||||
|
🌐 Live Demo
|
||||||
|
|
||||||
|
Application
|
||||||
|
|
||||||
|
> https://mithal-monitor-74639f9fbe38.hosted.ghaymah.systems
|
||||||
|
|
||||||
|
Health Check
|
||||||
|
|
||||||
|
> https://mithal-monitor-74639f9fbe38.hosted.ghaymah.systems/health
|
||||||
|
|
||||||
|
Metrics
|
||||||
|
|
||||||
|
> https://mithal-monitor-74639f9fbe38.hosted.ghaymah.systems/api/metrics
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# ⭐ Bonus Tasks
|
||||||
|
|
||||||
|
## Common – Mortakaz Integration Proposal
|
||||||
|
|
||||||
|
This section contains two integration proposals for products available on **Mortakaz**.
|
||||||
|
|
||||||
|
### Includes
|
||||||
|
|
||||||
|
- Green Framework Integration Proposal
|
||||||
|
- Jadl Integration Proposal
|
||||||
|
|
||||||
|
📂 Folder
|
||||||
|
|
||||||
|
```text
|
||||||
|
common-mortakaz/
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Common – Qabilah Profile
|
||||||
|
|
||||||
|
My Qabilah profile created for the assessment.
|
||||||
|
|
||||||
|
📂 Folder
|
||||||
|
|
||||||
|
```text
|
||||||
|
common-qabilah/
|
||||||
|
```
|
||||||
|
|
||||||
|
Profile
|
||||||
|
|
||||||
|
> https://qabilah.com/profile/mohammedhamdy102003/posts
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# Technologies Used
|
||||||
|
|
||||||
|
- Docker
|
||||||
|
- Python
|
||||||
|
- Flask
|
||||||
|
- GitHub Actions
|
||||||
|
- Ghaymah Cloud
|
||||||
|
- Ghaymah CLI
|
||||||
|
- GitHub Environments
|
||||||
|
- GitHub Secrets
|
||||||
|
- Gunicorn
|
||||||
|
- Linux
|
||||||
|
- Bash
|
||||||
|
- Git
|
||||||
|
- GitHub
|
||||||
|
- GitPasha
|
||||||
|
- Markdown
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# Author
|
||||||
|
|
||||||
|
**Mohammed Hamdy**
|
||||||
|
|
||||||
|
Faculty of Engineering, Sohag University
|
||||||
|
|
||||||
|
DevOps / SRE Enthusiast
|
||||||
|
|
||||||
|
GitHub
|
||||||
|
|
||||||
|
> https://github.com/mohammedhamdy102003/Ghaymah-Internship-Tasks
|
||||||
|
|
||||||
|
GitPasha
|
||||||
|
|
||||||
|
> https://app.gitpasha.com/mohammedhamdy/ghaymah-exam-mohammedhamdy-sre
|
||||||
@@ -10,7 +10,7 @@ The pipeline automatically builds the application, performs a smoke test, deploy
|
|||||||
|
|
||||||
# Pipeline Workflow
|
# Pipeline Workflow
|
||||||
|
|
||||||
```
|
```text
|
||||||
Developer
|
Developer
|
||||||
│
|
│
|
||||||
│ Push
|
│ Push
|
||||||
@@ -93,6 +93,30 @@ Purpose:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
# Pipeline Evidence
|
||||||
|
|
||||||
|
The following screenshots demonstrate successful execution of the CI/CD pipeline and deployment for both **Staging** and **Production** environments.
|
||||||
|
|
||||||
|
## Staging Pipeline
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Production Pipeline
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Deployment Verification
|
||||||
|
|
||||||
|
The following screenshot confirms that both **Staging** and **Production** applications were successfully deployed on **Ghaymah Cloud**.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# Staging vs Production
|
# Staging vs Production
|
||||||
|
|
||||||
| Staging | Production |
|
| Staging | Production |
|
||||||
@@ -180,12 +204,13 @@ No credentials are stored inside the repository.
|
|||||||
|
|
||||||
# Result
|
# Result
|
||||||
|
|
||||||
The pipeline successfully performs:
|
The pipeline successfully provides:
|
||||||
|
|
||||||
- Automated Docker image build
|
- Automated Docker image build
|
||||||
- Smoke testing
|
- Automated smoke testing
|
||||||
- Automatic deployment to Staging
|
- Automatic deployment to the Staging environment
|
||||||
- Manual approval before Production
|
- Manual approval before Production deployment
|
||||||
|
- Secure deployment using GitHub Secrets
|
||||||
- Production deployment using Ghaymah CLI
|
- Production deployment using Ghaymah CLI
|
||||||
|
|
||||||
This implementation provides a reliable and production-ready CI/CD workflow.
|
This implementation demonstrates a complete production-ready CI/CD workflow following modern DevOps and SRE best practices.
|
||||||
|
|||||||
ثنائية
q3-cicd/images/production-and-staging-deployment.jpg
Normal file
ثنائية
q3-cicd/images/production-and-staging-deployment.jpg
Normal file
ملف ثنائي غير معروض.
|
بعد العرض: | الارتفاع: | الحجم: 108 KiB |
ثنائية
q3-cicd/images/production-pipeline-success.jpg
Normal file
ثنائية
q3-cicd/images/production-pipeline-success.jpg
Normal file
ملف ثنائي غير معروض.
|
بعد العرض: | الارتفاع: | الحجم: 98 KiB |
ثنائية
q3-cicd/images/staging-pipeline-success.jpg
Normal file
ثنائية
q3-cicd/images/staging-pipeline-success.jpg
Normal file
ملف ثنائي غير معروض.
|
بعد العرض: | الارتفاع: | الحجم: 94 KiB |
@@ -1,6 +1,10 @@
|
|||||||
# Mithal Monitor
|
# Mithal Monitor
|
||||||
|
|
||||||
A Flask-based monitoring application that periodically collects website metrics and exposes them through REST APIs. The application is containerized with Docker and deployed on Ghaymah.
|
A Flask-based monitoring application that periodically collects website metrics and exposes them through REST APIs.
|
||||||
|
|
||||||
|
The application is containerized with Docker and deployed on Ghaymah Cloud.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@@ -23,7 +27,7 @@ A Flask-based monitoring application that periodically collects website metrics
|
|||||||
- SQLite
|
- SQLite
|
||||||
- Docker
|
- Docker
|
||||||
- Gunicorn
|
- Gunicorn
|
||||||
- Ghaymah
|
- Ghaymah Cloud
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -35,7 +39,7 @@ A Flask-based monitoring application that periodically collects website metrics
|
|||||||
GET /health
|
GET /health
|
||||||
```
|
```
|
||||||
|
|
||||||
Example Response
|
Example Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
@@ -51,7 +55,7 @@ Example Response
|
|||||||
GET /api/metrics
|
GET /api/metrics
|
||||||
```
|
```
|
||||||
|
|
||||||
Example Response
|
Example Response:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
[
|
[
|
||||||
@@ -72,28 +76,28 @@ Example Response
|
|||||||
|
|
||||||
## Running Locally
|
## Running Locally
|
||||||
|
|
||||||
Clone the repository
|
Clone the repository:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone <repo-url>
|
git clone <repo-url>
|
||||||
cd Q5-Mithal-Monitor
|
cd Q5-Mithal-Monitor
|
||||||
```
|
```
|
||||||
|
|
||||||
Install dependencies
|
Install dependencies:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
Run the application
|
Run the application:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python app.py
|
python app.py
|
||||||
```
|
```
|
||||||
|
|
||||||
The application will be available on
|
The application will be available on:
|
||||||
|
|
||||||
```
|
```text
|
||||||
http://localhost:5000
|
http://localhost:5000
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -101,13 +105,13 @@ http://localhost:5000
|
|||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
||||||
Build the image
|
Build the image:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker build -t mithal-monitor .
|
docker build -t mithal-monitor .
|
||||||
```
|
```
|
||||||
|
|
||||||
Run the container
|
Run the container:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -p 80:80 mithal-monitor
|
docker run -p 80:80 mithal-monitor
|
||||||
@@ -117,40 +121,61 @@ docker run -p 80:80 mithal-monitor
|
|||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
The application is deployed on Ghaymah.
|
The application is deployed on Ghaymah Cloud.
|
||||||
|
|
||||||
Deployment URL:
|
Deployment URL:
|
||||||
|
|
||||||
```
|
```text
|
||||||
https://mithal-monitor-74639f9fbe38.hosted.ghaymah.systems
|
https://mithal-monitor-74639f9fbe38.hosted.ghaymah.systems
|
||||||
```
|
```
|
||||||
|
|
||||||
Health Endpoint
|
Health Endpoint:
|
||||||
|
|
||||||
```
|
```text
|
||||||
https://mithal-monitor-74639f9fbe38.hosted.ghaymah.systems/health
|
https://mithal-monitor-74639f9fbe38.hosted.ghaymah.systems/health
|
||||||
```
|
```
|
||||||
|
|
||||||
Metrics Endpoint
|
Metrics Endpoint:
|
||||||
|
|
||||||
```
|
```text
|
||||||
https://mithal-monitor-74639f9fbe38.hosted.ghaymah.systems/api/metrics
|
https://mithal-monitor-74639f9fbe38.hosted.ghaymah.systems/api/metrics
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Monitoring Dashboard
|
||||||
|
|
||||||
|
The deployed Mithal Monitor application provides a dashboard for monitoring website availability and performance metrics.
|
||||||
|
|
||||||
|
The dashboard displays:
|
||||||
|
|
||||||
|
- Current service status
|
||||||
|
- HTTP response latency
|
||||||
|
- DNS lookup time
|
||||||
|
- Search latency
|
||||||
|
- SSL certificate expiration status
|
||||||
|
- Historical monitoring data
|
||||||
|
- Recent monitoring records
|
||||||
|
|
||||||
|
### Dashboard Preview
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
```
|
```text
|
||||||
Q5-Mithal-Monitor/
|
q5-mithal-monitor/
|
||||||
│
|
|
||||||
├── app.py
|
├── app.py
|
||||||
|
├── monitor.py
|
||||||
|
├── monitor-data.json
|
||||||
├── requirements.txt
|
├── requirements.txt
|
||||||
├── Dockerfile
|
├── Dockerfile
|
||||||
├── monitor.db
|
|
||||||
├── templates/
|
├── templates/
|
||||||
├── static/
|
├── images/
|
||||||
├── .ghaymah.json
|
│ └── mointor-dashboard.jpg
|
||||||
└── README.md
|
└── README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
ثنائية
q5-mithal-monitor/images/mointor-dashboard.jpg
Normal file
ثنائية
q5-mithal-monitor/images/mointor-dashboard.jpg
Normal file
ملف ثنائي غير معروض.
|
بعد العرض: | الارتفاع: | الحجم: 82 KiB |
المرجع في مشكلة جديدة
حظر مستخدم