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

Generate log files for Python Profiling cli #1366

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

nartal1
Copy link
Collaborator

@nartal1 nartal1 commented Oct 1, 2024

This fixes #1363

In PR-#1269, support was added to generate stderr log files for qualification tool and missed profiling tool. This PR adds support to generate log files for profiling tool as well. While doing so, refactor was done to distinguish between profiling and qualification log.

Before this change:

2024-10-01 14:12:00,954 ERROR rapids.tools.submit.onpremLocal: Error removing temporary log4j properties file: remove: path should be string, bytes or os.PathLike, not NoneType

After this change:
New file created rapids_4_spark_profile_stderr.log under rapids_4_spark_profile/ directory

2024-10-01 14:15:10,345 INFO rapids.tools.submit.onpremLocal: Temporary log4j properties file removed: /tmp/tmps69jwl4g.properties

Signed-off-by: Niranjan Artal <nartal@nvidia.com>
@nartal1 nartal1 added the bug Something isn't working label Oct 1, 2024
@nartal1 nartal1 self-assigned this Oct 1, 2024
Copy link
Collaborator

@amahussein amahussein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting that no change on the scala side. I remember the log file was created by the QualificationOutputWriter. If that's the case, it means that we cannot generate log file by simply running profiling jar cmd. Or do I miss something?

@nartal1
Copy link
Collaborator Author

nartal1 commented Oct 2, 2024

Interesting that no change on the scala side. I remember the log file was created by the QualificationOutputWriter. If that's the case, it means that we cannot generate log file by simply running profiling jar cmd. Or do I miss something?

We can generate log file by providing the log4jc configuration in java command. Since the sample log4j.properties is checked in, we can modify the output file path, output file name and other parameters before running the java command.

java -Dlog4j.configuration= /home/dev/spark-rapids-tools/user_tools/src/spark_rapids_pytools/resources/dev/log4j.properties -cp rapids-4-spark-tools_2.12-24.08.3-SNAPSHOT.jar:$SPARK_HOME/jars/* com.nvidia.spark.rapids.tool.profiling.ProfileMain /home/dev/tmp_dir/testing_eventlog

Copy link
Collaborator

@parthosa parthosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nartal1. Tested this. LGTME

Copy link
Collaborator

@amahussein amahussein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nartal1 !
LGTME

@amahussein amahussein added the user_tools Scope the wrapper module running CSP, QualX, and reports (python) label Oct 3, 2024
@nartal1 nartal1 merged commit 6cb7fa0 into NVIDIA:dev Oct 3, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working user_tools Scope the wrapper module running CSP, QualX, and reports (python)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Python CLI does not generate log files for Profiling cmd
3 participants