Skip to content

Commit

Permalink
fix(ci): boxes (#10895)
Browse files Browse the repository at this point in the history
bootstrap_local was overloaded in purpose
  • Loading branch information
ludamad authored Dec 19, 2024
1 parent ab57045 commit a99619c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ case "$cmd" in
;;
"test-boxes")
github_group "test-boxes"
bootstrap_local "CI=1 SKIP_BB_CRS=1 ./bootstrap.sh fast && ./boxes/bootstrap.sh test";
bootstrap_local_noninteractive "CI=1 SKIP_BB_CRS=1 ./bootstrap.sh fast && ./boxes/bootstrap.sh test";
exit
;;
"image-aztec")
Expand Down
30 changes: 30 additions & 0 deletions ci3/bootstrap_local_noninteractive
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
# Launches our CI image locally and runs the bootstrap.
# This is used interim while we have CI runners that are not launched with bootstrap_ec2.
# It uses docker-in-docker as some test flows require it (e.g. e2e).
# We use a volume on /var/lib/docker as overlayfs trashes performance (in fact it just breaks).
# We mount in aws credentials to leverage the s3 cache.
# The host repository is mounted in read-only, and a clone is taken to ensure a clean start.
# If anything goes wrong during the run, the container will drop into a shell.

root=$(git rev-parse --show-toplevel)
source $root/ci3/source
current_commit=$(git rev-parse HEAD)
cmd=${1:-"CI=1 ./bootstrap.sh fast"}

docker run --rm \
--privileged \
-v bootstrap_ci_local_docker:/var/lib/docker \
-v $root:/aztec-packages-host:ro \
-v $HOME/.aws:/root/.aws \
aztecprotocol/ci:2.0 bash -c "
/usr/local/share/docker-init.sh &> /dev/null
git config --global --add safe.directory /aztec-packages-host/.git
mkdir -p /root/aztec-packages && cd /root/aztec-packages
# Ensure we get a clean clone of the repo.
git init &>/dev/null
git remote add origin https://github.com/aztecprotocol/aztec-packages
git fetch --depth 1 origin $current_commit 2>/dev/null || (echo 'The commit was not pushed, run aborted.' && exit 1)
git checkout FETCH_HEAD &>/dev/null
$cmd
"

0 comments on commit a99619c

Please sign in to comment.