Skip to content

Commit 4a1c0df

Browse files
authored
chore: Bring boxes back to CI. Build and run using docker/docker-compose. (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.
1 parent b265531 commit 4a1c0df

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1731
-32173
lines changed

.circleci/config.yml

+62-33
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
name: "Build"
115115
command: cond_spot_run_build noir-packages 32
116116

117-
noir-acir-tests:
117+
noir-compile-acir-tests:
118118
docker:
119119
- image: aztecprotocol/alpine-build-image
120120
resource_class: small
@@ -123,7 +123,7 @@ jobs:
123123
- *setup_env
124124
- run:
125125
name: "Build"
126-
command: cond_spot_run_build noir-acir-tests 32
126+
command: cond_spot_run_build noir-compile-acir-tests 32
127127

128128
# Barretenberg
129129
barretenberg-wasm-linux-clang:
@@ -324,6 +324,17 @@ jobs:
324324
name: "Build and test"
325325
command: build l1-contracts
326326

327+
boxes-files:
328+
machine:
329+
image: ubuntu-2204:2023.07.2
330+
resource_class: medium
331+
steps:
332+
- *checkout
333+
- *setup_env
334+
- run:
335+
name: "Build"
336+
command: build boxes-files
337+
327338
yarn-project-base:
328339
machine:
329340
image: ubuntu-2204:2023.07.2
@@ -423,38 +434,49 @@ jobs:
423434
name: "Build and test"
424435
command: build aztec-faucet | add_timestamps
425436

426-
boxes-blank-react:
427-
machine:
428-
image: ubuntu-2204:2023.07.2
429-
resource_class: large
437+
boxes:
438+
docker:
439+
- image: aztecprotocol/alpine-build-image
440+
resource_class: small
430441
steps:
431442
- *checkout
432443
- *setup_env
433444
- run:
434-
name: "Test via adhoc script"
435-
command: ./boxes/run_tests blank-react
445+
name: "Build"
446+
command: cond_spot_run_build boxes 4
436447

437448
boxes-blank:
438-
machine:
439-
image: ubuntu-2204:2023.07.2
440-
resource_class: large
449+
docker:
450+
- image: aztecprotocol/alpine-build-image
451+
resource_class: small
441452
steps:
442453
- *checkout
443454
- *setup_env
444455
- run:
445-
name: "Test via adhoc script"
446-
command: ./boxes/run_tests blank
456+
name: "Test"
457+
command: cond_spot_run_compose boxes 4 ./docker-compose.yml BOX=box-blank
458+
459+
boxes-blank-react:
460+
docker:
461+
- image: aztecprotocol/alpine-build-image
462+
resource_class: small
463+
steps:
464+
- *checkout
465+
- *setup_env
466+
- run:
467+
name: "Test"
468+
command: cond_spot_run_compose boxes 4 ./docker-compose.yml BOX=box-blank-react
447469

448470
boxes-token:
449-
machine:
450-
image: ubuntu-2204:2023.07.2
451-
resource_class: large
471+
docker:
472+
- image: aztecprotocol/alpine-build-image
473+
resource_class: small
452474
steps:
453475
- *checkout
454476
- *setup_env
455477
- run:
456-
name: "Test via adhoc script"
457-
command: ./boxes/run_tests token
478+
name: "Test"
479+
command: cond_spot_run_compose boxes 4 ./docker-compose.yml BOX=box-token
458480

459481
end-to-end:
460482
machine:
@@ -1045,7 +1067,7 @@ workflows:
10451067
- noir-arm64
10461068
<<: *defaults
10471069
- noir-packages: *defaults
1048-
- noir-acir-tests:
1070+
- noir-compile-acir-tests:
10491071
requires:
10501072
- noir-ecr-manifest
10511073
<<: *defaults
@@ -1067,7 +1089,7 @@ workflows:
10671089
- barretenberg-acir-tests-bb:
10681090
requires:
10691091
- barretenberg-x86_64-linux-clang-assert
1070-
- noir-acir-tests
1092+
- noir-compile-acir-tests
10711093
<<: *defaults
10721094
- bb-js:
10731095
requires:
@@ -1080,7 +1102,7 @@ workflows:
10801102
- bb-js-acir-tests:
10811103
requires:
10821104
- bb-js
1083-
- noir-acir-tests
1105+
- noir-compile-acir-tests
10841106
<<: *defaults
10851107

10861108
- l1-contracts: *defaults
@@ -1089,13 +1111,16 @@ workflows:
10891111

10901112
- yellow-paper: *defaults
10911113

1114+
- boxes-files: *defaults
1115+
10921116
# Yarn Project
10931117
- yarn-project-base:
10941118
requires:
10951119
- l1-contracts
10961120
- bb-js
10971121
- noir-ecr-manifest
10981122
- noir-packages
1123+
- boxes-files
10991124
<<: *defaults
11001125
- yarn-project:
11011126
requires:
@@ -1113,18 +1138,22 @@ workflows:
11131138
- aztec-faucet: *defaults_yarn_project_prod
11141139

11151140
# Boxes.
1116-
# - boxes-blank-react:
1117-
# requires:
1118-
# - aztec-sandbox
1119-
# <<: *defaults
1120-
# - boxes-blank:
1121-
# requires:
1122-
# - aztec-sandbox
1123-
# <<: *defaults
1124-
# - boxes-token:
1125-
# requires:
1126-
# - aztec-sandbox
1127-
# <<: *defaults
1141+
- boxes:
1142+
requires:
1143+
- aztec-sandbox
1144+
<<: *defaults
1145+
- boxes-blank:
1146+
requires:
1147+
- boxes
1148+
<<: *defaults
1149+
- boxes-blank-react:
1150+
requires:
1151+
- boxes
1152+
<<: *defaults
1153+
- boxes-token:
1154+
requires:
1155+
- boxes
1156+
<<: *defaults
11281157

11291158
# End to end tests.
11301159
- e2e-join:

CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build-system/ @charlielye
2+
/build_manifest.yml @charlielye

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ All the packages that make up [Aztec](https://docs.aztec.network).
1111
- [Aztec.nr](./yarn-project/aztec-nr/): A [Noir](https://noir-lang.org) framework for smart contracts on Aztec.
1212
- [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.
1313
- [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/).
14-
- [Aztec Boxes](./yarn-project/boxes/): A minimal framework for building full stack applications for Aztec (using React).
1514
- [Example contracts](./yarn-project/noir-contracts/): Example contracts for the Aztec network, written in Noir.
1615
- [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.
16+
- [Aztec Boxes](./boxes/): Example starter projects.
1717

1818
## Issues Board
1919

aztec-up/bin/aztec-nargo

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
set -euo pipefail
33

44
export SKIP_NET=1
5+
export PATH=$PATH:$HOME/bin
56

67
if [ "${1:-}" == "lsp" ]; then
78
docker run -i -v $HOME:$HOME -e HOME=$HOME aztecprotocol/noir $@

barretenberg/acir_tests/Dockerfile.bb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/barretenberg-x86_64-linux-clang-assert
2-
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-acir-tests as noir-acir-tests
2+
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-compile-acir-tests as noir-acir-tests
33

44
FROM node:18.19.0-alpine
55
RUN apk update && apk add git bash curl jq coreutils
@@ -13,4 +13,4 @@ RUN FLOW=prove_then_verify ./run_acir_tests.sh
1313
# TODO(https://github.com/AztecProtocol/barretenberg/issues/811) make this able to run the default test
1414
RUN FLOW=prove_and_verify_goblin ./run_acir_tests.sh assert_statement
1515
# Run 1_mul through native bb build, all_cmds flow, to test all cli args.
16-
RUN VERBOSE=1 FLOW=all_cmds ./run_acir_tests.sh 1_mul
16+
RUN VERBOSE=1 FLOW=all_cmds ./run_acir_tests.sh 1_mul

barretenberg/acir_tests/Dockerfile.bb.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/bb.js
2-
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-acir-tests as noir-acir-tests
2+
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-compile-acir-tests as noir-acir-tests
33

44
FROM node:18.19.0
55
COPY --from=0 /usr/src/barretenberg/ts-build /usr/src/barretenberg/ts

barretenberg/acir_tests/Dockerfile.bb.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/barretenberg-x86_64-linux-clang-assert
22
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/barretenberg-x86_64-linux-clang-sol
3-
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-acir-tests as noir-acir-tests
3+
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/noir-compile-acir-tests as noir-acir-tests
44

55
FROM node:18.19.0-alpine
66
RUN apk update && apk add git bash curl jq

boxes/.dockerignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.yarn/*
2+
!.yarn/releases
3+
dest
4+
node_modules
5+
.tsbuildinfo
6+
Dockerfile*
7+
.dockerignore
8+
docker-compose.yml

boxes/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.yarn/*
2+
!.yarn/releases
3+
4+
node_modules
5+
dest
6+
src/contracts/target

0 commit comments

Comments
 (0)