Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilWindle committed Sep 13, 2023
1 parent 5a697cd commit 24e6757
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 12 deletions.
23 changes: 20 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ jobs:
name: "Test"
command: ./scripts/cond_run_script end-to-end $JOB_NAME ./scripts/run_tests_local guides/dapp_testing.test.ts ./scripts/docker-compose-e2e-sandbox.yml
working_directory: yarn-project/end-to-end

guides-sample-dapp:
machine:
image: ubuntu-2004:202010-01
Expand Down Expand Up @@ -1057,6 +1057,17 @@ jobs:
name: "Noop"
command: echo Noop

aztec-sandbox-multi-platform:
machine:
image: ubuntu-2004:202010-01
resource_class: large
steps:
- *checkout
- *setup_env
- run:
name: "Build and test"
command: force_deploy_build aztec-sandbox-multi-platform "linux/amd64,linux/arm64,linux/arm/v7"

deploy-npm:
machine:
image: ubuntu-2004:202010-01
Expand Down Expand Up @@ -1181,6 +1192,7 @@ jobs:
command: |
deploy_ecr aztec-sandbox
deploy_npm aztec-sandbox
deploy-dockerhub:
machine:
image: ubuntu-2004:202010-01
Expand Down Expand Up @@ -1491,13 +1503,18 @@ workflows:
- guides-sample-dapp
<<: *defaults

- deploy-dockerhub:
- aztec-sandbox-multi-platform:
requires:
- e2e-end
<<: *defaults

- deploy-dockerhub:
requires:
- aztec-sandbox-multi-platform
<<: *deploy_defaults
- deploy-npm:
requires:
- e2e-end
- aztec-sandbox-multi-platform
<<: *deploy_defaults

- deploy-end:
Expand Down
7 changes: 3 additions & 4 deletions build-system/scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ set -euo pipefail

REPOSITORY=$1
FORCE_BUILD=${2:-"false"}
PLATFORMS=${3:-"linux/amd64"}
DOCKERFILE=$(query_manifest dockerfile $REPOSITORY)
PROJECT_DIR=$(query_manifest projectDir $REPOSITORY)
BUILD_DIR=$(query_manifest buildDir $REPOSITORY)
Expand Down Expand Up @@ -168,8 +169,7 @@ for STAGE in $STAGES; do
echo "Building stage: $STAGE"
STAGE_IMAGE_COMMIT_URI=$ECR_URL/$REPOSITORY:cache-$CONTENT_HASH-$STAGE
# Build our dockerfile, add timing information
#docker build --target $STAGE $STAGE_CACHE_FROM -t $STAGE_IMAGE_COMMIT_URI -f $DOCKERFILE --build-arg COMMIT_TAG=$COMMIT_TAG_VERSION --build-arg ARG_CONTENT_HASH=$CONTENT_HASH . \
docker buildx build --platform linux/arm64 --target $STAGE $STAGE_CACHE_FROM -t $STAGE_IMAGE_COMMIT_URI -f $DOCKERFILE --build-arg COMMIT_TAG=$COMMIT_TAG_VERSION --build-arg ARG_CONTENT_HASH=$CONTENT_HASH . \
docker buildx build --platform $PLATFORMS --target $STAGE $STAGE_CACHE_FROM -t $STAGE_IMAGE_COMMIT_URI -f $DOCKERFILE --build-arg COMMIT_TAG=$COMMIT_TAG_VERSION --build-arg ARG_CONTENT_HASH=$CONTENT_HASH . \
| while read line ; do echo "$(date "+%H:%M:%S")| $line"; done

# We don't want to have redo this stages work when building the final image. Use it as a layer cache.
Expand All @@ -193,8 +193,7 @@ fi
IMAGE_COMMIT_URI=$ECR_URL/$REPOSITORY:cache-$CONTENT_HASH
echo "Building image: $IMAGE_COMMIT_URI"
# Build our dockerfile, add timing information
#docker build -t $IMAGE_COMMIT_URI -f $DOCKERFILE $CACHE_FROM --build-arg COMMIT_TAG=$COMMIT_TAG_VERSION --build-arg ARG_CONTENT_HASH=$CONTENT_HASH . \
docker buildx build --platform linux/arm64 -t $IMAGE_COMMIT_URI -f $DOCKERFILE $CACHE_FROM --build-arg COMMIT_TAG=$COMMIT_TAG_VERSION --build-arg ARG_CONTENT_HASH=$CONTENT_HASH . \
docker buildx build --platform $PLATFORMS -t $IMAGE_COMMIT_URI -f $DOCKERFILE $CACHE_FROM --build-arg COMMIT_TAG=$COMMIT_TAG_VERSION --build-arg ARG_CONTENT_HASH=$CONTENT_HASH . \
| while read line ; do echo "$(date "+%H:%M:%S")| $line"; done
echo "Pushing image: $IMAGE_COMMIT_URI"
retry docker push $IMAGE_COMMIT_URI > /dev/null 2>&1
Expand Down
12 changes: 7 additions & 5 deletions build-system/scripts/force_deploy_build
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
set -e

REPOSITORY=$1
FORCE_BUILD=${2:-"false"}
shift
FORCE_BUILD=${1:-"false"}
shift

# if FORCE_BUILD is already set, just continue with it
if [[ $FORCE_BUILD == 'true' ]]; then
build $REPOSITORY true
build $REPOSITORY true $@
exit 0
fi

Expand All @@ -37,12 +39,12 @@ if [[ -n "${COMMIT_TAG:-}" ]]; then
VERSION=$(npx semver $COMMIT_TAG_VERSION)
if [ -z "$VERSION" ]; then
# Not a version tag, build normally
build $REPOSITORY
build $REPOSITORY false $@
else
# Force build
build $REPOSITORY true
build $REPOSITORY true $@
fi
else
# Not a tagged commit, build normally
build $REPOSITORY
build $REPOSITORY false $@
fi
17 changes: 17 additions & 0 deletions build_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,23 @@
"types"
]
},
"aztec-sandbox-multi-platform": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/aztec-sandbox",
"dockerfile": "aztec-sandbox/Dockerfile.multi",
"rebuildPatterns": ["^yarn-project/aztec-sandbox/"],
"dependencies": [
"aztec-node",
"aztec-rpc",
"aztec.js",
"circuits.js",
"ethereum",
"foundation",
"l1-artifacts",
"noir-contracts",
"types"
]
},
"aztec.js": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/aztec.js",
Expand Down

0 comments on commit 24e6757

Please sign in to comment.