From bd0c0478f45e431c8dbbd3563b8d202187b6791e Mon Sep 17 00:00:00 2001 From: gurusai-voleti Date: Mon, 29 Dec 2025 13:00:57 +0000 Subject: [PATCH] chore: Migrate gsutil usage to gcloud storage --- .../linux_benchmarks/cloudharmony_network_benchmark.py | 6 +++--- perfkitbenchmarker/linux_packages/ycsb.py | 2 +- perfkitbenchmarker/providers/gcp/bigquery.py | 4 ++-- tests/data/sysbench_stderr_output_sample.txt | 3 +-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/perfkitbenchmarker/linux_benchmarks/cloudharmony_network_benchmark.py b/perfkitbenchmarker/linux_benchmarks/cloudharmony_network_benchmark.py index 7d3840cea1..3b7bcdbe49 100644 --- a/perfkitbenchmarker/linux_benchmarks/cloudharmony_network_benchmark.py +++ b/perfkitbenchmarker/linux_benchmarks/cloudharmony_network_benchmark.py @@ -303,13 +303,13 @@ def _PrepareBucket(benchmark_spec): bucket_uri = f'gs://{bucket}' service.MakeBucket(bucket) # set default permissions to allow cloudharmony test file access - perm_cmd = ['gsutil', 'defacl', 'set', 'public-read', bucket_uri] + perm_cmd = ['gcloud', 'storage', 'buckets', 'update', bucket_uri, '--predefined-default-object-acl=public-read'] vm_util.IssueCommand(perm_cmd) # set bucket lifecyle to ensure bucket deletion after 30 days lifecyle_config_file = data.ResourcePath( 'cloudharmony_network_gcp_lifecycle.json' ) - lc_cmd = ['gsutil', 'lifecycle', 'set', lifecyle_config_file, bucket_uri] + lc_cmd = ['gcloud', 'storage', 'buckets', 'update', bucket_uri, '--lifecycle-file', lifecyle_config_file] vm_util.IssueCommand(lc_cmd) # prepare preprovisioned test data tmp_dir = vm_util.GetTempDir() @@ -332,7 +332,7 @@ def _PrepareBucket(benchmark_spec): # copy preprovisioned test data to test bucket src_path = posixpath.join(remote_probe_dir, '*') dst_url = f'{bucket_uri}/probe' - cp_cmd = ['gsutil', 'cp', '-r', src_path, dst_url] + cp_cmd = ['gcloud', 'storage', 'cp', '--recursive', src_path, dst_url] vm_util.IssueCommand(cp_cmd, raise_on_timeout=False) # save the service and the bucket name benchmark_spec.service = service diff --git a/perfkitbenchmarker/linux_packages/ycsb.py b/perfkitbenchmarker/linux_packages/ycsb.py index a0c041f2d6..015d94c1a3 100644 --- a/perfkitbenchmarker/linux_packages/ycsb.py +++ b/perfkitbenchmarker/linux_packages/ycsb.py @@ -694,7 +694,7 @@ def CheckPrerequisites(): def _DownloadAndInstallTarball(vm, install_dir, url): """Downloads and installs a tarball to the VM.""" if url.startswith('gs://'): - download_cmd = 'gsutil cat' + download_cmd = 'gcloud storage cat' else: download_cmd = 'curl -L' install_cmd = ( diff --git a/perfkitbenchmarker/providers/gcp/bigquery.py b/perfkitbenchmarker/providers/gcp/bigquery.py index b4b1c50f0f..19fd8cc55a 100644 --- a/perfkitbenchmarker/providers/gcp/bigquery.py +++ b/perfkitbenchmarker/providers/gcp/bigquery.py @@ -611,7 +611,7 @@ def ExtractDataset( # Make sure the bucket is empty. vm_util.IssueCommand( - ['gsutil', '-m', 'rm', gcs_uri + '/**'], raise_on_failure=False + ['gcloud', 'storage', 'rm', gcs_uri + '/**'], raise_on_failure=False ) project_dataset = self.FormatProjectAndDatasetForCommand(dataset) @@ -701,7 +701,7 @@ def LoadDataset( for table in tables: schema_path = schema_dir + table + '.json' local_schema = './%s.json' % table - vm_util.IssueCommand(['gsutil', 'cp', schema_path, local_schema]) + vm_util.IssueCommand(['gcloud', 'storage', 'cp', schema_path, local_schema]) cmd = [ 'bq', 'load', diff --git a/tests/data/sysbench_stderr_output_sample.txt b/tests/data/sysbench_stderr_output_sample.txt index 796d333f9e..3ba50b62d5 100644 --- a/tests/data/sysbench_stderr_output_sample.txt +++ b/tests/data/sysbench_stderr_output_sample.txt @@ -680,8 +680,7 @@ Warning: Permanently added '' (ECDSA) to the list of known hosts. 2017-07-07 11:35:32,601 41b2ddaa MainThread mysql_service(1/0) INFO percentile_response_time is 17.730000 2017-07-07 11:35:32,623 41b2ddaa MainThread INFO Publishing 16 samples to /tmp/perfkitbenchmarker/runs/.json 2017-07-07 11:35:32,624 41b2ddaa MainThread INFO Publishing 16 samples to gs://perfkit -2017-07-07 11:35:32,624 41b2ddaa MainThread INFO Running: gsutil cp /tmp/perfkitbenchmarker/runs/ -2017-07-07 11:35:34,238 41b2ddaa MainThread INFO +2017-07-07 11:35:32,624 41b2ddaa MainThread INFO Running: gcloud storage cp /tmp/perfkitbenchmarker/runs/2017-07-07 11:35:34,238 41b2ddaa MainThread INFO -------------------------PerfKitBenchmarker Complete Results------------------------- {'metadata': {'cloud': 'GCP', 'dedicated_host': False,