forked from Dan4ick/Lidar_Muxa
- flyguard/device.py: автоопределение NVIDIA GPU, сбор телеметрии и Graceful Fallback на CPU; - flyguard/lamina.py: ускорение 2D DoG фильтрации на тензорах PyTorch CUDA (0.25 мс вместо 8 мс); - flyguard/mbon_readout.py: векторизованный GPU-цикл обучения MBON без CPU-синхронизаций (поддержка 50k-100k клеток Кеньона); - flyguard/mushroom_body.py, flyguard/track_readout.py: аппаратное ускорение и опция GPU-бустинга; - flyguard/pipeline.py, tools/*.py: сквозная поддержка параметра device='auto' для всех инструментов; - Dockerfile.gpu, requirements-gpu.txt, docker-compose.yml: MLOps-инфраструктура под NVIDIA RTX 4070 Ti Super 16GB; - tests/test_pipeline.py: добавлены юнит-тесты на GPU device detection и роутинг ламины (40 тестов PASS).
58 lines
2 KiB
Text
58 lines
2 KiB
Text
# ============================================================================
|
|
# FlyGuard GPU: NVIDIA RTX / CUDA 12 Production Image (Кейс 05, ЛЦТ-2026)
|
|
# Архитектура: Ada Lovelace (RTX 4070 Ti Super 16GB) / Ampere / Turing
|
|
# ============================================================================
|
|
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04 AS base
|
|
|
|
# System configuration & environment
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONPATH="/app:/app/tools" \
|
|
FLYGUARD_DATA="/data" \
|
|
NVIDIA_VISIBLE_DEVICES=all \
|
|
NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
|
|
|
# Install Python 3.11, pip, and system dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
software-properties-common \
|
|
ca-certificates \
|
|
libgomp1 \
|
|
&& add-apt-repository -y ppa:deadsnakes/ppa \
|
|
&& apt-get update && apt-get install -y --no-install-recommends \
|
|
python3.11 \
|
|
python3.11-distutils \
|
|
curl \
|
|
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 \
|
|
&& ln -sf /usr/bin/python3.11 /usr/bin/python3 \
|
|
&& ln -sf /usr/bin/python3.11 /usr/bin/python \
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Create non-root user and directories
|
|
RUN useradd -m -u 1000 -s /bin/bash flyguard && \
|
|
mkdir -p /app /data /app/artifacts && \
|
|
chown -R flyguard:flyguard /app /data
|
|
|
|
WORKDIR /app
|
|
|
|
# Cache layer: copy only requirements first
|
|
COPY --chown=flyguard:flyguard requirements-gpu.txt /app/
|
|
|
|
# Install python dependencies with PyTorch CUDA 12
|
|
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
|
pip install --no-cache-dir -r requirements-gpu.txt
|
|
|
|
# Copy application source code
|
|
COPY --chown=flyguard:flyguard . /app/
|
|
|
|
RUN chmod +x /app/docker-entrypoint.sh
|
|
|
|
USER flyguard
|
|
|
|
VOLUME ["/data", "/app/artifacts"]
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD python3 -c "import flyguard, torch; print('healthy', torch.cuda.is_available())" || exit 1
|
|
|
|
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
|
CMD ["test"]
|