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
81 changes: 81 additions & 0 deletions .github/workflows/test-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: "Test demo docker composition"

on:
workflow_dispatch:
pull_request:
types:
- opened
- synchronize

jobs:
changes:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.filter.outputs.changed }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
changed:
- demo/**
- etter/**
- scripts/**
- Makefile
- pyproject.toml
- uv.lock
- .github/workflows/test-demo.yml

run-composition:
needs:
- changes
if: ${{ needs.changes.outputs.changed == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up env
run: |
cp demo/.env.example demo/.env
- name: Download data
run: |
make download-data
make download-data-ign
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and run demo composition
run: |
docker compose -f demo/docker-compose.yml up --build -d --wait
- name: Test demo composition
run: |
check_url() {
local url=$1
local tmpfile
tmpfile=$(mktemp)
local http_code
http_code=$(curl -sSo "$tmpfile" -w "%{http_code}" "$url")
if [[ "$http_code" -lt 200 || "$http_code" -ge 300 ]]; then
echo "FAILED $url (HTTP $http_code):"
cat "$tmpfile"
rm "$tmpfile"
return 1
fi
echo "OK $url (HTTP $http_code)"
rm "$tmpfile"
}
check_url http://localhost:8000/
check_url http://localhost:8000/docs
check_url http://localhost:3002/health
- name: Dump logs on failure
if: failure()
run: docker compose -f demo/docker-compose.yml logs
- name: Tear down demo composition
if: always()
run: |
docker compose -f demo/docker-compose.yml down --volumes
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
help:
@echo "Setup:"
@echo " make install Install dependencies"
@echo " make dev Install with dev dependencies"
@echo " make install-dev Install with dev dependencies"
@echo " make install-dev-full Install with dev and PostGIS dependencies"
@echo " make download-data Download SwissNames3D dataset"
@echo " make download-data-ign Download IGN BD-CARTO dataset"
@echo ""
@echo "Running:"
@echo " make repl Run interactive REPL"
@echo " make demo Run the demo app"
@echo " make demo-composition Run the demo app with Docker Compose"
@echo ""
@echo "Docs:"
@echo " make docs-preview Build and preview the documentation site"
Expand All @@ -20,9 +22,12 @@ help:
install:
uv sync

dev:
install-dev:
uv sync --extra dev

install-dev-full:
uv sync --extra dev --extra postgis

DATA_PKT = data/swissNAMES3D_PLY.shp

BDCARTO_ARCHIVE_NAME = BDCARTO_5-0_TOUSTHEMES_GPKG_LAMB93_FXX_2025-09-15
Expand All @@ -37,6 +42,9 @@ repl:
demo:
uv run uvicorn demo.main:app --port 8000 --reload

demo-composition:
docker compose -f demo/docker-compose.yml up --build -d

download-data: $(DATA_PKT)

download-data-ign: $(DATA_PKT_IGN)
Expand Down
21 changes: 20 additions & 1 deletion demo/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ services:
postgresql+psycopg2://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgis:5432/${POSTGRES_DB:-geodata}
SWISSNAMES3D_TABLE: ${SWISSNAMES3D_TABLE:-swissnames3d}
IGN_BDCARTO_TABLE: ${IGN_BDCARTO_TABLE:-ign_bdcarto}
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8000/')",
]
interval: 5s
timeout: 10s
retries: 20
start_period: 30s
depends_on:
postgis:
condition: service_healthy
Expand All @@ -73,8 +85,15 @@ services:
environment:
- PYTHON_API_URL=http://api:8000
- PORT=3002
healthcheck:
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:3002/health"]
interval: 5s
timeout: 5s
retries: 10
start_period: 15s
depends_on:
- api
api:
condition: service_healthy
restart: unless-stopped

volumes:
Expand Down
4 changes: 4 additions & 0 deletions demo/etter-mcp-app/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ expressApp.post("/mcp", async (req, res) => {
await transport.handleRequest(req, res, req.body);
});

expressApp.get("/health", (req, res) => {
res.status(200).json({ status: "ok" });
});

expressApp.listen(PORT, (err) => {
if (err) {
console.error("Error starting server:", err);
Expand Down
Loading