-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move alpine containers to ubuntu (#5026)
Move bb alpine containers to be built in ubuntu so we can use the bb binary in `yarn-project`. This also shifts some noir containers to ubuntu that rely on the bb binary Closes #4708
- Loading branch information
1 parent
26d2643
commit d483e67
Showing
12 changed files
with
178 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM aztecprotocol/barretenberg-x86_64-linux-clang | ||
WORKDIR /usr/src/barretenberg/cpp | ||
RUN apk update && apk add curl libstdc++ jq | ||
RUN apt update && apt install curl libstdc++6 jq -y | ||
RUN ./scripts/ci/ultra_honk_bench.sh |
37 changes: 23 additions & 14 deletions
37
barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 25 additions & 18 deletions
43
barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-assert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
# We have to stay on 3.17 for now, to get clang-format 15, as code is not yet formatted to 16. | ||
FROM alpine:3.17 AS builder | ||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add --no-cache \ | ||
build-base \ | ||
clang15 \ | ||
cmake \ | ||
ninja \ | ||
git \ | ||
curl \ | ||
perl \ | ||
clang-extra-tools \ | ||
bash | ||
FROM ubuntu:lunar as builder | ||
|
||
RUN apt update && apt install -y \ | ||
build-essential \ | ||
curl \ | ||
git \ | ||
cmake \ | ||
lsb-release \ | ||
wget \ | ||
software-properties-common \ | ||
gnupg \ | ||
ninja-build \ | ||
npm \ | ||
libssl-dev \ | ||
jq \ | ||
bash \ | ||
libstdc++6 \ | ||
clang-format | ||
|
||
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 | ||
|
||
WORKDIR /usr/src/barretenberg/cpp | ||
COPY . . | ||
# Build everything to ensure everything builds. All tests will be run from the result of this build. | ||
RUN ./format.sh check && cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert -DCI=ON && cmake --build --preset default | ||
RUN ./format.sh check && cmake --preset clang16 -DCMAKE_BUILD_TYPE=RelWithAssert -DCI=ON && cmake --build --preset clang16 | ||
RUN srs_db/download_grumpkin.sh | ||
|
||
FROM alpine:3.17 | ||
RUN apk update && apk add curl libstdc++ | ||
FROM ubuntu:lunar | ||
RUN apt update && apt install curl libstdc++6 -y | ||
COPY --from=builder /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db | ||
COPY --from=builder /usr/src/barretenberg/cpp/build/bin /usr/src/barretenberg/cpp/build/bin | ||
COPY --from=builder /usr/src/barretenberg/cpp/build/bin /usr/src/barretenberg/cpp/build/bin |
40 changes: 23 additions & 17 deletions
40
barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-benchmarks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
FROM alpine:3.18 AS builder | ||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add --no-cache \ | ||
build-base \ | ||
clang16 \ | ||
openmp-dev \ | ||
cmake \ | ||
ninja \ | ||
git \ | ||
curl \ | ||
perl | ||
FROM ubuntu:lunar as builder | ||
|
||
WORKDIR /usr/src/barretenberg/cpp | ||
RUN apt update && apt install -y \ | ||
build-essential \ | ||
curl \ | ||
git \ | ||
cmake \ | ||
lsb-release \ | ||
wget \ | ||
software-properties-common \ | ||
gnupg \ | ||
ninja-build \ | ||
npm \ | ||
libssl-dev \ | ||
jq \ | ||
bash \ | ||
libstdc++6 | ||
|
||
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 | ||
|
||
WORKDIR /usr/src/barretenberg/cpp | ||
COPY . . | ||
# Build everything to ensure everything builds. All tests will be run from the result of this build. | ||
RUN cmake --preset default && cmake --build --preset default --target external_bench | ||
RUN cmake --preset clang16 && cmake --build --preset clang16 --target external_bench | ||
|
||
FROM alpine:3.18 | ||
RUN apk update && apk add curl openmp | ||
FROM ubuntu:lunar | ||
RUN apt update && apt install curl libomp-dev -y | ||
COPY --from=builder /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db | ||
COPY --from=builder /usr/src/barretenberg/cpp/build/bin/*_bench /usr/src/barretenberg/cpp/build/bin/ | ||
COPY --from=builder /usr/src/barretenberg/cpp/build/bin/*_bench /usr/src/barretenberg/cpp/build/bin/ |
39 changes: 22 additions & 17 deletions
39
barretenberg/cpp/dockerfiles/Dockerfile.x86_64-linux-clang-fuzzing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
FROM alpine:3.18 AS builder | ||
RUN apk update && \ | ||
apk upgrade && \ | ||
apk add --no-cache \ | ||
build-base \ | ||
clang16 \ | ||
compiler-rt \ | ||
openmp-dev \ | ||
cmake \ | ||
ninja \ | ||
git \ | ||
curl \ | ||
perl | ||
FROM ubuntu:lunar as builder | ||
|
||
WORKDIR /usr/src/barretenberg/cpp | ||
RUN apt update && apt install -y \ | ||
build-essential \ | ||
curl \ | ||
git \ | ||
cmake \ | ||
lsb-release \ | ||
wget \ | ||
software-properties-common \ | ||
gnupg \ | ||
ninja-build \ | ||
npm \ | ||
libssl-dev \ | ||
jq \ | ||
bash \ | ||
libstdc++6 | ||
|
||
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 | ||
|
||
WORKDIR /usr/src/barretenberg/cpp | ||
COPY . . | ||
# Build the entire project, as we want to check everything builds under clang | ||
# Build the entire project, as we want to check everything builds under clang-fuzzing with clang-16. | ||
RUN cmake --preset fuzzing && cmake --build --preset fuzzing | ||
|
||
FROM alpine:3.18 | ||
RUN apk update && apk add openmp | ||
FROM ubuntu:lunar | ||
RUN apt update && apt install libomp-dev -y | ||
COPY --from=builder /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
FROM alpine:3.18 AS builder | ||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add --no-cache \ | ||
build-base \ | ||
cmake \ | ||
ninja \ | ||
git \ | ||
curl | ||
FROM ubuntu:lunar as builder | ||
|
||
RUN apt update && apt install -y \ | ||
build-essential \ | ||
curl \ | ||
git \ | ||
cmake \ | ||
lsb-release \ | ||
wget \ | ||
software-properties-common \ | ||
gnupg \ | ||
ninja-build \ | ||
npm \ | ||
libssl-dev \ | ||
jq \ | ||
bash \ | ||
libstdc++6 | ||
|
||
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 | ||
|
||
WORKDIR /usr/src/barretenberg/cpp | ||
COPY . . | ||
# Build the entire project, as we want to check everything builds under gcc. | ||
RUN cmake --preset gcc -DCI=ON && cmake --build --preset gcc | ||
|
||
FROM alpine:3.18 | ||
RUN apk update && apk add libstdc++ | ||
FROM ubuntu:lunar | ||
RUN apt update && apt install libstdc++6 -y | ||
COPY --from=builder /usr/src/barretenberg/cpp/build-gcc/bin/bb /usr/src/barretenberg/cpp/build/bin/bb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,50 @@ | ||
FROM alpine:3.18 | ||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add --no-cache \ | ||
build-base \ | ||
clang16 \ | ||
openmp-dev \ | ||
cmake \ | ||
ninja \ | ||
git \ | ||
curl \ | ||
perl | ||
FROM ubuntu:lunar as builder | ||
|
||
RUN apt update && apt install -y \ | ||
build-essential \ | ||
curl \ | ||
git \ | ||
cmake \ | ||
lsb-release \ | ||
wget \ | ||
software-properties-common \ | ||
gnupg \ | ||
ninja-build \ | ||
npm \ | ||
libssl-dev \ | ||
jq \ | ||
bash \ | ||
libstdc++6 | ||
|
||
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 | ||
|
||
WORKDIR /usr/src/barretenberg/cpp | ||
|
||
COPY ./cpp . | ||
# Build everything to ensure everything builds. All tests will be run from the result of this build. | ||
RUN cmake --preset clang16 && cmake --build --preset clang16 --target solidity_key_gen solidity_proof_gen | ||
|
||
FROM docker.io/frolvlad/alpine-glibc:alpine-3.17_glibc-2.34 as builder | ||
RUN apk update && apk add git curl build-base openmp-dev bash | ||
FROM ubuntu:lunar | ||
RUN apt update && apt install -y \ | ||
build-essential \ | ||
curl \ | ||
git \ | ||
bash \ | ||
libomp-dev | ||
|
||
COPY --from=0 /usr/src/barretenberg/cpp/build/bin /usr/src/barretenberg/cpp/build/bin | ||
COPY --from=0 /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db | ||
COPY --from=builder /usr/src/barretenberg/cpp/build/bin /usr/src/barretenberg/cpp/build/bin | ||
COPY --from=builder /usr/src/barretenberg/cpp/srs_db /usr/src/barretenberg/cpp/srs_db | ||
WORKDIR /usr/src/barretenberg/sol | ||
COPY ./sol . | ||
|
||
# Copy forge binary directly from foundry | ||
COPY --from=ghcr.io/foundry-rs/foundry:latest /usr/local/bin/forge /usr/local/bin/forge | ||
# Download and install foundry | ||
RUN curl -L https://foundry.paradigm.xyz | bash | ||
ENV PATH="${PATH}:/root/.foundry/bin" | ||
RUN foundryup | ||
|
||
RUN cd ../cpp/srs_db && ./download_ignition.sh 3 && cd ../../sol | ||
|
||
RUN ./scripts/init.sh | ||
|
||
# TestBase is excluded as it is just boilerplate | ||
RUN forge test --no-match-contract TestBase | ||
RUN forge test --no-match-contract TestBase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
# Building requires foundry. | ||
FROM ghcr.io/foundry-rs/foundry:nightly-4a643801d0b3855934cdec778e33e79c79971783 | ||
RUN apk update && apk add git jq bash nodejs npm yarn python3 py3-pip && pip3 install slither-analyzer==0.10.0 slitherin==0.5.0 | ||
FROM ubuntu:lunar | ||
|
||
RUN apt update && apt install curl git jq bash nodejs npm python3.11-full python3-pip -y | ||
|
||
# Use virtualenv, do not try to use pipx, it's not working. | ||
RUN python3 -m venv /root/.venv | ||
RUN /root/.venv/bin/pip3 install slither-analyzer==0.10.0 slitherin==0.5.0 | ||
RUN curl -L https://foundry.paradigm.xyz | bash | ||
|
||
# Set env variables for foundry and venv | ||
ENV PATH="${PATH}:/root/.foundry/bin:/root/.venv/bin" | ||
RUN foundryup | ||
|
||
WORKDIR /usr/src/l1-contracts | ||
COPY . . | ||
RUN git init | ||
RUN forge clean && forge fmt --check && forge build && forge test | ||
|
||
RUN npm install --global yarn | ||
RUN yarn && yarn lint | ||
|
||
RUN git add . && yarn slither && yarn slither-has-diff | ||
RUN forge build | ||
|
||
FROM scratch | ||
COPY --from=0 /usr/src/l1-contracts/out /usr/src/l1-contracts/out | ||
COPY --from=0 /usr/src/l1-contracts/out /usr/src/l1-contracts/out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters