diff --git a/build-images/Dockerfile b/build-images/Dockerfile index 19824e784be..893c93fe4c0 100644 --- a/build-images/Dockerfile +++ b/build-images/Dockerfile @@ -81,8 +81,9 @@ RUN ulimit -n 65535 && \ mv ./target/local/$t /opt/foundry/bin/$t; \ strip /opt/foundry/bin/$t; \ done -FROM scratch AS foundry +FROM ubuntu:noble AS foundry COPY --from=foundry-build /opt/foundry /opt/foundry +ENV PATH="/opt/foundry/bin:$PATH" ######################################################################################################################## # This image contains *just* what's needed to perform a full build of the aztec project. diff --git a/build-images/Earthfile b/build-images/Earthfile index 6fede09e686..f546ee73556 100644 --- a/build-images/Earthfile +++ b/build-images/Earthfile @@ -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 \ No newline at end of file diff --git a/build-images/Makefile b/build-images/Makefile index dc5bd045cbb..24934a9fa0a 100755 --- a/build-images/Makefile +++ b/build-images/Makefile @@ -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 . @@ -7,9 +9,10 @@ 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 tag aztecprotocol/foundry:$(ARCH)-$(FOUNDRY_TAG) aztecprotocol/foundry:$(FOUNDRY_TAG) + docker manifest rm aztecprotocol/foundry:$(FOUNDRY_TAG) docker manifest create aztecprotocol/foundry:$(FOUNDRY_TAG) \ --amend aztecprotocol/foundry:x86_64-$(FOUNDRY_TAG) \ --amend aztecprotocol/foundry:arm64-$(FOUNDRY_TAG) @@ -17,16 +20,35 @@ foundry: osxcross: docker build -t aztecprotocol/osxcross:$(ARCH)-14.0 --target osxcross --push . + docker manifest rm aztecprotocol/osxcross:14.0 docker manifest create aztecprotocol/osxcross:14.0 \ --amend aztecprotocol/osxcross:x86_64-14.0 \ --amend aztecprotocol/osxcross:arm64-14.0 docker manifest push aztecprotocol/osxcross:14.0 build: - docker build -t aztecprotocol/build --target build . + docker build -t aztecprotocol/build:$(ARCH)-$(VERSION) --target build . + docker tag aztecprotocol/build:$(ARCH)-$(VERSION) aztecprotocol/build + +build-push: build + docker push aztecprotocol/build:$(ARCH)-$(VERSION) + docker manifest rm aztecprotocol/build:$(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 build -t aztecprotocol/devbox:$(ARCH)-$(VERSION) --target devbox . + docker tag aztecprotocol/devbox:$(ARCH)-$(VERSION) aztecprotocol/devbox + +devbox-push: devbox + docker push aztecprotocol/devbox:$(ARCH)-$(VERSION) + docker manifest rm aztecprotocol/devbox:$(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 . diff --git a/yarn-project/Earthfile b/yarn-project/Earthfile index 5c6bd59d1c3..0c6c1f9a1e7 100644 --- a/yarn-project/Earthfile +++ b/yarn-project/Earthfile @@ -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 \ @@ -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 diff --git a/yarn-project/end-to-end/scripts/docker-compose-no-sandbox.yml b/yarn-project/end-to-end/scripts/docker-compose-no-sandbox.yml index 71278ea4a81..078485dd13d 100644 --- a/yarn-project/end-to-end/scripts/docker-compose-no-sandbox.yml +++ b/yarn-project/end-to-end/scripts/docker-compose-no-sandbox.yml @@ -1,7 +1,8 @@ version: '3' services: fork: - image: aztecprotocol/foundry-nightly-de33b6af53005037b463318d2628b5cfcaf3991:latest + image: aztecprotocol/foundry:de33b6af53005037b463318d2628b5cfcaf39916 + pull_policy: always entrypoint: > sh -c ' if [ -n "$FORK_BLOCK_NUMBER" ] && [ -n "$FORK_URL" ]; then diff --git a/yarn-project/end-to-end/scripts/docker-compose-p2p.yml b/yarn-project/end-to-end/scripts/docker-compose-p2p.yml index e3d894d0795..7381dea2a7e 100644 --- a/yarn-project/end-to-end/scripts/docker-compose-p2p.yml +++ b/yarn-project/end-to-end/scripts/docker-compose-p2p.yml @@ -1,7 +1,8 @@ version: '3' services: fork: - image: aztecprotocol/foundry-nightly-de33b6af53005037b463318d2628b5cfcaf3991:latest + image: aztecprotocol/foundry:de33b6af53005037b463318d2628b5cfcaf39916 + pull_policy: always entrypoint: 'anvil --silent -p 8545 --host 0.0.0.0 --chain-id 31337' expose: - '8545' diff --git a/yarn-project/end-to-end/scripts/docker-compose.yml b/yarn-project/end-to-end/scripts/docker-compose.yml index 3987fd269b9..8a5a72a6377 100644 --- a/yarn-project/end-to-end/scripts/docker-compose.yml +++ b/yarn-project/end-to-end/scripts/docker-compose.yml @@ -1,7 +1,8 @@ version: '3' services: fork: - image: aztecprotocol/foundry-nightly-de33b6af53005037b463318d2628b5cfcaf3991:latest + image: aztecprotocol/foundry:de33b6af53005037b463318d2628b5cfcaf39916 + pull_policy: always entrypoint: > sh -c ' if [ -n "$FORK_BLOCK_NUMBER" ] && [ -n "$FORK_URL" ]; then