From 49c09ff8fd0fcc3d41ca67875ad0d4e2ea27dcd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20Pe=CC=81rez?= Date: Wed, 18 Feb 2026 00:03:05 +0000 Subject: [PATCH] chore: fix commands --- .pre-commit-config.yaml | 26 +------- .pre-commit-hooks/solid-boundary-check.sh | 27 ++++++++ .typedialog/README.md | 4 +- infrastructure/api-gateway/Dockerfile | 2 +- infrastructure/docker/docker-compose.yaml | 79 +++++++++++++++++++++-- 5 files changed, 105 insertions(+), 33 deletions(-) create mode 100755 .pre-commit-hooks/solid-boundary-check.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8945d50..26d3e02 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -48,30 +48,8 @@ repos: hooks: - id: solid-boundary-check name: SOLID Architecture Boundaries - entry: bash -c ' - VIOLATIONS=$(git diff --cached --name-only --diff-filter=ACM | - grep -E "\.(nu|rs)$" | - grep -v "templates/" | - grep -v "extensions/providers/" | - grep -v "orchestrator/" | - xargs grep -lE "^\^hcloud|^\^aws |^\^doctl|hcloud server" 2>/dev/null | - grep -v "^$") ; - if [ -n "$VIOLATIONS" ]; then - echo "SOLID VIOLATION: Provider API calls outside orchestrator:"; - echo "$VIOLATIONS"; - exit 1; - fi ; - SSH_VIOLATIONS=$(git diff --cached --name-only --diff-filter=ACM | - grep -E "\.(rs)$" | - grep -E "control-center|vault-service" | - xargs grep -lE "ssh2?::|russh::" 2>/dev/null) ; - if [ -n "$SSH_VIOLATIONS" ]; then - echo "SOLID VIOLATION: SSH code outside orchestrator:"; - echo "$SSH_VIOLATIONS"; - exit 1; - fi - ' - language: system + entry: .pre-commit-hooks/solid-boundary-check.sh + language: script pass_filenames: false stages: [pre-commit] diff --git a/.pre-commit-hooks/solid-boundary-check.sh b/.pre-commit-hooks/solid-boundary-check.sh new file mode 100755 index 0000000..0c278c5 --- /dev/null +++ b/.pre-commit-hooks/solid-boundary-check.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -euo pipefail + +VIOLATIONS=$(git diff --cached --name-only --diff-filter=ACM | + grep -E "\.(nu|rs)$" | + grep -v "templates/" | + grep -v "extensions/providers/" | + grep -v "orchestrator/" | + xargs grep -lE "^\^hcloud|^\^aws |^\^doctl|hcloud server" 2>/dev/null | + grep -v "^$") || true + +if [ -n "$VIOLATIONS" ]; then + echo "SOLID VIOLATION: Provider API calls outside orchestrator:" + echo "$VIOLATIONS" + exit 1 +fi + +SSH_VIOLATIONS=$(git diff --cached --name-only --diff-filter=ACM | + grep -E "\.(rs)$" | + grep -E "control-center|vault-service" | + xargs grep -lE "ssh2?::|russh::" 2>/dev/null) || true + +if [ -n "$SSH_VIOLATIONS" ]; then + echo "SOLID VIOLATION: SSH code outside orchestrator:" + echo "$SSH_VIOLATIONS" + exit 1 +fi diff --git a/.typedialog/README.md b/.typedialog/README.md index a02741e..d015749 100644 --- a/.typedialog/README.md +++ b/.typedialog/README.md @@ -22,7 +22,7 @@ TypeDialog enables interactive form-based configuration from Nickel schemas. ├── templates/ # Jinja2 templates for schema rendering │ └── service-form.template.j2 ├── schemas/ # Symlink to Nickel schemas - │ └── platform/schemas/ → ../../../schemas/platform/schemas/ + │ └── platform/schemas/ → ../../../schemas/platform/ └── constraints/ # Validation constraints └── constraints.toml # Shared validation rules ``` @@ -97,7 +97,7 @@ typedialog --version ```toml # Batch generate all forms -for schema in provisioning/schemas/platform/schemas/*.ncl; do +for schema in provisioning/schemas/platform/*.ncl; do service=$(basename $schema .ncl) typedialog generate-form --schema $schema diff --git a/infrastructure/api-gateway/Dockerfile b/infrastructure/api-gateway/Dockerfile index eb38c06..afd2258 100644 --- a/infrastructure/api-gateway/Dockerfile +++ b/infrastructure/api-gateway/Dockerfile @@ -25,7 +25,7 @@ COPY src ./src RUN cargo build --release --bin api-gateway # Runtime stage -FROM debian:bookworm-slim +FROM debian:trixie-slim # Install runtime dependencies RUN apt-get update && apt-get install -y \ diff --git a/infrastructure/docker/docker-compose.yaml b/infrastructure/docker/docker-compose.yaml index 0fcc1b7..bb55630 100644 --- a/infrastructure/docker/docker-compose.yaml +++ b/infrastructure/docker/docker-compose.yaml @@ -5,8 +5,8 @@ services: # Orchestrator - Core workflow coordination orchestrator: build: - context: ../../crates/orchestrator - dockerfile: Dockerfile + context: ../.. + dockerfile: crates/orchestrator/Dockerfile container_name: provisioning-orchestrator ports: - "8080:8080" @@ -30,8 +30,8 @@ services: # Control Center - Web UI control-center: build: - context: ../../crates/control-center - dockerfile: Dockerfile + context: ../.. + dockerfile: crates/control-center/Dockerfile container_name: provisioning-control-center command: ["control-center", "--config", "/etc/provisioning/config.defaults.toml"] ports: @@ -117,8 +117,8 @@ services: # MCP Server - Model Context Protocol mcp-server: build: - context: ../../crates/mcp-server - dockerfile: Dockerfile + context: ../.. + dockerfile: crates/mcp-server/Dockerfile container_name: provisioning-mcp-server ports: - "8082:8082" @@ -168,6 +168,65 @@ services: networks: - provisioning-net + # Provisioning Daemon - Core provisioning service + provisioning-daemon: + build: + context: ../.. + dockerfile: crates/provisioning-daemon/Dockerfile + container_name: provisioning-daemon + ports: + - "8079:8079" + volumes: + - daemon-data:/data + - daemon-config:/etc/provisioning + environment: + - RUST_LOG=info + - DATA_DIR=/data + - PROVISIONING_DAEMON_MODE=solo + - PROVISIONING_CONFIG_DIR=/etc/provisioning + depends_on: + orchestrator: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8079/api/v1/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 30s + restart: unless-stopped + networks: + - provisioning-net + + # RAG Service - Retrieval-Augmented Generation service + provisioning-rag: + build: + context: ../.. + dockerfile: crates/rag/docker/Dockerfile + container_name: provisioning-rag + ports: + - "9090:9090" + volumes: + - rag-data:/app/data + - rag-cache:/app/cache + environment: + - PROVISIONING_LOG_LEVEL=info + - PROVISIONING_API_HOST=0.0.0.0 + - PROVISIONING_API_PORT=9090 + - PROVISIONING_CACHE_SIZE=1000 + - PROVISIONING_CACHE_TTL_SECS=3600 + depends_on: + orchestrator: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9090/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 5s + restart: unless-stopped + networks: + - provisioning-net + volumes: orchestrator-data: driver: local @@ -181,6 +240,14 @@ volumes: driver: local mcp-server-data: driver: local + daemon-data: + driver: local + daemon-config: + driver: local + rag-data: + driver: local + rag-cache: + driver: local networks: provisioning-net: