Skip to content

Commit 1ffc9ef

Browse files
author
Sovereign Map Test Suite
committed
uploaded GUI
1 parent e86cbda commit 1ffc9ef

35 files changed

Lines changed: 9829 additions & 180 deletions

DEPLOYMENT_GUIDE.md

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

Dockerfile

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Mohawk Inference Engine GUI - Production Docker Image
2+
# Version: 2.1.0
3+
# Cross-platform: Windows, Linux, macOS
4+
5+
FROM python:3.11-slim-bookworm
6+
7+
# Set environment variables for production
8+
ENV PYTHONDONTWRITEBYTECODE=1 \
9+
PYTHONUNBUFFERED=1 \
10+
PIP_NO_CACHE_DIR=1 \
11+
PIP_DISABLE_PIP_VERSION_CHECK=1 \
12+
DEBIAN_FRONTEND=noninteractive
13+
14+
# Set working directory
15+
WORKDIR /app
16+
17+
# Install system dependencies
18+
RUN apt-get update && apt-get install -y --no-install-recommends \
19+
# System libraries for PyQt6
20+
libgl1-mesa-glx \
21+
libxkbcommon-x11-0 \
22+
libdbus-1-3 \
23+
libegl1-mesa \
24+
# Build tools
25+
gcc \
26+
git \
27+
&& rm -rf /var/lib/apt/lists/*
28+
29+
# Install Python dependencies
30+
COPY requirements.txt .
31+
RUN pip install --no-cache-dir -r requirements.txt
32+
33+
# Copy application code
34+
COPY mohawk_gui/ ./mohawk_gui/
35+
36+
# Create non-root user for security (production best practice)
37+
RUN groupadd mohawk && \
38+
useradd -r -g mohawk mohawk && \
39+
chown -R mohawk:mohawk /app
40+
USER mohawk
41+
42+
# Create directories for runtime data
43+
RUN mkdir -p /app/certs /app/logs /app/models && \
44+
chown -R mohawk:mohawk /app/certs /app/logs /app/models
45+
46+
# Copy configuration template
47+
COPY mohawk_gui/config.toml ./config.toml
48+
49+
# Expose ports
50+
EXPOSE 8003 8443
51+
52+
# Health check
53+
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
54+
CMD python -c "import sys; sys.exit(0)" || exit 1
55+
56+
# Default command - can be overridden at runtime
57+
CMD ["python", "mohawk_gui/main.py", "--host", "0.0.0.0", "--port", "8003"]
58+
59+
# =============================================================================
60+
# Multi-stage build for smaller image (optional)
61+
# =============================================================================
62+
# FROM debian:bookworm-slim AS base
63+
# RUN apt-get update && apt-get install -y \
64+
# python3.11 \
65+
# python3-pip \
66+
# libgl1-mesa-glx \
67+
# libxkbcommon-x11-0 \
68+
# libdbus-1-3 \
69+
# && rm -rf /var/lib/apt/lists/*
70+
#
71+
# WORKDIR /app
72+
# COPY --from=python:3.11-slim-bookworm /usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages/

Dockerfile.worker

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,60 @@
1-
# Dockerfile for Mohawk Worker
2-
FROM python:3.12-slim AS builder
1+
# Mohawk Inference Engine Worker - Production Docker Image
2+
# Version: 2.1.0
3+
# Cross-platform: Windows, Linux, macOS
34

4-
# Install system dependencies for liboqs
5-
RUN apt-get update && apt-get install -y \
6-
build-essential \
7-
cmake \
8-
libssl-dev \
9-
pkg-config \
10-
&& curl -sS https://liboqs.org/install.sh | bash \
11-
&& ldconfig /usr/local/lib
5+
FROM python:3.11-slim-bookworm
126

13-
# Create non-root user for security
14-
RUN useradd -u 1000 -g 1000 appuser
7+
# Set environment variables for production
8+
ENV PYTHONDONTWRITEBYTECODE=1 \
9+
PYTHONUNBUFFERED=1 \
10+
PIP_NO_CACHE_DIR=1 \
11+
PIP_DISABLE_PIP_VERSION_CHECK=1 \
12+
DEBIAN_FRONTEND=noninteractive
1513

14+
# Set working directory
1615
WORKDIR /app
1716

18-
# Copy requirements and install Python dependencies
17+
# Install system dependencies
18+
RUN apt-get update && apt-get install -y --no-install-recommends \
19+
# System libraries for PyQt6 (if needed)
20+
libgl1-mesa-glx \
21+
libxkbcommon-x11-0 \
22+
libdbus-1-3 \
23+
libegl1-mesa \
24+
# Build tools
25+
gcc \
26+
git \
27+
# ONNX runtime for model inference
28+
onnxruntime>=1.16.0 \
29+
&& rm -rf /var/lib/apt/lists/*
30+
31+
# Install Python dependencies
1932
COPY requirements.txt .
2033
RUN pip install --no-cache-dir -r requirements.txt
2134

2235
# Copy application code
36+
COPY mohawk_gui/ ./mohawk_gui/
2337
COPY prototype/ ./prototype/
2438

25-
# Set ownership for non-root user
26-
RUN chown -R appuser:appuser /app
39+
# Create non-root user for security (production best practice)
40+
RUN groupadd mohawk && \
41+
useradd -r -g mohawk mohawk && \
42+
chown -R mohawk:mohawk /app
43+
USER mohawk
2744

28-
USER appuser
45+
# Create directories for runtime data
46+
RUN mkdir -p /app/certs /app/logs /app/models && \
47+
chown -R mohawk:mohawk /app/certs /app/logs /app/models
2948

30-
# Expose worker port
49+
# Copy configuration template
50+
COPY mohawk_gui/config.toml ./config.toml
51+
52+
# Expose ports
3153
EXPOSE 8003
3254

3355
# Health check
34-
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
35-
CMD curl -f http://localhost:8003/metrics || exit 1
56+
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
57+
CMD python -c "import sys; print('OK'); sys.exit(0)" || exit 1
3658

37-
# Run worker
59+
# Default command - can be overridden at runtime
3860
CMD ["python", "prototype/worker_secure.py", "--port", "8003"]

0 commit comments

Comments
 (0)