Skip to content

Commit

Permalink
fixed issue of user-specified use_benchmark not taking effect
Browse files Browse the repository at this point in the history
  • Loading branch information
SooLee committed May 4, 2021
1 parent 6f45e16 commit f64d71a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions tests/awsf3/postrunjson/GBPtlqb2rFGH.postrun.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
"cpu": "",
"ebs_iops": "",
"ebs_size": 45,
"ebs_size_as_is": false,
"ebs_throughput": "",
"ebs_type": "gp3",
"email": false,
"encrypt_s3_upload": false,
Expand All @@ -134,6 +136,7 @@
"language": "cwl_v1",
"log_bucket": "tibanna-output",
"mem": 0,
"mem_as_is": false,
"overwrite_input_extra": false,
"password": "",
"public_postrun_json": false,
Expand Down
2 changes: 1 addition & 1 deletion tibanna/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Version information."""

# The following line *must* be the last in the module, exactly as formatted:
__version__ = "1.2.2"
__version__ = "1.2.3"
18 changes: 12 additions & 6 deletions tibanna/ec2_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,14 @@ def update(self, d):

def fill_default(self):
# use benchmark or not
if not hasattr(self, 'instance_type') and (not hasattr(self, 'cpu') or not hasattr(self, 'mem')):
self.use_benchmark = True
elif not hasattr(self, 'ebs_size'):
self.use_benchmark = True
else:
self.use_benchmark = False
if not hasattr(self, 'use_benchmark'):
if not hasattr(self, 'instance_type') and (not hasattr(self, 'cpu') or not hasattr(self, 'mem')):
self.use_benchmark = True
elif not hasattr(self, 'ebs_size'):
self.use_benchmark = True
else:
self.use_benchmark = False
logger.debug("Config.fill_default: use_benchmark=" + str(self.use_benchmark))
# fill in default
for field in ['instance_type', 'EBS_optimized', 'cpu', 'ebs_iops', 'ebs_throughput', 'password', 'key_name',
'spot_duration', 'availability_zone', 'security_group', 'subnet']:
Expand Down Expand Up @@ -341,6 +343,10 @@ def __init__(self, input_dict, dryrun=False):
self.input_size_in_bytes = self.get_input_size_in_bytes()
if self.cfg.use_benchmark:
self.benchmark = self.get_benchmarking(self.input_size_in_bytes)
logger.debug('self.benchmark = ' + str(self.benchmark))
else:
logger.debug('self.cfg.use_benchmark = ' + str(self.cfg.use_benchmark))
logger.debug('self.cfg.as_dict() = ' + str(self.cfg.as_dict()))
self.init_instance_type_list()
self.update_config_instance_type()
self.update_config_ebs_size()
Expand Down

0 comments on commit f64d71a

Please sign in to comment.