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(ci): fix master, better spot copy times #6374

Merged
merged 11 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 3 additions & 2 deletions .github/ensure-tester-with-images/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ runs:
export BUILDER_SPOT_IP=${{ env.BUILDER_SPOT_IP }}
export BUILDER_SPOT_KEY=~/.ssh/build_instance_key
scripts/run_on_builder "
flock ${{ env.IMAGE_KEY }}.lock bash -c '! [ -f ${{ env.IMAGE_KEY }}.brotli ] && docker save ${{ inputs.builder_images_to_copy }} | brotli -2 > ${{ env.IMAGE_KEY }}.brotli'
cat ${{ env.IMAGE_KEY }}.brotli
sudo mkdir -p /var/lib/docker/images
sudo flock /var/lib/docker/images/${{ env.IMAGE_KEY }}.lock bash -c '! [ -f /var/lib/docker/images/${{ env.IMAGE_KEY }}.brotli ] && docker save ${{ inputs.builder_images_to_copy }} | brotli -2 > /var/lib/docker/images/${{ env.IMAGE_KEY }}.brotli'
sudo cat /var/lib/docker/images/${{ env.IMAGE_KEY }}.brotli
" | brotli --decompress | docker load

- name: Test
Expand Down
45 changes: 23 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
BUILD_INSTANCE_SSH_KEY: ${{ secrets.BUILD_INSTANCE_SSH_KEY }}
GIT_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
# kludge until we move away from runners
WAIT_FOR_RUNNERS: false

Expand All @@ -42,7 +43,7 @@ jobs:
bench_list: ${{ steps.bench_list.outputs.list }}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: build-${{ inputs.username || github.actor }}-x86
Expand All @@ -69,7 +70,7 @@ jobs:
test: ${{ fromJson( needs.build.outputs.e2e_list )}}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: Setup and Test
timeout-minutes: 40
Expand All @@ -79,7 +80,7 @@ jobs:
builder_type: builder-x86
# these are copied to the tester and expected by the earthly command below
# if they fail to copy, it will try to build them on the tester and fail
builder_images_to_copy: aztecprotocol/aztec:${{ github.event.pull_request.head.sha }} aztecprotocol/end-to-end:${{ github.event.pull_request.head.sha }}
builder_images_to_copy: aztecprotocol/aztec:${{ env.GITHUB_COMMIT }} aztecprotocol/end-to-end:${{ env.GITHUB_COMMIT }}
# command to produce the images in case they don't exist
builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images
run: |
Expand All @@ -98,7 +99,7 @@ jobs:
test: ${{ fromJson( needs.build.outputs.bench_list )}}
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: Setup and Test
uses: ./.github/ensure-tester-with-images
Expand All @@ -108,7 +109,7 @@ jobs:
builder_type: builder-x86
# these are copied to the tester and expected by the earthly command below
# if they fail to copy, it will try to build them on the tester and fail
builder_images_to_copy: aztecprotocol/aztec:${{ github.event.pull_request.head.sha }} aztecprotocol/end-to-end:${{ github.event.pull_request.head.sha }}
builder_images_to_copy: aztecprotocol/aztec:${{ env.GITHUB_COMMIT }} aztecprotocol/end-to-end:${{ env.GITHUB_COMMIT }}
# command to produce the images in case they don't exist
builder_command: cd yarn-project/end-to-end/ && ../../scripts/earthly-ci +${{ matrix.test }}
run: |
Expand All @@ -128,7 +129,7 @@ jobs:
# # - uses: actions/checkout@v4
# # with:
# # fetch-depth: 100 # Downloading base benchmark from master requires access to history
# # ref: "${{ github.event.pull_request.head.sha }}"
# # ref: "${{ env.GITHUB_COMMIT }}"
# # - uses: ./.github/ci-setup-action
# # with:
# # concurrency_key: build-${{ inputs.username || github.actor }}-x86
Expand All @@ -153,7 +154,7 @@ jobs:
runs-on: ${{ inputs.username || github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: noir-format-${{ inputs.username || github.actor }}-x86
Expand All @@ -173,7 +174,7 @@ jobs:
runs-on: ${{ inputs.username || github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
Expand All @@ -190,7 +191,7 @@ jobs:
runs-on: ${{ github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: bb-js-test-${{ github.actor }}-x86
Expand All @@ -204,7 +205,7 @@ jobs:
runs-on: ${{ inputs.username || github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: noir-${{ inputs.username || github.actor }}-x86
Expand All @@ -216,7 +217,7 @@ jobs:
runs-on: ${{ inputs.username || github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: noir-packages-${{ inputs.username || github.actor }}-x86
Expand All @@ -228,7 +229,7 @@ jobs:
runs-on: ${{ inputs.username || github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: noir-projects-${{ inputs.username || github.actor }}-x86
Expand All @@ -241,7 +242,7 @@ jobs:
runs-on: ${{ github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
Expand All @@ -256,7 +257,7 @@ jobs:
runs-on: ${{ github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
Expand All @@ -270,7 +271,7 @@ jobs:
runs-on: ${{ github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: prover-client-test-${{ github.actor }}-x86
Expand All @@ -283,7 +284,7 @@ jobs:
runs-on: ${{ github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: build-acir-tests-${{ github.actor }}-x86
Expand All @@ -296,7 +297,7 @@ jobs:
runs-on: ${{ github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: barretenberg-acir-tests-bb-${{ github.actor }}-x86
Expand All @@ -310,7 +311,7 @@ jobs:
runs-on: ${{ github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: barretenberg-acir-tests-sol-${{ github.actor }}-x86
Expand All @@ -324,7 +325,7 @@ jobs:
runs-on: ${{ github.actor }}-x86
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: barretenberg-acir-tests-bb-js-${{ github.actor }}-x86
Expand All @@ -339,7 +340,7 @@ jobs:
if: github.event.number
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
with:
concurrency_key: docs-preview-${{ inputs.username || github.actor }}-x86
Expand All @@ -352,7 +353,7 @@ jobs:
needs: setup
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
- uses: ./.github/ci-setup-action
- name: Build Bench Binaries
uses: ./.github/ensure-builder
Expand All @@ -378,7 +379,7 @@ jobs:
pull-requests: write
steps:
- uses: actions/checkout@v4
with: { ref: "${{ github.event.pull_request.head.sha }}" }
with: { ref: "${{ env.GITHUB_COMMIT }}" }
# Only allow one memory-hunger prover test to use this runner
- uses: ./.github/ci-setup-action
with:
Expand Down
2 changes: 2 additions & 0 deletions scripts/ci/attach_ebs_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ fi
mkdir -p /var/lib/docker
mount $BLKDEVICE /var/lib/docker
service docker restart
# clear our images cache
rm -rf /var/lib/docker/images
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this running every time we mount the cache on an instance? Is it ok to clear the cache then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a bad name, let me fix it

# important: everything (except earthly ls) should go through earthly-ci
scripts/earthly-ci bootstrap
touch /home/ubuntu/.setup-complete
Loading