Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit 3eb7704

Browse files
lindong28tfboyd
authored andcommitted
Acticate gcloud service before downloading data (#305)
1 parent 8122ca8 commit 3eb7704

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

perfzero/lib/benchmark.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ def _setup(self):
5353
self.config.gce_nvme_raid_str)
5454
self.benchmark_execution_time['create_drive'] = time.time() - start_time
5555

56+
# Acticate gcloud service
57+
start_time = time.time()
58+
utils.setup_python_path(self.site_packages_dir, self.config.python_path_str)
59+
utils.active_gcloud_service(self.auth_token_path)
60+
utils.make_dir_if_not_exist(self.output_root_dir)
61+
self.benchmark_execution_time['activate_gcloud_service'] = time.time() - start_time
62+
5663
# Download gcloud auth token and data
5764
start_time = time.time()
5865
utils.download_from_gcs(self.config.get_gcs_downloads('/data'))
@@ -65,12 +72,6 @@ def _setup(self):
6572
self.config.force_update)
6673
self.benchmark_execution_time['checkout_repository'] = time.time() - start_time
6774

68-
start_time = time.time()
69-
utils.setup_python_path(self.site_packages_dir, self.config.python_path_str)
70-
utils.active_gcloud_service(self.auth_token_path)
71-
utils.make_dir_if_not_exist(self.output_root_dir)
72-
self.benchmark_execution_time['activate_gcloud_service'] = time.time() - start_time
73-
7475
self.stream_handler = logging.StreamHandler(sys.stdout)
7576
self.stream_handler.setFormatter(
7677
logging.Formatter('%(asctime)s %(levelname)s: %(message)s'))

0 commit comments

Comments
 (0)