diff --git a/.circleci/config.yml b/.circleci/config.yml index 993ee6fb9eb..f3cafe6d2db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -472,7 +472,7 @@ jobs: name: "Build and test" command: build key-store - noir-contracts: + noir-contracts-build: docker: - image: aztecprotocol/alpine-build-image resource_class: small @@ -481,7 +481,18 @@ jobs: - *setup_env - run: name: "Build and test" - command: cond_spot_run_build noir-contracts 32 + command: cond_spot_run_build noir-contracts-build 32 + + noir-contracts: + machine: + image: ubuntu-2004:202010-01 + resource_class: large + steps: + - *checkout + - *setup_env + - run: + name: "Build and test" + command: build noir-contracts noir-compiler: machine: @@ -1094,13 +1105,13 @@ workflows: <<: *defaults - l1-contracts: *defaults - - noir-contracts: *defaults + - noir-contracts-build: *defaults - yarn-project-base: requires: - circuits-wasm-linux-clang - l1-contracts - - noir-contracts + - noir-contracts-build <<: *defaults - aztec-js: *yarn_project @@ -1119,6 +1130,7 @@ workflows: - p2p-bootstrap: *yarn_project - l1-artifacts: *yarn_project - noir-compiler: *yarn_project + - noir-contracts: *yarn_project - sequencer-client: *yarn_project - types: *yarn_project - circuits-js: *yarn_project @@ -1143,6 +1155,7 @@ workflows: - p2p-bootstrap - l1-artifacts - noir-compiler + - noir-contracts - sequencer-client - types - circuits-js diff --git a/build_manifest.json b/build_manifest.json index 7e5016900dc..74355ba4e8d 100644 --- a/build_manifest.json +++ b/build_manifest.json @@ -2,54 +2,77 @@ "barretenberg-x86_64-linux-clang": { "buildDir": "circuits/cpp/barretenberg/cpp", "dockerfile": "dockerfiles/Dockerfile.x86_64-linux-clang", - "rebuildPatterns": ["^circuits/cpp/barretenberg/cpp/"], + "rebuildPatterns": [ + "^circuits/cpp/barretenberg/cpp/" + ], "dependencies": [] }, "barretenberg-x86_64-linux-clang-assert": { "buildDir": "circuits/cpp/barretenberg/cpp", "dockerfile": "dockerfiles/Dockerfile.x86_64-linux-clang-assert", - "rebuildPatterns": ["^circuits/cpp/barretenberg/cpp/"], + "rebuildPatterns": [ + "^circuits/cpp/barretenberg/cpp/" + ], "dependencies": [] }, "barretenberg-x86_64-linux-clang-fuzzing": { "buildDir": "circuits/cpp/barretenberg/cpp", "dockerfile": "dockerfiles/Dockerfile.x86_64-linux-clang-fuzzing", - "rebuildPatterns": ["^circuits/cpp/barretenberg/cpp/"], + "rebuildPatterns": [ + "^circuits/cpp/barretenberg/cpp/" + ], "dependencies": [] }, "barretenberg-x86_64-linux-gcc": { "buildDir": "circuits/cpp/barretenberg/cpp", "dockerfile": "dockerfiles/Dockerfile.x86_64-linux-gcc", - "rebuildPatterns": ["^circuits/cpp/barretenberg/cpp/"], + "rebuildPatterns": [ + "^circuits/cpp/barretenberg/cpp/" + ], "dependencies": [] }, "barretenberg-wasm-linux-clang": { "buildDir": "circuits/cpp/barretenberg/cpp", "dockerfile": "dockerfiles/Dockerfile.wasm-linux-clang", - "rebuildPatterns": ["^circuits/cpp/barretenberg/cpp/"], + "rebuildPatterns": [ + "^circuits/cpp/barretenberg/cpp/" + ], "dependencies": [] }, "barretenberg-circuits-x86_64-linux-clang-builder-runner": { "buildDir": "circuits/cpp/barretenberg/cpp", "dockerfile": "dockerfiles/Dockerfile.circuits-x86_64-linux-clang-builder-runner", - "rebuildPatterns": ["^circuits/cpp/barretenberg/cpp/"], + "rebuildPatterns": [ + "^circuits/cpp/barretenberg/cpp/" + ], "dependencies": [] }, "barretenberg-circuits-wasm-linux-clang-builder-runner": { "buildDir": "circuits/cpp/barretenberg/cpp", "dockerfile": "dockerfiles/Dockerfile.circuits-wasm-linux-clang-builder-runner", - "rebuildPatterns": ["^circuits/cpp/barretenberg/cpp/"], + "rebuildPatterns": [ + "^circuits/cpp/barretenberg/cpp/" + ], "dependencies": [] }, "bb.js": { "buildDir": "circuits/cpp/barretenberg/ts", - "rebuildPatterns": ["^circuits/cpp/barretenberg/ts/"], - "dependencies": ["barretenberg-wasm-linux-clang"] + "rebuildPatterns": [ + "^circuits/cpp/barretenberg/ts/" + ], + "dependencies": [ + "barretenberg-wasm-linux-clang" + ] }, "barretenberg-acir-tests": { "buildDir": "circuits/cpp/barretenberg/acir_tests", - "rebuildPatterns": ["^circuits/cpp/barretenberg/acir_tests/"], - "dependencies": ["bb.js", "barretenberg-x86_64-linux-clang-assert"] + "rebuildPatterns": [ + "^circuits/cpp/barretenberg/acir_tests/" + ], + "dependencies": [ + "bb.js", + "barretenberg-x86_64-linux-clang-assert" + ] }, "circuits-wasm-linux-clang": { "buildDir": "circuits/cpp", @@ -307,6 +330,19 @@ "types" ] }, + "noir-contracts-build": { + "buildDir": "yarn-project", + "projectDir": "yarn-project/noir-contracts", + "dockerfile": "noir-contracts/Dockerfile.build", + "rebuildPatterns": [ + "^yarn-project/noir-contracts/" + ], + "dependencies": [ + "aztec.js", + "foundation", + "noir-compiler" + ] + }, "noir-contracts": { "buildDir": "yarn-project", "projectDir": "yarn-project/noir-contracts", @@ -445,4 +481,4 @@ "types" ] } -} +} \ No newline at end of file diff --git a/yarn-project/noir-contracts/Dockerfile b/yarn-project/noir-contracts/Dockerfile index 4f45adf7f39..5807d15c811 100644 --- a/yarn-project/noir-contracts/Dockerfile +++ b/yarn-project/noir-contracts/Dockerfile @@ -1,20 +1,15 @@ -# Running on ubuntu until noir supports an alpine build +FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/yarn-project-base AS builder -# Builder stage to build the noir artifacts -FROM ubuntu:kinetic - -RUN apt-get update && apt-get install -y \ - curl \ - git \ - sed - -WORKDIR /usr/src/yarn-project COPY . . -WORKDIR /usr/src/yarn-project/noir-contracts +WORKDIR /usr/src/yarn-project/noir-contracts +RUN yarn build && yarn test -# Download and extract nargo -RUN ./scripts/install_noir.sh -ENV PATH="/usr/src/yarn-project/noir-contracts/.nargo/bin:${PATH}" +# Prune dev dependencies. See comment in base image. +RUN yarn cache clean +RUN yarn workspaces focus --production > /dev/null -RUN ./scripts/compile_ci.sh +FROM node:18-alpine +COPY --from=builder /usr/src/yarn-project/noir-contracts /usr/src/yarn-project/noir-contracts +WORKDIR /usr/src/yarn-project/noir-contracts +ENTRYPOINT ["yarn"] \ No newline at end of file diff --git a/yarn-project/noir-contracts/Dockerfile.build b/yarn-project/noir-contracts/Dockerfile.build new file mode 100644 index 00000000000..4f45adf7f39 --- /dev/null +++ b/yarn-project/noir-contracts/Dockerfile.build @@ -0,0 +1,20 @@ +# Running on ubuntu until noir supports an alpine build + +# Builder stage to build the noir artifacts +FROM ubuntu:kinetic + +RUN apt-get update && apt-get install -y \ + curl \ + git \ + sed + +WORKDIR /usr/src/yarn-project +COPY . . + +WORKDIR /usr/src/yarn-project/noir-contracts + +# Download and extract nargo +RUN ./scripts/install_noir.sh +ENV PATH="/usr/src/yarn-project/noir-contracts/.nargo/bin:${PATH}" + +RUN ./scripts/compile_ci.sh diff --git a/yarn-project/yarn-project-base/Dockerfile b/yarn-project/yarn-project-base/Dockerfile index eba8e313394..da9b9993c74 100644 --- a/yarn-project/yarn-project-base/Dockerfile +++ b/yarn-project/yarn-project-base/Dockerfile @@ -1,6 +1,6 @@ FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/circuits-wasm-linux-clang as circuits FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/l1-contracts as contracts -FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-contracts as noir +FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-contracts-build as noir FROM node:18-alpine AS builder_ RUN apk update && apk add --no-cache build-base git python3 curl bash jq sed