-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: e2e on spots [ci rebuild] (#3068)
We spent 21538 compute minutes in e2e jobs in the last 2 days. ![image](https://github.com/AztecProtocol/aztec-packages/assets/5764343/465d2a45-7572-4163-9380-011f8bc66eb5) Note that even in the reduced cost running on smallest docker instance, CCI makes up 2/3rds of the cost! Their machines are *over* 10x the cost of spot instance. Not a *huge* deal today, but if we intend on continuing to scale our collection of e2e tests it could be problematic. For reference, we've double our CCI costs every month for the last 3 months from ~$800 to now ~$5000. (Separate issue, but still hopeful we should eventually be able to run an e2e test in 10-20 seconds rather than minutes). Ignoring spot stuff and price, this PR makes an important step towards the correct build-system abstraction, i.e. build-system is responsible for: * Building docker containers. * Running containers, or compose files. * Handles the conditionality (rebuilding only what needs to be rebuilt). * Handles pulling of dependent containers to do builds or runs of compose. * Handles launching builds/runs on spots if wanting bigger cheap machines or lower cost. * Uploading processing benchmarks. Specifically this PR introduces `cond_run_compose` and `cond_spot_run_compose` scripts for launching built containers from compose scripts. We should *not* be calling custom project scripts from `config.yml`. We should run a container (or compose file), and the running of that container should run whatever script needs to be run. This takes us a step closer to the next phase, which code-generating config.yml from build-manifest.yml. **Please try to fit within this pattern and let's discuss if it doesn't work for some reason**. The code generating is more than just a convenience, but reflects that we have an abstraction that can be defined as a simple set of rules about how to build/run/deploy. It will make it much easier for engineers not familiar with build-system to add projects and for "just-the-right-thing" to happen. If we manage to get to that point, it may become relatively painless to shift the entire CI over to github actions, if so inclined.
- Loading branch information
1 parent
4b24c58
commit 15db6bf
Showing
17 changed files
with
207 additions
and
253 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,35 @@ | ||
#!/bin/bash | ||
[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace | ||
set -eu | ||
|
||
REPOSITORY=$1 | ||
COMPOSE_FILE=$2 | ||
shift 2 | ||
|
||
CONTENT_HASH=$(calculate_content_hash $REPOSITORY) | ||
BASE_TAG=cache-$CONTENT_HASH | ||
SUCCESS_TAG=$BASE_TAG-$JOB_NAME | ||
|
||
echo "Content hash: $CONTENT_HASH" | ||
|
||
if ! check_rebuild $SUCCESS_TAG $REPOSITORY; then | ||
# Login to pull our ecr images with docker. | ||
ecr_login | ||
|
||
# For each dependency and self, pull in the latest image and give it correct tag. | ||
for REPO in $(query_manifest runDependencies $REPOSITORY $JOB_NAME) $REPOSITORY; do | ||
echo "Pulling $REPO..." | ||
REPO_IMAGE_URI=$(calculate_image_uri $REPO) | ||
retry docker pull $REPO_IMAGE_URI | ||
docker tag $REPO_IMAGE_URI aztecprotocol/$REPO | ||
done | ||
|
||
cd $(query_manifest projectDir $REPOSITORY) | ||
|
||
export $@ | ||
docker-compose -f $COMPOSE_FILE run $REPOSITORY | ||
|
||
upload_logs_to_s3 log | ||
|
||
retry tag_remote_image $REPOSITORY $BASE_TAG $SUCCESS_TAG | ||
fi |
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,10 @@ | ||
#!/bin/bash | ||
[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace | ||
set -eu | ||
|
||
REPOSITORY=$1 | ||
CPUS=$2 | ||
shift 2 | ||
|
||
export TAG_POSTFIX=$JOB_NAME | ||
cond_spot_run_script $REPOSITORY $CPUS cond_run_compose $REPOSITORY $@ |
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
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
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.