Skip to content

Commit

Permalink
chore: ci3 fixes (#10280)
Browse files Browse the repository at this point in the history
Co-authored-by: Charlie Lye <[email protected]>
  • Loading branch information
ludamad and charlielye authored Nov 28, 2024
1 parent ef201b0 commit 248e650
Show file tree
Hide file tree
Showing 14 changed files with 868 additions and 905 deletions.
1,687 changes: 844 additions & 843 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

19 changes: 5 additions & 14 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,8 @@ base-log-uploader:
rm -rf aws awscliv2.zip
COPY +scripts/scripts /usr/src/scripts

ensure-build:
LOCALLY
RUN docker pull aztecprotocol/ci:2.0
RUN docker start registry || docker run -d -p 5000:5000 --name registry registry:2
RUN docker tag aztecprotocol/ci:2.0 127.0.0.1:5000/aztecprotocol/ci:2.0
RUN docker push 127.0.0.1:5000/aztecprotocol/ci:2.0

example:
WAIT
BUILD +ensure-build
END
LOCALLY
FROM local-registry.io/aztecprotocol/ci:2.0
RUN echo works
bootstrap:
# Note: Assumes a fresh clone!
FROM ./build-images+from-registry
COPY . .
RUN TEST=0 CI=1 ./bootstrap.sh
4 changes: 2 additions & 2 deletions barretenberg/acir_tests/browser-test-app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ __metadata:

"@aztec/bb.js@file:../../ts::locator=browser-test-app%40workspace%3A.":
version: 0.65.0
resolution: "@aztec/bb.js@file:../../ts#../../ts::hash=85adcd&locator=browser-test-app%40workspace%3A."
resolution: "@aztec/bb.js@file:../../ts#../../ts::hash=ec10b0&locator=browser-test-app%40workspace%3A."
dependencies:
comlink: "npm:^4.4.1"
commander: "npm:^10.0.1"
Expand All @@ -17,7 +17,7 @@ __metadata:
tslib: "npm:^2.4.0"
bin:
bb.js: ./dest/node/main.js
checksum: 10c0/d3622ba7becd0472742054f71fb10799636c679b571df852a7d84d06747730aa6a97dcae0336197e6f1887db996fe2e8fa9758004753686061aff7c77ba85e54
checksum: 10c0/9b4c4c6c87774e55fd2a5e47799e38237ad4bcddd5106012db9af386c50961fb6a0312c7001c99f685dd84f3c1e1846bf8bd903981fc8cd402d4c2d0c7eb2c09
languageName: node
linkType: hard

Expand Down
2 changes: 1 addition & 1 deletion barretenberg/cpp/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fi

# Attempt to just pull artefacts from CI and exit on success.
if [ -n "${USE_CACHE:-}" ] && ./bootstrap_cache.sh ; then
# This ensures is_build later will no-op
# This ensures the build later will no-op
SKIP_BUILD=1
fi

Expand Down
7 changes: 6 additions & 1 deletion ci3/base/denoise
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash
set -euo pipefail

if [ -n "${BUILD_SYSTEM_DEBUG:-}" ] ; then
set -e
$@
exit 0
fi
# Ensure a command is passed
if [ "$#" -eq 0 ]; then
echo "Usage: $0 <command>"
Expand Down Expand Up @@ -45,4 +50,4 @@ else
echo ". done (${SECONDS}s)"
fi

exit $status
exit $status
3 changes: 3 additions & 0 deletions l1-contracts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ fi
# Attempt to just pull artefacts from CI and elide the build on success.
[ -n "${USE_CACHE:-}" ] && ./bootstrap_cache.sh && SKIP_BUILD=1

export AZTEC_CACHE_REBUILD_PATTERNS=.rebuild_patterns
HASH=$($ci3/cache/content_hash)

if [ "${SKIP_BUILD:-0}" -eq 0 ] ; then
$ci3/github/group "l1-contracts build"
# Clean
Expand Down
18 changes: 3 additions & 15 deletions noir-projects/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,16 @@ if [ -n "$CMD" ]; then
exit 1
fi
fi

$ci3/github/group "noir-projects yarn"
$ci3/github/group "noir-projects build"
# TODO: Remove yarn, use bash?
yarn install
$ci3/github/endgroup

export AZTEC_CACHE_REBUILD_PATTERNS="
../noir/.rebuild_patterns
../barretenberg/cpp/.rebuild_patterns
./noir-protocol-circuits/.rebuild_patterns
./mock-protocol-circuits/.rebuild_patterns
./noir-contracts/.rebuild_patterns"
export AZTEC_CACHE_REBUILD_PATTERNS=$(echo ../noir/.rebuild_patterns_native {noir-protocol-circuits,mock-protocol-circuits,noir-contracts}/.rebuild_patterns)
VKS_HASH=$($ci3/cache/content_hash)

export AZTEC_CACHE_REBUILD_PATTERNS="
../noir/.rebuild_patterns
./noir-protocol-circuits/.rebuild_patterns
./mock-protocol-circuits/.rebuild_patterns
./noir-contracts/.rebuild_patterns"
export AZTEC_CACHE_REBUILD_PATTERNS=$(echo ../noir/.rebuild_patterns_native {../barretenberg/cpp,noir-protocol-circuits,mock-protocol-circuits,noir-contracts}/.rebuild_patterns)
CIRCUITS_HASH=$($ci3/cache/content_hash)

$ci3/github/group "noir-projects build"
# Attempt to just pull artefacts from CI first.
if [ -z "${USE_CACHE:-}" ] || ! ./bootstrap_cache_circuits.sh ; then
parallel --line-buffer --tag {} ::: {noir-contracts,noir-protocol-circuits,mock-protocol-circuits}/bootstrap_circuits.sh
Expand Down
3 changes: 1 addition & 2 deletions noir-projects/bootstrap_cache_circuits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ source $(git rev-parse --show-toplevel)/ci3/base/source

echo -e "\033[1mRetrieving noir projects circuits from remote cache...\033[0m"

export AZTEC_CACHE_REBUILD_PATTERNS={../noir,noir-protocol-circuits,mock-protocol-circuits,noir-contracts}/.rebuild_patterns
export AZTEC_CACHE_REBUILD_PATTERNS=$(echo ../noir/.rebuild_patterns_native {noir-protocol-circuits,mock-protocol-circuits,noir-contracts}/.rebuild_patterns)
$ci3/cache/download noir-projects-circuits-$($ci3/cache/content_hash).tar.gz

5 changes: 2 additions & 3 deletions noir-projects/bootstrap_cache_vks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ source $(git rev-parse --show-toplevel)/ci3/base/source

echo -e "\033[1mRetrieving noir projects vks from remote cache...\033[0m"

export AZTEC_CACHE_REBUILD_PATTERNS={../noir,../barretenberg/cpp,noir-protocol-circuits,mock-protocol-circuits,noir-contracts}/.rebuild_patterns
$ci3/cache/download noir-projects-vks-$($ci3/cache/content_hash).tar.gz

export AZTEC_CACHE_REBUILD_PATTERNS=$(echo ../noir/.rebuild_patterns_native {../barretenberg/cpp,noir-protocol-circuits,mock-protocol-circuits,noir-contracts}/.rebuild_patterns)
$ci3/cache/download noir-projects-vks-$($ci3/cache/content_hash).tar.gz
File renamed without changes.
5 changes: 0 additions & 5 deletions scripts/earthly-ci-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@ global:
cache_size_pct: 50
buildkit_max_parallelism: 10
container_frontend: docker-shell
buildkit_additional_config: |
[registry."172.17.0.1:5000"]
http = true
[registry."docker.io"]
mirrors = ["http://localhost:5000"]
buildkit_additional_args: ["-e", "BUILDKIT_STEP_LOG_MAX_SIZE=-1"]
11 changes: 0 additions & 11 deletions ci3/earthly/local → scripts/earthly-local
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,6 @@ else
S3_BUILD_CACHE_DOWNLOAD=false
fi

# Generate Earthly configuration dynamically
echo 'global:
buildkit_additional_config: |
[registry."'$(hostname -I | awk '{print $1}')':5000"]
http = true
[registry."local-registry.io"]
http = true
mirrors = ["http://'$(hostname -I | awk '{print $1}')':5000"]' > $earthly_config_tmp

export EARTHLY_CONFIG=$earthly_config_tmp

# Run Earthly with all secrets
earthly --secret AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-}" \
--secret AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY:-}" \
Expand Down
7 changes: 0 additions & 7 deletions scripts/earthly-local-config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion yarn-project/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CMD=${1:-}
function build {
$ci3/github/group "yarn-project build"

export AZTEC_CACHE_REBUILD_PATTERNS=../{avm-transpiler,l1-contracts,noir-projects,yarn-project}/.rebuild_patterns\ ../barretenberg/*/.rebuild_patterns
export AZTEC_CACHE_REBUILD_PATTERNS=$(echo ../noir/.rebuild_patterns* ../noir-projects/*/.rebuild_patterns ../{avm-transpiler,l1-contracts,yarn-project}/.rebuild_patterns ../barretenberg/*/.rebuild_patterns)
HASH=$($ci3/cache/content_hash)
# Generate l1-artifacts before creating lock file
(cd l1-artifacts && bash ./scripts/generate-artifacts.sh)
Expand Down

0 comments on commit 248e650

Please sign in to comment.