chore(docker): Update dockerfiles to use new circuit download script (#1900)

This commit is contained in:
gusto 2025-11-06 19:36:09 +02:00 committed by GitHub
parent d08101a132
commit 898abc5e6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 111 deletions

View File

@ -2,8 +2,7 @@
# check=skip=SecretsUsedInArgOrEnv
# Ignore warnings about sensitive information as this is test data.
ARG VERSION=v0.3.0
ARG PLATFORM=linux-x86_64
ARG VERSION=v0.2.0
# ===========================
# BUILD IMAGE
@ -12,7 +11,6 @@ ARG PLATFORM=linux-x86_64
FROM rust:1.91.0-slim-bookworm AS builder
ARG VERSION
ARG PLATFORM
LABEL maintainer="augustinas@status.im" \
source="https://github.com/logos-co/nomos-node" \
@ -25,8 +23,10 @@ COPY . .
RUN apt-get update && apt-get install -yq \
git gcc g++ clang libssl-dev pkg-config ca-certificates curl
RUN chmod +x testnet/scripts/download_circuit_binaries.sh && \
testnet/scripts/download_circuit_binaries.sh "$VERSION" "$PLATFORM"
RUN chmod +x scripts/setup-nomos-circuits.sh && \
scripts/setup-nomos-circuits.sh "$VERSION" "/opt/circuits"
ENV NOMOS_CIRCUITS=/opt/circuits
RUN cargo build --release -p nomos-node
@ -37,7 +37,6 @@ RUN cargo build --release -p nomos-node
FROM debian:bookworm-slim
ARG VERSION
ARG PLATFORM
LABEL maintainer="augustinas@status.im" \
source="https://github.com/logos-co/nomos-node" \
@ -49,21 +48,10 @@ RUN apt-get update && apt-get install -yq \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /nomos/zk/proofs /opt/nomos/proofs
COPY --from=builder /nomos/bin/circuits /opt/nomos/circuits
COPY --from=builder /opt/circuits /opt/circuits
COPY --from=builder /nomos/target/release/nomos-node /usr/local/bin/nomos-node
ENV NOMOS_POL_PROVING_KEY_PATH="/opt/nomos/proofs/pol/src/proving_key/pol.zkey" \
NOMOS_POC_PROVING_KEY_PATH="/opt/nomos/proofs/poc/src/proving_key/proof_of_claim.zkey" \
NOMOS_POQ_PROVING_KEY_PATH="/opt/nomos/proofs/poq/src/proving_key/poq.zkey" \
NOMOS_ZKSIGN_PROVING_KEY_PATH="/opt/nomos/proofs/zksign/src/proving_key/zksign.zkey"
ENV NOMOS_PROVER="/opt/nomos/circuits/${PLATFORM}/prover-${VERSION}-${PLATFORM}/prover/prover" \
NOMOS_VERIFIER="/opt/nomos/circuits/${PLATFORM}/verifier-${VERSION}-${PLATFORM}/verifier/verifier" \
NOMOS_POC="/opt/nomos/circuits/${PLATFORM}/poc-${VERSION}-${PLATFORM}/witness-generator/poc" \
NOMOS_POL="/opt/nomos/circuits/${PLATFORM}/pol-${VERSION}-${PLATFORM}/witness-generator/pol" \
NOMOS_POQ="/opt/nomos/circuits/${PLATFORM}/poq-${VERSION}-${PLATFORM}/witness-generator/poq" \
NOMOS_ZKSIGN="/opt/nomos/circuits/${PLATFORM}/zksign-${VERSION}-${PLATFORM}/witness-generator/zksign"
ENV NOMOS_CIRCUITS=/opt/circuits
EXPOSE 3000 8080 9000 60000

View File

@ -2,8 +2,7 @@
# check=skip=SecretsUsedInArgOrEnv
# Ignore warnings about sensitive information as this is test data.
ARG VERSION=v0.3.0
ARG PLATFORM=linux-x86_64
ARG VERSION=v0.2.0
# ===========================
# BUILD IMAGE
@ -12,7 +11,6 @@ ARG PLATFORM=linux-x86_64
FROM rust:1.91.0-slim-bookworm AS builder
ARG VERSION
ARG PLATFORM
LABEL maintainer="augustinas@status.im" \
source="https://github.com/logos-co/nomos-node" \
@ -25,8 +23,10 @@ COPY . .
RUN apt-get update && apt-get install -yq \
git gcc g++ clang libssl-dev pkg-config ca-certificates curl
RUN chmod +x testnet/scripts/download_circuit_binaries.sh && \
testnet/scripts/download_circuit_binaries.sh "$VERSION" "$PLATFORM"
RUN chmod +x scripts/setup-nomos-circuits.sh && \
scripts/setup-nomos-circuits.sh "$VERSION" "/opt/circuits"
ENV NOMOS_CIRCUITS=/opt/circuits
RUN cargo build --release --all-features
@ -37,7 +37,6 @@ RUN cargo build --release --all-features
FROM debian:bookworm-slim
ARG VERSION
ARG PLATFORM
LABEL maintainer="augustinas@status.im" \
source="https://github.com/logos-co/nomos-node" \
@ -49,8 +48,7 @@ RUN apt-get update && apt-get install -yq \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /nomos/zk/proofs /opt/nomos/proofs
COPY --from=builder /nomos/bin/circuits /opt/nomos/circuits
COPY --from=builder /opt/circuits /opt/circuits
COPY --from=builder /nomos/target/release/nomos-node /usr/bin/nomos-node
COPY --from=builder /nomos/target/release/nomos-executor /usr/bin/nomos-executor
@ -58,17 +56,7 @@ COPY --from=builder /nomos/target/release/nomos-cli /usr/bin/nomos-cli
COPY --from=builder /nomos/target/release/cfgsync-server /usr/bin/cfgsync-server
COPY --from=builder /nomos/target/release/cfgsync-client /usr/bin/cfgsync-client
ENV NOMOS_POL_PROVING_KEY_PATH="/opt/nomos/proofs/pol/src/proving_key/pol.zkey" \
NOMOS_POC_PROVING_KEY_PATH="/opt/nomos/proofs/poc/src/proving_key/proof_of_claim.zkey" \
NOMOS_POQ_PROVING_KEY_PATH="/opt/nomos/proofs/poq/src/proving_key/poq.zkey" \
NOMOS_ZKSIGN_PROVING_KEY_PATH="/opt/nomos/proofs/zksign/src/proving_key/zksign.zkey"
ENV NOMOS_PROVER="/opt/nomos/circuits/${PLATFORM}/prover-${VERSION}-${PLATFORM}/prover/prover" \
NOMOS_VERIFIER="/opt/nomos/circuits/${PLATFORM}/verifier-${VERSION}-${PLATFORM}/verifier/verifier" \
NOMOS_POC="/opt/nomos/circuits/${PLATFORM}/poc-${VERSION}-${PLATFORM}/witness-generator/poc" \
NOMOS_POL="/opt/nomos/circuits/${PLATFORM}/pol-${VERSION}-${PLATFORM}/witness-generator/pol" \
NOMOS_POQ="/opt/nomos/circuits/${PLATFORM}/poq-${VERSION}-${PLATFORM}/witness-generator/poq" \
NOMOS_ZKSIGN="/opt/nomos/circuits/${PLATFORM}/zksign-${VERSION}-${PLATFORM}/witness-generator/zksign"
ENV NOMOS_CIRCUITS=/opt/circuits
EXPOSE 3000 8080 9000 60000

View File

@ -1,37 +0,0 @@
#!/bin/bash
set -euo pipefail
REPO="logos-co/nomos-pocs"
BINARIES=("poc" "pol" "poq" "prover" "verifier" "zksign")
OUTPUT_DIR="bin/circuits"
if [ "$#" -ne 2 ]; then
echo "Error: Invalid number of arguments." >&2
echo "Usage: $0 <VERSION> <PLATFORM>" >&2
echo "Example: $0 v0.3.0 linux-x86_64" >&2
exit 1
fi
VERSION="$1"
PLATFORM="$2"
RELEASE_TAG="circom_circuits-${VERSION}"
PLATFORM_DIR="${OUTPUT_DIR}/${PLATFORM}"
mkdir -p "$PLATFORM_DIR"
echo "Downloading and extracting binaries."
for bin_name in "${BINARIES[@]}"; do
FILENAME="${bin_name}-${VERSION}-${PLATFORM}.tar.gz"
DOWNLOAD_URL="https://github.com/${REPO}/releases/download/${RELEASE_TAG}/${FILENAME}"
echo "Attempting to download ${FILENAME}."
if ! curl -sL "$DOWNLOAD_URL" | tar -xz -C "$PLATFORM_DIR"; then
echo "Warning: Could not download ${FILENAME}. Skipping." >&2
fi
done
chmod +x "$OUTPUT_DIR"/*
echo "Binaries are ready in the '$OUTPUT_DIR' directory:"
ls -l "$OUTPUT_DIR"

View File

@ -1,36 +0,0 @@
#!/bin/bash
if [ "$#" -ne 4 ]; then
echo "Error: Invalid arguments." >&2
echo "Usage: source $0 <BINARIES_DIR> <NODE_SRC_DIR> <VERSION> <PLATFORM>" >&2
exit 1
fi
BINARIES_DIR="$1"
NODE_SRC_DIR="$2"
VERSION="$3"
PLATFORM="$4"
PROVER_VERIFIER_BINS=("prover" "verifier")
WITNESS_GEN_BINS=("poc" "pol" "poq" "zksign")
echo "Setting Nomos environment variables for ${VERSION} on ${PLATFORM}." >&2
for bin_name in "${PROVER_VERIFIER_BINS[@]}"; do
var_name="NOMOS_$(echo "$bin_name" | tr '[:lower:]' '[:upper:]')"
bin_path="${BINARIES_DIR}/${bin_name}-${VERSION}-${PLATFORM}/${bin_name}/${bin_name}"
export "$var_name"="$bin_path"
done
for bin_name in "${WITNESS_GEN_BINS[@]}"; do
var_name="NOMOS_$(echo "$bin_name" | tr '[:lower:]' '[:upper:]')"
bin_path="${BINARIES_DIR}/${bin_name}-${VERSION}-${PLATFORM}/witness-generator/${bin_name}"
export "$var_name"="$bin_path"
done
export NOMOS_POL_PROVING_KEY_PATH="${NODE_SRC_DIR}/zk/proofs/pol/src/proving_key/pol.zkey"
export NOMOS_POC_PROVING_KEY_PATH="${NODE_SRC_DIR}/zk/proofs/poc/src/proving_key/proof_of_claim.zkey"
export NOMOS_POQ_PROVING_KEY_PATH="${NODE_SRC_DIR}/zk/proofs/poq/src/proving_key/poq.zkey"
export NOMOS_ZKSIGN_PROVING_KEY_PATH="${NODE_SRC_DIR}/zk/proofs/zksign/src/proving_key/zksign.zkey"
echo "Environment variables set successfully." >&2