Skip to content
Merged
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
42 changes: 42 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Python
.venv
__pycache__/
*.pyc
*.pyo
*.pyd
.pytest_cache/
.coverage
*.egg-info/

# Logs
logs/
*.log

# Git
.git
.gitignore
.gitattributes

# IDE
.vscode/
.idea/
*.swp
*.swo

# Documentation
*.md
!README.md

# CI/CD
.github/

# Docker
Dockerfile
.dockerignore
docker-compose*.yml
compose.yaml

# Misc
.env
.env.*
.DS_Store
55 changes: 55 additions & 0 deletions .github/workflows/compose-smoke.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Compose Smoke

on:
pull_request:
paths:
- 'services/**'
- 'dev/compose/**'
- 'compose.yaml'
- '.github/workflows/compose-smoke.yml'

jobs:
compose:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Validate compose configuration
run: docker compose -f dev/compose/docker-compose.yml config

- name: Build services
run: docker compose -f dev/compose/docker-compose.yml build

- name: Start services
run: docker compose -f dev/compose/docker-compose.yml up -d

- name: Wait for services to be healthy
run: |
echo "Waiting for services to be healthy..."
timeout 120 bash -c 'until [ $(docker compose -f dev/compose/docker-compose.yml ps | grep -c "healthy") -eq 2 ]; do echo "Waiting..."; sleep 3; done'
echo "Both services are healthy"
docker compose -f dev/compose/docker-compose.yml ps

- name: Check orchestrator-ren health
run: |
echo "Testing orchestrator-ren /healthz endpoint..."
curl -f http://localhost:8000/healthz

- name: Check actuator-bus health
run: |
echo "Testing actuator-bus /healthz endpoint..."
curl -f http://localhost:8010/healthz

- name: Show logs on failure
if: failure()
run: docker compose -f dev/compose/docker-compose.yml logs

- name: Cleanup
if: always()
run: docker compose -f dev/compose/docker-compose.yml down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ build/
.ipynb_checkpoints/
datasets/raw/
artifacts/
logs/
40 changes: 35 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
.PHONY: help venv validate test clean
.PHONY: help venv validate test clean up down logs compose-test compose-validate

help:
@echo "Available targets:"
@echo " make venv - Create Python virtual environment and install dependencies"
@echo " make validate - Run contract validator with golden checks"
@echo " make test - Run all pytest tests"
@echo " make clean - Remove virtual environment and cache files"
@echo " make venv - Create Python virtual environment and install dependencies"
@echo " make validate - Run contract validator with golden checks"
@echo " make test - Run all pytest tests"
@echo " make clean - Remove virtual environment and cache files"
@echo ""
@echo "Docker Compose targets:"
@echo " make up - Start dev stack (orchestrator + actuator)"
@echo " make down - Stop and remove dev stack containers"
@echo " make logs - Follow logs from all containers"
@echo " make compose-test - Run smoke test against running containers"
@echo " make compose-validate - Validate docker-compose configuration"

venv:
python -m venv .venv
Expand All @@ -22,3 +29,26 @@ clean:
if exist .venv rmdir /s /q .venv
for /d /r %%i in (__pycache__) do @if exist "%%i" rmdir /s /q "%%i"
for /d /r %%i in (.pytest_cache) do @if exist "%%i" rmdir /s /q "%%i"

# ============================================================================
# Docker Compose Targets
# ============================================================================

up:
cd dev/compose && docker compose up -d --build

down:
cd dev/compose && docker compose down

logs:
cd dev/compose && docker compose logs -f

compose-test:
@echo "Testing orchestrator-ren on port 8000..."
@curl -s http://localhost:8000/healthz || echo "Failed to connect to orchestrator-ren"
@echo ""
@echo "Testing actuator-bus on port 8010..."
@curl -s http://localhost:8010/healthz || echo "Failed to connect to actuator-bus"

compose-validate:
cd dev/compose && docker compose config
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ git checkout -b feat/contracts-v1
git checkout -b feat/orchestrator-skeleton
```

## Docker Compose Development Stack

Run orchestrator-ren and actuator-bus locally:

```bash
# Start services
docker compose up

# In another terminal - run smoke tests
make compose-test

# Stop services
docker compose down
```

See `dev/compose/README.md` for detailed documentation.

## Branching
- `main`: protected, release-quality
- `dev`: integration
Expand Down
52 changes: 52 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This file provides a convenient entrypoint at the repo root.
# The source of truth is dev/compose/docker-compose.yml
#
# Usage: docker compose up
#
# See dev/compose/README.md for full documentation.

services:
orchestrator-ren:
build:
context: ./services/orchestrator_ren
dockerfile: Dockerfile
container_name: monad-orchestrator-ren
ports:
- "8000:8000"
volumes:
- ./logs:/app/logs
healthcheck:
test: ["CMD", "python", "-c", "from urllib.request import urlopen; urlopen('http://localhost:8000/healthz', timeout=2).read()"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
networks:
- monad-network
restart: unless-stopped

actuator-bus:
build:
context: ./services/actuator_bus
dockerfile: Dockerfile
container_name: monad-actuator-bus
ports:
- "8010:8001"
volumes:
- ./logs:/app/logs
healthcheck:
test: ["CMD", "python", "-c", "from urllib.request import urlopen; urlopen('http://localhost:8001/healthz', timeout=2).read()"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
depends_on:
orchestrator-ren:
condition: service_healthy
networks:
- monad-network
restart: unless-stopped

networks:
monad-network:
driver: bridge
Loading