diff --git a/README.md b/README.md new file mode 100644 index 0000000..83a27bc --- /dev/null +++ b/README.md @@ -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 + +![CI/CD Pipeline](q3-cicd/images/production-and-staging-deployment.jpg) + +### GitHub Actions Results + +| Staging Pipeline | Production Pipeline | +|-----------------|---------------------| +| ![](q3-cicd/images/staging-pipeline-success.jpg) | ![](q3-cicd/images/production-pipeline-success.jpg) | + +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 + +![Mithal Dashboard](q5-mithal-monitor/images/mointor-dashboard.jpg) + +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 diff --git a/q3-cicd/README.md b/q3-cicd/README.md index 1d79892..d68102e 100644 --- a/q3-cicd/README.md +++ b/q3-cicd/README.md @@ -10,7 +10,7 @@ The pipeline automatically builds the application, performs a smoke test, deploy # Pipeline Workflow -``` +```text Developer │ │ 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 + +![Staging Pipeline](images/staging-pipeline-success.jpg) + +--- + +## Production Pipeline + +![Production Pipeline](images/production-pipeline-success.jpg) + +--- + +## Deployment Verification + +The following screenshot confirms that both **Staging** and **Production** applications were successfully deployed on **Ghaymah Cloud**. + +![Deployment Verification](images/production-and-staging-deployment.jpg) + +--- + # Staging vs Production | Staging | Production | @@ -180,12 +204,13 @@ No credentials are stored inside the repository. # Result -The pipeline successfully performs: +The pipeline successfully provides: - Automated Docker image build -- Smoke testing -- Automatic deployment to Staging -- Manual approval before Production +- Automated smoke testing +- Automatic deployment to the Staging environment +- Manual approval before Production deployment +- Secure deployment using GitHub Secrets - 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. diff --git a/q3-cicd/images/production-and-staging-deployment.jpg b/q3-cicd/images/production-and-staging-deployment.jpg new file mode 100644 index 0000000..c54e8c6 Binary files /dev/null and b/q3-cicd/images/production-and-staging-deployment.jpg differ diff --git a/q3-cicd/images/production-pipeline-success.jpg b/q3-cicd/images/production-pipeline-success.jpg new file mode 100644 index 0000000..89249ee Binary files /dev/null and b/q3-cicd/images/production-pipeline-success.jpg differ diff --git a/q3-cicd/images/staging-pipeline-success.jpg b/q3-cicd/images/staging-pipeline-success.jpg new file mode 100644 index 0000000..8946eeb Binary files /dev/null and b/q3-cicd/images/staging-pipeline-success.jpg differ diff --git a/q5-mithal-monitor/README.md b/q5-mithal-monitor/README.md index 3fde7aa..7f315ad 100644 --- a/q5-mithal-monitor/README.md +++ b/q5-mithal-monitor/README.md @@ -1,6 +1,10 @@ # 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 @@ -23,7 +27,7 @@ A Flask-based monitoring application that periodically collects website metrics - SQLite - Docker - Gunicorn -- Ghaymah +- Ghaymah Cloud --- @@ -35,7 +39,7 @@ A Flask-based monitoring application that periodically collects website metrics GET /health ``` -Example Response +Example Response: ```json { @@ -51,7 +55,7 @@ Example Response GET /api/metrics ``` -Example Response +Example Response: ```json [ @@ -72,28 +76,28 @@ Example Response ## Running Locally -Clone the repository +Clone the repository: ```bash git clone cd Q5-Mithal-Monitor ``` -Install dependencies +Install dependencies: ```bash pip install -r requirements.txt ``` -Run the application +Run the application: ```bash python app.py ``` -The application will be available on +The application will be available on: -``` +```text http://localhost:5000 ``` @@ -101,13 +105,13 @@ http://localhost:5000 ## Docker -Build the image +Build the image: ```bash docker build -t mithal-monitor . ``` -Run the container +Run the container: ```bash docker run -p 80:80 mithal-monitor @@ -117,40 +121,61 @@ docker run -p 80:80 mithal-monitor ## Deployment -The application is deployed on Ghaymah. +The application is deployed on Ghaymah Cloud. Deployment URL: -``` +```text https://mithal-monitor-74639f9fbe38.hosted.ghaymah.systems ``` -Health Endpoint +Health Endpoint: -``` +```text https://mithal-monitor-74639f9fbe38.hosted.ghaymah.systems/health ``` -Metrics Endpoint +Metrics Endpoint: -``` +```text 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 + +![Mithal Monitor Dashboard](images/mointor-dashboard.jpg) + +--- + ## Project Structure -``` -Q5-Mithal-Monitor/ -│ +```text +q5-mithal-monitor/ + ├── app.py +├── monitor.py +├── monitor-data.json ├── requirements.txt ├── Dockerfile -├── monitor.db ├── templates/ -├── static/ -├── .ghaymah.json +├── images/ +│ └── mointor-dashboard.jpg └── README.md ``` diff --git a/q5-mithal-monitor/images/mointor-dashboard.jpg b/q5-mithal-monitor/images/mointor-dashboard.jpg new file mode 100644 index 0000000..d2e045a Binary files /dev/null and b/q5-mithal-monitor/images/mointor-dashboard.jpg differ