# Lab 00: Setup and Environment Getting your local workshop environment ready
Navigate: [All Slides](../index.html) | [Next: k6 Fundamentals](../01_k6_Fundamentals/index.html)
## What You'll Learn - How to start the workshop infrastructure with Docker Compose - How to verify each service is healthy - How to install k6 on your operating system - How to run a basic k6 smoke check - How to access Grafana dashboards
## Prerequisites - **Docker Desktop** (or Docker Engine + Compose plugin) - **Terminal access** - **Internet access** for k6 installation You should be able to run `docker info` without errors.
## Workshop Infrastructure The `docker-compose.yml` starts 10 services: - **demo-app** (port 3000) — target application - **broken-app** (port 3001) — intentionally misconfigured - **httpbin** (port 8080) — HTTP testing utility - **WireMock** (port 8888) — mock API server - **InfluxDB** (port 8086) — time-series database - **Grafana** (port 3030) — visualization dashboards - **Prometheus** (port 9090) — metrics scraping - **Alloy** (ports 4317, 4318, 12345) — telemetry pipeline - **Tempo** (port 3200) — distributed tracing - **ws-echo** (port 8765) — WebSocket echo server
## Start All Services From the repository root: ```bash cd infra && docker compose up -d ``` Wait for services to become healthy: ```bash docker compose ps ``` Look for `healthy` or `running` status for all containers.
## Verify Services Quick health checks: ```bash # demo-app curl http://localhost:3000/health # InfluxDB curl http://localhost:8086/ping # Grafana curl http://localhost:3030/api/health # Prometheus curl http://localhost:9090/-/healthy ``` All should return successful responses.
## Install k6 **macOS (Homebrew):** ```bash brew install k6 ``` **Linux (Debian/Ubuntu):** ```bash sudo gpg --no-default-keyring \ --keyring /usr/share/keyrings/k6-archive-keyring.gpg \ --keyserver hkp://keyserver.ubuntu.com:80 \ --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69 echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] \ https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list sudo apt-get update && sudo apt-get install k6 ``` **Windows (winget):** ```powershell winget install k6 --source winget ```
## Verify k6 Installation ```bash k6 version ``` Expected output: ``` k6 v0.xx.x ```
## Run the Smoke Check From the repository root: ```bash k6 run scripts/smoke-check.js ``` This script: - Makes a single request to demo-app - Verifies the response is healthy - Should complete in a few seconds with no errors
## Expected Smoke Check Output ``` /\ |‾‾| /‾‾/ /‾‾/ /\ / \ | |/ / / / / \/ \ | ( / ‾‾\ / \ | |\ \ | (‾) | / __________ \ |__| \__\ \_____/ .io execution: local script: scripts/smoke-check.js output: - scenarios: (100.00%) 1 scenario, 1 max VUs, 30s max duration * default: 1 looping VUs for 10s (gracefulStop: 30s) ✓ status is 200 checks.........................: 100.00% ✓ 1 ✗ 0 http_req_duration..............: avg=5ms ... ```
## Open Grafana Navigate to: **http://localhost:3030** Default credentials: - Username: `admin` - Password: `admin` You may be prompted to change the password — you can skip this for the workshop.
## Key Takeaways - Docker Compose manages the entire workshop infrastructure as a single unit - k6 is a single binary with no runtime dependencies - The **demo-app** (port 3000) is your primary target - The **broken-app** (port 3001) is intentionally misconfigured for threshold testing - **Grafana** (port 3030) is your observability dashboard throughout the workshop
# Lab Complete! Environment verified and ready
Navigate: [All Slides](../index.html) | [Next: k6 Fundamentals](../01_k6_Fundamentals/index.html)