Skip to content

Commit

Permalink
chore: Bring boxes back to CI. Build and run using docker/docker-comp…
Browse files Browse the repository at this point in the history
…ose. (AztecProtocol#3727)

Main gist is as title. Details below.
* Rename `noir-acir-tests` -> `noir-compile-acir-tests` to make it more
clear this is compile job, not a test job.
* `boxes` files are injected into `yarn-project-base` much like other
artefacts, as they're need for cli unboxing. Job is called
`boxes-files`.
* Added myself as a CODEOWNER for `build-system` and `build_manifest`
changes (just means I'm auto-added as reviewer).
* `PATH` adjustment in `aztec-nargo` to ensure it can find rootless
docker.
* `boxes` is cleaned up a lot. Removed a lot of "development time"
specifics. Made it into a workspace so we can build all the boxes as a
single job, and test them individually as part of a docker-compose run.
* The root `package.json` contains the resolutions to development
dependencies. As this isn't a part of the unboxed box, no adjustment
needs to be made r.e. resolutions.
* We still update the `@aztec/*` package versions as we unbox, but in
theory this could now be done by release please.
* However, there is still the issue of `Nargo.toml` which needs a more
significant change to point to github dependencies. If we could devise a
more cunning mechanism here, it's possible we could avoid needing to
adjust the projects at unbox time at all.
* HOWEVER, there is another case which I've supported here, *perhaps*
overkill, which is running unbox at development time. Such an unboxing
needs to carry the dependencies into the box and make several tweaks.
This has the nice benefit of being able to provide the full
functionality without having to have published anything, but adds a
couple of dozen lines of code otherwise not needed.
* Gets rid of scripts like `compile:local` which make no sense when
unboxed. Instead allow overriding `aztec-cli` via env var.
* Remove project references from `tsconfig.json` because we simply
assume to have built `yarn-project` in the development case.
* Remove committed noir artefacts and json, and instead build them at CI
time, or as part of `yarn build` once unboxed.
* Updated rotted noir code. TODO: replace with symlink to `src` so no
need to keep in sync? All symlinks are derefed at unbox time.
* Provide a simple `docker-compose` file for running any box against the
sandbox.
* Get rid of `tsconfig.dest.json` stuff. Simplify some webpack stuff
that was just copy pasted. (more needs to be done to strip this back to
be minimal, get rid of polyfills etc).
* Minor build system tweaks to fix dependencies when running
docker-compose.
  • Loading branch information
charlielye committed Dec 30, 2023
1 parent b265531 commit 4a1c0df
Show file tree
Hide file tree
Showing 78 changed files with 1,731 additions and 32,173 deletions.
95 changes: 62 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
name: "Build"
command: cond_spot_run_build noir-packages 32

noir-acir-tests:
noir-compile-acir-tests:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
Expand All @@ -123,7 +123,7 @@ jobs:
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build noir-acir-tests 32
command: cond_spot_run_build noir-compile-acir-tests 32

# Barretenberg
barretenberg-wasm-linux-clang:
Expand Down Expand Up @@ -324,6 +324,17 @@ jobs:
name: "Build and test"
command: build l1-contracts

boxes-files:
machine:
image: ubuntu-2204:2023.07.2
resource_class: medium
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: build boxes-files

yarn-project-base:
machine:
image: ubuntu-2204:2023.07.2
Expand Down Expand Up @@ -423,38 +434,49 @@ jobs:
name: "Build and test"
command: build aztec-faucet | add_timestamps

boxes-blank-react:
machine:
image: ubuntu-2204:2023.07.2
resource_class: large
boxes:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Test via adhoc script"
command: ./boxes/run_tests blank-react
name: "Build"
command: cond_spot_run_build boxes 4

boxes-blank:
machine:
image: ubuntu-2204:2023.07.2
resource_class: large
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Test via adhoc script"
command: ./boxes/run_tests blank
name: "Test"
command: cond_spot_run_compose boxes 4 ./docker-compose.yml BOX=box-blank

boxes-blank-react:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Test"
command: cond_spot_run_compose boxes 4 ./docker-compose.yml BOX=box-blank-react

boxes-token:
machine:
image: ubuntu-2204:2023.07.2
resource_class: large
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Test via adhoc script"
command: ./boxes/run_tests token
name: "Test"
command: cond_spot_run_compose boxes 4 ./docker-compose.yml BOX=box-token

end-to-end:
machine:
Expand Down Expand Up @@ -1045,7 +1067,7 @@ workflows:
- noir-arm64
<<: *defaults
- noir-packages: *defaults
- noir-acir-tests:
- noir-compile-acir-tests:
requires:
- noir-ecr-manifest
<<: *defaults
Expand All @@ -1067,7 +1089,7 @@ workflows:
- barretenberg-acir-tests-bb:
requires:
- barretenberg-x86_64-linux-clang-assert
- noir-acir-tests
- noir-compile-acir-tests
<<: *defaults
- bb-js:
requires:
Expand All @@ -1080,7 +1102,7 @@ workflows:
- bb-js-acir-tests:
requires:
- bb-js
- noir-acir-tests
- noir-compile-acir-tests
<<: *defaults

- l1-contracts: *defaults
Expand All @@ -1089,13 +1111,16 @@ workflows:

- yellow-paper: *defaults

- boxes-files: *defaults

# Yarn Project
- yarn-project-base:
requires:
- l1-contracts
- bb-js
- noir-ecr-manifest
- noir-packages
- boxes-files
<<: *defaults
- yarn-project:
requires:
Expand All @@ -1113,18 +1138,22 @@ workflows:
- aztec-faucet: *defaults_yarn_project_prod

# Boxes.
# - boxes-blank-react:
# requires:
# - aztec-sandbox
# <<: *defaults
# - boxes-blank:
# requires:
# - aztec-sandbox
# <<: *defaults
# - boxes-token:
# requires:
# - aztec-sandbox
# <<: *defaults
- boxes:
requires:
- aztec-sandbox
<<: *defaults
- boxes-blank:
requires:
- boxes
<<: *defaults
- boxes-blank-react:
requires:
- boxes
<<: *defaults
- boxes-token:
requires:
- boxes
<<: *defaults

# End to end tests.
- e2e-join:
Expand Down
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build-system/ @charlielye
/build_manifest.yml @charlielye
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ All the packages that make up [Aztec](https://docs.aztec.network).
- [Aztec.nr](./yarn-project/aztec-nr/): A [Noir](https://noir-lang.org) framework for smart contracts on Aztec.
- [Aztec Sandbox](./yarn-project/aztec-sandbox/): A package for setting up a local dev net, including a local Ethereum network, deployed rollup contracts and Aztec execution environment.
- [Aztec.js](./yarn-project/aztec.js/): A tool for interacting with the Aztec network. It communicates via the [Private Execution Environment (PXE)](./yarn-project/pxe/).
- [Aztec Boxes](./yarn-project/boxes/): A minimal framework for building full stack applications for Aztec (using React).
- [Example contracts](./yarn-project/noir-contracts/): Example contracts for the Aztec network, written in Noir.
- [End to end tests](./yarn-project/end-to-end/): Integration tests written in Typescript--a good reference for how to use the packages for specific tasks.
- [Aztec Boxes](./boxes/): Example starter projects.

## Issues Board

Expand Down
1 change: 1 addition & 0 deletions aztec-up/bin/aztec-nargo
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -euo pipefail

export SKIP_NET=1
export PATH=$PATH:$HOME/bin

if [ "${1:-}" == "lsp" ]; then
docker run -i -v $HOME:$HOME -e HOME=$HOME aztecprotocol/noir $@
Expand Down
4 changes: 2 additions & 2 deletions barretenberg/acir_tests/Dockerfile.bb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/barretenberg-x86_64-linux-clang-assert
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-acir-tests as noir-acir-tests
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-compile-acir-tests as noir-acir-tests

FROM node:18.19.0-alpine
RUN apk update && apk add git bash curl jq coreutils
Expand All @@ -13,4 +13,4 @@ RUN FLOW=prove_then_verify ./run_acir_tests.sh
# TODO(https://github.com/AztecProtocol/barretenberg/issues/811) make this able to run the default test
RUN FLOW=prove_and_verify_goblin ./run_acir_tests.sh assert_statement
# Run 1_mul through native bb build, all_cmds flow, to test all cli args.
RUN VERBOSE=1 FLOW=all_cmds ./run_acir_tests.sh 1_mul
RUN VERBOSE=1 FLOW=all_cmds ./run_acir_tests.sh 1_mul
2 changes: 1 addition & 1 deletion barretenberg/acir_tests/Dockerfile.bb.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/bb.js
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-acir-tests as noir-acir-tests
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-compile-acir-tests as noir-acir-tests

FROM node:18.19.0
COPY --from=0 /usr/src/barretenberg/ts-build /usr/src/barretenberg/ts
Expand Down
2 changes: 1 addition & 1 deletion barretenberg/acir_tests/Dockerfile.bb.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/barretenberg-x86_64-linux-clang-assert
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/barretenberg-x86_64-linux-clang-sol
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-acir-tests as noir-acir-tests
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-compile-acir-tests as noir-acir-tests

FROM node:18.19.0-alpine
RUN apk update && apk add git bash curl jq
Expand Down
8 changes: 8 additions & 0 deletions boxes/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.yarn/*
!.yarn/releases
dest
node_modules
.tsbuildinfo
Dockerfile*
.dockerignore
docker-compose.yml
6 changes: 6 additions & 0 deletions boxes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.yarn/*
!.yarn/releases

node_modules
dest
src/contracts/target

0 comments on commit 4a1c0df

Please sign in to comment.