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

fix(autoware_traffic_light_map_based_detector): output from screen to both #8411

Conversation

kminoda
Copy link
Contributor

@kminoda kminoda commented Aug 8, 2024

Description

Set output from screen to both to improve the debugging efficiency of Autoware in general.
With this change, the output from node will not only be displayed in screen but also to the log file.

See https://github.com/ros2/launch/blob/986ea832cec49c18bee4e29ee4df37fe3844fa90/launch/launch/logging/__init__.py#L397-L487

Related links

TIER IV INTERNAL THREAD

How was this PR tested?

Not tested

Notes for reviewers

None

Interface changes

None.

Effects on system behavior

Although there will be a slight increase in computational load due to the additional log, I would say that the risk is minimal since the node's output does not occupy terminal at this moment. But just in case, I would like to make this change for several nodes chosen from perception component which tends to have some issues pretty often.

@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Aug 8, 2024
Copy link

github-actions bot commented Aug 8, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@kminoda kminoda added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Aug 8, 2024
Copy link

codecov bot commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.18%. Comparing base (103e086) to head (cd13087).
Report is 28 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8411      +/-   ##
==========================================
+ Coverage   24.06%   29.18%   +5.12%     
==========================================
  Files        1384     1601     +217     
  Lines      102216   117338   +15122     
  Branches    38963    50569   +11606     
==========================================
+ Hits        24594    34250    +9656     
+ Misses      75105    73913    -1192     
- Partials     2517     9175    +6658     
Flag Coverage Δ *Carryforward flag
differential 0.00% <ø> (?)
total 29.24% <ø> (+5.18%) ⬆️ Carriedforward from 824b68c

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@yukkysaito yukkysaito left a comment

Choose a reason for hiding this comment

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

@mitsudome-r @xmfcx
Do you have any comments on this Pull Request? In the past, the .ros/log files in the system have grown significantly, which caused the disk space on the autonomous driving ECU to become constrained. I'm a bit concerned that if log files are output everywhere, it might lead to unintended system shutdowns.

@kminoda
Is this change only for this node? Do you plan to apply this to other nodes as well? If so, I think we should establish some rules.

@kminoda
Copy link
Contributor Author

kminoda commented Aug 8, 2024

@yukkysaito Thank you for the comment. I am willing to get an feedback from the community 🙏

As a first step, I would like to merge this change for several nodes which tend to have a lot of issues. For these nodes, I think this change would make a lot of difference when debugging. By choosing several nodes, I think we can minimize the impact on the system performance as well.

@mitsudome-r
Copy link
Member

Do you have any comments on this Pull Request? In the past, the .ros/log files in the system have grown significantly, which caused the disk space on the autonomous driving ECU to become constrained. I'm a bit concerned that if log files are output everywhere, it might lead to unintended system shutdowns.

I think we should consider giving a guidance about how users can setup log rotation if they wish to when we set output to "both" for all the nodes.
If we are just changing few nodes for the time being, I don't think it is going to be a critical issue.

@kminoda
Copy link
Contributor Author

kminoda commented Aug 13, 2024

@mitsudome-r Thank you for the comment. As you've mentioned, I would like to make this type of change to a few nodes where the debugging efficiency is critical even in short term perspective.

@yukkysaito Would you confirm if it is OK to merge several PRs that I've created for now? I will wait for your comment before merging them.

@youtalk
Copy link
Member

youtalk commented Aug 19, 2024

If you have another logger outside ROS system (e.g. syslog), I think the output="both" option performs duplicate logging.

@xmfcx
Copy link
Contributor

xmfcx commented Aug 19, 2024

@yukkysaito like @mitsudome-r suggested, creating a tutorial to set up https://linux.die.net/man/8/logrotate would be helpful.

As for this PR, we can merge as is.

My suggestion would be to set the log preferences of all nodes from a global variable.

So everything will be logged to "screen or log file or both" when you select it from the main launch file.

Maybe we could also have a simple python node package that monitors the log directory and keeps it at certain size too.

Now

  • Merge the PR.

Short term

  • Allow setting all node log method from a single global variable.

Long term

  • Create a logrotate tutorial
  • Or create a log rotation node package

@yukkysaito
Copy link
Contributor

@yukkysaito like @mitsudome-r suggested, creating a tutorial to set up https://linux.die.net/man/8/logrotate would be helpful.
As for this PR, we can merge as is.
My suggestion would be to set the log preferences of all nodes from a global variable.
So everything will be logged to "screen or log file or both" when you select it from the main launch file.
Maybe we could also have a simple python node package that monitors the log directory and keeps it at certain size too.

@mitsudome-r @xmfcx Thanks for your comments. I agree with you.
It would be fine if it's just this PR, but there are many similar PRs coming in.

@kminoda If it's not urgent, I might want to consider adopting the proposed short term change (Allow setting all node log methods from a single global variable) before proceeding with the merge. What do you think?

@xmfcx
Copy link
Contributor

xmfcx commented Aug 20, 2024

Allow setting all node log methods from a single global variable

If that's the case, we should close all these PRs and go for this option.
And make the default "screen" to not fill up the disk space.

@kminoda kminoda merged commit 1a58707 into autowarefoundation:main Aug 26, 2024
31 checks passed
@kminoda kminoda deleted the fix/autoware_traffic_light_map_based_detector_output_to_both branch August 26, 2024 10:33
@yukkysaito
Copy link
Contributor

@kminoda cc @xmfcx
Why was this pull request merged? I understood that it was supposed to be merged after completing this TODO.

If that's the case, we should close all these PRs and go for this option.
And make the default "screen" to not fill up the disk space.

@kminoda
Copy link
Contributor Author

kminoda commented Aug 27, 2024

@yukkysaito Sorry I missed the latest comment 🙏

Do we have any timeline for incorporating the global variable? Although this PR is not critically important, it is kind of urgent to set screen=both for some of the important nodes to reduce the debugging cost. So I still would like to merge these PRs for limited packages (of course not for all the packages 👍 ) unless the global variable feature is incorporated within a short period of time.

@yukkysaito
Copy link
Contributor

@kminoda
If it's not urgent, it's not preferable to change to screen=both for individual packages. If we need to merge such PRs in the future, could you please create a PR for the global variable feature?

kyoichi-sugahara pushed a commit to kyoichi-sugahara/autoware.universe that referenced this pull request Aug 27, 2024
a-maumau pushed a commit to a-maumau/autoware.universe that referenced this pull request Sep 2, 2024
ktro2828 pushed a commit to ktro2828/autoware.universe that referenced this pull request Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) tag:require-cuda-build-and-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants