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

fix(ci): setup subaction, cache submodules in GA, fix concurrency #5531

Merged
merged 49 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
52827b0
chore: Load bb benches into aggregate benchmark
spalladino Mar 15, 2024
b37c3ae
cache submodules
ludamad Apr 1, 2024
bb10e91
ok what about this
ludamad Apr 1, 2024
538c7c9
fix
ludamad Apr 1, 2024
8497b8b
path
ludamad Apr 1, 2024
954c0bb
ci-setup
ludamad Apr 1, 2024
1d81978
Fix
ludamad Apr 1, 2024
e5eeafc
actions bruv
ludamad Apr 1, 2024
6196d76
actions
ludamad Apr 1, 2024
2932d43
setup
ludamad Apr 1, 2024
6571d55
bash
ludamad Apr 1, 2024
76bfa00
Setup path
ludamad Apr 1, 2024
fa1d1cf
never gonna cache again Guilty keys have got no rhythm
ludamad Apr 1, 2024
799a097
maybe id
ludamad Apr 2, 2024
22467cc
rev-parse
ludamad Apr 2, 2024
856de47
fix
ludamad Apr 2, 2024
fe7ae85
build
ludamad Apr 2, 2024
feb4491
rev parse head
ludamad Apr 2, 2024
d94bdd7
Update ci.yml
ludamad Apr 2, 2024
a50a253
what
ludamad Apr 2, 2024
da5c19c
Merge remote-tracking branch 'origin/ad/cache-submodules' into ad/cac…
ludamad Apr 2, 2024
9a8ea4d
what
ludamad Apr 2, 2024
a5f13e9
try
ludamad Apr 2, 2024
9da52ca
try diff
ludamad Apr 2, 2024
9647745
test
ludamad Apr 2, 2024
a52c97a
try
ludamad Apr 2, 2024
0f22920
hmm
ludamad Apr 2, 2024
13b062d
hmmx2
ludamad Apr 2, 2024
16a0b64
try again
ludamad Apr 2, 2024
88c52db
counter
ludamad Apr 2, 2024
ffb7e80
this?
ludamad Apr 2, 2024
926a705
try again...
ludamad Apr 2, 2024
87aac61
Update action.yml
ludamad Apr 2, 2024
32b28fd
comment
ludamad Apr 2, 2024
d629eca
action naem
ludamad Apr 2, 2024
35ae846
Merge branch 'master' into ad/cache-submodules
ludamad Apr 2, 2024
230b47b
comment
ludamad Apr 2, 2024
11a166e
Merge remote-tracking branch 'origin/ad/cache-submodules' into ad/cac…
ludamad Apr 2, 2024
f7fabb5
merge
ludamad Apr 2, 2024
b379440
Merge branch 'master' into ad/cache-submodules
ludamad Apr 2, 2024
c548a50
Better concurrency
ludamad Apr 2, 2024
3713f44
better
ludamad Apr 2, 2024
fc4c498
revert
ludamad Apr 2, 2024
39b8d73
fix
ludamad Apr 2, 2024
aca1d7d
typo
ludamad Apr 2, 2024
f2f697e
Merge branch 'master' into ad/cache-submodules
ludamad Apr 2, 2024
5e97eca
Merge branch 'master' into ad/cache-submodules
ludamad Apr 2, 2024
1d8fe7f
Update ci.yml
ludamad Apr 2, 2024
f7be60f
fix concurrency
ludamad Apr 2, 2024
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
35 changes: 35 additions & 0 deletions .github/ci-setup-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Reusable setup workflow for CI tasks
name: Setup Workflow
description: 'Reusable setup steps'

inputs:
dockerhub_password:
required: true
description: 'DockerHub Password'
github_actor:
required: true
description: 'GitHub Actor'

runs:
# define an action, runs in OS of caller
using: composite
steps:
- name: Cache Submodules
id: cache-submodules
uses: actions/cache@v3
with:
path: .git
key: submodules-${{ hashFiles('.gitmodules') }}

- name: Checkout Submodules
shell: bash
run: git submodule sync --recursive && git submodule update --init --recursive

- name: Setup Earthly
uses: earthly/actions-setup@v1
with:
version: 'v0.8.5'

- name: Setup Env
shell: bash
run: ./scripts/setup_env.sh ${{ inputs.dockerhub_password }} ${{ inputs.github_actor }}
94 changes: 44 additions & 50 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,21 @@ jobs:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: build-${{ github.event.pull_request.number || github.ref_name }}-x86
cancel-in-progress: ${{ github.ref_name != 'master' }}
group: build-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}-x86
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.5

- name: Checkout
uses: actions/checkout@v4
with:
# we check out submodules in ci-setup-action
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive

- name: Setup
working-directory: ./scripts
run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }} ${{ github.actor }}
uses: ./.github/ci-setup-action
with:
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
github_actor: ${{ github.actor }}

- name: Test
- name: Build
working-directory: ./yarn-project
run: |
# push to registry
Expand All @@ -58,29 +55,26 @@ jobs:
- e2e-crowdfunding-and-claim
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: ${{ matrix.test }}-${{ github.event.pull_request.number || github.ref_name }}-arm
cancel-in-progress: ${{ github.ref_name != 'master' }}
group: ${{ matrix.test }}-${{ github.ref_name == 'master' && github.run_id|| github.ref_name }}-arm
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.5

- name: Checkout
uses: actions/checkout@v4
with:
# we check out submodules in ci-setup-action
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive

- name: Setup
working-directory: ./scripts
run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }} ${{ github.actor }}
uses: ./.github/ci-setup-action
with:
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
github_actor: ${{ github.actor }}

- name: Test
- name: Build
working-directory: ./yarn-project/end-to-end/
# We don't do much on arm, just run it on their builder
run:
# Flags:
# - e2e_build=true to get images from a local build, not a dockerhub registry strategy
# - e2e_mode=build to get images from a local build, not a dockerhub registry strategy
earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_mode=build

# all the end-to-end integration tests for aztec
Expand All @@ -95,22 +89,19 @@ jobs:
test: ${{ fromJson( needs.build-x86.outputs.e2e_list )}}
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: ${{ matrix.test }}-${{ github.event.pull_request.number || github.ref_name }}-x86
cancel-in-progress: ${{ github.ref_name != 'master' }}
group: ${{ matrix.test }}-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}-x86
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.5

- name: Checkout
uses: actions/checkout@v4
with:
# we check out submodules in ci-setup-action
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive

- name: Setup
working-directory: ./scripts
run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }} ${{ github.actor }}
uses: ./.github/ci-setup-action
with:
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
github_actor: ${{ github.actor }}

- name: Pull E2E Images
working-directory: ./barretenberg/cpp/
Expand All @@ -134,26 +125,23 @@ jobs:
fail-fast: false
matrix:
environment: [x86]
# pending fix fot intermittent test
# pending fix for intermittent test
# environment: [x86, arm]
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: bb-native-tests-${{ github.event.pull_request.number || github.ref_name }}-${{ matrix.environment }}
cancel-in-progress: ${{ github.ref_name != 'master' }}
group: bb-native-tests-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}-${{ matrix.environment }}
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.5

- name: Checkout
uses: actions/checkout@v4
with:
# we check out submodules in ci-setup-action
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive

- name: Setup
working-directory: ./scripts
run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }} ${{ github.actor }}
uses: ./.github/ci-setup-action
with:
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
github_actor: ${{ github.actor }}

- name: Test
working-directory: ./barretenberg/cpp/
Expand All @@ -170,28 +158,34 @@ jobs:
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
# TODO this allows NO concurrency of bench jobs
# TODO if this takes too long, we need to divide up into different bench machines for each pipeline step
group: bench-x86
# We use a looser concurrency limit here, but we place a lock
# in the actual step action so that only one bench takes place
group: bench-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}-x86
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.5

- name: Checkout
uses: actions/checkout@v4
with:
# we check out submodules in ci-setup-action
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive

- name: Setup
working-directory: ./scripts
run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }} ${{ github.actor }}
uses: ./.github/ci-setup-action
with:
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
github_actor: ${{ github.actor }}

- name: Build and Push Binaries
working-directory: ./barretenberg/cpp/
run: earthly-cloud build x86 --push +bench-base

# Only allow one person to use this runner
# The reason is that as detailed in https://github.com/ben-z/gh-action-mutex
# things do not become 'pending' in github actions, and instead just cancel one another
- name: Set up mutex
uses: ben-z/gh-action-mutex@v1.0.0-alpha.9
with:
branch: gh-action-mutex-bench

# Use bench_mode=cache to read the pushed build above
- name: Client IVC Bench
working-directory: ./barretenberg/cpp/
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/protocol-circuits-gate-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ on:

jobs:
compare_protocol_circuits_gates:
# cancel if reran on same PR if exists, otherwise if on same commit
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref_name != 'master' }}
group: compare_protocol_circuits_gates-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}
if: "!startsWith(github.head_ref, 'release-please--')"
runs-on: ubuntu-20.04
steps:
Expand Down
Loading