Skip to content

Commit

Permalink
New bucket for fuzz targets (#11131)
Browse files Browse the repository at this point in the history
Changing target bucket along with required auth.
Test run: https://github.com/near/nearcore/actions/runs/8783766575
  • Loading branch information
andrei-near authored Apr 23, 2024
1 parent 8954a36 commit c4342d2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/master_fuzzer_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ jobs:
- run: sudo mkswap /swap-file
- run: sudo swapon /swap-file

- name: Checkout
uses: actions/checkout@v4

- id: "auth"
uses: "google-github-actions/auth@v1"
name: Authenticate with Google Cloud
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: "projects/968400232856/locations/global/workloadIdentityPools/project-identity-pool/providers/github-provider"
service_account: "near-fuzzer-service-account@near-fuzzer.iam.gserviceaccount.com"
workload_identity_provider: "projects/346595944828/locations/global/workloadIdentityPools/github-pool/providers/github-provider"
service_account: "github-service-account@nearone-clusterfuzz.iam.gserviceaccount.com"

- name: Installing nightly rust
run: |
Expand All @@ -45,11 +49,9 @@ jobs:
with:
version: ">= 416.0.0"

- uses: actions/checkout@master

- name: "Compile fuzzers and upload to GCS"
run: |
NAME="nearcore-${{ github.ref_name }}-$(env TZ=Etc/UTC date +"%Y%m%d%H%M%S")"
# Our Clusterfuzz setup currently (2024-02) runs on Cascade Lake CPUs
RUSTFLAGS="--cfg fuzz -C target-cpu=cascadelake" cargo +nightly bolero build-clusterfuzz --all-features --profile fuzz
gsutil cp -Z target/fuzz/clusterfuzz.tar "gs://fuzzer_targets/${{ github.ref_name }}/$NAME.tar.gz"
gsutil cp -Z target/fuzz/clusterfuzz.tar "gs://nearone_fuzzer_targets/${{ github.ref_name }}/$NAME.tar.gz"
31 changes: 16 additions & 15 deletions .github/workflows/ondemand_fuzzer_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,22 @@ jobs:
- run: sudo mkswap /swap-file
- run: sudo swapon /swap-file

- name: Checkout Release/RC branch
if: contains(fromJSON('["released", "prereleased"]'), github.event.action)
uses: actions/checkout@v4

- name: Checkout ${{ github.event.inputs.branch_ref }} branch
if: ${{ github.event_name == 'workflow_dispatch'}}
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch_ref }}

- id: "auth"
uses: "google-github-actions/auth@v1"
name: Authenticate with Google Cloud
uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: "projects/968400232856/locations/global/workloadIdentityPools/project-identity-pool/providers/github-provider"
service_account: "near-fuzzer-service-account@near-fuzzer.iam.gserviceaccount.com"
workload_identity_provider: "projects/346595944828/locations/global/workloadIdentityPools/github-pool/providers/github-provider"
service_account: "github-service-account@nearone-clusterfuzz.iam.gserviceaccount.com"

- name: Installing nightly rust
run: |
Expand All @@ -57,20 +68,10 @@ jobs:
- run: rustup target add --toolchain nightly wasm32-unknown-unknown

- name: "Set up GCP SDK"
uses: "google-github-actions/setup-gcloud@v1"
uses: "google-github-actions/setup-gcloud@v2"
with:
version: ">= 416.0.0"

- name: Checkout Release/RC branch
if: contains(fromJSON('["released", "prereleased"]'), github.event.action)
uses: actions/checkout@master

- name: Checkout ${{ github.event.inputs.branch_ref }} branch
if: ${{ github.event_name == 'workflow_dispatch'}}
uses: actions/checkout@master
with:
ref: ${{ github.event.inputs.branch_ref }}

- name: Build Release branch fuzz targets
if: ${{ github.event.action == 'released'}}
run: echo "branch_type=release" >> "$GITHUB_ENV"
Expand All @@ -87,4 +88,4 @@ jobs:
run: |
NAME="nearcore-$branch_type-$(env TZ=Etc/UTC date +"%Y%m%d%H%M%S")"
RUSTFLAGS="--cfg fuzz" cargo +nightly bolero build-clusterfuzz --all-features --profile fuzz
gsutil cp -Z target/fuzz/clusterfuzz.tar "gs://fuzzer_targets/$branch_type/$NAME.tar.gz"
gsutil cp -Z target/fuzz/clusterfuzz.tar "gs://nearone_fuzzer_targets/$branch_type/$NAME.tar.gz"

0 comments on commit c4342d2

Please sign in to comment.