Commit Graph

19 Commits

Author SHA1 Message Date
Luca Sacchi Ricciardi
a021fe796b feat(lab-04): complete Phase 5 - Storage & S3 lab
Phase Plan:
- 05-PLAN.md: Combined execution plan for efficiency
- 05-RESEARCH.md: Domain research on volumes and MinIO

Test Scripts (4):
- 01-volumes-test.sh: Volume persistence verification
- 02-minio-test.sh: MinIO S3 API testing
- 03-persistence-test.sh: Database persistence verification
- 99-final-verification.sh: End-to-end verification

Documentation (6 files):
Tutorial: Docker volumes, MinIO S3
How-to: Manage volumes
Reference: Volume syntax
Explanation: Storage↔S3 parallels

Infrastructure:
- docker-compose.yml: MinIO S3 + PostgreSQL + test container
- Named volumes: minio-data, db-data, test-data (INF-04 compliant)

Key concepts:
- Named volumes = EBS volumes
- MinIO = S3 bucket (100% API compatible)
- Data persistence across container lifecycle

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 15:25:46 +02:00
Luca Sacchi Ricciardi
23a9ffe443 feat(lab-03): complete Phase 4 - Compute & EC2 lab
Phase Plans (5 files):
- 04-RESEARCH.md: Domain research on Docker limits, healthchecks, EC2 parallels
- 04-VALIDATION.md: Success criteria and validation strategy
- 04-01-PLAN.md: Test infrastructure (RED phase)
- 04-02-PLAN.md: Diátxis documentation
- 04-03-PLAN.md: Infrastructure implementation (GREEN phase)

Test Scripts (6 files, 1300+ lines):
- 01-resource-limits-test.sh: Validate INF-03 compliance
- 02-healthcheck-test.sh: Validate healthcheck configuration
- 03-enforcement-test.sh: Verify resource limits with docker stats
- 04-verify-infrastructure.sh: Infrastructure verification
- 99-final-verification.sh: End-to-end student verification
- run-all-tests.sh: Test orchestration with fail-fast
- quick-test.sh: Fast validation (<30s)

Documentation (11 files, 2500+ lines):
Tutorials (3):
- 01-set-resource-limits.md: EC2 instance types, Docker limits syntax
- 02-implement-healthchecks.md: ELB health check parallels
- 03-dependencies-with-health.md: depends_on with service_healthy

How-to Guides (4):
- check-resource-usage.md: docker stats monitoring
- test-limits-enforcement.md: Stress testing CPU/memory
- custom-healthcheck.md: HTTP, TCP, database healthchecks
- instance-type-mapping.md: Docker limits → EC2 mapping

Reference (3):
- compose-resources-syntax.md: Complete deploy.resources reference
- healthcheck-syntax.md: All healthcheck parameters
- ec2-instance-mapping.md: Instance type mapping table

Explanation (1):
- compute-ec2-parallels.md: Container=EC2, Limits=Instance Type, Healthcheck=ELB

Infrastructure:
- docker-compose.yml: 5 services (web, app, worker, db, stress-test)
  All services: INF-03 compliant (cpus + memory limits)
  All services: healthcheck configured
  EC2 parallels: t2.nano, t2.micro, t2.small, t2.medium, m5.large
- Dockerfile: Alpine 3.19 + stress tools + non-root user

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 15:16:58 +02:00
Luca Sacchi Ricciardi
39b9a56850 fix(lab-02): fix infrastructure verification script (04-verify-infrastructure.sh)
- Add missing BOLD color variable definition
- Fix grep/wc pipefail issues with awk for counting
- Fix docker inspect commands for network checks using jq
- All 20 tests now pass successfully

Test results:
- INF-02 compliance: 
- Network isolation: 
- Container placement: 
- Multi-homed app: 
- Private db isolation: 

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 17:39:32 +01:00
Luca Sacchi Ricciardi
5b2c8c37aa feat(lab-02): complete Phase 3 - Network & VPC lab
Implement Lab 02 with Docker bridge networks simulating VPC/Subnets.

Test Infrastructure (RED phase):
- 6 bash test scripts for network creation, isolation, INF-02 compliance
- Fail-fast orchestration with run-all-tests.sh
- Quick validation script for development

Documentation (Diátaxis framework):
- 3 tutorials: VPC creation, container deployment, isolation verification
- 4 how-to guides: create network, inspect config, test isolation, cleanup
- 3 reference docs: Docker network commands, Compose syntax, VPC mapping
- 1 explanation: Docker ↔ VPC parallels (PARA-01/02/03/04)

Infrastructure (GREEN phase):
- docker-compose.yml with VPC networks (10.0.1.0/24, 10.0.2.0/24)
- 5 services: web, app, db, test-public, test-private
- INF-02 compliant: 127.0.0.1 bindings only, no 0.0.0.0
- Private network with --internal flag
- Multi-homed app container (public + private networks)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 17:26:35 +01:00
Luca Sacchi Ricciardi
e4c497db72 feat(02-03): create infrastructure verification script
- Test 1: docker-compose.yml is valid YAML
- Test 2: Dockerfile exists and has USER directive
- Test 3: docker-compose.yml has user directive (1000:1000)
- Test 4: Docker image builds successfully
- Test 5: Container runs as non-root (labuser)
- Test 6: docker-compose service verification

GREEN phase check: All infrastructure tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 22:32:23 +01:00
Luca Sacchi Ricciardi
c534d5949b feat(02-03): create docker-compose.yml with user directive
- Defines service with local image build
- Specifies user directive (1000:1000) for non-root execution
- Includes container_name for easy reference
- Follows INF-01 requirement (no root)
- Enables test scripts to verify configuration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 22:29:41 +01:00
Luca Sacchi Ricciardi
317d94aca5 feat(02-03): create Dockerfile with non-root user
- Base image: alpine:3.19 (small, secure)
- Creates non-root user with UID/GID 1000
- Switches to non-root user with USER directive
- CMD demonstrates non-root execution with whoami
- Follows INF-01 requirement (no root execution)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 22:29:16 +01:00
Luca Sacchi Ricciardi
77235820ac feat(02-02): create explanation document for IAM parallels
- docker-iam-parallels.md: Conceptual mapping between Docker and AWS IAM
- Side-by-side comparisons with practical examples
- Covers PARA-01, PARA-03, PARA-04 requirements
- Explains least privilege principle and best practices
- Links to AWS documentation for deeper learning
2026-03-24 22:27:03 +01:00
Luca Sacchi Ricciardi
cc3a28f192 feat(02-02): create reference documents with technical specifications
- docker-socket-permissions.md: Docker socket technical specs and access control
- linux-users-groups.md: Linux user management reference with commands
- iam-parallels.md: Quick reference table for IAM parallelism
- Pure reference material with tables and specifications
2026-03-24 22:26:25 +01:00
Luca Sacchi Ricciardi
c759270e95 feat(02-02): create how-to guides for common procedures
- add-user-to-docker-group.md: Quick guide for adding users to docker group
- verify-non-root-container.md: Multiple methods to verify non-root execution
- reset-docker-permissions.md: Complete permission reset guide with troubleshooting
- Procedure-focused, command-first structure
2026-03-24 22:25:31 +01:00
Luca Sacchi Ricciardi
7bd61111f3 feat(02-02): create tutorial part 3 - verification and non-root containers
- Step-by-step verification of IAM configuration
- Multiple methods to verify non-root execution
- Explains principle of least privilege
- Integrates with automated test scripts
2026-03-24 22:24:52 +01:00
Luca Sacchi Ricciardi
b031f58dfd feat(02-02): create tutorial part 2 - Docker group permissions
- Step-by-step guide for adding users to docker group
- Explains group membership evaluation timing issue
- Shows parallelism with AWS IAM User + Policy
- Includes multiple troubleshooting scenarios
2026-03-24 22:24:26 +01:00
Luca Sacchi Ricciardi
b130b1cc3e feat(02-02): create tutorial part 1 - Linux users
- Step-by-step user creation guide for lab01_student
- Follows 'little often' principle with small incremental steps
- Includes verification at each step
- Troubleshooting section for common issues
2026-03-24 22:24:01 +01:00
Luca Sacchi Ricciardi
1a17eeb3a5 test(02-01): add test orchestration script for lab 01
- Created run-all-tests.sh to execute test suite in sequence
- Fail-fast approach stops on first failure (TDD RED phase)
- Provides summary and next steps (final verification)
- Can be run from any directory (uses absolute paths)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 22:19:52 +01:00
Luca Sacchi Ricciardi
99edd848a7 test(02-01): add final verification script for student self-check
- Created 99-final-verification.sh as "double check" command
- Verifies all lab requirements: user config, Docker access, INF-01, docs
- Uses visual indicators (✓ pass, ✗ fail, ○ skip) for clarity
- Tests Diátaxis framework documentation completeness
- Exit code 0 for all-pass, 1 for any failure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 22:19:33 +01:00
Luca Sacchi Ricciardi
4b2cab386f test(02-01): add non-root container verification test (INF-01)
- Created 03-non-root-test.sh for INF-01 compliance validation
- Tests verify no container runs as root (safety requirement)
- Checks docker exec whoami, docker inspect, and compose file
- Handles missing infrastructure gracefully with SKIP results

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 22:19:09 +01:00
Luca Sacchi Ricciardi
2926a53746 test(02-01): add Docker access control test script (TDD RED phase)
- Created test-02-docker-access.sh for socket access validation
- Tests verify socket permissions, docker group existence, and ownership
- Checks for usermod availability in /usr/sbin as well as PATH
- All tests pass against current Docker installation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 22:18:45 +01:00
Luca Sacchi Ricciardi
a5969baf0d test(02-01): add user creation test script (TDD RED phase)
- Created test-01-user-creation.sh for Linux user/group validation
- Tests verify user existence, docker group membership, and access control
- Uses helper functions for counter increments to work with set -e
- Handles missing sudo gracefully with SKIP results

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 22:18:07 +01:00
Luca Sacchi Ricciardi
16ddb802ad feat(01-02): create lab directory structure with placeholder READMEs
- Created labs/ directory with 5 lab subdirectories
- Created how-to-guides/ and reference/ directories
- Added placeholder README.md in each lab directory
2026-03-24 19:54:51 +01:00