# RESOURCE RECOMMENDATIONS: # - Minimum 2GB memory limit for compilation # - Minimum 1 CPU core for compilation # # Use in Kubernetes with resource limits: # resources: # requests: # memory: "2Gi" # cpu: "1000m" # limits: # memory: "4Gi" # cpu: "2000m" FROM rust:1.97-slim-trixie # pipefail for the piped build command below (hadolint DL4006). SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Install build and runtime dependencies. Upgrade existing OS packages first so # we pick up the latest Debian security fixes regardless of the base layer's age. RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \ build-essential \ pkg-config \ libpq-dev \ libssl-dev \ libpng-dev \ libjpeg-dev \ libfontconfig1-dev \ ca-certificates \ curl \ postgresql-client \ libpq5 \ util-linux \ && rm -rf /var/lib/apt/lists/* # Create app user RUN useradd --create-home --shell /bin/bash app # Symbolization: Antithesis reads debug info from /symbols. The build step below symlinks the # (unstripped) binary in, so make it app-owned. RUN mkdir -p /symbols && chown app:app /symbols # Set working directory WORKDIR /home/app # Copy the entire paradedb/paradedb source code COPY --chown=app:app . . # Import Antithesis test drivers COPY stressgres/suites/antithesis/ /opt/antithesis/test/v1/paradedb/ # Switch to app user USER app # Set environment variables ENV RUST_LOG=info ENV PGCLIENTENCODING=UTF8 # Prefetch while online; the image runs air-gapped in Antithesis. Sancov flags are scoped to the # host triple (resolved here, not hardcoded, so it also builds on arm64 CI) via # CARGO_TARGET__RUSTFLAGS + --target, keeping them off host build scripts. Coverage shim # comes from `--features dst`; its build script needs curl + a C toolchain. # See https://antithesis.com/docs/reference/sdk/rust/instrumentation RUN cargo fetch --manifest-path /home/app/Cargo.toml && \ TARGET="$(rustc -vV | sed -n 's/^host: //p')" && \ env "CARGO_TARGET_$(echo "$TARGET" | tr 'a-z-' 'A-Z_')_RUSTFLAGS=-Ccodegen-units=1 -Cpasses=sancov-module -Cllvm-args=-sanitizer-coverage-level=3 -Cllvm-args=-sanitizer-coverage-trace-pc-guard -Clink-args=-Wl,--build-id" \ cargo build --offline --profile dst --target "$TARGET" \ --manifest-path /home/app/Cargo.toml -p stressgres --features dst && \ ln -sf "/home/app/target/$TARGET/dst/stressgres" /symbols/stressgres CMD ["sleep", "infinity"]