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

Improve logs with user tools and jar version details #642

Merged
merged 1 commit into from
Oct 31, 2023
Merged
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
8 changes: 7 additions & 1 deletion user_tools/src/spark_rapids_pytools/rapids/rapids_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from logging import Logger
from typing import Any, Callable, Dict, List

import spark_rapids_pytools
from spark_rapids_tools import CspEnv
from spark_rapids_pytools.cloud_api.sp_types import get_platform, \
ClusterBase, DeployMode, NodeHWInfo
Expand Down Expand Up @@ -120,6 +121,7 @@ def wrapper(self, *args, **kwargs):
def __post_init__(self):
# when debug is set to true set it in the environment.
self.logger = ToolLogging.get_and_setup_logger(f'rapids.tools.{self.name}')
self.logger.info('Using Spark RAPIDS user tools version %s', spark_rapids_pytools.__version__)

def _check_environment(self) -> None:
self.ctxt.platform.setup_and_validate_env()
Expand Down Expand Up @@ -387,8 +389,12 @@ def _process_jar_arg(self):
fail_ok=False,
create_dir=True)
self.logger.info('RAPIDS accelerator jar is downloaded to work_dir %s', jar_path)
# get the jar file name and add it to the tool args
# get the jar file name
jar_file_name = FSUtil.get_resource_name(jar_path)
version_match = re.search(r'\d{2}\.\d{2}\.\d+', jar_file_name)
jar_version = version_match.group() if version_match else 'Unknown'
self.logger.info('Using Spark RAPIDS accelerator jar version %s', jar_version)
# add jar file name to the tool args
self.ctxt.add_rapids_args('jarFileName', jar_file_name)
self.ctxt.add_rapids_args('jarFilePath', jar_path)

Expand Down
Loading