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

[BUG] Support autoscaling clusters for user qualification tool on Databricks platforms #647

Merged
merged 1 commit into from
Nov 3, 2023
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
13 changes: 13 additions & 0 deletions user_tools/src/spark_rapids_pytools/cloud_api/databricks_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,20 @@ def _init_nodes(self):
master_nodes_from_conf = self.props.get_value_silent('driver')
worker_nodes_from_conf = self.props.get_value_silent('executors')
num_workers = self.props.get_value_silent('num_workers')
if num_workers is None and self.props.get_value_silent('autoscale') is not None:
target_workers = self.props.get_value_silent('autoscale', 'target_workers')
# use min_workers since it is usually the same as target_workers
min_workers = self.props.get_value_silent('autoscale', 'min_workers')
if target_workers is not None:
num_workers = target_workers
self.logger.info('Autoscaling cluster, will set number of workers to target_workers = %s',
num_workers)
elif min_workers is not None:
num_workers = min_workers
self.logger.info('Autoscaling cluster, will set number of workers to min_workers = %s',
num_workers)
if num_workers is None:
self.logger.info('Unable to find number of workers for cluster, will default to 0')
num_workers = 0
# construct master node info when cluster is inactive
if master_nodes_from_conf is None:
Expand Down
13 changes: 13 additions & 0 deletions user_tools/src/spark_rapids_pytools/cloud_api/databricks_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,20 @@ def _init_nodes(self):
driver_nodes_from_conf = self.props.get_value_silent('driver')
worker_nodes_from_conf = self.props.get_value_silent('executors')
num_workers = self.props.get_value_silent('num_workers')
if num_workers is None and self.props.get_value_silent('autoscale') is not None:
target_workers = self.props.get_value_silent('autoscale', 'target_workers')
# use min_workers since it is usually the same as target_workers
min_workers = self.props.get_value_silent('autoscale', 'min_workers')
if target_workers is not None:
num_workers = target_workers
self.logger.info('Autoscaling cluster, will set number of workers to target_workers = %s',
num_workers)
elif min_workers is not None:
num_workers = min_workers
self.logger.info('Autoscaling cluster, will set number of workers to min_workers = %s',
num_workers)
if num_workers is None:
self.logger.info('Unable to find number of workers for cluster, will default to 0')
num_workers = 0
# construct driver node info when cluster is inactive
if driver_nodes_from_conf is None:
Expand Down
Loading