Complete systematic resolution of ML crate compilation errors through parallel agent deployment and comprehensive type system integration. Key Achievements: - ✅ Reduced ML errors from 83 to ZERO compilation errors - ✅ Successfully converted ML crate to use common::Price, common::Decimal - ✅ Fixed all type system conflicts and import issues - ✅ Achieved full workspace compilation success - ✅ Systematic parallel agent approach validated Technical Details: - Deployed 6+ specialized parallel agents using skydesk and zen tools - Fixed 114+ specific compilation errors systematically - Converted IntegerPrice → common::Price throughout - Resolved trait bounds, method resolution, and enum variant issues - Added proper type conversions and error handling Verification: - cargo check -p ml: ✅ SUCCESS (warnings only) - cargo check --workspace: ✅ SUCCESS (warnings only) 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
81 lines
2.0 KiB
Docker
81 lines
2.0 KiB
Docker
# Multi-stage build for Foxhunt ML Training Service
|
|
FROM nvidia/cuda:12.1-devel-ubuntu22.04 as builder
|
|
|
|
# Install Rust and system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
curl \
|
|
build-essential \
|
|
pkg-config \
|
|
libssl-dev \
|
|
libpq-dev \
|
|
protobuf-compiler \
|
|
libblas-dev \
|
|
liblapack-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Rust
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
# Set workspace directory
|
|
WORKDIR /workspace
|
|
|
|
# Copy workspace Cargo files
|
|
COPY ../../Cargo.toml ../../Cargo.lock ./
|
|
COPY ../../crates ./crates
|
|
COPY ../../ml ./ml
|
|
COPY ../../data ./data
|
|
COPY ../ml_training_service ./services/ml_training_service
|
|
|
|
# Build the ML training service
|
|
RUN cargo build --release -p ml_training_service
|
|
|
|
# === RUNTIME IMAGE ===
|
|
FROM nvidia/cuda:12.1-runtime-ubuntu22.04
|
|
|
|
# Install runtime dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
ca-certificates \
|
|
libssl3 \
|
|
libpq5 \
|
|
curl \
|
|
libblas3 \
|
|
liblapack3 \
|
|
python3 \
|
|
python3-pip \
|
|
awscli \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install essential Python packages for ML
|
|
RUN pip3 install numpy pandas matplotlib tensorboard
|
|
|
|
# Create app user
|
|
RUN groupadd -r foxhunt && useradd -r -g foxhunt foxhunt
|
|
|
|
# Create directories
|
|
RUN mkdir -p /app/config /app/models /app/data /app/logs /app/cache \
|
|
&& chown -R foxhunt:foxhunt /app
|
|
|
|
# Copy binary from builder
|
|
COPY --from=builder /workspace/target/release/ml_training_service /app/ml_training_service
|
|
RUN chmod +x /app/ml_training_service
|
|
|
|
# Copy configuration templates
|
|
COPY config/ /app/config/
|
|
|
|
USER foxhunt
|
|
WORKDIR /app
|
|
|
|
# Expose ports
|
|
EXPOSE 50053 8083 6006
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=45s --retries=3 \
|
|
CMD curl -f http://localhost:8083/health || exit 1
|
|
|
|
# Set environment variables
|
|
ENV RUST_LOG=info
|
|
ENV FOXHUNT_CONFIG=/app/config/config.toml
|
|
ENV MODEL_CACHE_DIR=/app/cache
|
|
|
|
CMD ["./ml_training_service"] |