diff --git a/bootstrap.sh b/bootstrap.sh index 80c8d4919b5..b4290e83b0f 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -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") diff --git a/ci3/bootstrap_local_noninteractive b/ci3/bootstrap_local_noninteractive new file mode 100755 index 00000000000..c2f6cc9ecd6 --- /dev/null +++ b/ci3/bootstrap_local_noninteractive @@ -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 +"