-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduces earthly as an alternative CI that hopes to eventually replace our current build-system. https://docs.earthly.dev/ is a build system that combines Makefiles and Dockerfiles. This is basically exactly what our system needed, IMO, and has some nice things figured out. Hope is to reduce complexity of working with the build system by a good chunk. Core changes: - we have a github actions CI that runs a single end to end test inside earthly for arm64 and x86_64 - new Earthfile's now mirror the Dockerfile's, notable differences: - we build our own foundry package for ARM support - we build our own wasi-sdk package for ARM support - grumpkin SRS is no longer generated on the spot, but downloaded like bn254 SRS - we don't inject any commit hashes for Noir as this would cause spurious rebuilds as any difference stops caching, instead we inject a content hash (to be revisited) Side changes: - since we build our own wasi-sdk 21 package, and it is clang18, some compilation workarounds - allow specifying a different nargo and acvm binary in build - small output tweaks --------- Co-authored-by: Charlie Lye <karl.lye@gmail.com> Co-authored-by: Innokentii Sennovskii <isennovskiy@gmail.com> Co-authored-by: Cody Gunton <codygunton@gmail.com> Co-authored-by: Alex Gherghisan <alexghr@users.noreply.github.com> Co-authored-by: Mitchell Tracy <mitchell@aztecprotocol.com> Co-authored-by: Jan Beneš <janbenes1234@gmail.com> Co-authored-by: esau <152162806+sklppy88@users.noreply.github.com> Co-authored-by: Facundo <fcarreiro@users.noreply.github.com> Co-authored-by: josh crites <critesjosh@gmail.com> Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com> Co-authored-by: Álvaro Rodríguez <sirasistant@gmail.com> Co-authored-by: Ilyas Ridhuan <ilyas@aztecprotocol.com>
- Loading branch information
1 parent
acffa7b
commit 8e75fe5
Showing
67 changed files
with
1,159 additions
and
276 deletions.
There are no files selected for viewing
This file contains 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 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,46 @@ | ||
name: Run CI with Earthly | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: {} | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
# run ci for both x86_64 and arm64 | ||
strategy: {matrix: {environment: [x86, arm]}} | ||
# cancel if reran on same PR if exists, otherwise if on same commit | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.environment }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
submodules: recursive | ||
|
||
- name: Setup | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo DOCKER_HOST=ssh://build-instance-${{ matrix.environment }}.aztecprotocol.com >> $GITHUB_ENV | ||
echo ${{ secrets.DOCKERHUB_PASSWORD}} | docker login -u aztecprotocolci --password-stdin | ||
echo ${{ secrets.BUILD_INSTANCE_SSH_KEY }} | base64 -d > ~/.ssh/build_instance_key | ||
chmod 600 ~/.ssh/build_instance_key | ||
cat > ~/.ssh/config <<EOF | ||
IdentityFile ~/.ssh/build_instance_key | ||
StrictHostKeyChecking no | ||
User ubuntu | ||
EOF | ||
# Turn on if updating our custom built WASM-enabled clang (wasi-sdk), foundry or other base images | ||
#- name: Ensure Base Images | ||
# run: | | ||
# scripts/earthly --push ./foundry/+build | ||
# Uncomment the following line if needed for the arm environment | ||
# scripts/earthly --push ./barretenberg/cpp/+build-wasi-sdk | ||
|
||
- name: CI | ||
run: scripts/earthly +build-ci-small |
This file contains 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 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 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,31 @@ | ||
VERSION 0.8 | ||
FROM ubuntu:lunar | ||
|
||
build-ci: | ||
BUILD ./avm-transpiler/+build | ||
BUILD ./barretenberg/cpp/+build-release | ||
BUILD ./barretenberg/cpp/+preset-wasm | ||
BUILD ./barretenberg/cpp/+build-gcc | ||
BUILD ./barretenberg/cpp/+build-fuzzing | ||
BUILD ./barretenberg/cpp/+build-clang-assert | ||
BUILD ./barretenberg/cpp/+test-clang-format | ||
BUILD ./barretenberg/cpp/+test-clang-format | ||
BUILD ./boxes/+build | ||
BUILD ./noir/+packages | ||
BUILD ./noir/+nargo | ||
BUILD ./noir-projects/+build | ||
BUILD ./yarn-project/+build | ||
BUILD +test-end-to-end | ||
|
||
build-ci-small: | ||
BUILD ./yarn-project/end-to-end/+e2e-escrow-contract | ||
|
||
build: | ||
# yarn-project has the entry point to Aztec | ||
BUILD ./yarn-project/+build | ||
|
||
test-end-to-end: | ||
BUILD ./yarn-project/end-to-end/+test-all | ||
|
||
bench: | ||
RUN echo hi |
This file contains 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 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,23 @@ | ||
VERSION 0.8 | ||
IMPORT ../noir AS noir | ||
# we rely on noir source, which this image has | ||
FROM noir+nargo | ||
|
||
# move noir contents to /build/noir | ||
RUN mv /build /noir && mkdir /build && mv /noir /build | ||
# work in avm-transpiler | ||
WORKDIR /build/avm-transpiler | ||
|
||
RUN apt-get update && apt-get install -y git | ||
|
||
COPY --keep-ts --dir scripts src Cargo.lock Cargo.toml rust-toolchain.toml . | ||
|
||
build: | ||
RUN ./scripts/bootstrap_native.sh | ||
SAVE ARTIFACT target/release/avm-transpiler avm-transpiler | ||
|
||
run: | ||
#TODO needed? | ||
FROM ubuntu:focal | ||
COPY +build/avm-transpiler /build/avm-transpiler | ||
ENTRYPOINT ["sh", "-c"] |
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.