Skip to content

Commit

Permalink
Add timeout tag to dataproc disks.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=263878851
  • Loading branch information
tohaowu authored and yuyantingzero committed Aug 19, 2019
1 parent a0a92de commit 86c5951
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions perfkitbenchmarker/providers/gcp/gcp_dpb_dataproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,21 @@ def _Create(self):
# TODO(saksena): Retrieve the cluster create time and hold in a var
cmd.Issue()

def _PostCreate(self):
"""Get the cluster's data and tag it."""
cmd = util.GcloudCommand(
self, 'dataproc', 'clusters', 'describe', self.cluster_id)
stdout, _, _ = cmd.Issue()
config = json.loads(stdout)['config']
master = config['masterConfig']
worker = config['workerConfig']
for disk in master['instanceNames'] + worker['instanceNames']:
cmd = util.GcloudCommand(
self, 'compute', 'disks', 'add-labels', disk)
cmd.flags['labels'] = util.MakeFormattedDefaultTags()
cmd.flags['zone'] = self.dpb_service_zone
cmd.Issue()

def append_region(self, cmd):
region = self.dpb_service_zone.rsplit('-', 1)[0]
cmd.flags['region'] = region
Expand Down

0 comments on commit 86c5951

Please sign in to comment.