Skip to content

Commit

Permalink
chore: Fix noir-projects dockerfile for CircleCI (#7093)
Browse files Browse the repository at this point in the history
Broken after #6985

---------

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
  • Loading branch information
Thunkar and nventuro authored Jun 19, 2024
1 parent fcc15fa commit 52ce25d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 19 deletions.
9 changes: 9 additions & 0 deletions build_manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ noir-projects:
- noir
- avm-transpiler

# Compiles all aztec noir projects using nargo and the avm-transpiler, then tests them using the TXE.
noir-projects-tests:
buildDir: noir-projects
dockerfile: Dockerfile.test
dependencies:
- noir
- avm-transpiler
- yarn-project

# Uses nargo to compile all the noir test programs, used to test bb and bb.js.
noir-compile-acir-tests:
buildDir: noir/noir-repo/test_programs
Expand Down
25 changes: 6 additions & 19 deletions noir-projects/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM aztecprotocol/noir as noir
FROM aztecprotocol/avm-transpiler as transpiler
FROM aztecprotocol/yarn-project AS yarn-project

FROM ubuntu:lunar AS builder
RUN apt-get update && apt-get install -y parallel nodejs npm
Expand All @@ -14,25 +13,13 @@ ENV PATH="/usr/src/avm-transpiler/target/release:${PATH}"
# Copy in noir projects
WORKDIR /usr/src/noir-projects
COPY . .


# Build
WORKDIR /usr/src/noir-projects
RUN cd noir-protocol-circuits && ./bootstrap.sh && nargo test --silence-warnings

RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \
# Wait for TXE to initialize
sleep 5 && \
cd /usr/src/noir-projects/noir-contracts && \
./bootstrap.sh && nargo test --silence-warnings --oracle-resolver http://localhost:8080 ; \
kill $(cat /tmp/txe.pid)

RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \
# Wait for TXE to initialize
sleep 5 && \
cd /usr/src/noir-projects/aztec-nr && \
nargo test --silence-warnings --oracle-resolver http://localhost:8080

WORKDIR /usr/src/noir-projects/noir-contracts
RUN ./bootstrap.sh
WORKDIR /usr/src/noir-projects/noir-protocol-circuits
RUN ./bootstrap.sh
WORKDIR /usr/src/noir-projects/aztec-nr
RUN nargo compile --silence-warnings

FROM scratch
COPY --from=builder /usr/src/noir-projects /usr/src/noir-projects
38 changes: 38 additions & 0 deletions noir-projects/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM aztecprotocol/noir as noir
FROM aztecprotocol/avm-transpiler as transpiler
FROM aztecprotocol/yarn-project as yarn-project

RUN apt-get update && apt-get install -y parallel

# Copy in nargo
COPY --from=noir /usr/src/noir/noir-repo/target/release/nargo /usr/src/noir/noir-repo/target/release/nargo
ENV PATH="/usr/src/noir/noir-repo/target/release:${PATH}"
# Copy in transpiler
COPY --from=transpiler /usr/src/avm-transpiler/target/release/avm-transpiler /usr/src/avm-transpiler/target/release/avm-transpiler
ENV PATH="/usr/src/avm-transpiler/target/release:${PATH}"

# All built files are ignored so we have to repeat the txe build here.
# It is fast (compared to the tests) and we're moving to earthly, so we don't bother with something more sophisticated.
WORKDIR /usr/src/yarn-project
RUN yarn workspaces focus @aztec/txe
RUN cd ./txe && yarn build

# Copy in noir projects
WORKDIR /usr/src/noir-projects
COPY . .

# Build & test
RUN cd ./noir-protocol-circuits && ./bootstrap.sh && nargo test --silence-warnings

RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \
# Wait for TXE to initialize
sleep 5 && \
cd ./noir-contracts && \
./bootstrap.sh && nargo test --silence-warnings --oracle-resolver http://localhost:8080 ; \
kill $(cat /tmp/txe.pid)

RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \
# Wait for TXE to initialize
sleep 5 && \
cd ./aztec-nr && \
nargo test --silence-warnings --oracle-resolver http://localhost:8080

0 comments on commit 52ce25d

Please sign in to comment.