From aa754d6f32a184d542aee5b250b44b1e322f52db Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Sat, 28 Feb 2026 18:11:15 +0100 Subject: [PATCH] infra: delete 5 obsolete Dockerfiles replaced by S3 binary share Co-Authored-By: Claude Opus 4.6 --- infra/docker/Dockerfile.runtime | 31 ------ infra/docker/Dockerfile.service | 101 -------------------- infra/docker/Dockerfile.training | 53 ---------- infra/docker/Dockerfile.web-gateway | 76 --------------- infra/docker/Dockerfile.web-gateway-runtime | 45 --------- 5 files changed, 306 deletions(-) delete mode 100644 infra/docker/Dockerfile.runtime delete mode 100644 infra/docker/Dockerfile.service delete mode 100644 infra/docker/Dockerfile.training delete mode 100644 infra/docker/Dockerfile.web-gateway delete mode 100644 infra/docker/Dockerfile.web-gateway-runtime diff --git a/infra/docker/Dockerfile.runtime b/infra/docker/Dockerfile.runtime deleted file mode 100644 index ff150924c..000000000 --- a/infra/docker/Dockerfile.runtime +++ /dev/null @@ -1,31 +0,0 @@ -# Minimal runtime image for pre-built Rust service binaries -# Binaries are compiled in CI (with PVC sccache) and passed via build context -# Usage: docker build --build-arg SERVICE=trading_service -f Dockerfile.runtime . - -FROM debian:bookworm-slim - -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - libssl3 \ - curl \ - && rm -rf /var/lib/apt/lists/* - -# Install grpc_health_probe for Kubernetes health checks -RUN curl -fsSL https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.25/grpc_health_probe-linux-amd64 \ - -o /usr/local/bin/grpc_health_probe \ - && chmod +x /usr/local/bin/grpc_health_probe - -RUN groupadd -g 1000 foxhunt \ - && useradd -u 1000 -g foxhunt -m -s /bin/false foxhunt - -ARG SERVICE -ENV SERVICE=${SERVICE} - -WORKDIR /app - -COPY ${SERVICE} ./${SERVICE} -RUN chmod +x ./${SERVICE} - -USER foxhunt - -ENTRYPOINT ["/bin/sh", "-c", "exec /app/${SERVICE}"] diff --git a/infra/docker/Dockerfile.service b/infra/docker/Dockerfile.service deleted file mode 100644 index 418994cfa..000000000 --- a/infra/docker/Dockerfile.service +++ /dev/null @@ -1,101 +0,0 @@ -# Unified multi-stage Rust service builder -# Usage: docker build --build-arg SERVICE=trading_service -f infra/docker/Dockerfile.service . -# -# Optional sccache: pass SCCACHE_BUCKET + credentials to enable S3-backed build cache - -# ============================================================================= -# Stage 1: Builder -# ============================================================================= -FROM rust:1.89-slim-bookworm AS builder - -ARG SERVICE -ARG SCCACHE_BUCKET="" -ARG AWS_ACCESS_KEY_ID="" -ARG AWS_SECRET_ACCESS_KEY="" -ARG AWS_DEFAULT_REGION="fr-par" -ARG SCCACHE_ENDPOINT="" - -RUN test -n "${SERVICE}" || (echo "ERROR: SERVICE build-arg is required" && exit 1) - -RUN apt-get update && apt-get install -y --no-install-recommends \ - pkg-config \ - libssl-dev \ - protobuf-compiler \ - perl \ - make \ - curl \ - git \ - && rm -rf /var/lib/apt/lists/* - -# Conditionally install sccache when a bucket is configured -RUN if [ -n "${SCCACHE_BUCKET}" ]; then \ - curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.8.1/sccache-v0.8.1-x86_64-unknown-linux-musl.tar.gz \ - | tar xz --strip-components=1 -C /usr/local/bin sccache-v0.8.1-x86_64-unknown-linux-musl/sccache \ - && chmod +x /usr/local/bin/sccache; \ - fi - -# Set sccache env vars conditionally -ENV RUSTC_WRAPPER=${SCCACHE_BUCKET:+/usr/local/bin/sccache} -ENV SCCACHE_BUCKET=${SCCACHE_BUCKET} -ENV SCCACHE_S3_USE_SSL=true -ENV SCCACHE_ENDPOINT=${SCCACHE_ENDPOINT} -ENV AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} -ENV AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} -ENV AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION} -ENV AWS_REGION=${AWS_DEFAULT_REGION} -ENV SCCACHE_REGION=${AWS_DEFAULT_REGION} - -WORKDIR /build - -# Copy workspace manifests first for layer caching -COPY Cargo.toml Cargo.lock ./ -COPY .sqlx ./.sqlx - -# Copy workspace directories (post-restructure layout) -COPY crates ./crates -COPY bin ./bin -COPY services ./services -COPY testing ./testing - -ENV SQLX_OFFLINE=true - -RUN cargo build --release -p ${SERVICE} \ - && mkdir -p /build/out \ - && cp target/release/${SERVICE} /build/out/ \ - && strip /build/out/${SERVICE} - -# Show sccache stats if enabled -RUN if [ -n "${SCCACHE_BUCKET}" ] && command -v sccache >/dev/null 2>&1; then \ - sccache --show-stats; \ - fi - -# ============================================================================= -# Stage 2: Runtime -# ============================================================================= -FROM debian:bookworm-slim AS runtime - -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - libssl3 \ - curl \ - && rm -rf /var/lib/apt/lists/* - -# Install grpc_health_probe for Kubernetes health checks -RUN curl -fsSL https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.25/grpc_health_probe-linux-amd64 \ - -o /usr/local/bin/grpc_health_probe \ - && chmod +x /usr/local/bin/grpc_health_probe - -RUN groupadd -g 1000 foxhunt \ - && useradd -u 1000 -g foxhunt -m -s /bin/false foxhunt - -ARG SERVICE -ENV SERVICE=${SERVICE} - -WORKDIR /app - -COPY --from=builder /build/out/${SERVICE} ./${SERVICE} -RUN chmod +x ./${SERVICE} - -USER foxhunt - -ENTRYPOINT ["/bin/sh", "-c", "exec /app/${SERVICE}"] diff --git a/infra/docker/Dockerfile.training b/infra/docker/Dockerfile.training deleted file mode 100644 index ef825be25..000000000 --- a/infra/docker/Dockerfile.training +++ /dev/null @@ -1,53 +0,0 @@ -# Unified training runtime image — all 10 models (RL + supervised) with CUDA GPU pipeline -# Binaries are compiled in CI compile-training job with --features ml/cuda -# cuDNN required: candle CUDA backend links against libcudnn for kernel ops -# NVRTC required: GPU experience collection kernels are JIT-compiled at runtime -# Usage: kaniko --context dir://build-out/training --dockerfile Dockerfile.training -# Run: docker run --gpus all training train_baseline_rl --model dqn [args...] - -FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 - -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - libssl3 \ - curl \ - unzip \ - cuda-nvrtc-12-4 \ - && curl -fsSL https://downloads.rclone.org/v1.69.1/rclone-v1.69.1-linux-amd64.zip -o /tmp/rclone.zip \ - && unzip -j /tmp/rclone.zip '*/rclone' -d /usr/local/bin/ \ - && chmod +x /usr/local/bin/rclone \ - && rm /tmp/rclone.zip \ - && apt-get purge -y unzip \ - && rm -rf /var/lib/apt/lists/* - -RUN groupadd -g 1000 foxhunt \ - && useradd -u 1000 -g foxhunt -m -s /bin/false foxhunt - -COPY train_baseline_rl \ - train_baseline_supervised \ - evaluate_baseline \ - evaluate_supervised \ - hyperopt_baseline_rl \ - hyperopt_baseline_supervised \ - training_uploader \ - /usr/local/bin/ - -RUN chmod +x /usr/local/bin/train_baseline_rl \ - /usr/local/bin/train_baseline_supervised \ - /usr/local/bin/evaluate_baseline \ - /usr/local/bin/evaluate_supervised \ - /usr/local/bin/hyperopt_baseline_rl \ - /usr/local/bin/hyperopt_baseline_supervised \ - /usr/local/bin/training_uploader - -# CUDA runtime environment -ENV NVIDIA_VISIBLE_DEVICES=all -ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility - -USER foxhunt - -WORKDIR /data - -CMD ["echo", "Specify training command via K8s Job args"] diff --git a/infra/docker/Dockerfile.web-gateway b/infra/docker/Dockerfile.web-gateway deleted file mode 100644 index 63b7209c0..000000000 --- a/infra/docker/Dockerfile.web-gateway +++ /dev/null @@ -1,76 +0,0 @@ -# Multi-stage build: Node (dashboard) + Rust (web-gateway) + slim runtime -# Usage: docker build -f infra/docker/Dockerfile.web-gateway . - -# ============================================================================= -# Stage 1: Build web-dashboard static assets -# ============================================================================= -FROM node:22-slim AS dashboard - -WORKDIR /dashboard - -COPY web-dashboard/package.json web-dashboard/package-lock.json ./ -RUN npm ci - -COPY web-dashboard/ ./ -RUN npm run build - -# ============================================================================= -# Stage 2: Build web-gateway Rust binary -# ============================================================================= -FROM rust:1.89-slim-bookworm AS builder - -RUN apt-get update && apt-get install -y --no-install-recommends \ - pkg-config \ - libssl-dev \ - protobuf-compiler \ - perl \ - make \ - curl \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /build - -# Copy workspace manifests first for layer caching -COPY Cargo.toml Cargo.lock ./ -COPY .sqlx ./.sqlx - -# Copy workspace directories (post-restructure layout) -COPY crates ./crates -COPY bin ./bin -COPY services ./services -COPY testing ./testing - -ENV SQLX_OFFLINE=true - -RUN cargo build --release -p web-gateway \ - && strip target/release/web-gateway - -# ============================================================================= -# Stage 3: Runtime -# ============================================================================= -FROM debian:bookworm-slim - -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - libssl3 \ - curl \ - && rm -rf /var/lib/apt/lists/* - -RUN groupadd -g 1000 foxhunt \ - && useradd -u 1000 -g foxhunt -m -s /bin/false foxhunt - -WORKDIR /app - -COPY --from=builder /build/target/release/web-gateway ./web-gateway -COPY --from=dashboard /dashboard/dist/ ./static/ - -RUN chmod +x ./web-gateway - -EXPOSE 3000 - -USER foxhunt - -HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ - CMD curl -f http://localhost:3000/health || exit 1 - -ENTRYPOINT ["./web-gateway"] diff --git a/infra/docker/Dockerfile.web-gateway-runtime b/infra/docker/Dockerfile.web-gateway-runtime deleted file mode 100644 index a948c5f4a..000000000 --- a/infra/docker/Dockerfile.web-gateway-runtime +++ /dev/null @@ -1,45 +0,0 @@ -# Web-gateway runtime: Node dashboard build + pre-built Rust binary -# The Rust binary is compiled in CI (with PVC sccache) and passed via build context -# Usage: docker build -f Dockerfile.web-gateway-runtime . - -# ============================================================================= -# Stage 1: Build web-dashboard static assets -# ============================================================================= -FROM node:22-slim AS dashboard - -WORKDIR /dashboard - -COPY web-dashboard/package.json web-dashboard/package-lock.json ./ -RUN npm ci - -COPY web-dashboard/ ./ -RUN npm run build - -# ============================================================================= -# Stage 2: Runtime (pre-built binary + dashboard assets) -# ============================================================================= -FROM debian:bookworm-slim - -RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates \ - libssl3 \ - curl \ - && rm -rf /var/lib/apt/lists/* - -RUN groupadd -g 1000 foxhunt \ - && useradd -u 1000 -g foxhunt -m -s /bin/false foxhunt - -WORKDIR /app - -COPY --from=dashboard /dashboard/dist/ ./static/ -COPY build-out/services/web-gateway ./web-gateway -RUN chmod +x ./web-gateway - -EXPOSE 3000 - -USER foxhunt - -HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ - CMD curl -f http://localhost:3000/health || exit 1 - -ENTRYPOINT ["./web-gateway"]