Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 1 addition & 77 deletions build-images/Earthfile
Original file line number Diff line number Diff line change
@@ -1,80 +1,4 @@
VERSION 0.8

# TODO(AD): This is a kludge. There seem to be caching issues with FROM DOCKERFILE
# This needs to be investigated with a better workaround, but, until then, this prevents CI from being unstable.
# See Dockerfile for comments.

wasi-sdk:
FROM aztecprotocol/wasi-sdk:22.0
SAVE ARTIFACT /opt/wasi-sdk

osxcross:
FROM aztecprotocol/osxcross:14.0
SAVE ARTIFACT /opt/osxcross

foundry:
FROM aztecprotocol/foundry:de33b6af53005037b463318d2628b5cfcaf39916
SAVE ARTIFACT /opt/foundry

build:
FROM ubuntu:noble
RUN apt update && \
apt install -y \
# Utils
curl \
git \
curl \
wget \
jq \
gawk \
unzip \
netcat-openbsd \
parallel \
# C++ (clang=18, which we will move to. 16 is for current build.)
build-essential \
cmake \
ninja-build \
clang \
clang-16 \
clang-format-16 \
libc++-dev \
libomp-dev \
doxygen \
# Node (18.19.1)
nodejs \
npm \
# Python (clang bindings for wasm bindgen.)
python3 \
python3-clang && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install wasi-sdk.
COPY +wasi-sdk/wasi-sdk /opt/wasi-sdk

# Install osxcross. Requires developer to mount SDK from their mac host.
COPY +osxcross/osxcross /opt/osxcross
ENV PATH="/opt/osxcross/bin:$PATH"
ENV LD_LIBRARY_PATH="/opt/osxcross/lib:$LD_LIBRARY_PATH"

# Install foundry.
COPY +foundry/foundry /opt/foundry
ENV PATH="/opt/foundry/bin:$PATH"

# Install rust and cross-compilers. Noir specifically uses 1.74.1.
# We add everyone write ownership so downstream boxes can write.
ENV RUSTUP_HOME=/opt/rust/rustup
ENV CARGO_HOME=/opt/rust/cargo
ENV PATH="/opt/rust/cargo/bin:$PATH"
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.74.1 && \
rustup target add wasm32-unknown-unknown wasm32-wasi aarch64-apple-darwin && \
chmod -R a+w /opt/rust

# Install yq
RUN curl -L https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_$(dpkg --print-architecture) \
-o /usr/local/bin/yq && chmod +x /usr/local/bin/yq

# Install yarn
RUN npm install --global yarn

# Install solhint
RUN npm install --global solhint
SAVE ARTIFACT /opt/foundry/bin/anvil
FROM aztecprotocol/build:1.0
19 changes: 18 additions & 1 deletion build-images/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
ARCH := $(shell uname -m | sed 's/aarch64/arm64/')
FOUNDRY_TAG := de33b6af53005037b463318d2628b5cfcaf39916
VERSION := 1.0

wasi-sdk:
docker build -t aztecprotocol/wasi-sdk:$(ARCH)-22.0 --target wasi-sdk --push .
Expand All @@ -7,7 +9,6 @@ wasi-sdk:
--amend aztecprotocol/wasi-sdk:arm64-22.0
docker manifest push aztecprotocol/wasi-sdk:22.0

FOUNDRY_TAG := de33b6af53005037b463318d2628b5cfcaf39916
foundry:
docker build -t aztecprotocol/foundry:$(ARCH)-$(FOUNDRY_TAG) --build-arg TAG=$(FOUNDRY_TAG) --target foundry --push .
docker manifest create aztecprotocol/foundry:$(FOUNDRY_TAG) \
Expand All @@ -24,9 +25,25 @@ osxcross:

build:
docker build -t aztecprotocol/build --target build .
docker tag aztecprotocol/build aztecprotocol/build:$(ARCH)-$(VERSION)

build-push: build
docker push aztecprotocol/build:$(ARCH)-$(VERSION)
docker manifest create aztecprotocol/build:$(VERSION) \
--amend aztecprotocol/build:x86_64-$(VERSION) \
--amend aztecprotocol/build:arm64-$(VERSION)
docker manifest push aztecprotocol/build:$(VERSION)

devbox:
docker build -t aztecprotocol/devbox --target devbox .
docker tag aztecprotocol/devbox aztecprotocol/devbox:$(ARCH)-$(VERSION)

devbox-push: devbox
docker push aztecprotocol/devbox:$(ARCH)-$(VERSION)
docker manifest create aztecprotocol/devbox:$(VERSION) \
--amend aztecprotocol/devbox:x86_64-$(VERSION) \
--amend aztecprotocol/devbox:arm64-$(VERSION)
docker manifest push aztecprotocol/devbox:$(VERSION)

sysbox:
docker build -t aztecprotocol/sysbox --target sysbox .
Expand Down
14 changes: 11 additions & 3 deletions yarn-project/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ end-to-end-prod:
**/artifacts
SAVE ARTIFACT /usr/src /usr/src

anvil:
FROM ../build-images+build
SAVE ARTIFACT /opt/foundry/bin/anvil

end-to-end:
FROM ubuntu:noble
RUN apt-get update && apt-get install -y wget gnupg \
Expand All @@ -100,7 +104,7 @@ end-to-end:
&& rm -rf /var/lib/apt/lists/*
ENV CHROME_BIN="/usr/bin/google-chrome-stable"
ENV PATH=/opt/foundry/bin:$PATH
COPY ../build-images+build/anvil /opt/foundry/bin/anvil
COPY +anvil/anvil /opt/foundry/bin/anvil
COPY +end-to-end-prod/usr/src /usr/src
WORKDIR /usr/src/yarn-project/end-to-end
RUN ln -s /usr/src/yarn-project/.yarn/releases/yarn-3.6.3.cjs /usr/local/bin/yarn
Expand All @@ -118,12 +122,16 @@ all:
export-aztec:
ARG EARTHLY_GIT_HASH
FROM +aztec
SAVE IMAGE aztecprotocol/aztec:$EARTHLY_GIT_HASH
WAIT
SAVE IMAGE aztecprotocol/aztec:$EARTHLY_GIT_HASH
END

export-end-to-end:
ARG EARTHLY_GIT_HASH
FROM +end-to-end
SAVE IMAGE aztecprotocol/end-to-end:$EARTHLY_GIT_HASH
WAIT
SAVE IMAGE aztecprotocol/end-to-end:$EARTHLY_GIT_HASH
END

format-check:
FROM +build
Expand Down
10 changes: 3 additions & 7 deletions yarn-project/end-to-end/Earthfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
VERSION 0.8

E2E_COMPOSE_TEST:
BUILD ../+export-aztec
BUILD ../+export-end-to-end
FUNCTION
ARG test
ARG compose_file=./scripts/docker-compose.yml
Expand All @@ -15,13 +17,7 @@ E2E_COMPOSE_TEST:
ELSE
LET CMD="docker-compose"
END
WITH DOCKER \
--load aztecprotocol/aztec:latest=../+aztec \
--load aztecprotocol/end-to-end:latest=../+end-to-end \
--load aztecprotocol/foundry-nightly-de33b6af53005037b463318d2628b5cfcaf3991:latest=../../build-images+build
# Run our docker compose, ending whenever sandbox ends, filtering out noisy eth_getLogs
RUN $CMD -p $project_name -f $compose_file up --exit-code-from=end-to-end --force-recreate
END
RUN $CMD -p $project_name -f $compose_file up --exit-code-from=end-to-end --force-recreate

UPLOAD_LOGS:
FUNCTION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
fork:
image: aztecprotocol/foundry-nightly-de33b6af53005037b463318d2628b5cfcaf3991:latest
image: aztecprotocol/foundry:de33b6af53005037b463318d2628b5cfcaf3991
entrypoint: >
sh -c '
if [ -n "$FORK_BLOCK_NUMBER" ] && [ -n "$FORK_URL" ]; then
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/scripts/docker-compose-p2p.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
fork:
image: aztecprotocol/foundry-nightly-de33b6af53005037b463318d2628b5cfcaf3991:latest
image: aztecprotocol/foundry:de33b6af53005037b463318d2628b5cfcaf3991
entrypoint: 'anvil --silent -p 8545 --host 0.0.0.0 --chain-id 31337'
expose:
- '8545'
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/scripts/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
fork:
image: aztecprotocol/foundry-nightly-de33b6af53005037b463318d2628b5cfcaf3991:latest
image: aztecprotocol/foundry:de33b6af53005037b463318d2628b5cfcaf3991
entrypoint: >
sh -c '
if [ -n "$FORK_BLOCK_NUMBER" ] && [ -n "$FORK_URL" ]; then
Expand Down