Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: share e2e code with canary #2299

Merged
merged 16 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 38 additions & 12 deletions build_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,60 +26,83 @@
},
"bb.js": {
"buildDir": "barretenberg/ts",
"dependencies": ["barretenberg-wasm-linux-clang"]
"dependencies": [
"barretenberg-wasm-linux-clang"
]
},
"barretenberg-acir-tests-bb": {
"buildDir": "barretenberg/acir_tests",
"dockerfile": "Dockerfile.bb",
"dependencies": ["barretenberg-x86_64-linux-clang-assert"]
"dependencies": [
"barretenberg-x86_64-linux-clang-assert"
]
},
"barretenberg-acir-tests-bb.js": {
"buildDir": "barretenberg/acir_tests",
"dockerfile": "Dockerfile.bb.js",
"dependencies": ["bb.js"]
"dependencies": [
"bb.js"
]
},
"circuits-wasm-linux-clang": {
"buildDir": "circuits/cpp",
"dockerfile": "dockerfiles/Dockerfile.wasm-linux-clang",
"rebuildPatterns": ".rebuild_patterns",
"dependencies": ["barretenberg-wasm-linux-clang"]
"dependencies": [
"barretenberg-wasm-linux-clang"
]
},
"circuits-wasm-linux-clang-assert": {
"buildDir": "circuits/cpp",
"dockerfile": "dockerfiles/Dockerfile.wasm-linux-clang-assert",
"rebuildPatterns": ".rebuild_patterns",
"dependencies": ["barretenberg-wasm-linux-clang"]
"dependencies": [
"barretenberg-wasm-linux-clang"
]
},
"circuits-x86_64-linux-clang-tidy": {
"buildDir": "circuits/cpp",
"dockerfile": "dockerfiles/Dockerfile.x86_64-linux-clang-tidy",
"rebuildPatterns": ".rebuild_patterns",
"dependencies": ["barretenberg-x86_64-linux-clang"]
"dependencies": [
"barretenberg-x86_64-linux-clang"
]
},
"circuits-x86_64-linux-clang": {
"buildDir": "circuits/cpp",
"dockerfile": "dockerfiles/Dockerfile.x86_64-linux-clang",
"rebuildPatterns": ".rebuild_patterns",
"dependencies": ["barretenberg-x86_64-linux-clang"]
"dependencies": [
"barretenberg-x86_64-linux-clang"
]
},
"circuits-x86_64-linux-clang-assert": {
"buildDir": "circuits/cpp",
"dockerfile": "dockerfiles/Dockerfile.x86_64-linux-clang-assert",
"rebuildPatterns": ".rebuild_patterns",
"dependencies": ["barretenberg-x86_64-linux-clang"]
"dependencies": [
"barretenberg-x86_64-linux-clang"
]
},
"docs": {
"buildDir": ".",
"dockerfile": "docs/Dockerfile",
"rebuildPatterns": ["^docs/", "^.*.cpp$", "^.*.ts$"]
"rebuildPatterns": [
"^docs/",
"^.*.cpp$",
"^.*.ts$"
]
},
"l1-contracts": {
"buildDir": "l1-contracts"
},
"l1-artifacts": {
"buildDir": "yarn-project",
"projectDir": "yarn-project/l1-artifacts",
"rebuildPatterns": ["^l1-contracts/", "^yarn-project/l1-artifacts/"],
"rebuildPatterns": [
"^l1-contracts/",
"^yarn-project/l1-artifacts/"
],
"dependencies": []
},
"yarn-project-base": {
Expand All @@ -94,7 +117,10 @@
"^yarn-project/yarn-project-base/",
"^yarn-project/yarn.lock"
],
"dependencies": ["circuits-wasm-linux-clang", "l1-contracts"]
"dependencies": [
"circuits-wasm-linux-clang",
"l1-contracts"
]
},
"acir-simulator": {
"buildDir": "yarn-project",
Expand Down Expand Up @@ -207,4 +233,4 @@
"buildDir": "yarn-project",
"projectDir": "yarn-project/world-state"
}
}
}
2 changes: 1 addition & 1 deletion circuits/cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,4 @@
"inherits": "wasm"
}
]
}
}
21 changes: 15 additions & 6 deletions yarn-project/canary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
FROM node:18-alpine
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/yarn-project-base AS builder

RUN apk update && apk add --no-cache udev ttf-freefont chromium curl jq bash
ENV CHROME_BIN="/usr/bin/chromium-browser" PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"

ARG COMMIT_TAG=""

#Build canary
WORKDIR /usr/src/
COPY ./canary .
COPY . .

# Setup & Build end-to-end package
WORKDIR /usr/src/yarn-project/end-to-end
RUN ./scripts/setup_canary.sh $COMMIT_TAG
RUN yarn && yarn build

# Build canary package
WORKDIR /usr/src/yarn-project/canary
# Update @aztec deps
RUN ./scripts/update_packages.sh $COMMIT_TAG
RUN yarn && yarn build

RUN cp node_modules/@aztec/aztec.js/dest/main.js src/web/
RUN cp node_modules/@aztec/circuits.js/resources/aztec3-circuits.wasm src/web/
# Copy web artifacts for browser test
RUN cp ../node_modules/@aztec/aztec.js/dest/main.js src/web/
RUN cp ../node_modules/@aztec/circuits.js/resources/aztec3-circuits.wasm src/web/

ENTRYPOINT ["yarn", "test"]
4 changes: 1 addition & 3 deletions yarn-project/canary/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"dependencies": {
"@aztec/aztec.js": "workspace:^",
"@aztec/cli": "workspace:^",
"@aztec/foundation": "workspace:^",
"@aztec/end-to-end": "workspace:^",
"@aztec/l1-artifacts": "workspace:^",
"@aztec/noir-contracts": "workspace:^",
"@jest/globals": "^29.5.0",
Expand All @@ -33,8 +33,6 @@
"jest": "^29.5.0",
"koa": "^2.14.2",
"koa-static": "^5.0.0",
"puppeteer": "^21.1.0",
"string-argv": "^0.3.2",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"tslib": "^2.4.0",
Expand Down
10 changes: 5 additions & 5 deletions yarn-project/canary/scripts/update_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ set -eu

COMMIT_TAG=$1

if [ -z "$COMMIT_TAG" ]; then
echo "No commit tag provided."
if [ -z "$COMMIT_TAG" ]; then
echo "No commit tag provided."
exit 0
fi

VERSION=$(npx semver $COMMIT_TAG)
if [ -z "$VERSION" ]; then
echo "$COMMIT_TAG is not a semantic version."
if [ -z "$VERSION" ]; then
echo "$COMMIT_TAG is not a semantic version."
exit 1
fi

echo "Updating Aztec dependencies to version $VERSION"

TMP=$(mktemp)
for PKG in $(jq --raw-output ".dependencies | keys[] | select(contains(\"@aztec/\"))" package.json); do
for PKG in $(jq --raw-output ".dependencies | keys[] | select(contains(\"@aztec/\") and (. != \"@aztec/end-to-end\"))" package.json); do
jq --arg v $VERSION ".dependencies[\"$PKG\"] = \$v" package.json > $TMP && mv $TMP package.json
done

Expand Down
Loading