-
Notifications
You must be signed in to change notification settings - Fork 609
feat: run noir-packages-test in Earthly #6174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| # Must include the .gitignore for all child projects as this is used by Earthly | ||
| # Note due to how we use Eartlhy each .gitignore MUST accompany any earthfile that might actually copy these artifacts | ||
| **/Earthfile | ||
| **/Readme.md | ||
| **/Dockerfile* | ||
| **/docker-compose*.yml | ||
|
|
||
| # root .gitignore contents | ||
| dest | ||
| node_modules | ||
| .cache | ||
| scripts/.earthly | ||
| .pnp.cjs | ||
| .pnp.loader.mjs | ||
| build/ | ||
| .idea | ||
| cmake-build-debug | ||
| .terraform* | ||
| .bootstrapped | ||
| .tsbuildinfo | ||
|
|
||
| # Local Netlify folder | ||
| .netlify | ||
|
|
||
| .graphite* | ||
| .DS_Store | ||
|
|
||
| **/*.dockerignore | ||
|
|
||
| # Earthly | ||
| .arg | ||
| .secret | ||
|
|
||
| # ./ .gitignore contents: | ||
| **/package.tgz | ||
| packages | ||
|
|
||
| # ./noir-repo/ .gitignore contents: | ||
| /target | ||
| .DS_Store | ||
| examples/**/target/ | ||
| examples/9 | ||
| node_modules | ||
| pkg/ | ||
| .idea | ||
|
|
||
| # Yarn | ||
| .pnp.* | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/sdks | ||
| !.yarn/versions | ||
|
|
||
| # Noir.js | ||
| tooling/noir_js/lib | ||
|
|
||
| # Nargo output | ||
| *.proof | ||
| *.acir | ||
| *.acir.sha256 | ||
| *.tr | ||
| *.pk | ||
| *.vk | ||
| **/Verifier.toml | ||
| **/contract | ||
| **/target | ||
| !test_programs/acir_artifacts/*/target | ||
| !test_programs/acir_artifacts/*/target/witness.gz | ||
| !compiler/wasm/noir-script/target | ||
|
|
||
| gates_report.json | ||
|
|
||
| # Github Actions scratch space | ||
| # This gives a location to download artifacts into the repository in CI without making git dirty. | ||
| libbarretenberg-wasm32 | ||
|
|
||
| # Wasm build atifacts | ||
| compiler/wasm/nodejs | ||
| compiler/wasm/web | ||
| tooling/noirc_abi_wasm/nodejs | ||
| tooling/noirc_abi_wasm/web | ||
| tooling/noir_js/lib | ||
|
|
||
| # docs autogen build | ||
| /docs/docs/noir_js/reference/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| VERSION 0.8 | ||
|
|
||
| nargo: | ||
| nargo-src: | ||
|
|
||
| FROM ../build-images/+build | ||
| WORKDIR /usr/src | ||
| # Relevant source (TODO finer-grained 'tooling') | ||
|
|
@@ -14,26 +15,58 @@ nargo: | |
| noir-repo/utils \ | ||
| noir-repo/Cargo.lock \ | ||
| noir-repo/Cargo.toml \ | ||
| noir-repo/.github \ | ||
| noir-repo | ||
|
|
||
| # TODO(AD) is this OK as a content hash? | ||
| # NOTE: we use a fake commit hash here | ||
| # we don't want Noir to rebuild everytime the parent repo changes | ||
| # just only when it changes | ||
| # the commit hash gets injected into version strings | ||
| ENV COMMIT_HASH=$(find . -type f -exec sha256sum {} ';' | sort | sha256sum | awk '{print $1}') | ||
| RUN echo $COMMIT_HASH > .content-hash | ||
|
|
||
| # # borrow Nix's approach to build everything in 1970 | ||
| ENV SOURCE_TIMESTAMP=1 | ||
| ENV SOURCE_DATE_EPOCH=1 | ||
|
|
||
| nargo: | ||
| FROM +nargo-src | ||
| RUN ./noir-repo/.github/scripts/wasm-bindgen-install.sh | ||
| COPY ./scripts/bootstrap_native.sh ./scripts/bootstrap_native.sh | ||
| RUN ./scripts/bootstrap_native.sh | ||
| RUN echo CONTENT HASH $COMMIT_HASH | tee .content-hash | ||
| SAVE ARTIFACT /usr/src/noir-repo/target/release/nargo nargo | ||
| SAVE ARTIFACT /usr/src/noir-repo/target/release/acvm acvm | ||
| SAVE IMAGE aztecprotocol/nargo | ||
|
|
||
| packages: | ||
| packages-deps: | ||
| BUILD ../barretenberg/ts/+build # prefetch | ||
| FROM ../build-images/+build | ||
|
|
||
| # `noir-repo` is nested inside of `noir` so we copy `bb.js` as such to account | ||
| # for the extra nested folder specified in portalled package paths | ||
| COPY ../barretenberg/ts/+build/build /usr/src/../barretenberg/ts | ||
| LOCALLY | ||
| LET packages = $(git ls-files "**/package*.json" package*.json) | ||
| LET tsconfigs = $(git ls-files "**/tsconfig*.json" tsconfig*.json) | ||
|
|
||
| WORKDIR /usr/src | ||
| FROM +nargo-src | ||
|
|
||
| COPY ../barretenberg/ts/+build/build /usr/src/barretenberg/ts | ||
|
|
||
| WORKDIR /usr/src/noir | ||
|
|
||
| COPY --dir \ | ||
| ./noir-repo/package.json \ | ||
| ./noir-repo/yarn.lock \ | ||
| ./noir-repo/.yarnrc.yml \ | ||
| ./noir-repo/.yarn \ | ||
| ./noir-repo | ||
|
|
||
| FOR file IN $packages | ||
| COPY $file $file | ||
| END | ||
|
|
||
| RUN cd noir-repo && yarn install --immutable && cd ../ | ||
|
|
||
| FOR file IN $tsconfigs | ||
| COPY $file $file | ||
| END | ||
|
|
||
| # Relevant source (TODO finer-grained) | ||
| COPY --dir \ | ||
|
|
@@ -45,7 +78,7 @@ packages: | |
| noir-repo/scripts \ | ||
| noir-repo/test_programs \ | ||
| noir-repo/tooling \ | ||
| noir-repo/utils \ | ||
| noir-repo/utils \ | ||
| noir-repo/Cargo.lock \ | ||
| noir-repo/.yarnrc.yml \ | ||
| noir-repo/.yarn \ | ||
|
|
@@ -58,16 +91,74 @@ packages: | |
| noir-repo/.github \ | ||
| noir-repo | ||
|
|
||
| COPY noir-repo/.github/scripts noir-repo/.github/scripts | ||
| COPY ./scripts/bootstrap_packages.sh ./scripts/bootstrap_packages.sh | ||
| packages: | ||
| FROM +packages-deps | ||
|
|
||
| # TODO(AD) is this OK as a content hash? | ||
| ENV COMMIT_HASH=$(find . -type f -exec sha256sum {} ';' | sort | sha256sum | awk '{print $1}') | ||
| RUN echo CONTENT HASH $COMMIT_HASH | tee .content-hash | ||
| COPY ./scripts/bootstrap_packages.sh ./scripts/bootstrap_packages.sh | ||
| RUN ./scripts/bootstrap_packages.sh | ||
| SAVE ARTIFACT packages | ||
| SAVE IMAGE --cache-hint | ||
|
|
||
| packages-test-build: | ||
| FROM +packages-deps | ||
|
|
||
| COPY +nargo/nargo /usr/src/noir/noir-repo/target/release/nargo | ||
| COPY +nargo/acvm /usr/src/noir/noir-repo/target/release/acvm | ||
|
|
||
| ENV NARGO_BACKEND_PATH=/usr/src/barretenberg/ts/dest/node/main.js | ||
| ENV PATH=$PATH:/usr/src/noir/noir-repo/target/release | ||
|
|
||
| WORKDIR /usr/src/barretenberg/ts | ||
| RUN yarn --immutable | ||
|
|
||
| WORKDIR /usr/src/noir/noir-repo | ||
| COPY --dir noir-repo/.github/scripts/wasm-bindgen-install.sh ./.github/scripts/wasm-bindgen-install.sh | ||
| RUN ./.github/scripts/wasm-bindgen-install.sh | ||
|
|
||
| ENV SOURCE_DATE_EPOCH=$(date +%s) | ||
| ENV GIT_DIRTY=false | ||
| ENV GIT_COMMIT=$COMMIT_HASH | ||
| RUN yarn build | ||
| # this builds text fixtures to be used in tests | ||
| RUN yarn workspace @noir-lang/noir_wasm run test:build_fixtures | ||
|
|
||
| SAVE ARTIFACT /usr/src /usr/src | ||
|
|
||
| packages-test-node: | ||
| FROM +packages-test-build | ||
| ENV NODE_OPTIONS=--max_old_space_size=8192 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't actually needed now that |
||
| WORKDIR /usr/src/noir/noir-repo | ||
| RUN yarn workspaces foreach \ | ||
| --parallel \ | ||
| --verbose \ | ||
| --exclude @noir-lang/root \ # foreach includes the root workspace, ignore it | ||
| --exclude @noir-lang/noir_js \ # noir_js OOMs | ||
| --exclude integration-tests \ # separate node and browser tests | ||
| --exclude @noir-lang/noir_wasm \ | ||
| run test | ||
| RUN yarn workspaces foreach \ | ||
| --parallel \ | ||
| --verbose \ | ||
| --include integration-tests \ | ||
| --include @noir-lang/noir_wasm \ | ||
| run test:node | ||
|
|
||
| packages-test-browser: | ||
| FROM node:18 | ||
| COPY --dir +packages-test-build/usr/src /usr | ||
| WORKDIR /usr/src/noir/noir-repo | ||
| RUN ./.github/scripts/playwright-install.sh | ||
| RUN yarn workspaces foreach \ | ||
| --parallel \ | ||
| --verbose \ | ||
| --include integration-tests \ | ||
| --include @noir-lang/noir_wasm \ | ||
| run test:browser | ||
|
|
||
| packages-test: | ||
| BUILD +packages-test-node | ||
| BUILD +packages-test-browser | ||
|
|
||
| run: | ||
| # When running the container, mount the users home directory to same location. | ||
| FROM ubuntu:noble | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spent way more time than I care to admit to discover this 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no!