Skip to content

Commit f53de82

Browse files
Merge pull request #10 from rwilliamspbg-ops/feat/comprehensive-testing-linux-optimization
Feat/comprehensive testing linux optimization
2 parents ebb97b2 + 88795ee commit f53de82

11 files changed

Lines changed: 2870 additions & 143 deletions

Dockerfile

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,61 @@
11
# Mohawk Inference Engine GUI - Production Docker Image
2-
# Version: 2.1.0
2+
# Version: 2.1.0 - Linux/ARM64 Optimized
33

44
FROM python:3.12-bookworm
55

66
# Set environment variables
7-
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1 PIP_DISABLE_PIP_VERSION_CHECK=1
7+
ENV PYTHONDONTWRITEBYTECODE=1 \
8+
PYTHONUNBUFFERED=1 \
9+
PIP_NO_CACHE_DIR=1 \
10+
PIP_DISABLE_PIP_VERSION_CHECK=1 \
11+
DEBIAN_FRONTEND=noninteractive
812

913
# Set working directory
1014
WORKDIR /app
1115

12-
# Install system dependencies (bookworm includes Mesa libraries natively)
13-
RUN apt-get update && apt-get install -y gcc git libgl1 libegl1 libxkbcommon-x11-0 libdbus-1-3 && rm -rf /var/lib/apt/lists/*
16+
# Install system dependencies (Debian Bookworm compatible)
17+
# Includes build tools for ARM64 and service discovery support
18+
RUN apt-get update && apt-get install -y --no-install-recommends \
19+
build-essential \
20+
gcc \
21+
git \
22+
curl \
23+
pkg-config \
24+
libffi-dev \
25+
libssl-dev \
26+
libgl1 \
27+
libegl1 \
28+
libxkbcommon-x11-0 \
29+
libdbus-1-3 \
30+
avahi-daemon \
31+
&& rm -rf /var/lib/apt/lists/*
1432

1533
# Copy requirements first for better caching
1634
COPY requirements.txt .
17-
RUN pip install --no-cache-dir -r requirements.txt
18-
RUN pip install --no-cache-dir "fastapi>=0.104.0" "uvicorn>=0.24.0" "requests>=2.31.0"
35+
36+
# Install Python dependencies
37+
# Use --no-build-isolation for compatibility with ARM64
38+
RUN pip install --upgrade pip setuptools wheel && \
39+
pip install --no-cache-dir -r requirements.txt && \
40+
pip install --no-cache-dir \
41+
"fastapi>=0.104.0" \
42+
"uvicorn>=0.24.0" \
43+
"requests>=2.31.0"
1944

2045
# Copy application code
2146
COPY mohawk_gui/ ./mohawk_gui/
2247
COPY prototype/ ./prototype/
2348

2449
# Create non-root user for security
25-
RUN groupadd mohawk && useradd -r -g mohawk mohawk
26-
USER mohawk
50+
RUN groupadd mohawk && useradd -r -g mohawk mohawk && \
51+
chown -R mohawk:mohawk /app
2752

2853
# Expose ports
2954
EXPOSE 8003 8443
3055

31-
# Health check
32-
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import sys; sys.exit(0 if __import__('mohawk_gui').main else 1)" || exit 1
56+
# Health check with timeout and retries
57+
HEALTHCHECK --interval=10s --timeout=5s --start-period=5s --retries=3 \
58+
CMD curl -f http://localhost:8003/health || exit 1
3359

34-
# Default command
35-
CMD ["python", "mohawk_gui/main.py"]
60+
# Default command - run GUI backend with service discovery
61+
CMD ["python", "-m", "uvicorn", "prototype.gui_backend:app", "--host", "0.0.0.0", "--port", "8003"]

Dockerfile.worker

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Mohawk Inference Engine Worker - Production Docker Image
2-
# Version: 2.1.0
3-
# Cross-platform: Windows, Linux, macOS
2+
# Version: 2.1.0 - Linux/ARM64 Optimized
43

54
FROM python:3.12-bookworm
65

@@ -14,21 +13,29 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
1413
# Set working directory
1514
WORKDIR /app
1615

17-
# Install system dependencies (bookworm includes Mesa libraries natively)
16+
# Install system dependencies
17+
# Build tools for ARM64, service discovery, and GPU support
1818
RUN apt-get update && apt-get install -y --no-install-recommends \
19+
build-essential \
20+
gcc \
21+
git \
22+
curl \
23+
pkg-config \
24+
libffi-dev \
25+
libssl-dev \
1926
libgl1 \
2027
libegl1 \
2128
libxkbcommon-x11-0 \
2229
libdbus-1-3 \
2330
libegl1-mesa \
24-
gcc \
25-
git \
31+
avahi-daemon \
2632
&& rm -rf /var/lib/apt/lists/*
2733

2834
# Install Python dependencies
2935
COPY requirements.txt .
30-
RUN pip install --no-cache-dir -r requirements.txt
31-
RUN pip install --no-cache-dir "onnxruntime>=1.16.0"
36+
RUN pip install --upgrade pip setuptools wheel && \
37+
pip install --no-cache-dir -r requirements.txt && \
38+
pip install --no-cache-dir "onnxruntime>=1.16.0" || echo "ONNX Runtime optional"
3239

3340
# Copy application code
3441
COPY mohawk_gui/ ./mohawk_gui/
@@ -48,9 +55,9 @@ USER mohawk
4855
# Expose ports
4956
EXPOSE 8003
5057

51-
# Health check
58+
# Health check with timeout and retries
5259
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
53-
CMD python -c "import sys; print('OK'); sys.exit(0)" || exit 1
60+
CMD curl -f http://localhost:8003/health || exit 1
5461

55-
# Default command - can be overridden at runtime
56-
CMD ["python", "prototype/worker_secure.py", "--port", "8003"]
62+
# Default command - run worker with service discovery
63+
CMD ["python", "-m", "uvicorn", "prototype.worker_secure:app", "--host", "0.0.0.0", "--port", "8003"]

0 commit comments

Comments
 (0)