diff --git a/kubernetes/worker-controller/src/autoscaler_rules.py b/kubernetes/worker-controller/src/autoscaler_rules.py index dc53b9128..a5064bd05 100644 --- a/kubernetes/worker-controller/src/autoscaler_rules.py +++ b/kubernetes/worker-controller/src/autoscaler_rules.py @@ -19,9 +19,9 @@ def get_desired_worker_count(autoscaling_setting: dict, model_state: ModelState) strategy = autoscaling_setting.get('scaling_strategy') worker_count_min = int(autoscaling_setting.get('worker_count_min')) + worker_count_max = int(get_req_setting(autoscaling_setting, 'worker_count_max')) if strategy: - if strategy == 'FIXED_WORKERS': count = int(get_req_setting(autoscaling_setting, 'worker_count_fixed')) return max( @@ -30,7 +30,6 @@ def get_desired_worker_count(autoscaling_setting: dict, model_state: ModelState) ) elif strategy == 'QUEUE_LOAD': - worker_count_max = get_req_setting(autoscaling_setting, 'worker_count_max') analyses = model_state['analyses'] return max( min(analyses, worker_count_max), @@ -40,7 +39,6 @@ def get_desired_worker_count(autoscaling_setting: dict, model_state: ModelState) elif strategy == 'DYNAMIC_TASKS': chunks_per_worker = autoscaling_setting.get('chunks_per_worker') - worker_count_max = int(get_req_setting(autoscaling_setting, 'worker_count_max')) workers = math.ceil(int(model_state.get('tasks', 0)) / int(chunks_per_worker)) return max(