Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions README.md

This file was deleted.

19 changes: 19 additions & 0 deletions doodlestudent/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Configuration Base de Données
DB_NAME=tlc
DB_USER=tlc
DB_PASSWORD=tlc
DB_ROOT_PASSWORD=root

# Configuration URLs
FRONT_PORT=4200
BACK_PORT=8080
ETHERPAD_PORT=9001

# Configuration Etherpad
INTERNAL_PAD_URL=http://etherpad:9001/
EXTERNAL_PAD_URL=http://localhost:9001/
BACKEND_URL=http://backend:8080

# Chaos Engineering (Pumba)
CHAOS_INTERVAL=1m
LATENCY_TIME=3000
82 changes: 82 additions & 0 deletions doodlestudent/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI - Build and Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
# etape 1 : Compiler et tester le Backend (Java)
build-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Build and Test Backend
run: |
cd api
mvn clean package -DskipTests # On vérifie au moins que ça compile

# etape 2 : Compiler le Frontend (Angular)
build-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: front/package-lock.json

- name: Install and Build Frontend
run: |
cd front
npm install
npm run build

# etape 3 : Test de demarrage complet (Smoke Test)
docker-check:
runs-on: ubuntu-latest
needs: [build-backend, build-frontend]
steps:
- uses: actions/checkout@v4

- name: Create .env for CI
run: |
echo "DB_NAME=tlc" >> .env
echo "DB_USER=tlc" >> .env
echo "DB_PASSWORD=tlc" >> .env
echo "DB_ROOT_PASSWORD=root" >> .env
echo "FRONT_PORT=4200" >> .env
echo "BACK_PORT=8080" >> .env
echo "ETHERPAD_PORT=9001" >> .env
echo "BACKEND_URL=http://backend:8080" >> .env
echo "INTERNAL_PAD_URL=http://etherpad:9001/" >> .env
echo "EXTERNAL_PAD_URL=http://localhost:9001/" >> .env
echo "CHAOS_INTERVAL=1m" >> .env
echo "LATENCY_TIME=3000" >> .env

- name: Build and Start Stack
run: docker compose up -d --build

- name: Wait for Backend (Quarkus + MySQL)
run: sleep 40

- name: Check Containers Status
run: docker compose ps

- name: Test API Response
run: curl -v http://localhost:8080/api/polls

- name: Stop Containers
run: docker compose down
22 changes: 22 additions & 0 deletions doodlestudent/README.french.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Doodle in quarkus

Ce repository est une application de type doodle développée avec quarkus.io pour le back et angular pour le front.

Elle initialise automatiquement un pad pour la réunion et un salon de discussion.

Le but est de faire travailler les étudiants sur la partie déploiement de ce type d'application dite cloud native.

Votre mission est de mettre en production une telle application en permettant
- qu'à chaque commit sur ce repository, si les tests passent, alors nous déployons automatiquement une nouvelle version dans un contexte (Continuous Deployement)
- que l'application doit être monitorer finement.
- que l'application redémarre automatiquement en cas de crash du serveur ou de crash d'un des services de l'application.
- que Les accès doivent http doivent utiliser https.


Une démo de l'application est accessible [ici](https://doodle.diverse-team.fr).

- Voici une petite [vidéo](https://drive.google.com/file/d/1GQbdgq2CHcddTlcoHqM5Zc8Dw5o_eeLg/preview) de présentation des fonctionnalités de l'application.
- Voici une petite [vidéo](https://drive.google.com/file/d/1l5UAsU5_q-oshwEW6edZ4UvQjN3-tzwi/preview) de présentation de l'architecture de l'application.
- Voici une petite [vidéo](https://drive.google.com/file/d/1jxYNfJdtd4r_pDbOthra360ei8Z17tX_/preview) de revue de code de l'application.

Un descriptif du cours, des TPs et des étapes du projet est lui accessible [ici](https://hackmd.diverse-team.fr/s/SJqu5DjSD)
91 changes: 91 additions & 0 deletions doodlestudent/README_DEVOPS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# DoodleStudent – DevOps Project

**Membres de l'équipe :** MEZIANE Zakariae - ALIOUA Nordine - NOUMDEM Karl

## Presentation
DoodleStudent est une application micro-services composée d'un backend, d'un frontend et de services tiers. Ce projet a été modernisé avec une approche DevOps afin d'améliorer l'automatisation, la reproductibilité, la résilience et la maintenabilité.

## Architecture
L'application est composée des services suivants :
- Frontend : Application Angular servie via Nginx
- Backend : API Quarkus (Java)
- Base de données : MySQL
- Services externes : Etherpad (édition collaborative) et SMTP (gestion des e-mails)

## Lancer le projet

### Avec Docker Compose
```bash
docker-compose up -d
```
Lance automatiquement tous les services et réseaux isolés.

### Avec Ansible (déploiement automatisé)
```bash
ansible-playbook -i infra/ansible/inventory.ini infra/ansible/playbook.yml
```
Automatise l'installation de Docker, la configuration et le lancement du projet.

---

## 1. Conteneurisation & Orchestration

### Dockerisation Multi-Stage
Nous avons implémenté des Dockerfiles multi-stages pour optimiser les performances et la sécurité :
- Backend (api/Dockerfile) : Stage Build (Maven + JDK 17) et Stage Run (JRE léger). Ajout de iproute2 pour le Chaos Engineering.
- Frontend (front/Dockerfile) : Stage Build (Node 18) et Stage Run (Nginx Alpine).

### Orchestration avec Docker Compose
Le fichier docker-compose.yaml permet de piloter les services (db, backend, frontend, etherpad, mail) de manière isolée et reproductible.

---

## 2. Gestion de Configuration (Configuration Management)

### Fichier .env
Les variables sensibles sont externalisées (mots de passe, ports, URLs) pour éviter le hardcoding et faciliter la configuration selon l'environnement.

### Automatisation avec Ansible
Une structure Ansible a été mise en place pour gérer l'Infrastructure as Code (IaC) :
- inventory.ini : Définition des environnements.
- group_vars/ : Centralisation des variables.
- templates/ : Génération dynamique du fichier .env via Jinja2.
- playbook.yml : Automatisation complète du déploiement.

---

## 3. CI/CD (Intégration et Déploiement Continu)

Un pipeline GitHub Actions a été configuré pour garantir la qualité et automatiser les validations :
1. Compilation Backend (Maven) et Frontend (Angular).
2. Vérification des Dockerfiles.
3. Smoke Test : Lancement complet via Docker Compose et test de disponibilité via curl sur l'API.

---

## 4. Chaos Engineering (Pumba)

Des tests de résilience ont été réalisés pour garantir la haute disponibilité :
- Test 1 : Crash (Auto-Healing). Arrêt forcé du backend et redémarrage automatique via Docker.
- Test 2 : Latence (Stress Test). Injection d'un délai de 3000ms via Pumba pour tester la stabilité sous charge dégradée.

---

## Objectifs DevOps atteints
- Automatisation complète du déploiement (IaC).
- Standardisation des environnements via Docker.
- Gestion propre des configurations (.env + Ansible).
- Pipeline CI/CD fonctionnel avec Smoke Test.
- Résilience testée et validée par le Chaos Engineering.

## Choix techniques
- Docker & Compose : Standardisation et isolation.
- Ansible : Automatisation et gestion de configuration.
- CI/CD : Validation continue du projet.
- Chaos Engineering : Test de robustesse face aux pannes.

## Monitoring (Uptime Kuma)
Nous avons intégré Uptime Kuma pour surveiller la disponibilité du système en temps réel. Le tableau de bord (port 3001) permet de visualiser graphiquement l'impact des tests de chaos.

## Conclusion
Ce projet illustre une transformation complète vers une approche DevOps moderne, alliant automatisation, reproductibilité et robustesse.
15 changes: 15 additions & 0 deletions doodlestudent/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Remote meetings planning

This project is used in a course on the *ops* part at the [University of Rennes](https://www.univ-rennes1.fr/), France. It is a kind of doodle clone developed in so-called "native cloud" technologies in order to allow students to work on a continuous deployment chain in a containerized environment. Among the feature, the application automatically initializes a pad for the meeting and a chat room for the meeting participants.

- The [back](https://github.com/barais/doodlestudent/tree/main/api) is developed using the [quarkus.io](https://quarkus.io/) framework.
- The [front](https://github.com/barais/doodlestudent/tree/main/front) is developed in [angular](https://angular.io/) using the [primeng](https://www.primefaces.org/primeng/) angular UI component library and the [fullcalendar](https://fullcalendar.io/) graphical component.

A demo of the application is available [here](https://doodle.diverse-team.fr/).

Three videos (in french) are available. They present:
- the [main application feature](https://drive.google.com/file/d/1GQbdgq2CHcddTlcoHqM5Zc8Dw5o_eeLg/preview),
- its [architecture](https://drive.google.com/file/d/1l5UAsU5_q-oshwEW6edZ4UvQjN3-tzwi/preview)
- and a [short code review](https://drive.google.com/file/d/1jxYNfJdtd4r_pDbOthra360ei8Z17tX_/preview) .

For french native speaker that wants to follow the course. The course web page is available [here](https://hackmd.diverse-team.fr/s/SJqu5DjSD).
1 change: 1 addition & 0 deletions doodlestudent/api/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

37 changes: 37 additions & 0 deletions doodlestudent/api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#Maven
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties
.mvn/wrapper/maven-wrapper.jar
# Eclipse
.project
.classpath
.settings/
bin/

# IntelliJ
.idea
*.ipr
*.iml
*.iws

# NetBeans
nb-configuration.xml

# Visual Studio Code
.vscode
.factorypath

# OSX
.DS_Store

# Vim
*.swp
*.swo

# patch
*.orig
*.rej

18 changes: 18 additions & 0 deletions doodlestudent/api/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
1 change: 1 addition & 0 deletions doodlestudent/api/APIKEY.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
19d89ca52bc0fa4f19d6325464d9d7a032649b9fa68c111514627081e2784b4a
13 changes: 13 additions & 0 deletions doodlestudent/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Build stage
FROM maven:3.9.6-eclipse-temurin-17 AS build
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN mvn clean package -DskipTests

# Run stage
FROM eclipse-temurin:17-jre
RUN apt-get update && apt-get install -y iproute2
COPY --from=build /usr/src/app/target/quarkus-app/ /deployments/

EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/deployments/quarkus-run.jar"]
53 changes: 53 additions & 0 deletions doodlestudent/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# code-with-quarkus project

This project uses Quarkus, the Supersonic Subatomic Java Framework.

If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .

## Running the application in dev mode

You can run your application in dev mode that enables live coding using:
```shell script
docker-compose up --detach
# Wait the correct start of the docker services and then
./mvnw compile quarkus:dev
```

To stop the application and its dependencies, type `ctrl+c` in the bash session and run `docker-compose down`.

## Packaging and running the application

The application can be packaged using:
```shell script
./mvnw package
```
It produces the `code-with-quarkus-1.0.0-SNAPSHOT-runner.jar` file in the `/target` directory.
Be aware that it’s not an _über-jar_ as the dependencies are copied into the `target/lib` directory.
If you want to build an _über-jar_, execute the following command:
```shell script
./mvnw clean package -Dquarkus.package.type=uber-jar
```

The application is now runnable using `java -jar target/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar`.

## Creating a native executable

You can create a native executable using:
```shell script
./mvnw package -Pnative
```

Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
```shell script
./mvnw package -Pnative -Dquarkus.native.container-build=true
```

You can then execute your native executable with: `./target/code-with-quarkus-1.0.0-SNAPSHOT-runner`

If you want to learn more about building native executables, please consult https://quarkus.io/guides/maven-tooling.html.

# RESTEasy JAX-RS

Guide: https://quarkus.io/guides/rest-json


Loading