From 1037fd46c12b258b2f0d1cbd62c372edb271fde9 Mon Sep 17 00:00:00 2001 From: zz_y Date: Fri, 18 Sep 2026 20:40:20 +0000 Subject: [PATCH] build: use public locked dependencies in Docker images --- control_plane/Dockerfile | 23 ++++------------------- data_plane/Dockerfile | 22 ++++------------------ 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/control_plane/Dockerfile b/control_plane/Dockerfile index 3bf613466..0ca9f984f 100644 --- a/control_plane/Dockerfile +++ b/control_plane/Dockerfile @@ -1,19 +1,9 @@ # Builds the control_plane (controller) binary → asap/control-plane:dev. # -# Companion to data_plane/Dockerfile (same repo-ownership + build-context -# rationale — see that file's header). Splitting the controller into its own -# image (it used to ship inside the combined asap/query-backend:dev) is part of -# the 2026-05 reorg: each crate owns its image, named after the crate. +# Build from the backend checkout; Cargo fetches public Git dependencies +# at the revisions recorded in Cargo.lock. # -# Even though the controller doesn't compile asap-precompute-rs/asap-gorilla-rust -# directly, the workspace manifest must still resolve every member's path-deps -# (data_plane path-deps those siblings), so the same build-contexts are supplied. -# -# DOCKER_BUILDKIT=1 docker build -f control_plane/Dockerfile \ -# --build-context asap-precompute-rs=/path/ASAPCollector/asap-precompute-rs \ -# --build-context asap-sketchlib=/path/asap_sketchlib \ -# --build-context asap-gorilla-rust=/path/ASAPCollector/asap-gorilla-rust \ -# -t asap/control-plane:dev . +# docker build -f control_plane/Dockerfile -t asap/control-plane:dev . FROM rust:1.90-bookworm AS build WORKDIR /src @@ -24,14 +14,9 @@ RUN apt-get update && \ protobuf-compiler git ca-certificates && \ rm -rf /var/lib/apt/lists/* -# Same sibling-checkout layout as data_plane/Dockerfile so workspace path-deps -# resolve during the build. COPY . ASAPQuery-backend -COPY --from=asap-precompute-rs . ASAPCollector/asap-precompute-rs -COPY --from=asap-sketchlib . asap_sketchlib -COPY --from=asap-gorilla-rust . ASAPCollector/asap-gorilla-rust -RUN cd ASAPQuery-backend && cargo build --release --bin control_plane +RUN cd ASAPQuery-backend && cargo build --locked --release --bin control_plane # Runtime image: binary + CA certs. FROM debian:bookworm-slim diff --git a/data_plane/Dockerfile b/data_plane/Dockerfile index 7c5ea7b37..d1461b7e8 100644 --- a/data_plane/Dockerfile +++ b/data_plane/Dockerfile @@ -6,18 +6,10 @@ # old cross-repo combined builder (ASAPCollector deploy/docker/Dockerfile.backend) # is retired. # -# Cross-repo build-contexts: the data_plane crate path-deps `control_plane` -# (in-repo, copied with the repo) and, transitively through asap-precompute-rs, -# the sibling crates asap-precompute-rs / asap-gorilla-rust (in the ASAPCollector -# repo) and asap_sketchlib (separate repo). They are supplied as BuildKit -# build-contexts that recreate the canonical sibling layout under /src so the -# `../../ASAPCollector/...` / `../../asap_sketchlib` path-deps resolve. +# Build from the backend checkout; Cargo fetches public Git dependencies +# at the revisions recorded in Cargo.lock. # -# DOCKER_BUILDKIT=1 docker build -f data_plane/Dockerfile \ -# --build-context asap-precompute-rs=/path/ASAPCollector/asap-precompute-rs \ -# --build-context asap-sketchlib=/path/asap_sketchlib \ -# --build-context asap-gorilla-rust=/path/ASAPCollector/asap-gorilla-rust \ -# -t asap/data-plane:dev . +# docker build -f data_plane/Dockerfile -t asap/data-plane:dev . FROM rust:1.90-bookworm AS build WORKDIR /src @@ -27,15 +19,9 @@ RUN apt-get update && \ protobuf-compiler git ca-certificates && \ rm -rf /var/lib/apt/lists/* -# Recreate the sibling-checkout layout the path-deps expect: -# /src/ASAPQuery-backend, /src/ASAPCollector/asap-precompute-rs, -# /src/asap_sketchlib, /src/ASAPCollector/asap-gorilla-rust COPY . ASAPQuery-backend -COPY --from=asap-precompute-rs . ASAPCollector/asap-precompute-rs -COPY --from=asap-sketchlib . asap_sketchlib -COPY --from=asap-gorilla-rust . ASAPCollector/asap-gorilla-rust -RUN cd ASAPQuery-backend && cargo build --release --bin data_plane +RUN cd ASAPQuery-backend && cargo build --locked --release --bin data_plane # Runtime image: binary + CA certs. FROM debian:bookworm-slim