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

Disable cost saving functionality #1218

Merged
merged 2 commits into from
Jul 23, 2024
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
7 changes: 4 additions & 3 deletions user_tools/src/spark_rapids_pytools/rapids/qualification.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,9 @@ def _process_custom_args(self):
# This is noise to dump everything
# self.logger.debug('%s custom arguments = %s', self.pretty_name(), self.ctxt.props['wrapperCtx'])

def __is_savings_calc_enabled(self):
return self.ctxt.get_ctxt('enableSavingsCalculations')
def __is_savings_calc_enabled(self) -> bool:
cost_savings_func_flag = self.ctxt.get_value('sparkRapids', 'cli', 'defaults', 'costSavingsSettings', 'enabled')
return cost_savings_func_flag and self.ctxt.get_ctxt('enableSavingsCalculations')
cindyyuanjiang marked this conversation as resolved.
Show resolved Hide resolved

def __get_recommended_apps(self, all_rows, selected_cols=None) -> pd.DataFrame:
speed_up_col = self.ctxt.get_value('toolOutput', 'csv', 'summaryReport',
Expand Down Expand Up @@ -866,7 +867,7 @@ def __build_global_report_summary(self,
target_platform = self.ctxt.get_ctxt('targetPlatform')
if target_platform is not None:
pricing_config = self.ctxt.platform.configs.get_value_silent('csp_pricing')
if pricing_config is None:
if pricing_config is None and self.__is_savings_calc_enabled():
# OnPrem platform doesn't have pricing information. We do not calculate cost savings for
# OnPrem platform if the target_platform is not specified.
self.logger.warning('The pricing configuration for the given platform is not defined.\n\t'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ sparkRapids:
defaults:
gpuClusterRecommendation:
defaultRecommendation: 'MATCH'
costSavingsSettings: #temporrary settings to control the code behavior until the cost savings feature is fully removed
enabled: false
toolOptions:
- all
- any
Expand Down