From 4b4b79efd1fea93f516d16a0bc7b625c64b431b1 Mon Sep 17 00:00:00 2001 From: Andrei <122784628+andrei-near@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:00:49 +0100 Subject: [PATCH 1/7] new bucket --- .github/workflows/master_fuzzer_binaries.yml | 14 +++++---- .../workflows/ondemand_fuzzer_binaries.yml | 29 ++++++++++--------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/master_fuzzer_binaries.yml b/.github/workflows/master_fuzzer_binaries.yml index e1139200f01..9160a377f69 100644 --- a/.github/workflows/master_fuzzer_binaries.yml +++ b/.github/workflows/master_fuzzer_binaries.yml @@ -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-services.iam.gserviceaccount.com" - name: Installing nightly rust run: | @@ -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" diff --git a/.github/workflows/ondemand_fuzzer_binaries.yml b/.github/workflows/ondemand_fuzzer_binaries.yml index 9d8a350ab71..772e2c97aa6 100644 --- a/.github/workflows/ondemand_fuzzer_binaries.yml +++ b/.github/workflows/ondemand_fuzzer_binaries.yml @@ -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-services.iam.gserviceaccount.com" - name: Installing nightly rust run: | @@ -61,16 +72,6 @@ jobs: 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" @@ -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" From 8e26d9ccc6ae782fb0ba687b82688b35048d69fa Mon Sep 17 00:00:00 2001 From: Andrei <122784628+andrei-near@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:56:14 +0100 Subject: [PATCH 2/7] test gs credentials --- .github/workflows/ondemand_fuzzer_binaries.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ondemand_fuzzer_binaries.yml b/.github/workflows/ondemand_fuzzer_binaries.yml index 772e2c97aa6..b6ca6b4095c 100644 --- a/.github/workflows/ondemand_fuzzer_binaries.yml +++ b/.github/workflows/ondemand_fuzzer_binaries.yml @@ -87,5 +87,7 @@ jobs: - name: "Compile fuzzers and upload to GCS" 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://nearone_fuzzer_targets/$branch_type/$NAME.tar.gz" + # RUSTFLAGS="--cfg fuzz" cargo +nightly bolero build-clusterfuzz --all-features --profile fuzz + touch test_clusterfuzz.tar + #gsutil cp -Z target/fuzz/clusterfuzz.tar "gs://nearone_fuzzer_targets/$branch_type/$NAME.tar.gz" + gsutil cp -Z clusterfuzz.tar "gs://nearone_fuzzer_targets/$branch_type/$NAME.tar.gz" From bfbdb70e618198005804f9e57f864a1b5cdad25a Mon Sep 17 00:00:00 2001 From: Andrei <122784628+andrei-near@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:56:42 +0100 Subject: [PATCH 3/7] no test --- .github/workflows/ondemand_fuzzer_binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ondemand_fuzzer_binaries.yml b/.github/workflows/ondemand_fuzzer_binaries.yml index b6ca6b4095c..59fc68d233e 100644 --- a/.github/workflows/ondemand_fuzzer_binaries.yml +++ b/.github/workflows/ondemand_fuzzer_binaries.yml @@ -88,6 +88,6 @@ 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 - touch test_clusterfuzz.tar + touch clusterfuzz.tar #gsutil cp -Z target/fuzz/clusterfuzz.tar "gs://nearone_fuzzer_targets/$branch_type/$NAME.tar.gz" gsutil cp -Z clusterfuzz.tar "gs://nearone_fuzzer_targets/$branch_type/$NAME.tar.gz" From 9455364da4db7c0f3f36fb65530716997b5aff71 Mon Sep 17 00:00:00 2001 From: Andrei <122784628+andrei-near@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:58:16 +0100 Subject: [PATCH 4/7] no rust --- .github/workflows/ondemand_fuzzer_binaries.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ondemand_fuzzer_binaries.yml b/.github/workflows/ondemand_fuzzer_binaries.yml index 59fc68d233e..05d07cff49b 100644 --- a/.github/workflows/ondemand_fuzzer_binaries.yml +++ b/.github/workflows/ondemand_fuzzer_binaries.yml @@ -54,8 +54,8 @@ jobs: - name: Installing nightly rust run: | - rustup install nightly - rustup default nightly + # rustup install nightly + # rustup default nightly - uses: baptiste0928/cargo-install@21a18ba3bf4a184d1804e8b759930d3471b1c941 with: From 623d2ac5d0a79f5445ee41a5ab293401b6cfbb64 Mon Sep 17 00:00:00 2001 From: Andrei <122784628+andrei-near@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:02:03 +0100 Subject: [PATCH 5/7] cloud v2 --- .github/workflows/ondemand_fuzzer_binaries.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ondemand_fuzzer_binaries.yml b/.github/workflows/ondemand_fuzzer_binaries.yml index 05d07cff49b..67e4d701386 100644 --- a/.github/workflows/ondemand_fuzzer_binaries.yml +++ b/.github/workflows/ondemand_fuzzer_binaries.yml @@ -52,10 +52,10 @@ jobs: workload_identity_provider: "projects/346595944828/locations/global/workloadIdentityPools/github-pool/providers/github-provider" service_account: "github-service-account@nearone-services.iam.gserviceaccount.com" - - name: Installing nightly rust - run: | - # rustup install nightly - # rustup default nightly + # - name: Installing nightly rust + # run: | + # rustup install nightly + # rustup default nightly - uses: baptiste0928/cargo-install@21a18ba3bf4a184d1804e8b759930d3471b1c941 with: @@ -65,10 +65,10 @@ jobs: git: https://github.com/Ekleog-NEAR/bolero rev: 56da8e6d1d018519a30b36d85d3a53fe35a42eaf - - run: rustup target add --toolchain nightly wasm32-unknown-unknown + # - 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" From 5b645435bc092adf9a294c868b6744b19f2ac302 Mon Sep 17 00:00:00 2001 From: Andrei <122784628+andrei-near@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:06:28 +0100 Subject: [PATCH 6/7] service account --- .github/workflows/ondemand_fuzzer_binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ondemand_fuzzer_binaries.yml b/.github/workflows/ondemand_fuzzer_binaries.yml index 67e4d701386..7e1b48853e5 100644 --- a/.github/workflows/ondemand_fuzzer_binaries.yml +++ b/.github/workflows/ondemand_fuzzer_binaries.yml @@ -50,7 +50,7 @@ jobs: uses: "google-github-actions/auth@v2" with: workload_identity_provider: "projects/346595944828/locations/global/workloadIdentityPools/github-pool/providers/github-provider" - service_account: "github-service-account@nearone-services.iam.gserviceaccount.com" + service_account: "github-service-account@nearone-clusterfuzz.iam.gserviceaccount.com" # - name: Installing nightly rust # run: | From 522400cfe818ccae0822baa3826db697920d12cb Mon Sep 17 00:00:00 2001 From: Andrei <122784628+andrei-near@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:09:49 +0100 Subject: [PATCH 7/7] tests ok --- .github/workflows/master_fuzzer_binaries.yml | 2 +- .github/workflows/ondemand_fuzzer_binaries.yml | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/master_fuzzer_binaries.yml b/.github/workflows/master_fuzzer_binaries.yml index 9160a377f69..715a2eb8b62 100644 --- a/.github/workflows/master_fuzzer_binaries.yml +++ b/.github/workflows/master_fuzzer_binaries.yml @@ -27,7 +27,7 @@ jobs: uses: "google-github-actions/auth@v2" with: workload_identity_provider: "projects/346595944828/locations/global/workloadIdentityPools/github-pool/providers/github-provider" - service_account: "github-service-account@nearone-services.iam.gserviceaccount.com" + service_account: "github-service-account@nearone-clusterfuzz.iam.gserviceaccount.com" - name: Installing nightly rust run: | diff --git a/.github/workflows/ondemand_fuzzer_binaries.yml b/.github/workflows/ondemand_fuzzer_binaries.yml index 7e1b48853e5..b2f05916127 100644 --- a/.github/workflows/ondemand_fuzzer_binaries.yml +++ b/.github/workflows/ondemand_fuzzer_binaries.yml @@ -52,10 +52,10 @@ jobs: 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: | - # rustup install nightly - # rustup default nightly + - name: Installing nightly rust + run: | + rustup install nightly + rustup default nightly - uses: baptiste0928/cargo-install@21a18ba3bf4a184d1804e8b759930d3471b1c941 with: @@ -65,7 +65,7 @@ jobs: git: https://github.com/Ekleog-NEAR/bolero rev: 56da8e6d1d018519a30b36d85d3a53fe35a42eaf - # - run: rustup target add --toolchain nightly wasm32-unknown-unknown + - run: rustup target add --toolchain nightly wasm32-unknown-unknown - name: "Set up GCP SDK" uses: "google-github-actions/setup-gcloud@v2" @@ -87,7 +87,5 @@ jobs: - name: "Compile fuzzers and upload to GCS" 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 - touch clusterfuzz.tar - #gsutil cp -Z target/fuzz/clusterfuzz.tar "gs://nearone_fuzzer_targets/$branch_type/$NAME.tar.gz" - gsutil cp -Z clusterfuzz.tar "gs://nearone_fuzzer_targets/$branch_type/$NAME.tar.gz" + RUSTFLAGS="--cfg fuzz" cargo +nightly bolero build-clusterfuzz --all-features --profile fuzz + gsutil cp -Z target/fuzz/clusterfuzz.tar "gs://nearone_fuzzer_targets/$branch_type/$NAME.tar.gz"