The lab kit, to download — https://github.com/hrhouma2/aiopsatlas-observabilite-labo-fr — with
git clone https://github.com/hrhouma2/aiopsatlas-observabilite-labo-fr.git lab3. This lesson installs Docker (steps 1 to 3), gets this kit (step 4), tours it (step 5), then runs its checklist (step 6). The startup itself is in lesson 04.
A car's dashboard only lights up all green if the engine has enough fuel and the road ahead is clear. .\labo.ps1 prerequis (or ./labo.sh prerequis) plays that role before starting the observability stack: Docker is the engine, the allocated memory is the fuel, and the nine ports of the lab are the road that must be free. You only run demarrer (lesson 04) once this checklist ends with its green line: Tout est prêt. (everything is ready).
The lab is described in a docker-compose.yml file and driven by a script in two versions: labo.ps1 (PowerShell 5.1 or 7, Windows) and labo.sh (bash: Linux, macOS, WSL 2, Git Bash). You install nothing but Docker on your machine: Prometheus, Grafana, Loki, Alertmanager, Alloy, node-exporter, cAdvisor, the API, the load generator and the webhook all run in containers. Four of these images are built on your machine at first startup (api, charge, webhook from python:3.13-slim, and loki to add a health check binary to it); the other six are downloaded as they are.
| System | What you install | Memory setting | Special note |
|---|---|---|---|
| Windows 10/11 | Docker Desktop, WSL 2 engine | file %UserProfile%\.wslconfig | Set-ExecutionPolicy if PowerShell refuses the script |
| macOS | Docker Desktop (Intel or Apple Silicon) | Settings → Resources → Memory | nothing else; curl is already present |
| Linux | Docker Engine + docker-compose-plugin plugin + curl | the machine's RAM, directly | docker group; no kernel setting is needed |
What prerequis checks, in order: the docker command exists; the Docker daemon answers; docker compose (v2) is available; curl is present (bash version only: labo.ps1 uses PowerShell's built-in commands); the memory visible to Docker is at least 2 GB (4 GB recommended: between 2 and 4, the script displays a warning but lets it through); at least two processors; and each of the nine lab ports is free, or already used by the lab itself.
| Port | Service | Port | Service | Port | Service |
|---|---|---|---|---|---|
| 9090 | Prometheus | 3100 | Loki | 8080 | cAdvisor |
| 9093 | Alertmanager | 12345 | Alloy | 8000 | Catalog API |
| 3000 | Grafana (GRAFANA_PORT) | 9100 | node-exporter | 8090 | webhook |
Port 3000 is a special case. It is Grafana's, and it is the most requested port on a developer workstation: a Node application, another dashboard, another Grafana often already occupy it. The kit plans for this case with the GRAFANA_PORT environment variable. In docker-compose.yml, Grafana's port publishing reads:
ports:
- "${GRAFANA_PORT:-3000}:3000"What to read: ${GRAFANA_PORT:-3000} is the variable if it is defined, 3000 otherwise. The right-hand part (:3000) is the port inside the container and never changes; the left-hand part is the port on your machine. The labo.ps1 and labo.sh scripts read the same variable: prerequis checks the right port, demarrer displays the right URL and etat queries Grafana at the right place. Documentation: Docker Compose — Interpolation.
Windows: install Docker Desktop with WSL 2. Download Docker Desktop, leave "Use WSL 2 instead of Hyper-V" checked, restart if asked, then launch Docker Desktop and wait for the whale icon to be stable. Under WSL 2, Docker takes half of your RAM by default; on an 8 GB machine, that is tight. To guarantee it 4 GB, create the file C:\Users\<you>\.wslconfig:
notepad $env:UserProfile\.wslconfigPaste these lines, save, then restart the WSL virtual machine:
[wsl2]
memory=4GB
processors=4wsl --shutdownThen relaunch Docker Desktop.
macOS: install Docker Desktop and check the memory. Install the .dmg matching your chip, launch Docker Desktop, then open Settings → Resources → Advanced and check that the Memory slider is at 4 GB or more. Click "Apply & restart" if you changed it.
Linux: Docker Engine, Compose plugin, curl and docker group. Install Docker Engine and the Compose plugin according to your distribution's documentation (packages docker-ce, docker-ce-cli, containerd.io, docker-compose-plugin), plus curl if it is missing. Then, to avoid typing sudo on every command:
sudo usermod -aG docker $USER
newgrp docker # ou déconnecte-toi puis reconnecte-toi
docker run --rm hello-worldGet the lab kit.
git clone https://github.com/hrhouma2/aiopsatlas-observabilite-labo-fr.git lab3
cd lab3All the course commands are run from this lab3 folder. If you do not have git, the "Code → Download ZIP" button on the GitHub page gives the same content: unzip it and rename the folder to lab3.
Tour the file tree. List the files (ls or Get-ChildItem -Recurse -File). On the course machine, the kit contains 32 files:
docker-compose.yml les 10 services, leurs ports, leurs volumes, leurs healthchecks
labo.ps1 le script de pilotage, Windows
labo.sh le même, bash
README.md le mode d'emploi du kit
LICENSE .gitattributes .gitignore
api/app.py l'API catalogue (FastAPI + prometheus_client)
api/donnees/cours.json les 64 cours
api/Dockerfile api/requirements.txt
charge/charge.py le générateur de trafic
charge/Dockerfile charge/requirements.txt
webhook/webhook.py le récepteur d'alertes
webhook/Dockerfile webhook/requirements.txt
prometheus/prometheus.yml les 8 cibles, scrape toutes les 15 s
prometheus/regles/alertes.yml les 10 règles d'alerte
prometheus/regles/enregistrement.yml les règles d'enregistrement (api:taux_erreurs_5m…)
alertmanager/alertmanager.yml le routage vers le webhook
loki/loki.yml loki/Dockerfile
alloy/config.alloy la collecte des logs Docker → Loki
grafana/provisioning/datasources/sources.yml Prometheus, Loki, Alertmanager
grafana/provisioning/dashboards/tableaux-de-bord.yml
grafana/provisioning/dashboards/api-catalogue.json
grafana/provisioning/dashboards/hote-conteneurs.json
grafana/provisioning/dashboards/journaux-api.json
modules/01-le-labo/requetes.txt les requêtes PromQL de ce module
modules/01-le-labo/requetes-logql.txt les requêtes LogQL de ce module
outils/generer-cours.py le script qui a fabriqué cours.jsonWhat to see: one folder per service, and a modules/ folder where each module of the course stores its working files. You have nothing to modify before module 3.
Run the checklist.
.\labo.ps1 prerequis./labo.sh prerequisOn the course machine (Windows 11, Docker Desktop, PowerShell 5.1), before the first startup:
== Prérequis ==
✔ docker : Docker version 29.3.1, build c2be9cc
✔ le démon Docker répond
✔ docker compose : 5.1.1
✔ mémoire disponible pour Docker : 31 Go
✔ processeurs : 20
✔ port 9090 libre
✔ port 9093 libre
✔ port 3000 libre
✔ port 3100 libre
✔ port 12345 libre
✔ port 9100 libre
✔ port 8080 libre
✔ port 8000 libre
✔ port 8090 libre
Tout est prêt. Lancez : .\labo.ps1 demarrerWhat to see: fourteen check marks, and the last line green. Versions and memory depend on your machine. The bash version displays one more line, ✔ curl : présent, and ends with Lancez : ./labo.sh demarrer. Once the lab is started, rerunning prerequis displays port 9090 : utilisé par le labo lui-même (used by the lab itself) instead of libre (free): this is normal, and it is what you will see in lesson 04.
If port 3000 is already taken: choose Grafana's port. Define GRAFANA_PORT before prerequis, and keep it defined for demarrer and etat:
$env:GRAFANA_PORT = 3001
.\labo.ps1 prerequisGRAFANA_PORT=3001 ./labo.sh prerequisThe checklist then displays ✔ port 3001 libre instead of the port 3000 line, and Grafana will answer on http://localhost:3001. All the course addresses mentioning port 3000 remain valid: replace 3000 with 3001. The variable only lives in the current terminal; if you open another terminal, define it again.
The messages below were genuinely triggered on the course machine.
Windows only — PowerShell refuses the script.
.\labo.ps1 : Impossible de charger le fichier C:\Users\<toi>\lab3\labo.ps1, car l'exécution de
scripts est désactivée sur ce système. Pour plus d'informations, consultez about_Execution_Policies à l'adresse
https://go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo : Erreur de sécurité : (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccessWindows' default execution policy blocks unsigned scripts. Allow them for your account only:
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedAnswer O (yes, oui) and rerun .\labo.ps1 prerequis. This is also what labo.ps1 displays when you launch it without an argument.
Docker is not installed, or the terminal was opened before the installation.
docker : Le terme «docker» n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou
programme exécutable. Vérifiez l'orthographe du nom, ou si un chemin d'accès existe, vérifiez que le chemin d'accès
est correct et réessayez.(docker: command not found under bash.) Close and reopen the terminal: the PATH has not been reloaded. If the message persists, Docker is not installed.
The daemon does not answer. prerequis displays a cross on le démon Docker répond (the Docker daemon answers). On Windows and macOS, Docker Desktop is not launched, or still starting: wait for the icon to be stable. Native Linux only — permission denied while trying to connect to the Docker daemon socket: your user is not in the docker group, or you did not log back in after usermod; id -nG must list docker.
Port 3000 is already occupied by another program. When the lab is not started yet and another program listens on Grafana's port, prerequis displays the cross and the remedy on the same line:
✘ port 3000 déjà occupé par un autre programme — choisissez un autre port pour Grafana : $env:GRAFANA_PORT = 3001 puis relancez
Corrigez les points marqués ✘ puis relancez .\labo.ps1 prerequisDo what the line says (step 7). For another occupied port (9090, 8000…), the message is déjà occupé par un autre programme — arrêtez-le ou changez le port dans docker-compose.yml (already occupied by another program — stop it or change the port in docker-compose.yml): find the program (Get-NetTCPConnection -LocalPort 9090 on Windows, sudo ss -ltnp | grep 9090 on Linux) and stop it, or change the left-hand part of the port in docker-compose.yml ("9091:9090").
Windows only — not enough memory. ✘ mémoire pour Docker : 1 Go — il en faut au moins 2 (fichier %UserProfile%\.wslconfig : [wsl2] memory=4GB, puis wsl --shutdown) (memory for Docker: 1 GB — at least 2 needed). Do step 1. Between 2 and 4 GB, the script displays a warning instead of a cross and lets it through.
Git Bash on Windows — both scripts work. On the course machine, ./labo.sh prerequis launched from Git Bash gives the same list as labo.ps1, with the extra ✔ curl : présent line and the colors displayed. You can therefore follow the course's bash appendices on Windows if you prefer that terminal; the variable is then passed as on Linux: GRAFANA_PORT=3001 ./labo.sh prerequis.
This lab requires only one thing on your machine: Docker (Desktop or Engine, with the Compose plugin, and curl for the bash version); the ten services all run in containers, four of them built on your machine at first startup. Count on 2 GB of memory minimum for Docker, 4 GB recommended; on Windows, it is set in %UserProfile%\.wslconfig followed by wsl --shutdown. Nine ports must be free: 9090, 9093, 3000, 3100, 12345, 9100, 8080, 8000 and 8090. The kit is fetched with git clone https://github.com/hrhouma2/aiopsatlas-observabilite-labo-fr.git lab3, then cd lab3: 32 files, one folder per service, one modules/ folder for the course. .\labo.ps1 prerequis or ./labo.sh prerequis is your checklist: fourteen check marks (fifteen in bash) and Tout est prêt. before starting. If port 3000 is taken, GRAFANA_PORT=3001 moves Grafana without touching anything else; the variable must stay defined for prerequis, demarrer and etat. If PowerShell refuses the script: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned.
.wslconfig): all the keys of the file, including memory, processors and swap.${VARIABLE:-default} syntax used for GRAFANA_PORT, and the .env file that lets you set the variable once and for all at the root of lab3.RemoteSigned changes, and why it is the recommended setting for a workstation.demarrer then etat, and the tour of the nine interfaces.