# Ghaymah SRE Technical Assessment

This repository contains my submission for the **Ghaymah Internship Program – SRE Technical Assessment**.

The project demonstrates deployment, monitoring, incident analysis, CI/CD automation, scalability planning, and monitoring dashboard implementation using Ghaymah Cloud Platform.

---

# Repository Structure

```
.
├── q1-deploy-monitor/
│   ├── Dockerfile
│   ├── health-check.sh
│   ├── dashboard.html
│   └── README.md
│
├── q2-postmortem/
│   ├── postmortem-report.md
│   └── README.md
│
├── q3-cicd/
│   ├── workflow.yml
│   └── README.md
│
├── q4-scalability/
│   ├── architecture.png
│   ├── calculations.md
│   └── README.md
│
├── q5-mithal-monitor/
│   ├── collector.py
│   ├── dashboard.html
│   ├── Dockerfile
│   ├── requirements.txt
│   └── README.md
│
├── common-mortakaz/
├── common-qabilah/
└── README.md
```

---

# Task 1 — Deploy & Monitor

### Objective

Deploy a containerized web application on **Ghaymah Cloud** and implement a basic monitoring dashboard.

### Deliverables

- Dockerized application
- Health check endpoint
- Monitoring dashboard
- Successful deployment on Ghaymah

---

# Task 2 — Incident Postmortem

### Objective

Analyze a production outage caused by repeated **OOMKilled** events.

### Deliverables

- Executive summary
- Timeline
- Root cause analysis
- Corrective actions
- Preventive recommendations
- Auto-scaling proposal

---

# Task 3 — CI/CD Pipeline

### Objective

Create a complete deployment pipeline using **GitHub Actions** and **Ghaymah CLI**.

### Features

- Docker image build
- Application validation
- Deploy to Staging
- Manual Approval
- Deploy to Production
- Health checks

---

# Task 4 — Scalability Design

### Objective

Design infrastructure capable of serving **15,000 Requests/sec**.

### Includes

- Architecture diagram
- Capacity calculations
- Horizontal scaling strategy
- Cold-start optimization
- Block Storage usage
- Auto-scaling recommendations

---

# Task 5 — Mithal Monitoring Dashboard

### Objective

Build a monitoring solution for **https://mithal.space**

### Metrics Collected

- HTTP Latency
- Uptime
- DNS Resolution Time
- SSL Certificate Status
- Search Response Time

### Dashboard Features

- 24-hour uptime percentage
- Latency chart
- SSL expiration status
- Latest monitoring checks
- Automatic refresh

---

# Technologies Used

- Python
- Docker
- GitHub Actions
- Ghaymah CLI
- HTML
- CSS
- JavaScript
- Chart.js

---

# Deployment

Applications were deployed using the official **Ghaymah CLI**.

General deployment workflow:

```bash
gy auth login

gy resource app init --project-id <PROJECT_ID>

gy resource app launch
```

---

# Notes

- Each task is self-contained.
- Every task includes its own documentation.
- The implementation follows the official Ghaymah documentation whenever applicable.

---

# Author

**Moamen Lotfy**

SRE Track Candidate

Ghaymah Internship Program

## Qabilah Profile

As required by the technical assessment, I created a Qabilah account and followed the official Ghaymah account.

**Profile Link:**

https://qabilah.com/profile/momendevops/professional-profile
