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

chore: move UPLOAD_LOGS into root earthfile #6424

Merged
merged 5 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
28 changes: 27 additions & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,30 @@ release-meta:
scripts:
FROM scratch
COPY scripts /usr/src/scripts
SAVE ARTIFACT /usr/src/scripts scripts
SAVE ARTIFACT /usr/src/scripts scripts

UPLOAD_LOGS:
FUNCTION
ARG PULL_REQUEST
ARG BRANCH
ARG COMMIT_HASH
LOCALLY
LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}"
FROM +base-log-uploader
TomAFrench marked this conversation as resolved.
Show resolved Hide resolved
COPY ./log /usr/var/log
ENV PULL_REQUEST=$PULL_REQUEST
ENV BRANCH=$BRANCH
ENV COMMIT_HASH=$COMMIT_HASH
RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log

base-log-uploader:
# Install awscli on a fresh ubuntu, and copy the repo "scripts" folder, which we'll use to upload logs
# Note that we cannot do this LOCALLY because Earthly does not support using secrets locally
FROM ubuntu:noble
RUN apt update && \
apt install -y curl git jq unzip
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update && \
rm -rf aws awscliv2.zip
COPY +scripts/scripts /usr/src/scripts
34 changes: 4 additions & 30 deletions yarn-project/end-to-end/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,32 +43,6 @@ E2E_TEST:
# Run our docker compose, ending whenever sandbox ends, filtering out noisy eth_getLogs
RUN docker run --rm aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG $test || $allow_fail

UPLOAD_LOGS:
FUNCTION
ARG PULL_REQUEST
ARG BRANCH
ARG COMMIT_HASH
LOCALLY
LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}"
FROM +base-log-uploader
COPY ./log /usr/var/log
ENV PULL_REQUEST=$PULL_REQUEST
ENV BRANCH=$BRANCH
ENV COMMIT_HASH=$COMMIT_HASH
RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log

base-log-uploader:
# Install awscli on a fresh ubuntu, and copy the repo "scripts" folder, which we'll use to upload logs
# Note that we cannot do this LOCALLY because Earthly does not support using secrets locally
FROM ubuntu:noble
RUN apt update && \
apt install -y curl git jq unzip
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update && \
rm -rf aws awscliv2.zip
COPY ../../+scripts/scripts /usr/src/scripts

e2e-2-pxes:
DO +E2E_TEST --test=./src/e2e_2_pxes.test.ts

Expand Down Expand Up @@ -208,25 +182,25 @@ bench-publish-rollup:
ARG BRANCH
ARG COMMIT_HASH
DO +E2E_COMPOSE_TEST --test=benchmarks/bench_publish_rollup.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml
DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH
DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH

bench-process-history:
ARG PULL_REQUEST
ARG BRANCH
ARG COMMIT_HASH
DO +E2E_COMPOSE_TEST --test=benchmarks/bench_process_history.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml
DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH
DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH

bench-tx-size:
ARG PULL_REQUEST
ARG BRANCH
ARG COMMIT_HASH
DO +E2E_COMPOSE_TEST --test=benchmarks/bench_tx_size_fees.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml
DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH
DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH

bench-proving:
ARG PULL_REQUEST
ARG BRANCH
ARG COMMIT_HASH
DO +E2E_COMPOSE_TEST --test=bench_proving --debug="aztec:benchmarks:*,aztec:prover*,aztec:bb*" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml
DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH
DO ../../+UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH
2 changes: 1 addition & 1 deletion yarn-project/scripts/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ bench-comment:
[ -f $BENCH_FOLDER/benchmark.json ] \
&& (cd /usr/src/yarn-project/scripts && AZTEC_BOT_COMMENTER_GITHUB_TOKEN=$AZTEC_BOT_COMMENTER_GITHUB_TOKEN yarn bench-comment) \
|| echo "No benchmark file found in $BENCH_FOLDER"


Loading