Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HC-393: add target tracking metric for autoscaling that allows for 1:1 scaling of jobs to workers #86

Merged
merged 4 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ rsa==4.7
s3transfer==0.3.0
six==1.13.0
tqdm==4.41.1
urllib3==1.25.8
urllib3==1.26.5
vine==1.3.0
wcwidth==0.1.8
zipp==0.6.0
2 changes: 1 addition & 1 deletion sdscli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
from __future__ import division
from __future__ import absolute_import

__version__ = "1.1.3"
__version__ = "1.1.4"
__url__ = "https://github.com/sdskit/sdscli"
__description__ = "Command line interface for SDSKit"
1 change: 1 addition & 0 deletions sdscli/adapters/hysds/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def update_mozart(conf, ndeps=False, config_only=False, comp='mozart'):

# update verdi for code/config bundle
set_bar_desc(bar, 'Ensuring HySDS venv')
execute(fab.rm_rf, '~/verdi', roles=[comp])
execute(fab.ensure_venv, 'verdi',
update_bash_profile=False, roles=[comp])
bar.update()
Expand Down
10 changes: 9 additions & 1 deletion sdscli/cloud/aws/asg.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,16 @@ def create(args, conf):
i] + ', for example: [t2.medium t3.medium t3a.medium]: ', default='t2.medium t3.medium t3a.medium')
i_list = inst.split()
d = {'QUEUE_NAME': q_list[i], 'INSTANCE_TYPES': i_list}
use_job_total = prompt(get_prompt_tokens=lambda x: [(Token, "Do you want to scale up based on total jobs to workers? (default is number of waiting jobs to workers) [y/n]: ")],
validator=YesNoValidator(), style=prompt_style).strip() == 'y'
if use_job_total:
d['TOTAL_JOBS_METRIC'] = True
queues.append(d)
logger.debug(str(queues))
for i, q in enumerate(queues):
queue = q['QUEUE_NAME']
ins_type = q['INSTANCE_TYPES']
total_jobs_metric = q.get('TOTAL_JOBS_METRIC', False)
inst_type_arr = []
for j in range(len(ins_type)):
inst_type_arr.append({'InstanceType':ins_type[j]})
Expand Down Expand Up @@ -348,7 +353,10 @@ def create(args, conf):

# add target tracking scaling policy
policy_name = "{}-target-tracking".format(asg)
metric_name = "JobsWaitingPerInstance-{}".format(asg)
if total_jobs_metric:
metric_name = "JobsPerInstance-{}".format(asg)
else:
metric_name = "JobsWaitingPerInstance-{}".format(asg)
ttsp_args = {
'AutoScalingGroupName': asg,
'PolicyName': policy_name,
Expand Down