-
Notifications
You must be signed in to change notification settings - Fork 40
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
Use environment variables to set thresholds in static yaml configurations #1389
Conversation
…ions Signed-off-by: Ahmed Hussein <[email protected]> Fixes NVIDIA#1387 This code change aims at parsing yaml configuration file and resolving the environment variables. - `spillThresholdBytes` defined in qualification-conf.yaml can be overridden by an env-var `RAPIDS_USER_TOOLS_SPILL_BYTES_THRESHOLD`. - `totalCoreSecThreshold` defined in qualification-conf.yaml can be overridden by an env-var `RAPIDS_USER_TOOLS_CORE_SECONDS_THRESHOLD`. Usage: ``` export RAPIDS_USER_TOOLS_CORE_SECONDS_THRESHOLD=1024 spark_rapids <args> ```
CC: @viadea FYI to control spillThreshold or coreSeconds in a specific environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks good. are we documenting these for user, or mean for more advanced configuration?
Signed-off-by: Ahmed Hussein <[email protected]>
It is meant for advanced configuration. |
Signed-off-by: Ahmed Hussein <[email protected]>
Signed-off-by: Ahmed Hussein <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @amahussein. This is an interesting approach. During runtime, we can configure our configs.
This will also be helpful if we want to configure other thresholds in future (such as Top Candidate cut-off speedup etc)
Signed-off-by: Ahmed Hussein [email protected]
Fixes #1387
This code change aims at parsing yaml configuration file and resolving the environment variables.
spillThresholdBytes
defined in qualification-conf.yaml can be overridden by an env-varRAPIDS_USER_TOOLS_SPILL_BYTES_THRESHOLD
.totalCoreSecThreshold
defined in qualification-conf.yaml can be overridden by an env-varRAPIDS_USER_TOOLS_CORE_SECONDS_THRESHOLD
.These changes improve the flexibility and maintainability of the configuration management in the
user_tools
package.Usage:
Code changes
This pull request introduces several changes to the
user_tools
package, mainly focusing on dependency updates and configuration management enhancements. The key changes include updating dependencies inpyproject.toml
, integrating thepyaml_env
library for environment variable parsing in YAML files, and modifying configuration files to support environment variable substitution.Documentation Update
Filed an issue internally to add the new env_variables to the documentation
Dependency updates and integration:
user_tools/pyproject.toml
: Updated thepyYAML
dependency to a version range and addedpyaml_env
to handle environment variables in YAML files.Code changes for environment variable parsing:
user_tools/src/spark_rapids_pytools/common/prop_manager.py
: Importedparse_config
frompyaml_env
and replacedyaml.safe_load
withparse_config
in the__open_yaml_file
method. [1] [2]user_tools/src/spark_rapids_tools/utils/propmanager.py
: Importedparse_config
frompyaml_env
and replacedyaml.safe_load
withparse_config
in theload_yaml
function. [1] [2]Configuration file enhancements:
user_tools/src/spark_rapids_pytools/resources/qualification-conf.yaml
: Modified configuration parameters to support environment variable substitution using the!ENV
tag. [1] [2]