Skip to content

Conversation

@jasha26
Copy link
Contributor

@jasha26 jasha26 commented Jan 28, 2026

Description

This PR introduces a robust Cloud Build configuration (cloudbuild/benchmarks-cloudbuild.yaml) to automate performance benchmarking for GCSFS. It handles the full lifecycle of the benchmark run: provisioning infrastructure (VMs and GCS buckets), setting up the environment, executing benchmark scripts, and uploading results.

Substitutions

The substitutions section defines variables that control the infrastructure setup and the specific benchmarks to be executed. These can be overridden at build time.

Variable Description Format / Example
_ZONE The Google Cloud zone where the VM and Zonal buckets will be created. us-central1-a
_INFRA_PREFIX A prefix used for naming all generated resources (VMs, Buckets) to ensure uniqueness and easy identification. gcsfs-perf
_VM_SERVICE_ACCOUNT The email address of the Service Account attached to the benchmark VM. service-account@project.iam.gserviceaccount.com
_BUCKET_TYPES A space-separated list of bucket types to provision and test against. zonal regional hns
_BENCHMARK_CONFIG Defines the benchmark suites to run. Format: group1:config1,config2 group2:config1. read:read_seq,read_rand write:write_seq

Key Cloud Build Steps

The pipeline is designed to be robust, ensuring resources are cleaned up even if tests fail.

1. Generate SSH Key (generate-ssh-key)

Creates a temporary SSH key pair (google_compute_engine) for this specific build run to securely communicate with the worker VM.

2. Initialize Variables (init-variables)

  • Generates unique resource names (using the Build ID) for the VM and Buckets.
  • Writes these variables to a shared file (build_vars.env) so subsequent steps can reference the exact resources created.

3. Create Buckets (create-buckets)

  • Provisions the necessary GCS buckets (Regional, Zonal, HNS) in parallel based on _BUCKET_TYPES.
  • Ensures a persistent Results Bucket exists to store benchmark data.

4. Create VM (create-vm)

  • Provisions a high-performance Compute Engine VM (C4 instance with Hyperdisk) configured with the generated SSH keys and specific network settings.

5. Run Benchmarks (run-benchmarks)

  • Wait for SSH: Polls the VM until it is ready to accept connections.
  • Copy Source: Transfers the GCSFS source code to the VM using scp.
  • Install Dependencies: Runs a remote script to install Python, pip, and required system libraries.
  • Execute Tests: Iterates through the _BENCHMARK_CONFIG, running the Python benchmark script for each configuration against the provisioned buckets.
  • Upload Results: Uploads generated JSON/CSV result files from the VM to the persistent GCS Results Bucket.
  • Note: This step has allowFailure: true to ensure cleanup steps run even if benchmarks fail.

6. Cleanup (cleanup-ssh-key, cleanup-vm, delete-buckets)

  • SSH Keys: Removes the temporary public key from the project's OS Login metadata.
  • VM: Deletes the compute instance.
  • Buckets: Deletes the temporary test buckets.

7. Check Failure (check-failure)

  • Inspects a local marker file (/workspace/failure) created by the run-benchmarks step.
  • If the marker exists, this step explicitly fails the build, ensuring the CI system reports a failure status after cleanup is complete.

Testing

  • Verified via Cloud Build execution.
  • Confirmed VM creation, dependency installation, and benchmark script execution.
  • Verified results upload to GCS.

ankitaluthra1 and others added 5 commits January 25, 2026 15:10
* Adds test coverage check in repo

* Adds pytest covergae dependency

* Update threshold for new code
commit 37a9e59
Author: jasha26 <jasha@google.com>
Date:   Wed Jan 28 10:40:49 2026 +0000

    fixing python version warning

commit 4fcf690
Author: jasha26 <jasha@google.com>
Date:   Wed Jan 28 10:19:39 2026 +0000

    test cleanup fixes

commit 5d196e0
Author: jasha26 <jasha@google.com>
Date:   Wed Jan 28 10:18:29 2026 +0000

    test cleanup fixes

commit 9b5db26
Author: jasha26 <jasha@google.com>
Date:   Wed Jan 28 10:16:42 2026 +0000

    test cleanup fixes

commit 9ff78d9
Author: jasha26 <jasha@google.com>
Date:   Wed Jan 28 09:44:02 2026 +0000

    test cleanup fixes

commit b5dc005
Author: jasha26 <jasha@google.com>
Date:   Wed Jan 28 02:58:48 2026 +0000

    SSH in cloudbuild

commit 2a758ab
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 18:25:13 2026 +0000

    fix cloudbuild script

commit db8dca5
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 18:11:37 2026 +0000

    fix cloudbuild script

commit a5e2a57
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 18:00:02 2026 +0000

    fix cloudbuild script

commit 94e128d
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 17:50:34 2026 +0000

    fix cloudbuild script

commit 6722790
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 17:41:38 2026 +0000

    fix cloudbuild script

commit 4fa6112
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 14:34:58 2026 +0000

    fix cloudbuild script

commit 61b279e
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 14:21:53 2026 +0000

    fix cloudbuild script

commit abbffef
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 14:14:54 2026 +0000

    fix cloudbuild script

commit 21c9523
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 14:02:49 2026 +0000

    fix cloudbuild script

commit c80042e
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 13:49:14 2026 +0000

    fix cloudbuild script

commit ccc0082
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 13:42:17 2026 +0000

    fix cloudbuild script

commit 19b7d7b
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 13:28:00 2026 +0000

    fix cloudbuild script

commit 5cf00c3
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 13:14:06 2026 +0000

    fix cloudbuild script

commit 2b9c462
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 13:09:07 2026 +0000

    fix cloudbuild script

commit d4ce167
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 12:02:23 2026 +0000

    fix cloudbuild script

commit b9a1929
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 11:53:39 2026 +0000

    fix cloudbuild script

commit 493a1ef
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 11:34:36 2026 +0000

    fix cloudbuild script

commit cf20272
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 11:22:09 2026 +0000

    fix cloudbuild script

commit bd0bdd7
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 11:04:26 2026 +0000

    fix cloudbuild script

commit c2da9a0
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 11:03:39 2026 +0000

    fix cloudbuild script

commit ffa4566
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 10:41:35 2026 +0000

    fix cloudbuild script

commit cce5a77
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 10:40:40 2026 +0000

    fix cloudbuild script

commit d32d4aa
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 10:39:35 2026 +0000

    fix cloudbuild script and config for testing

commit 17e39d7
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 10:00:32 2026 +0000

    undo script and move to cloudbuild

commit b9c29c7
Author: jasha26 <jasha@google.com>
Date:   Tue Jan 27 09:39:24 2026 +0000

    SSH in cloudbuild

commit 0eb4b82
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 20:27:22 2026 +0000

    bucket types introduced

commit 37cc264
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 20:19:58 2026 +0000

    bucket types introduced

commit 09271c1
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 20:16:18 2026 +0000

    bucket types introduced

commit e8d5440
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 19:46:59 2026 +0000

    Failures as warning to ensure cleanup

commit 74fae2a
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 19:42:15 2026 +0000

    Removed mig

commit 28edde3
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 19:39:58 2026 +0000

    Removed mig

commit 3d08685
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 14:21:49 2026 +0000

    SSH issue debug

commit b243c9b
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 14:11:49 2026 +0000

    updating variable management

commit 54bb87b
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 14:08:18 2026 +0000

    disable infra tests

commit 0787658
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 13:33:38 2026 +0000

    updating variable management

commit 476ae2a
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 13:20:36 2026 +0000

    updating variable management

commit 55f667d
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 12:19:29 2026 +0000

    updating variable management

commit 19d64e1
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 11:00:37 2026 +0000

    updating variable management

commit 04223bf
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 10:26:34 2026 +0000

    updating variable management

commit 4280859
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 10:26:03 2026 +0000

    updating variable management

commit 5183d79
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 08:50:35 2026 +0000

    updating variable management

commit 1a73e69
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 08:49:36 2026 +0000

    updating variable management

commit f6089be
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 08:48:53 2026 +0000

    updating variable management

commit 3eda30c
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 08:46:35 2026 +0000

    updating variable management

commit 9dc2364
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 08:45:42 2026 +0000

    updating variable management

commit f2763ea
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 08:43:22 2026 +0000

    updating variable management

commit c911331
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 08:33:14 2026 +0000

    updating variable management

commit cd21ef3
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 08:27:40 2026 +0000

    updating variable management

commit 742c1dd
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 07:51:15 2026 +0000

    Added logging pool

commit 44656ba
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 07:46:25 2026 +0000

    Added option to skip steps for debugging

commit ae0ec77
Author: jasha26 <jasha@google.com>
Date:   Fri Jan 23 06:23:13 2026 +0000

    cloudbuild for perf benchmarks
@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 50.00000% with 6 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@e0c0a9f). Learn more about missing BASE report.

Files with missing lines Patch % Lines
gcsfs/tests/conftest.py 50.00% 6 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #753   +/-   ##
=======================================
  Coverage        ?   75.37%           
=======================================
  Files           ?       18           
  Lines           ?     2761           
  Branches        ?        0           
=======================================
  Hits            ?     2081           
  Misses          ?      680           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ankitaluthra1
Copy link
Collaborator

/gcbrun

@@ -0,0 +1,10 @@
coverage:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets remove test coverage related changes from this PR, there is another PR for test coverage which contains full changes, it would also need some repo changes, so lets not block this PR for it

@@ -0,0 +1,330 @@
substitutions:
Copy link
Collaborator

Choose a reason for hiding this comment

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

The output wont be accessible outside, should we document such caveats and add alternatives on how ppl can run this on their own

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The cloudbuild itself generates logs which prints the final results table. I think that is good enough output of you inspect logs after there.

If you mean the cav files in bucket, i think that's something that is already documented in PR description.

@ankitaluthra1
Copy link
Collaborator

/gcbrun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants