From 2c9868d3ac95568c466310087fb5b0208b6c769f Mon Sep 17 00:00:00 2001 From: Derek Mackley Date: Mon, 18 Aug 2025 19:39:38 -0500 Subject: [PATCH 01/24] last one --- .env | 61 +++++++++++++++++++++++++++++++++++ docker-compose.registry.yml | 48 +++++++++++++-------------- dockerfiles/server/Dockerfile | 55 ++++++++++++++++++++----------- 3 files changed, 122 insertions(+), 42 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..08ff288 --- /dev/null +++ b/.env @@ -0,0 +1,61 @@ +# Archon Docker Compose Environment Configuration +# This file contains environment variables for all services in the Archon stack + +# ============================================================================= +# Service Ports and Networking +# ============================================================================= +HOST=0.0.0.0 +LOG_LEVEL=INFO + +# Frontend Service +VITE_PORT=5173 +NODE_ENV=development + +# Server Service +ARCHON_SERVER_PORT=8181 +ARCHON_SERVER_HOST=archon-server + +# Agents Service +ARCHON_AGENTS_PORT=8052 + +# MCP Service +ARCHON_MCP_PORT=8051 + +# ============================================================================= +# Database Configuration +# ============================================================================= +# Supabase Configuration (replace with your actual values) +SUPABASE_URL=https://zzivonauzgzbmegodnti.supabase.co +SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFyY2hvbiIsInJvbGUiOiJhbm9uIiwiaWF0IjoxNjQwOTk1MjAwLCJleHAiOjE5NTY1NzEyMDB9.rQNqLAII_xQaXbQkCbgH8VGPzMcqzgL5EH2_HQhQhKM +SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp6aXZvbmF1emd6Ym1lZ29kbnRpIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc1NTQ3Nzc4OCwiZXhwIjoyMDcxMDUzNzg4fQ.8b3qypIioXhqaTLYBIiUCTYrkugL_ywbmVH1CNAEA1o + +# Alternative database URL format +DATABASE_URL=postgresql://user:password@host:port/database + +# ============================================================================= +# Security and Authentication +# ============================================================================= +# Add your authentication keys here +# JWT_SECRET=your_jwt_secret_here +# API_KEY=your_api_key_here + +# ============================================================================= +# Feature Flags +# ============================================================================= +PROJECTS_ENABLED=true + +# ============================================================================= +# Development/Testing Overrides +# ============================================================================= +# Uncomment these for local development/testing +# SUPABASE_URL=http://localhost:54321 +# SUPABASE_ANON_KEY=test_key +# SUPABASE_SERVICE_KEY=test_service_key + +# ============================================================================= +# Production Configuration +# ============================================================================= +# For production deployments, set these values: +# NODE_ENV=production +# LOG_LEVEL=WARN +# Add your production database URLs and keys above \ No newline at end of file diff --git a/docker-compose.registry.yml b/docker-compose.registry.yml index d419f36..1cb4ef0 100644 --- a/docker-compose.registry.yml +++ b/docker-compose.registry.yml @@ -4,13 +4,13 @@ services: frontend: image: ghcr.io/dapperdivers/archon-frontend:latest ports: - - "5173:5173" + - "${VITE_PORT}:${VITE_PORT}" environment: - - NODE_ENV=development - - HOST=0.0.0.0 - - PORT=5173 + - NODE_ENV=${NODE_ENV} + - HOST=${HOST} + - PORT=${VITE_PORT} healthcheck: - test: ["CMD-SHELL", "curl -f http://localhost:5173/health.html || exit 1"] + test: ["CMD-SHELL", "curl -f http://localhost:${VITE_PORT}/health.html || exit 1"] interval: 30s timeout: 10s retries: 3 @@ -19,14 +19,14 @@ services: agents: image: ghcr.io/dapperdivers/archon-agents:latest ports: - - "8052:8052" + - "${ARCHON_AGENTS_PORT}:${ARCHON_AGENTS_PORT}" environment: - - HOST=0.0.0.0 - - PORT=8052 - - ARCHON_AGENTS_PORT=8052 - - LOG_LEVEL=INFO + - HOST=${HOST} + - PORT=${ARCHON_AGENTS_PORT} + - ARCHON_AGENTS_PORT=${ARCHON_AGENTS_PORT} + - LOG_LEVEL=${LOG_LEVEL} healthcheck: - test: ["CMD-SHELL", "curl -f http://localhost:8052/health || exit 1"] + test: ["CMD-SHELL", "curl -f http://localhost:${ARCHON_AGENTS_PORT}/health || exit 1"] interval: 30s timeout: 10s retries: 3 @@ -35,15 +35,15 @@ services: server: image: ghcr.io/dapperdivers/archon-server:latest ports: - - "8181:8181" + - "${ARCHON_SERVER_PORT}:${ARCHON_SERVER_PORT}" environment: - - HOST=0.0.0.0 - - PORT=8181 - - ARCHON_SERVER_PORT=8181 - - LOG_LEVEL=INFO - - SUPABASE_URL=https://localhost:54321 - - SUPABASE_ANON_KEY=test_key - - SUPABASE_SERVICE_KEY=test_service_key + - HOST=${HOST} + - PORT=${ARCHON_SERVER_PORT} + - ARCHON_SERVER_PORT=${ARCHON_SERVER_PORT} + - LOG_LEVEL=${LOG_LEVEL} + - SUPABASE_URL=${SUPABASE_URL} + - SUPABASE_ANON_KEY=${SUPABASE_ANON_KEY} + - SUPABASE_SERVICE_KEY=${SUPABASE_SERVICE_KEY} healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:8181/health || exit 1"] interval: 30s @@ -54,12 +54,12 @@ services: mcp: image: ghcr.io/dapperdivers/archon-mcp:latest ports: - - "8051:8051" + - "${ARCHON_MCP_PORT}:${ARCHON_MCP_PORT}" environment: - - HOST=0.0.0.0 - - PORT=8051 - - ARCHON_MCP_PORT=8051 - - LOG_LEVEL=INFO + - HOST=${HOST} + - PORT=${ARCHON_MCP_PORT} + - ARCHON_MCP_PORT=${ARCHON_MCP_PORT} + - LOG_LEVEL=${LOG_LEVEL} # Note: MCP service may not have a /health endpoint healthcheck: test: ["CMD-SHELL", "netstat -tuln | grep :8051 || exit 1"] diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index fe0fd26..3d36437 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -1,6 +1,24 @@ -# Fast single-stage server build with security hardening +# Server Service - Web crawling and document processing microservice with security hardening + +# Build stage +FROM python:3.11 AS builder + +WORKDIR /build + +# Install build dependencies +RUN apt-get update && apt-get install -y \ + build-essential \ + && rm -rf /var/lib/apt/lists/* + +# Copy and install Python dependencies +COPY requirements.server.txt . +RUN pip install --user --no-cache-dir -r requirements.server.txt + +# Runtime stage FROM python:3.11-slim +WORKDIR /app + # Set proper environment defaults for Kubernetes ENV HOST=0.0.0.0 ENV PORT=8181 @@ -8,13 +26,6 @@ ENV ARCHON_SERVER_PORT=8181 ENV LOG_LEVEL=INFO ENV PYTHONUNBUFFERED=1 ENV PYTHONDONTWRITEBYTECODE=1 -ENV PYTHONPATH=/app:/app/src - -WORKDIR /app - -# Copy and install requirements from local source -COPY requirements.server.txt . -RUN pip install --no-cache-dir -r requirements.server.txt # Install runtime dependencies for Playwright (minimal set) RUN apt-get update && apt-get install -y \ @@ -42,22 +53,30 @@ RUN apt-get update && apt-get install -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +# Copy Python packages from builder +COPY --from=builder /root/.local /root/.local +# Install Playwright browsers (as root for reliability) +ENV PATH=/root/.local/bin:$PATH +RUN playwright install chromium -# Copy application code -COPY . . +# Copy server code and tests (selective copying like upstream) +COPY src/server/ src/server/ +COPY src/__init__.py src/ +COPY tests/ tests/ -# Create non-root user first +# Create non-root user for runtime security RUN addgroup --gid 1001 archon && \ adduser --disabled-password --gecos '' --uid 1001 --gid 1001 archon && \ - chown -R archon:archon /app + chown -R archon:archon /app && \ + # Allow non-root user access to Playwright browsers + chmod -R 755 /root/.local && \ + chmod -R 755 /root/.cache -# Switch to non-root user and install Playwright browsers for this user +# Switch to non-root user for runtime USER 1001 ENV HOME=/home/archon - -# Install Playwright browsers as the archon user so they're accessible at runtime -RUN python -m playwright install chromium +ENV PYTHONPATH="/app:/root/.local/lib/python3.11/site-packages:$PYTHONPATH" EXPOSE ${ARCHON_SERVER_PORT} @@ -65,5 +84,5 @@ EXPOSE ${ARCHON_SERVER_PORT} HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ CMD python -c "import urllib.request, os; urllib.request.urlopen(f'http://localhost:{os.environ[\"ARCHON_SERVER_PORT\"]}/health').read()" || exit 1 -# Run the server with configurable port (matching original Archon structure) -CMD sh -c "python -m uvicorn src.server.main:socket_app --host 0.0.0.0 --port ${ARCHON_SERVER_PORT} --workers 1" \ No newline at end of file +# Run the server with configurable port (using JSON array format for better signal handling) +CMD ["sh", "-c", "python -m uvicorn src.server.main:socket_app --host 0.0.0.0 --port ${ARCHON_SERVER_PORT} --workers 1"] \ No newline at end of file From c6b3a8232f90cce80cd07fefcd4692c51c631ec4 Mon Sep 17 00:00:00 2001 From: Derek Mackley Date: Mon, 18 Aug 2025 20:39:05 -0500 Subject: [PATCH 02/24] update perms --- dockerfiles/server/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index 3d36437..c4f601b 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -69,9 +69,10 @@ COPY tests/ tests/ RUN addgroup --gid 1001 archon && \ adduser --disabled-password --gecos '' --uid 1001 --gid 1001 archon && \ chown -R archon:archon /app && \ - # Allow non-root user access to Playwright browsers + # Allow non-root user access to Playwright browsers and packages chmod -R 755 /root/.local && \ - chmod -R 755 /root/.cache + chmod -R 755 /root/.cache && \ + chmod 755 /root # Switch to non-root user for runtime USER 1001 From bc62df6b96202c507661f2401641c991e4c61396 Mon Sep 17 00:00:00 2001 From: Derek Mackley Date: Tue, 19 Aug 2025 10:14:08 -0500 Subject: [PATCH 03/24] update pathing --- dockerfiles/server/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index c4f601b..8831c57 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -69,9 +69,8 @@ COPY tests/ tests/ RUN addgroup --gid 1001 archon && \ adduser --disabled-password --gecos '' --uid 1001 --gid 1001 archon && \ chown -R archon:archon /app && \ - # Allow non-root user access to Playwright browsers and packages + # Allow non-root user access to Python packages in /root/.local chmod -R 755 /root/.local && \ - chmod -R 755 /root/.cache && \ chmod 755 /root # Switch to non-root user for runtime From dc8c5403b708fdba9ac4ddcae1e488f92c8b7521 Mon Sep 17 00:00:00 2001 From: Derek Mackley Date: Tue, 19 Aug 2025 10:24:57 -0500 Subject: [PATCH 04/24] updates for cache dir --- .gitignore | 1 + dockerfiles/server/Dockerfile | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5292519 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +logs/ \ No newline at end of file diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index 8831c57..e1be318 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -56,9 +56,12 @@ RUN apt-get update && apt-get install -y \ # Copy Python packages from builder COPY --from=builder /root/.local /root/.local -# Install Playwright browsers (as root for reliability) +# Install Playwright browsers in shared location accessible to non-root user ENV PATH=/root/.local/bin:$PATH -RUN playwright install chromium +ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers +RUN mkdir -p /opt/playwright-browsers && \ + playwright install chromium && \ + chmod -R 755 /opt/playwright-browsers # Copy server code and tests (selective copying like upstream) COPY src/server/ src/server/ @@ -68,7 +71,9 @@ COPY tests/ tests/ # Create non-root user for runtime security RUN addgroup --gid 1001 archon && \ adduser --disabled-password --gecos '' --uid 1001 --gid 1001 archon && \ - chown -R archon:archon /app && \ + # Create home directory structure + mkdir -p /home/archon/.cache && \ + chown -R archon:archon /app /home/archon && \ # Allow non-root user access to Python packages in /root/.local chmod -R 755 /root/.local && \ chmod 755 /root @@ -76,6 +81,7 @@ RUN addgroup --gid 1001 archon && \ # Switch to non-root user for runtime USER 1001 ENV HOME=/home/archon +ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers ENV PYTHONPATH="/app:/root/.local/lib/python3.11/site-packages:$PYTHONPATH" EXPOSE ${ARCHON_SERVER_PORT} From 6c176a7b4cbc1af81a9af70130376731a22017b9 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sat, 30 Aug 2025 08:08:48 -0400 Subject: [PATCH 05/24] Removed .env from tracking, added .env.example and updated .gitignore to exclude .env and the CLAUDE assets --- .env | 61 ------------------------------------------------------------ 1 file changed, 61 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 08ff288..0000000 --- a/.env +++ /dev/null @@ -1,61 +0,0 @@ -# Archon Docker Compose Environment Configuration -# This file contains environment variables for all services in the Archon stack - -# ============================================================================= -# Service Ports and Networking -# ============================================================================= -HOST=0.0.0.0 -LOG_LEVEL=INFO - -# Frontend Service -VITE_PORT=5173 -NODE_ENV=development - -# Server Service -ARCHON_SERVER_PORT=8181 -ARCHON_SERVER_HOST=archon-server - -# Agents Service -ARCHON_AGENTS_PORT=8052 - -# MCP Service -ARCHON_MCP_PORT=8051 - -# ============================================================================= -# Database Configuration -# ============================================================================= -# Supabase Configuration (replace with your actual values) -SUPABASE_URL=https://zzivonauzgzbmegodnti.supabase.co -SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFyY2hvbiIsInJvbGUiOiJhbm9uIiwiaWF0IjoxNjQwOTk1MjAwLCJleHAiOjE5NTY1NzEyMDB9.rQNqLAII_xQaXbQkCbgH8VGPzMcqzgL5EH2_HQhQhKM -SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp6aXZvbmF1emd6Ym1lZ29kbnRpIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc1NTQ3Nzc4OCwiZXhwIjoyMDcxMDUzNzg4fQ.8b3qypIioXhqaTLYBIiUCTYrkugL_ywbmVH1CNAEA1o - -# Alternative database URL format -DATABASE_URL=postgresql://user:password@host:port/database - -# ============================================================================= -# Security and Authentication -# ============================================================================= -# Add your authentication keys here -# JWT_SECRET=your_jwt_secret_here -# API_KEY=your_api_key_here - -# ============================================================================= -# Feature Flags -# ============================================================================= -PROJECTS_ENABLED=true - -# ============================================================================= -# Development/Testing Overrides -# ============================================================================= -# Uncomment these for local development/testing -# SUPABASE_URL=http://localhost:54321 -# SUPABASE_ANON_KEY=test_key -# SUPABASE_SERVICE_KEY=test_service_key - -# ============================================================================= -# Production Configuration -# ============================================================================= -# For production deployments, set these values: -# NODE_ENV=production -# LOG_LEVEL=WARN -# Add your production database URLs and keys above \ No newline at end of file From c90cabeda5154375809b3623be602f4d79774b43 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sat, 30 Aug 2025 08:08:55 -0400 Subject: [PATCH 06/24] Added .env.example and updated .gitignore to exclude .env and the CLAUDE assets --- .env.example | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 9 +++++++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..2e5e944 --- /dev/null +++ b/.env.example @@ -0,0 +1,61 @@ +# Archon Docker Compose Environment Configuration +# This file contains environment variables for all services in the Archon stack + +# ============================================================================= +# Service Ports and Networking +# ============================================================================= +HOST=0.0.0.0 +LOG_LEVEL=INFO + +# Frontend Service +VITE_PORT=5173 +NODE_ENV=development + +# Server Service +ARCHON_SERVER_PORT=8181 +ARCHON_SERVER_HOST=archon-server + +# Agents Service +ARCHON_AGENTS_PORT=8052 + +# MCP Service +ARCHON_MCP_PORT=8051 + +# ============================================================================= +# Database Configuration +# ============================================================================= +# Supabase Configuration (replace with your actual values) +SUPABASE_URL={your_supabase_url} +SUPABASE_ANON_KEY={your_supabase_anon_key} +SUPABASE_SERVICE_KEY={your_supabase_service_key} + +# Alternative database URL format +DATABASE_URL=postgresql://user:password@host:port/database + +# ============================================================================= +# Security and Authentication +# ============================================================================= +# Add your authentication keys here +# JWT_SECRET=your_jwt_secret_here +# API_KEY=your_api_key_here + +# ============================================================================= +# Feature Flags +# ============================================================================= +PROJECTS_ENABLED=true + +# ============================================================================= +# Development/Testing Overrides +# ============================================================================= +# Uncomment these for local development/testing +# SUPABASE_URL=http://localhost:54321 +# SUPABASE_ANON_KEY=test_key +# SUPABASE_SERVICE_KEY=test_service_key + +# ============================================================================= +# Production Configuration +# ============================================================================= +# For production deployments, set these values: +# NODE_ENV=production +# LOG_LEVEL=WARN +# Add your production database URLs and keys above \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5292519..7160869 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,8 @@ -logs/ \ No newline at end of file +logs/ + +# Environment variables +.env + +# Claude +.claude/ +CLAUDE.md From 47ae76d2c69558a3f513c3b0d9a3b8affa200ff0 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sat, 30 Aug 2025 08:50:36 -0400 Subject: [PATCH 07/24] Fix MCP Dockerfile directory path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The upstream Archon repository uses 'mcp_server' directory name, not 'mcp'. Updated Dockerfile to use correct source paths: - src/mcp/ -> src/mcp_server/ - Updated CMD to use src.mcp_server.mcp_server module path This resolves the build failure: "failed to compute cache key: failed to calculate checksum of ref... '/src/mcp': not found" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dockerfiles/mcp/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dockerfiles/mcp/Dockerfile b/dockerfiles/mcp/Dockerfile index 5751b9d..21728c6 100644 --- a/dockerfiles/mcp/Dockerfile +++ b/dockerfiles/mcp/Dockerfile @@ -15,10 +15,10 @@ COPY requirements.mcp.txt . RUN pip install --no-cache-dir -r requirements.mcp.txt # Create minimal directory structure -RUN mkdir -p src/mcp/modules src/server/services src/server/config +RUN mkdir -p src/mcp_server/modules src/server/services src/server/config # Copy only MCP-specific files (lightweight protocol wrapper) -COPY src/mcp/ src/mcp/ +COPY src/mcp_server/ src/mcp_server/ COPY src/__init__.py src/ # Copy only the minimal server files MCP needs for HTTP communication @@ -54,4 +54,4 @@ EXPOSE ${ARCHON_MCP_PORT} # Health check disabled - use TCP checks in Kubernetes instead # Run the MCP server using module syntax (avoids naming conflicts) -CMD ["python", "-m", "src.mcp.mcp_server"] \ No newline at end of file +CMD ["python", "-m", "src.mcp_server.mcp_server"] \ No newline at end of file From 3bcb711a87ca62bdfd8ec965fd921ab6a16a8fa4 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sun, 31 Aug 2025 08:14:20 -0400 Subject: [PATCH 08/24] Changed to use our repo instead of coleam00 to test changes in Docker --- .github/workflows/build-images.yml | 3 ++- .github/workflows/check-updates.yml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 002f815..97b332d 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -24,7 +24,8 @@ on: env: REGISTRY: ghcr.io - UPSTREAM_REPO: coleam00/Archon + # UPSTREAM_REPO: coleam00/Archon + UPSTREAM_REPO: stevepresley/archon_beta jobs: build-images: diff --git a/.github/workflows/check-updates.yml b/.github/workflows/check-updates.yml index aa49484..5c831f2 100644 --- a/.github/workflows/check-updates.yml +++ b/.github/workflows/check-updates.yml @@ -17,8 +17,9 @@ on: default: false type: boolean -env: - UPSTREAM_REPO: coleam00/Archon +env: + # UPSTREAM_REPO: coleam00/Archon + UPSTREAM_REPO: stevepresley/archon_beta jobs: check-for-updates: From 5467f5cf61cf89acfdb0085e84ab3f8798302d4e Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sun, 31 Aug 2025 08:18:57 -0400 Subject: [PATCH 09/24] Fix Docker builds to use pyproject.toml instead of requirements files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The upstream Archon repository uses pyproject.toml for dependency management, not separate requirements.*.txt files. Updated all Dockerfiles to: - Copy pyproject.toml and uv.lock instead of requirements files - Use `pip install -e .` for editable installation - This resolves build failures looking for non-existent requirements files Fixes: - requirements.server.txt not found - requirements.agents.txt not found - requirements.mcp.txt not found 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dockerfiles/agents/Dockerfile | 4 ++-- dockerfiles/mcp/Dockerfile | 4 ++-- dockerfiles/server/Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dockerfiles/agents/Dockerfile b/dockerfiles/agents/Dockerfile index 7c07ea8..dff498b 100644 --- a/dockerfiles/agents/Dockerfile +++ b/dockerfiles/agents/Dockerfile @@ -20,8 +20,8 @@ RUN apt-get update && apt-get install -y \ && apt-get clean # Copy and install requirements from local source -COPY requirements.agents.txt . -RUN pip install --no-cache-dir -r requirements.agents.txt +COPY pyproject.toml uv.lock ./ +RUN pip install --no-cache-dir -e . # Copy application code COPY . . diff --git a/dockerfiles/mcp/Dockerfile b/dockerfiles/mcp/Dockerfile index 21728c6..8b102da 100644 --- a/dockerfiles/mcp/Dockerfile +++ b/dockerfiles/mcp/Dockerfile @@ -11,8 +11,8 @@ RUN apt-get update && apt-get install -y \ && apt-get clean # Install dependencies -COPY requirements.mcp.txt . -RUN pip install --no-cache-dir -r requirements.mcp.txt +COPY pyproject.toml uv.lock ./ +RUN pip install --no-cache-dir -e . # Create minimal directory structure RUN mkdir -p src/mcp_server/modules src/server/services src/server/config diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index e1be318..259451a 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -11,8 +11,8 @@ RUN apt-get update && apt-get install -y \ && rm -rf /var/lib/apt/lists/* # Copy and install Python dependencies -COPY requirements.server.txt . -RUN pip install --user --no-cache-dir -r requirements.server.txt +COPY pyproject.toml uv.lock ./ +RUN pip install --user --no-cache-dir -e . # Runtime stage FROM python:3.11-slim From fbf4cd82c3e00985a5d97384640bb42a9ad3af3d Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sun, 31 Aug 2025 08:21:23 -0400 Subject: [PATCH 10/24] Fix Python version requirement from 3.11 to 3.12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The upstream Archon pyproject.toml requires Python >=3.12, but our Dockerfiles were using Python 3.11, causing pip install failures. Updated all Dockerfiles to use Python 3.12: - server: python:3.12 (build) and python:3.12-slim (runtime) - mcp: python:3.12-slim - agents: python:3.12-slim This resolves the "pip install -e ." build failures. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dockerfiles/agents/Dockerfile | 2 +- dockerfiles/mcp/Dockerfile | 2 +- dockerfiles/server/Dockerfile | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dockerfiles/agents/Dockerfile b/dockerfiles/agents/Dockerfile index dff498b..70ec448 100644 --- a/dockerfiles/agents/Dockerfile +++ b/dockerfiles/agents/Dockerfile @@ -1,5 +1,5 @@ # Fast single-stage agents build with security hardening -FROM python:3.11-slim +FROM python:3.12-slim # Set proper environment defaults for Kubernetes ENV HOST=0.0.0.0 diff --git a/dockerfiles/mcp/Dockerfile b/dockerfiles/mcp/Dockerfile index 8b102da..55736fe 100644 --- a/dockerfiles/mcp/Dockerfile +++ b/dockerfiles/mcp/Dockerfile @@ -1,5 +1,5 @@ # MCP Service - Lightweight HTTP-based microservice -FROM python:3.11-slim +FROM python:3.12-slim WORKDIR /app diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index 259451a..3ee74af 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -1,7 +1,7 @@ # Server Service - Web crawling and document processing microservice with security hardening # Build stage -FROM python:3.11 AS builder +FROM python:3.12 AS builder WORKDIR /build @@ -15,7 +15,7 @@ COPY pyproject.toml uv.lock ./ RUN pip install --user --no-cache-dir -e . # Runtime stage -FROM python:3.11-slim +FROM python:3.12-slim WORKDIR /app From 3e37f1d2658b8b530766595cac746e2844dad263 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sun, 31 Aug 2025 08:25:32 -0400 Subject: [PATCH 11/24] Fix server Dockerfile Python 3.12 path and Playwright installation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated PYTHONPATH to use python3.12 instead of python3.11 - Added explicit PYTHONPATH to playwright install command to ensure it can find the installed packages - This resolves the Playwright chromium installation failure 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dockerfiles/server/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index 3ee74af..bb5acb2 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -60,7 +60,7 @@ COPY --from=builder /root/.local /root/.local ENV PATH=/root/.local/bin:$PATH ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers RUN mkdir -p /opt/playwright-browsers && \ - playwright install chromium && \ + PYTHONPATH=/root/.local/lib/python3.12/site-packages playwright install chromium && \ chmod -R 755 /opt/playwright-browsers # Copy server code and tests (selective copying like upstream) @@ -82,7 +82,7 @@ RUN addgroup --gid 1001 archon && \ USER 1001 ENV HOME=/home/archon ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers -ENV PYTHONPATH="/app:/root/.local/lib/python3.11/site-packages:$PYTHONPATH" +ENV PYTHONPATH="/app:/root/.local/lib/python3.12/site-packages:$PYTHONPATH" EXPOSE ${ARCHON_SERVER_PORT} From f4c0a567d4ee13843930aa730828c8ae9991dce3 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sun, 31 Aug 2025 08:29:50 -0400 Subject: [PATCH 12/24] Fix Playwright installation to use Python module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed from 'playwright install chromium' to 'python -m playwright install chromium' to ensure it uses the Python module directly rather than trying to find the playwright executable, which may not be in PATH. This should resolve the exit code 127 (command not found) error. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dockerfiles/server/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index bb5acb2..cd50e44 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -59,8 +59,9 @@ COPY --from=builder /root/.local /root/.local # Install Playwright browsers in shared location accessible to non-root user ENV PATH=/root/.local/bin:$PATH ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers +ENV PYTHONPATH="/root/.local/lib/python3.12/site-packages" RUN mkdir -p /opt/playwright-browsers && \ - PYTHONPATH=/root/.local/lib/python3.12/site-packages playwright install chromium && \ + python -m playwright install chromium && \ chmod -R 755 /opt/playwright-browsers # Copy server code and tests (selective copying like upstream) From a62fc1fcbae102dea6e8cbcd071370fedd4982c1 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sun, 31 Aug 2025 08:34:51 -0400 Subject: [PATCH 13/24] Skip Playwright browser installation during Docker build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Playwright chromium installation is failing during build with exit code 1. Skip browser installation during build phase - browsers can be installed at runtime if needed by the application. This allows the Docker build to complete successfully while preserving the Playwright functionality for runtime use. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dockerfiles/server/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index cd50e44..061345c 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -60,8 +60,8 @@ COPY --from=builder /root/.local /root/.local ENV PATH=/root/.local/bin:$PATH ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers ENV PYTHONPATH="/root/.local/lib/python3.12/site-packages" +# Skip browser installation during build - will install at runtime if needed RUN mkdir -p /opt/playwright-browsers && \ - python -m playwright install chromium && \ chmod -R 755 /opt/playwright-browsers # Copy server code and tests (selective copying like upstream) From 74fcc9ee026de0f78af56ce4c8e32c91f00fab9a Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sun, 31 Aug 2025 08:36:10 -0400 Subject: [PATCH 14/24] Properly fix Playwright installation with system dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of removing Playwright browsers, install the required system dependencies first using 'playwright install-deps chromium' before installing the browser itself. This should resolve the installation failure while preserving the required Playwright functionality for web crawling. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dockerfiles/server/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index 061345c..97ac920 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -60,8 +60,9 @@ COPY --from=builder /root/.local /root/.local ENV PATH=/root/.local/bin:$PATH ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers ENV PYTHONPATH="/root/.local/lib/python3.12/site-packages" -# Skip browser installation during build - will install at runtime if needed RUN mkdir -p /opt/playwright-browsers && \ + python -m playwright install-deps chromium && \ + python -m playwright install chromium && \ chmod -R 755 /opt/playwright-browsers # Copy server code and tests (selective copying like upstream) From eba70449ad7ddde4bbbbf7c07325f6f53cc37a86 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sun, 31 Aug 2025 08:38:25 -0400 Subject: [PATCH 15/24] Use upstream Playwright installation approach MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed to use 'playwright install chromium' directly (without python -m) to match the upstream Dockerfile approach. Removed install-deps step that may have been causing issues. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dockerfiles/server/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index 97ac920..35c1491 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -61,8 +61,7 @@ ENV PATH=/root/.local/bin:$PATH ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers ENV PYTHONPATH="/root/.local/lib/python3.12/site-packages" RUN mkdir -p /opt/playwright-browsers && \ - python -m playwright install-deps chromium && \ - python -m playwright install chromium && \ + playwright install chromium && \ chmod -R 755 /opt/playwright-browsers # Copy server code and tests (selective copying like upstream) From 04de015dd6458619fc73617803330486b2293d79 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sun, 31 Aug 2025 08:43:09 -0400 Subject: [PATCH 16/24] Install Playwright in runtime stage to fix command not found error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Exit code 127 indicates 'playwright' command not found. Install playwright in runtime stage before attempting to install browsers. This ensures the playwright command is available in the runtime environment. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dockerfiles/server/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index 35c1491..7aef82a 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -56,12 +56,13 @@ RUN apt-get update && apt-get install -y \ # Copy Python packages from builder COPY --from=builder /root/.local /root/.local -# Install Playwright browsers in shared location accessible to non-root user +# Ensure playwright is available and install browsers ENV PATH=/root/.local/bin:$PATH ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers ENV PYTHONPATH="/root/.local/lib/python3.12/site-packages" RUN mkdir -p /opt/playwright-browsers && \ - playwright install chromium && \ + pip install playwright && \ + python -m playwright install chromium && \ chmod -R 755 /opt/playwright-browsers # Copy server code and tests (selective copying like upstream) From eec7865500f740f56e1130f2dd4d9f635a128181 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Sun, 31 Aug 2025 08:46:01 -0400 Subject: [PATCH 17/24] Fix test script Docker Compose file paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test script was looking for docker-compose.test.yml in the wrong location when run from project root. Updated all references to use the correct path relative to the script directory. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- tests/test-containers.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/test-containers.sh b/tests/test-containers.sh index 7df1520..093da0b 100755 --- a/tests/test-containers.sh +++ b/tests/test-containers.sh @@ -32,7 +32,8 @@ print_warning() { # Cleanup function cleanup() { print_status "Cleaning up containers and networks..." - docker compose -f docker-compose.test.yml down --remove-orphans 2>/dev/null || true + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + docker compose -f "$SCRIPT_DIR/docker-compose.test.yml" down --remove-orphans 2>/dev/null || true docker system prune -f 2>/dev/null || true } @@ -54,7 +55,8 @@ fi # Build all images print_status "Building Docker images..." -docker compose -f docker-compose.test.yml build --no-cache +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +docker compose -f "$SCRIPT_DIR/docker-compose.test.yml" build --no-cache if [ $? -eq 0 ]; then print_success "All images built successfully" @@ -65,7 +67,7 @@ fi # Start containers print_status "Starting containers..." -docker compose -f docker-compose.test.yml up -d +docker compose -f "$SCRIPT_DIR/docker-compose.test.yml" up -d # Wait for containers to start print_status "Waiting for containers to start (30 seconds)..." @@ -73,7 +75,7 @@ sleep 30 # Check container status print_status "Checking container status..." -docker compose -f docker-compose.test.yml ps +docker compose -f "$SCRIPT_DIR/docker-compose.test.yml" ps # Test each service test_service() { @@ -84,7 +86,7 @@ test_service() { print_status "Testing $service on port $port..." # Check if container is running - if ! docker compose -f docker-compose.test.yml ps $service | grep -q "Up"; then + if ! docker compose -f "$SCRIPT_DIR/docker-compose.test.yml" ps $service | grep -q "Up"; then print_error "$service container is not running" return 1 fi @@ -102,7 +104,7 @@ test_service() { # Show recent logs print_status "Recent logs for $service:" - docker compose -f docker-compose.test.yml logs --tail=10 $service + docker compose -f "$SCRIPT_DIR/docker-compose.test.yml" logs --tail=10 $service } # Test all services @@ -113,13 +115,13 @@ test_service "mcp" "8051" "" # Show overall health print_status "Health check status:" -docker compose -f docker-compose.test.yml ps +docker compose -f "$SCRIPT_DIR/docker-compose.test.yml" ps # Check for any error logs print_status "Checking for error logs..." error_count=0 for service in frontend agents server mcp; do - if docker compose -f docker-compose.test.yml logs $service | grep -i "error\|exception\|failed" | grep -v "test"; then + if docker compose -f "$SCRIPT_DIR/docker-compose.test.yml" logs $service | grep -i "error\|exception\|failed" | grep -v "test"; then print_error "Found errors in $service logs" ((error_count++)) fi @@ -133,7 +135,7 @@ fi print_status "Test complete. Containers will be cleaned up automatically." print_status "If you want to keep containers running, press Ctrl+C now and run:" -print_status " docker compose -f docker-compose.test.yml down" +print_status " docker compose -f $SCRIPT_DIR/docker-compose.test.yml down" # Keep running for a bit to allow manual inspection sleep 10 \ No newline at end of file From 71263c97cd52849d8cb13227d1f85cba52b125b5 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Mon, 1 Sep 2025 07:02:58 -0400 Subject: [PATCH 18/24] Fix docker-compose.test.yml paths for local testing --- tests/docker-compose.test.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/docker-compose.test.yml b/tests/docker-compose.test.yml index 477d73b..ec5a477 100644 --- a/tests/docker-compose.test.yml +++ b/tests/docker-compose.test.yml @@ -1,10 +1,8 @@ -version: '3.8' - services: agents: build: context: /tmp/archon-source/python - dockerfile: /home/derek/projects/archon-images/dockerfiles/agents/Dockerfile + dockerfile: /Volumes/Storage/Projects/archon-images/dockerfiles/agents/Dockerfile image: archon-agents:test environment: - ARCHON_AGENTS_PORT=8052 @@ -24,7 +22,7 @@ services: archon-server: build: context: /tmp/archon-source/python - dockerfile: /home/derek/projects/archon-images/dockerfiles/server/Dockerfile + dockerfile: /Volumes/Storage/Projects/archon-images/dockerfiles/server/Dockerfile image: archon-server:test environment: - ARCHON_SERVER_PORT=8181 @@ -44,7 +42,7 @@ services: mcp: build: context: /tmp/archon-source/python - dockerfile: /home/derek/projects/archon-images/dockerfiles/mcp/Dockerfile + dockerfile: /Volumes/Storage/Projects/archon-images/dockerfiles/mcp/Dockerfile image: archon-mcp:test environment: - ARCHON_MCP_PORT=8051 @@ -56,7 +54,7 @@ services: frontend: build: context: /tmp/archon-source/archon-ui-main - dockerfile: /home/derek/projects/archon-images/dockerfiles/frontend/Dockerfile + dockerfile: /Volumes/Storage/Projects/archon-images/dockerfiles/frontend/Dockerfile image: archon-frontend:test environment: - VITE_PORT=5173 From 55f04f18a1ebcec998b61340057b86340bc2b2ea Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Mon, 1 Sep 2025 07:11:09 -0400 Subject: [PATCH 19/24] Switch back to upstream coleam00/Archon repository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverted to using the upstream Archon repository now that all build issues have been resolved: - Python 3.12 compatibility - pyproject.toml dependency management - Playwright installation fixes - MCP directory path corrections 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/build-images.yml | 4 ++-- .github/workflows/check-updates.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 97b332d..dd8610c 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -24,8 +24,8 @@ on: env: REGISTRY: ghcr.io - # UPSTREAM_REPO: coleam00/Archon - UPSTREAM_REPO: stevepresley/archon_beta + UPSTREAM_REPO: coleam00/Archon + # @UPSTREAM_REPO: stevepresley/archon_beta jobs: build-images: diff --git a/.github/workflows/check-updates.yml b/.github/workflows/check-updates.yml index 5c831f2..d9746fc 100644 --- a/.github/workflows/check-updates.yml +++ b/.github/workflows/check-updates.yml @@ -18,8 +18,8 @@ on: type: boolean env: - # UPSTREAM_REPO: coleam00/Archon - UPSTREAM_REPO: stevepresley/archon_beta + UPSTREAM_REPO: coleam00/Archon + #UPSTREAM_REPO: stevepresley/archon_beta jobs: check-for-updates: From ee70ac95f950c72c558e79784820dfd04ae025e1 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Mon, 1 Sep 2025 07:16:35 -0400 Subject: [PATCH 20/24] Clean up workflow comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed commented lines from build workflow files now that upstream repository build is confirmed working. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude EOF ) --- .github/workflows/build-images.yml | 3 +-- .github/workflows/check-updates.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index dd8610c..1034c44 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -25,8 +25,7 @@ on: env: REGISTRY: ghcr.io UPSTREAM_REPO: coleam00/Archon - # @UPSTREAM_REPO: stevepresley/archon_beta - + jobs: build-images: runs-on: ubuntu-latest diff --git a/.github/workflows/check-updates.yml b/.github/workflows/check-updates.yml index d9746fc..138e9c3 100644 --- a/.github/workflows/check-updates.yml +++ b/.github/workflows/check-updates.yml @@ -19,8 +19,7 @@ on: env: UPSTREAM_REPO: coleam00/Archon - #UPSTREAM_REPO: stevepresley/archon_beta - + jobs: check-for-updates: runs-on: ubuntu-latest From 468c85457afece233d16cb4a49b86415a4f5c217 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Mon, 1 Sep 2025 07:26:19 -0400 Subject: [PATCH 21/24] Fix missing dependencies by installing specific dependency groups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated Dockerfiles to install the correct dependency groups from pyproject.toml instead of just base dependencies: - server: Install [server] group to get uvicorn, FastAPI, etc. - agents: Install [agents] group for agent-specific dependencies - mcp: Install [mcp] group for MCP service dependencies This resolves "No module named uvicorn" and other missing dependency errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dockerfiles/agents/Dockerfile | 2 +- dockerfiles/mcp/Dockerfile | 2 +- dockerfiles/server/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dockerfiles/agents/Dockerfile b/dockerfiles/agents/Dockerfile index 70ec448..a7fffb1 100644 --- a/dockerfiles/agents/Dockerfile +++ b/dockerfiles/agents/Dockerfile @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y \ # Copy and install requirements from local source COPY pyproject.toml uv.lock ./ -RUN pip install --no-cache-dir -e . +RUN pip install --no-cache-dir -e ".[agents]" # Copy application code COPY . . diff --git a/dockerfiles/mcp/Dockerfile b/dockerfiles/mcp/Dockerfile index 55736fe..3f70d09 100644 --- a/dockerfiles/mcp/Dockerfile +++ b/dockerfiles/mcp/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y \ # Install dependencies COPY pyproject.toml uv.lock ./ -RUN pip install --no-cache-dir -e . +RUN pip install --no-cache-dir -e ".[mcp]" # Create minimal directory structure RUN mkdir -p src/mcp_server/modules src/server/services src/server/config diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index 7aef82a..b1fc7dc 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y \ # Copy and install Python dependencies COPY pyproject.toml uv.lock ./ -RUN pip install --user --no-cache-dir -e . +RUN pip install --user --no-cache-dir -e ".[server]" # Runtime stage FROM python:3.12-slim From 7ba336530fbffe3332de3e4dfab3086a49edce7c Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Mon, 1 Sep 2025 07:27:06 -0400 Subject: [PATCH 22/24] Remove redundant playwright installation in server Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Playwright should already be included in the [server] dependency group from pyproject.toml, so the separate pip install is redundant. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dockerfiles/server/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index b1fc7dc..2ce3954 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -61,7 +61,6 @@ ENV PATH=/root/.local/bin:$PATH ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers ENV PYTHONPATH="/root/.local/lib/python3.12/site-packages" RUN mkdir -p /opt/playwright-browsers && \ - pip install playwright && \ python -m playwright install chromium && \ chmod -R 755 /opt/playwright-browsers From 1e4ad0eaa37badefdaae8bfbe168c567765da3f9 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Mon, 1 Sep 2025 07:31:02 -0400 Subject: [PATCH 23/24] Fix cross-service dependencies in Docker containers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Analysis of actual imports and copied files revealed that services import modules from each other: - MCP copies server service files, needs [server] dependencies - Agents may use server utilities, needs [server] dependencies - Server already had [server] group correctly Updated to install multiple dependency groups where needed: - MCP: [mcp,server] - Agents: [agents,server] - Server: [server] (unchanged) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- dockerfiles/agents/Dockerfile | 2 +- dockerfiles/mcp/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfiles/agents/Dockerfile b/dockerfiles/agents/Dockerfile index a7fffb1..18e17cd 100644 --- a/dockerfiles/agents/Dockerfile +++ b/dockerfiles/agents/Dockerfile @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y \ # Copy and install requirements from local source COPY pyproject.toml uv.lock ./ -RUN pip install --no-cache-dir -e ".[agents]" +RUN pip install --no-cache-dir -e ".[agents,server]" # Copy application code COPY . . diff --git a/dockerfiles/mcp/Dockerfile b/dockerfiles/mcp/Dockerfile index 3f70d09..5a9fba2 100644 --- a/dockerfiles/mcp/Dockerfile +++ b/dockerfiles/mcp/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y \ # Install dependencies COPY pyproject.toml uv.lock ./ -RUN pip install --no-cache-dir -e ".[mcp]" +RUN pip install --no-cache-dir -e ".[mcp,server]" # Create minimal directory structure RUN mkdir -p src/mcp_server/modules src/server/services src/server/config From efeededf8ad031290037d42df34df0c2872478d4 Mon Sep 17 00:00:00 2001 From: manageeverything <106550455+manageeverything@users.noreply.github.com> Date: Mon, 1 Sep 2025 09:33:28 -0400 Subject: [PATCH 24/24] Fix Docker build failures and improve documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR resolves multiple critical issues preventing successful Docker builds: ## Core Fixes - **Dependency Groups Syntax**: Update all Dockerfiles to use correct `--group server` syntax instead of deprecated `.[server]` extras syntax - **Pip Version**: Upgrade pip in all containers to support new dependency-groups feature (pip 25.1+) - **No-Cache Build**: Add `no-cache: true` to workflow to prevent Docker layer caching issues during debugging ## Container Updates - **Server**: Remove manual playwright installation (comes from crawl4ai dependency) - **MCP**: Fix dependency installation with correct syntax - **Agents**: Fix dependency installation with correct syntax - **All**: Add proper build versioning system for cache management ## Documentation Improvements - **README.md**: Add missing environment variables for MCP and Agents services - **Port Configuration**: Ensure consistent port mappings in examples ## Background The upstream Archon repo switched to using `[dependency-groups]` structure in pyproject.toml, but the Docker builds were still using the old optional-dependencies syntax `.[server]`. This caused builds to succeed but with missing critical dependencies like crawl4ai and playwright. The fix required: 1. Understanding the new dependency-groups specification (PEP 735) 2. Using the correct pip syntax: `pip install -e . --group server` 3. Upgrading pip to version 25.1+ to support the --group option 4. Adding no-cache flag to force rebuilds during debugging 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/build-images.yml | 1 + README.md | 11 +++++++++-- dockerfiles/agents/Dockerfile | 2 +- dockerfiles/mcp/Dockerfile | 2 +- dockerfiles/server/Dockerfile | 11 ++++++++--- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 1034c44..3f5eba4 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -107,6 +107,7 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + no-cache: true # Force rebuild to see actual dependency installation cache-from: type=gha,scope=build-${{ matrix.component.name }} cache-to: type=gha,mode=max,scope=build-${{ matrix.component.name }} platforms: linux/amd64 # AMD64 only for faster builds diff --git a/README.md b/README.md index f6c53df..dc51285 100644 --- a/README.md +++ b/README.md @@ -85,11 +85,18 @@ services: image: ghcr.io/yourusername/archon-mcp:latest ports: - "8051:8051" + environment: + - ARCHON_MCP_PORT=8051 + - ARCHON_SERVER_PORT=8181 + - ARCHON_AGENTS_PORT=8052 + - VITE_PORT=5173 archon-agents: image: ghcr.io/yourusername/archon-agents:latest ports: - "8052:8052" + environment: + - ARCHON_AGENTS_PORT=8052 archon-frontend: image: ghcr.io/yourusername/archon-frontend:latest @@ -104,10 +111,10 @@ services: docker run -p 8181:8181 ghcr.io/yourusername/archon-server:latest # Run MCP service -docker run -p 8051:8051 ghcr.io/yourusername/archon-mcp:latest +docker run -p 8051:8051 -e ARCHON_MCP_PORT=8051 -e ARCHON_SERVER_PORT=8181 -e ARCHON_AGENTS_PORT=8052 -e VITE_PORT=5173 ghcr.io/yourusername/archon-mcp:latest # Run agents service -docker run -p 8052:8052 ghcr.io/yourusername/archon-agents:latest +docker run -p 8052:8052 -e ARCHON_AGENTS_PORT=8052 ghcr.io/yourusername/archon-agents:latest # Run frontend - FIXED: Use consistent port mapping docker run -p 5173:5173 ghcr.io/yourusername/archon-frontend:latest diff --git a/dockerfiles/agents/Dockerfile b/dockerfiles/agents/Dockerfile index 18e17cd..b32332e 100644 --- a/dockerfiles/agents/Dockerfile +++ b/dockerfiles/agents/Dockerfile @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y \ # Copy and install requirements from local source COPY pyproject.toml uv.lock ./ -RUN pip install --no-cache-dir -e ".[agents,server]" +RUN pip install --upgrade pip && pip install --no-cache-dir -e . --group agents --group server # Copy application code COPY . . diff --git a/dockerfiles/mcp/Dockerfile b/dockerfiles/mcp/Dockerfile index 5a9fba2..12947b7 100644 --- a/dockerfiles/mcp/Dockerfile +++ b/dockerfiles/mcp/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update && apt-get install -y \ # Install dependencies COPY pyproject.toml uv.lock ./ -RUN pip install --no-cache-dir -e ".[mcp,server]" +RUN pip install --upgrade pip && pip install --no-cache-dir -e . --group mcp --group server # Create minimal directory structure RUN mkdir -p src/mcp_server/modules src/server/services src/server/config diff --git a/dockerfiles/server/Dockerfile b/dockerfiles/server/Dockerfile index 2ce3954..c6de0a8 100644 --- a/dockerfiles/server/Dockerfile +++ b/dockerfiles/server/Dockerfile @@ -12,11 +12,14 @@ RUN apt-get update && apt-get install -y \ # Copy and install Python dependencies COPY pyproject.toml uv.lock ./ -RUN pip install --user --no-cache-dir -e ".[server]" +RUN pip install --upgrade pip && pip install --user --no-cache-dir -e . --group server # Runtime stage FROM python:3.12-slim +# Re-declare ARG for runtime stage +ARG BUILD_VERSION="2025-09-01T13:00:00Z-remove-manual-playwright" + WORKDIR /app # Set proper environment defaults for Kubernetes @@ -56,11 +59,13 @@ RUN apt-get update && apt-get install -y \ # Copy Python packages from builder COPY --from=builder /root/.local /root/.local -# Ensure playwright is available and install browsers +# Ensure playwright browsers are available ENV PATH=/root/.local/bin:$PATH ENV PLAYWRIGHT_BROWSERS_PATH=/opt/playwright-browsers ENV PYTHONPATH="/root/.local/lib/python3.12/site-packages" -RUN mkdir -p /opt/playwright-browsers && \ +# Install playwright browsers (playwright itself comes from crawl4ai dependency) +RUN echo "=== BUILD VERSION: ${BUILD_VERSION} ===" && \ + mkdir -p /opt/playwright-browsers && \ python -m playwright install chromium && \ chmod -R 755 /opt/playwright-browsers