From 36e4239eccf00bc009e42ec218d0922b5d1138da Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 1 Aug 2023 13:35:05 -0400 Subject: [PATCH] feat: minimal barretenberg .circleci (#1352) See https://github.com/AztecProtocol/barretenberg/pull/648 for this running This will free up a bunch of spot vcpu usage --- .../cpp/barretenberg/.circleci/config.yml | 654 +++++++++--------- 1 file changed, 327 insertions(+), 327 deletions(-) diff --git a/circuits/cpp/barretenberg/.circleci/config.yml b/circuits/cpp/barretenberg/.circleci/config.yml index 24bc70738dc..0dc48e614c0 100644 --- a/circuits/cpp/barretenberg/.circleci/config.yml +++ b/circuits/cpp/barretenberg/.circleci/config.yml @@ -55,73 +55,73 @@ setup_env: &setup_env name: "Setup environment" command: ./build-system/scripts/setup_env "$CIRCLE_SHA1" "$CIRCLE_TAG" "$CIRCLE_JOB" "$CIRCLE_REPOSITORY_URL" "$CIRCLE_BRANCH" -setup_aztec_commit: &setup_aztec_commit - run: - name: "Setup environment for Aztec Integration Testing" - command: | - # Load the aztec commit into env for use in integration tests - # Aztec commit will be chosen according to the following priorities: - # 1. if present, grab commit from cpp/.aztec-packages-commit file - # 2. if this is a branch with an identically named branch in aztec-pacakages, run against that branch - # 3. default to aztec-packages 'master' - - # default to master - AZTEC_COMMIT=master - echo "Checking if a branch/commit is specified in .aztec-packages-commit" - echo "or if this is a branch with a sibling branch in aztec-packages." - echo "Otherwise defaulting to test against circuits in aztec-packages 'master'." - - COMMIT_FROM_FILE=$(cat cpp/.aztec-packages-commit 2>/dev/null || true) - if [ -n "$COMMIT_FROM_FILE" ] && [[ "$COMMIT_FROM_FILE" = *[![:space:]]* ]]; then - # if a commit is present in .aztec-packages-commit, use that - # check that there is text in the commit file that is not just whitespace - echo "Using aztec-packages commit ($COMMIT_FROM_FILE) from .aztec-packages-commit file" - AZTEC_COMMIT=$COMMIT_FROM_FILE - elif [ -n "$CIRCLE_BRANCH" ] && [ "$CIRCLE_BRANCH" != master ]; then - echo "Checking if a sibling branch ($CIRCLE_BRANCH) exists in aztec-packages" - if git ls-remote --heads git@github.com:AztecProtocol/aztec-packages.git 2>/dev/null | grep "refs/heads/$CIRCLE_BRANCH" &>/dev/null; then - echo "Sibling branch ($CIRCLE_BRANCH) exists in aztec-packages! Circuits tests will run against that branch." - AZTEC_COMMIT=$CIRCLE_BRANCH - else - echo "No sibling branch exists in aztec-packages. Defaulting to 'master'." - fi - else - echo "Defaulting to 'master'." - fi - - echo "export AZTEC_COMMIT=$AZTEC_COMMIT" >> "$BASH_ENV" - source "$BASH_ENV" - -# This step is used to save logs from various barretenberg test to the workspace so that they can be used later to parse benchmark values out of them -# NOTE(AD): This is now obsolete as benchmarking has been moved to aztec-packages repo. Another pass may simplify this. -save_logs: &save_logs - persist_to_workspace: - root: /tmp/test-logs - paths: - - ./* +# setup_aztec_commit: &setup_aztec_commit +# run: +# name: "Setup environment for Aztec Integration Testing" +# command: | +# # Load the aztec commit into env for use in integration tests +# # Aztec commit will be chosen according to the following priorities: +# # 1. if present, grab commit from cpp/.aztec-packages-commit file +# # 2. if this is a branch with an identically named branch in aztec-pacakages, run against that branch +# # 3. default to aztec-packages 'master' + +# # default to master +# AZTEC_COMMIT=master +# echo "Checking if a branch/commit is specified in .aztec-packages-commit" +# echo "or if this is a branch with a sibling branch in aztec-packages." +# echo "Otherwise defaulting to test against circuits in aztec-packages 'master'." + +# COMMIT_FROM_FILE=$(cat cpp/.aztec-packages-commit 2>/dev/null || true) +# if [ -n "$COMMIT_FROM_FILE" ] && [[ "$COMMIT_FROM_FILE" = *[![:space:]]* ]]; then +# # if a commit is present in .aztec-packages-commit, use that +# # check that there is text in the commit file that is not just whitespace +# echo "Using aztec-packages commit ($COMMIT_FROM_FILE) from .aztec-packages-commit file" +# AZTEC_COMMIT=$COMMIT_FROM_FILE +# elif [ -n "$CIRCLE_BRANCH" ] && [ "$CIRCLE_BRANCH" != master ]; then +# echo "Checking if a sibling branch ($CIRCLE_BRANCH) exists in aztec-packages" +# if git ls-remote --heads git@github.com:AztecProtocol/aztec-packages.git 2>/dev/null | grep "refs/heads/$CIRCLE_BRANCH" &>/dev/null; then +# echo "Sibling branch ($CIRCLE_BRANCH) exists in aztec-packages! Circuits tests will run against that branch." +# AZTEC_COMMIT=$CIRCLE_BRANCH +# else +# echo "No sibling branch exists in aztec-packages. Defaulting to 'master'." +# fi +# else +# echo "Defaulting to 'master'." +# fi + +# echo "export AZTEC_COMMIT=$AZTEC_COMMIT" >> "$BASH_ENV" +# source "$BASH_ENV" + +# # This step is used to save logs from various barretenberg test to the workspace so that they can be used later to parse benchmark values out of them +# # NOTE(AD): This is now obsolete as benchmarking has been moved to aztec-packages repo. Another pass may simplify this. +# save_logs: &save_logs +# persist_to_workspace: +# root: /tmp/test-logs +# paths: +# - ./* jobs: - wasm-linux-clang: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Build" - command: cond_spot_run_build barretenberg-wasm-linux-clang 64 - - x86_64-linux-gcc: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Build" - command: cond_spot_run_build barretenberg-x86_64-linux-gcc 64 + # wasm-linux-clang: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Build" + # command: cond_spot_run_build barretenberg-wasm-linux-clang 64 + + # x86_64-linux-gcc: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Build" + # command: cond_spot_run_build barretenberg-x86_64-linux-gcc 64 x86_64-linux-clang: docker: @@ -134,229 +134,229 @@ jobs: name: "Build" command: cond_spot_run_build barretenberg-x86_64-linux-clang 64 - x86_64-linux-clang-assert: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Build" - command: cond_spot_run_build barretenberg-x86_64-linux-clang-assert 64 - - stdlib-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 stdlib-tests - - *save_logs - - dsl-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 dsl_tests - - *save_logs - - barretenberg-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_test_script ./scripts/bb-tests.sh barretenberg-x86_64-linux-clang-assert - - *save_logs - - honk-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 honk_tests - - *save_logs - - proof-system-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 proof_system_tests - - *save_logs - - stdlib-recursion-turbo-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 stdlib_recursion_tests --gtest_filter=*turbo* - - *save_logs - - stdlib-recursion-ultra-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 3 stdlib_recursion_tests --gtest_filter=-*turbo* - - *save_logs - - join-split-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 3 join_split_example_proofs_join_split_tests --gtest_filter=-*full_proof* - - *save_logs - - # bb-bin-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Test" - # command: cond_spot_run_test_script ./scripts/bin-test.sh barretenberg-x86_64-linux-clang-assert - - bb-js: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build" - command: build bb.js - - bb-js-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_tests bb.js - - acir-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: cond_spot_run_build acir-tests 32 - - # These machines cost a fortune (10x other machines). - # There is a branch coming for github actions that will build mac stuff on releases. - # I'll leave this here for now, just in case proves useful to be able to do CI mac builds on branches, - # but let's not uncomment in master. - # - # aarch64-macos-clang: - # macos: - # xcode: "14.3.1" - # resource_class: macos.m1.medium.gen1 - # steps: - # - *checkout - # - run: - # name: "Install toolchain" - # command: brew install cmake ninja - # - run: - # name: "Build" - # working_directory: ~/project/cpp - # command: cmake --preset default && cmake --build --preset default --target bb - # - run: - # name: "Test" - # working_directory: ~/project/cpp/bin-test - # command: ./bin-test.sh - - ################################### - # Aztec integration tests - #circuits-wasm-linux-clang-builder-runner: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Build" - # command: cond_spot_run_build barretenberg-circuits-wasm-linux-clang-builder-runner 64 - - circuits-x86_64-linux-clang-builder-runner: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Build" - command: cond_spot_run_build barretenberg-circuits-x86_64-linux-clang-builder-runner 64 - - #circuits-wasm-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - *setup_aztec_commit - # - run: - # name: "Build" - # command: cond_spot_run_test_script ./scripts/run_aztec_circuits_tests barretenberg-circuits-wasm-linux-clang-builder-runner "$AZTEC_COMMIT" 1 wasm scripts/a3-tests -*.skip*:*.circuit* - - circuits-x86_64-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - *setup_aztec_commit - - run: - name: "Build" - command: cond_spot_run_test_script ./scripts/run_aztec_circuits_tests barretenberg-circuits-x86_64-linux-clang-builder-runner "$AZTEC_COMMIT" 1 x86_64 scripts/a3-tests -*.skip* - # End Aztec integration tests - ################################### + # x86_64-linux-clang-assert: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Build" + # command: cond_spot_run_build barretenberg-x86_64-linux-clang-assert 64 + + # stdlib-tests: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Test" + # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 stdlib-tests + # - *save_logs + + # dsl-tests: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Test" + # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 dsl_tests + # - *save_logs + + # barretenberg-tests: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Test" + # command: cond_spot_run_test_script ./scripts/bb-tests.sh barretenberg-x86_64-linux-clang-assert + # - *save_logs + + # honk-tests: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Test" + # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 honk_tests + # - *save_logs + + # proof-system-tests: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Test" + # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 proof_system_tests + # - *save_logs + + # stdlib-recursion-turbo-tests: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Test" + # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 stdlib_recursion_tests --gtest_filter=*turbo* + # - *save_logs + + # stdlib-recursion-ultra-tests: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Test" + # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 3 stdlib_recursion_tests --gtest_filter=-*turbo* + # - *save_logs + + # join-split-tests: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Test" + # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 3 join_split_example_proofs_join_split_tests --gtest_filter=-*full_proof* + # - *save_logs + + # # bb-bin-tests: + # # docker: + # # - image: aztecprotocol/alpine-build-image + # # resource_class: small + # # steps: + # # - *checkout + # # - *setup_env + # # - run: + # # name: "Test" + # # command: cond_spot_run_test_script ./scripts/bin-test.sh barretenberg-x86_64-linux-clang-assert + + # bb-js: + # machine: + # image: ubuntu-2004:202010-01 + # resource_class: large + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Build" + # command: build bb.js + + # bb-js-tests: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Test" + # command: cond_spot_run_tests bb.js + + # acir-tests: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Build and test" + # command: cond_spot_run_build acir-tests 32 + + # # These machines cost a fortune (10x other machines). + # # There is a branch coming for github actions that will build mac stuff on releases. + # # I'll leave this here for now, just in case proves useful to be able to do CI mac builds on branches, + # # but let's not uncomment in master. + # # + # # aarch64-macos-clang: + # # macos: + # # xcode: "14.3.1" + # # resource_class: macos.m1.medium.gen1 + # # steps: + # # - *checkout + # # - run: + # # name: "Install toolchain" + # # command: brew install cmake ninja + # # - run: + # # name: "Build" + # # working_directory: ~/project/cpp + # # command: cmake --preset default && cmake --build --preset default --target bb + # # - run: + # # name: "Test" + # # working_directory: ~/project/cpp/bin-test + # # command: ./bin-test.sh + + # ################################### + # # Aztec integration tests + # #circuits-wasm-linux-clang-builder-runner: + # # docker: + # # - image: aztecprotocol/alpine-build-image + # # resource_class: small + # # steps: + # # - *checkout + # # - *setup_env + # # - run: + # # name: "Build" + # # command: cond_spot_run_build barretenberg-circuits-wasm-linux-clang-builder-runner 64 + + # circuits-x86_64-linux-clang-builder-runner: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - run: + # name: "Build" + # command: cond_spot_run_build barretenberg-circuits-x86_64-linux-clang-builder-runner 64 + + # #circuits-wasm-tests: + # # docker: + # # - image: aztecprotocol/alpine-build-image + # # resource_class: small + # # steps: + # # - *checkout + # # - *setup_env + # # - *setup_aztec_commit + # # - run: + # # name: "Build" + # # command: cond_spot_run_test_script ./scripts/run_aztec_circuits_tests barretenberg-circuits-wasm-linux-clang-builder-runner "$AZTEC_COMMIT" 1 wasm scripts/a3-tests -*.skip*:*.circuit* + + # circuits-x86_64-tests: + # docker: + # - image: aztecprotocol/alpine-build-image + # resource_class: small + # steps: + # - *checkout + # - *setup_env + # - *setup_aztec_commit + # - run: + # name: "Build" + # command: cond_spot_run_test_script ./scripts/run_aztec_circuits_tests barretenberg-circuits-x86_64-linux-clang-builder-runner "$AZTEC_COMMIT" 1 x86_64 scripts/a3-tests -*.skip* + # # End Aztec integration tests + # ################################### # Repeatable config for defining the workflow below. tag_regex: &tag_regex /v[0-9]+(\.[0-9]+)*(-[a-zA-Z-]+\.[0-9]+)?/ @@ -372,55 +372,55 @@ defaults: &defaults event: fail branch_pattern: "master" -bb_test: &bb_test - requires: - - x86_64-linux-clang-assert - <<: *defaults +# bb_test: &bb_test +# requires: +# - x86_64-linux-clang-assert +# <<: *defaults -notmaster: ¬master - filters: - branches: - ignore: - - master - <<: *defaults +# notmaster: ¬master +# filters: +# branches: +# ignore: +# - master +# <<: *defaults workflows: system: jobs: # - aarch64-macos-clang: *defaults - - x86_64-linux-gcc: *defaults + # - x86_64-linux-gcc: *defaults - x86_64-linux-clang: *defaults - - x86_64-linux-clang-assert: *defaults - - wasm-linux-clang: *defaults - - proof-system-tests: *bb_test - - honk-tests: *bb_test - - dsl-tests: *bb_test - - barretenberg-tests: *bb_test - - stdlib-tests: *bb_test - - stdlib-recursion-turbo-tests: *bb_test - - stdlib-recursion-ultra-tests: *bb_test - - join-split-tests: *bb_test + # - x86_64-linux-clang-assert: *defaults + # - wasm-linux-clang: *defaults + # - proof-system-tests: *bb_test + # - honk-tests: *bb_test + # - dsl-tests: *bb_test + # - barretenberg-tests: *bb_test + # - stdlib-tests: *bb_test + # - stdlib-recursion-turbo-tests: *bb_test + # - stdlib-recursion-ultra-tests: *bb_test + # - join-split-tests: *bb_test # - bb-bin-tests: *bb_test - - bb-js: - requires: - - wasm-linux-clang - <<: *defaults - - bb-js-tests: - requires: - - bb-js - <<: *defaults - - acir-tests: - requires: - - x86_64-linux-clang-assert - - bb-js - <<: *defaults + # - bb-js: + # requires: + # - wasm-linux-clang + # <<: *defaults + # - bb-js-tests: + # requires: + # - bb-js + # <<: *defaults + # - acir-tests: + # requires: + # - x86_64-linux-clang-assert + # - bb-js + # <<: *defaults #- circuits-wasm-linux-clang-builder-runner: *notmaster - - circuits-x86_64-linux-clang-builder-runner: *notmaster + # - circuits-x86_64-linux-clang-builder-runner: *notmaster #- circuits-wasm-tests: # requires: # - circuits-wasm-linux-clang-builder-runner # <<: *notmaster - - circuits-x86_64-tests: - requires: - - circuits-x86_64-linux-clang-builder-runner - <<: *notmaster + # - circuits-x86_64-tests: + # requires: + # - circuits-x86_64-linux-clang-builder-runner + # <<: *notmaster