-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: bench bb in pr's, docker shell utils (#3561)
- adds a CI task that runs bb benchmarks - adds utilities for running alpine or ubuntu docker in an interactive context (to be expanded as useful, for now just lets you rebuild in ubuntu or alpine easily)
- Loading branch information
Showing
19 changed files
with
156 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/barretenberg-x86_64-linux-clang | ||
WORKDIR /usr/src/barretenberg/cpp | ||
RUN apk update && apk add curl libstdc++ jq | ||
RUN ./scripts/ci/ultra_honk_bench.sh |
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
20 changes: 20 additions & 0 deletions
20
barretenberg/cpp/dockerfiles/interactive/Dockerfile.alpine
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Use Alpine 3.18 as the base image | ||
FROM alpine:3.18 | ||
|
||
# Install necessary packages | ||
RUN apk update && apk add \ | ||
bash \ | ||
build-base \ | ||
clang16 \ | ||
cmake \ | ||
ninja \ | ||
git \ | ||
curl \ | ||
perl \ | ||
libstdc++ | ||
|
||
# Set the working directory in the container | ||
WORKDIR /usr/src/barretenberg/cpp | ||
|
||
# Set bash as the default command to keep the container running interactively | ||
CMD ["/bin/bash"] |
24 changes: 24 additions & 0 deletions
24
barretenberg/cpp/dockerfiles/interactive/Dockerfile.ubuntu
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM ubuntu:lunar | ||
|
||
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 | ||
|
||
WORKDIR /usr/src/barretenberg/cpp | ||
|
||
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 | ||
|
||
CMD ["/bin/bash"] |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env sh | ||
[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace | ||
set -eu | ||
|
||
# enter script folder | ||
cd "$(dirname $0)" | ||
cd ../../srs_db | ||
./download_ignition.sh 1 | ||
./download_grumpkin.sh | ||
cd ../build | ||
./bin/ultra_honk_rounds_bench --benchmark_format=json | tee ultra_honk_rounds_bench.json | ||
echo "Testing if we have created valid JSON." | ||
cat ultra_honk_rounds_bench.json | jq empty | ||
echo "JSON is valid. Continuing." |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Uploads to S3 a recent barretenberg benchmark run. | ||
#!/usr/bin/env bash | ||
[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace | ||
set -eu | ||
|
||
extract_repo barretenberg-bench /usr/src extracted-repo | ||
|
||
BUCKET_NAME="aztec-ci-artifacts" | ||
COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" | ||
|
||
if [ "${BRANCH:-}" = "master" ]; then | ||
TARGET_FOLDER="barretenberg-bench-v1/master/$COMMIT_HASH/" | ||
elif [ -n "${PULL_REQUEST:-}" ]; then | ||
TARGET_FOLDER="barretenberg-bench-v1/pulls/${PULL_REQUEST##*/}" | ||
else | ||
echo Skipping upload since no target folder was defined | ||
fi | ||
echo "Uploading to s3://$BUCKET_NAME/$TARGET_FOLDER" | ||
aws s3 cp extracted-repo/src/barretenberg/cpp/build/ultra_honk_rounds_bench.json "s3://$BUCKET_NAME/$TARGET_FOLDER/ultra_honk_rounds_bench.json" |
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Script to enter a docker shell. | ||
# This comes in two flavors, ubuntu and alpine. | ||
# This mounts the current folder into the image, allowing for in-docker development. | ||
# You then need to run cmake commands fresh to build. | ||
# Ideally you can combine with a fresh clone of the repo to keep it persistently around, or move around build dirs as needed. | ||
# This is useful for debugging issues like bb being slow on alpine or running into errors on a specific version of gcc. | ||
# usage: ./docker_interactive.sh ubuntu or ./docker_interactive.sh alpine | ||
|
||
# Enter script directory. | ||
set -eu | ||
cd $(dirname $0) | ||
# allows for 'alpine' or 'ubuntu' | ||
ENVIRONMENT_KIND="${1:-alpine}" | ||
DOCKERFILE="../dockerfiles/interactive/Dockerfile.$ENVIRONMENT_KIND" | ||
docker build -t "env-$ENVIRONMENT_KIND" -f "$DOCKERFILE" . | ||
docker run -it --mount type=bind,source=$(pwd)/..,target=/usr/src/barretenberg/cpp "env-$ENVIRONMENT_KIND" |
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
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
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