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
2 changes: 1 addition & 1 deletion .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
env:
REGISTRY: ghcr.io
UPSTREAM_REPO: coleam00/Archon

jobs:
build-images:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ on:
default: false
type: boolean

env:
env:
UPSTREAM_REPO: coleam00/Archon

jobs:
check-for-updates:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/agents/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 . .
Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/mcp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# MCP Service - Lightweight HTTP-based microservice
FROM python:3.11-slim
FROM python:3.12-slim

WORKDIR /app

Expand All @@ -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
Expand Down
16 changes: 9 additions & 7 deletions dockerfiles/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -11,11 +11,11 @@ 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 python:3.12-slim

WORKDIR /app

Expand Down Expand Up @@ -56,11 +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)
Expand All @@ -82,7 +84,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}

Expand Down
10 changes: 4 additions & 6 deletions tests/docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
20 changes: 11 additions & 9 deletions tests/test-containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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"
Expand All @@ -65,15 +67,15 @@ 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)..."
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() {
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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