Skip to content

WIP: Add computer_hw package (copied, improved from pr2_computer_monitor) #21

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

Open
wants to merge 18 commits into
base: kinetic
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
cb6e10b
[capability] Computer monitor pkg, copied from https://github.com/PR2…
130s Sep 18, 2021
ecb7ec7
[capability] Rename from pr2_computer_monitor to computer_hw package
130s Aug 4, 2021
3331e7f
[capability] Add CPU monitoring
130s Aug 4, 2021
ba38cc3
[computer_hw][maintenance] Rename scripts to executable, for more gen…
130s Aug 4, 2021
3eb71ef
[computer_hw][maintenance] Refactoring: Move a class from executable …
130s Aug 7, 2021
647228d
[computer_hw][fix] GPU temperature not detected (fix https://github.c…
130s Aug 7, 2021
0091fdb
[computer_hw][capability] '/diagnostics_agg' topic not being publishe…
130s Aug 9, 2021
3d65d9d
WIP: [fix] GPU status not captured when running from Docker (or poten…
130s Sep 18, 2021
5d3d6fc
[improve] Add test case and data for nvidia-smi
130s Sep 18, 2021
6f43370
[computer_hw] Py format err (part of https://github.com/ros-drivers/l…
130s Sep 19, 2021
1864e08
[computer_hw][maintenance] 1) Separate ROS-agnostic components. 2) Se…
130s Jan 23, 2022
8655e1d
WIP: Allow more runtime config.
Feb 21, 2022
a41daba
[improve] Stop printing GPU info per every msg reception.
Feb 22, 2022
84fec60
WIP: Python 2to3 (for now done manually)
130s Feb 24, 2022
627afbc
Capability: [CI] Add GitHub Action, for ROS Melodic, Noetic
130s Feb 22, 2023
c8feea4
Drop capability: [CI] Travis CI to be off. Delegate to GHA
130s Feb 22, 2023
8662757
Improve Python import definition
130s Feb 22, 2023
deb5cec
Fix failing import in test (See CI failure https://github.com/kinu-ga…
130s Feb 22, 2023
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
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI - Ubuntu Focal

on:
# direct pushes to protected branches are not supported
pull_request:
push:
# run every day, at 6am UTC
schedule:
- cron: '0 6 * * *'
# allow manually starting this workflow
workflow_dispatch:

jobs:
industrial_ci:
name: ROS Noetic (${{ matrix.ros_repo }})
runs-on: ubuntu-20.04

strategy:
matrix:
ROS_DISTRO: [ melodic, noetic ]
ROS_REPO: [ main ]

env:
CCACHE_DIR: "${{ github.workspace }}/.ccache"

steps:
- name: Fetch repository
uses: actions/checkout@v3

- name: ccache cache
uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
# we always want the ccache cache to be persisted, as we cannot easily
# determine whether dependencies have changed, and ccache will manage
# updating the cache for us. Adding 'run_id' to the key will force an
# upload at the end of the job.
key: ccache-${{ matrix.ros_distro }}-${{ matrix.ros_repo }}-${{github.run_id}}
restore-keys: |
ccache-${{ matrix.ros_distro }}-${{ matrix.ros_repo }}

- name: Run industrial_ci
uses: ros-industrial/industrial_ci@master
env:
ROS_DISTRO: ${{ matrix.ros_distro }}
ROS_REPO: ${{ matrix.ros_repo }}
54 changes: 0 additions & 54 deletions .travis.yml

This file was deleted.

50 changes: 50 additions & 0 deletions computer_hw/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package computer_hw
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.6.32 (2021-05-26)
-------------------
* Merge pull request `#268 <https://github.com/pr2/pr2_robot/issues/268>`_ from k-okada/fix_for_noetic
* run 2to3 -w -fexcept .
* run 2to3 -w -fprint .
* Contributors: Kei Okada

1.6.31 (2020-04-14)
-------------------
* add --ignore-self arg in ntp_monitor.py (`#259 <https://github.com/pr2/pr2_robot/issues/259>`_)
* fixed CMake errors
* Contributors: David Feil-Seifer, Shingo Kitagawa

1.6.30 (2018-04-23)
-------------------
* removed more tests for jenkins build
* Contributors: David Feil-Seifer

1.6.29 (2018-04-22)
-------------------

1.6.28 (2018-04-21)
-------------------
* made sure tests only run if CATKIN_ENABLE_TESTING is set
* Contributors: David Feil-Seifer

1.6.27 (2018-04-20)
-------------------

1.6.26 (2018-03-19)
-------------------

1.6.25 (2018-03-19)
-------------------
* updated packages for new maintainer
* updated changelogs
* Contributors: David Feil-Seifer

1.6.7 (2015-02-11)
------------------
* Reverted changes
* Added dependencies in catkin
* Added catkin_package() to pr2_robot
* Updated mainpage.dox
* Fix binary location of network_detector
* Contributors: Ryohei Ueda, TheDash
39 changes: 39 additions & 0 deletions computer_hw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html
cmake_minimum_required(VERSION 2.8.3)
project(computer_hw)
# Load catkin and all dependencies required for this package
# TODO: remove all from COMPONENTS that are not catkin packages.
find_package(catkin REQUIRED COMPONENTS roscpp std_msgs)

if(CATKIN_ENABLE_TESTING)
catkin_add_nosetests(test/parse_test.py)
endif()

include_directories(include ${catkin_INCLUDE_DIRS})

catkin_package(
DEPENDS roscpp std_msgs
CATKIN_DEPENDS # TODO
INCLUDE_DIRS # TODO include
LIBRARIES network_detector# TODO
)

catkin_install_python(PROGRAMS
executables/cpu_monitor.py executables/hd_monitor.py executables/ntp_monitor.py executables/ntp_monitor.py executables/nvidia_temp.py executables/wifi_monitor.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

add_executable(network_detector src/network_detector.cpp)
target_link_libraries(network_detector ${catkin_LIBRARIES})
add_dependencies(network_detector ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})

install(TARGETS network_detector
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

foreach(dir conf)
install(DIRECTORY ${dir}/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir})
endforeach(dir)

catkin_python_setup()
17 changes: 17 additions & 0 deletions computer_hw/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# computer_hw

## Development history
`computer_hw` package was originally made in [pr2_robot](https://github.com/PR2/pr2_robot) repository. See discussion [pr2_common#286](https://github.com/PR2/pr2_common/issues/286) for the migration.

## Installation tips
In order for ipmitool to work on computers with a BMC, the following line needs to appear in `/etc/sudoers`:

```
ALL ALL=NOPASSWD: /usr/bin/ipmitool sdr type Temperature
```

## Usage / Operation
TBD

EoF

8 changes: 8 additions & 0 deletions computer_hw/conf/cpu_monitor.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<launch>
<node name="cpu_monitor" pkg="computer_hw" type="cpu_monitor.py"
args="--diag-hostname=my_machine" >
<param name="check_ipmi_tool" value="false" type="bool" />
<param name="enforce_clock_speed" value="false" type="bool" />
<param name="num_cores" value="-1" type="int" />
</node>
</launch>
6 changes: 6 additions & 0 deletions computer_hw/conf/hd_monitor.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<launch>
<node pkg="computer_hw" type="hd_monitor.py"
args="$(optenv HOME /home) --diag-hostname=my_machine" name="hd_monitor" >
<param name="no_hd_temp_warn" value="True" />
</node>
</launch>
17 changes: 17 additions & 0 deletions computer_hw/conf/monitor.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<launch>
<arg name="gpu_monitor_rate" default="1.0" />
<arg name="gpu_stats_window_max" default="172800" doc="ROS Topic's statistics feature. Default '172800' is 48 hours for 1 hz" />

<!-- Sensors -->
<node pkg="libsensors_monitor" type="libsensors_monitor" name="libsensors_monitor" output="screen" respawn="true" />

<node pkg="computer_hw" type="nvidia_temp.py" name="nvidia_temperature_monitor" output="screen" respawn="true">
<param name="enable_statistics" value="true" />
<param name="statistics_window_max_elements" value="$(arg gpu_stats_window_max)" />
<param name="gpu_monitor_rate" value="$(arg gpu_monitor_rate)" />
</node>

<!-- Enable ROS' diagnostics aggregation feature -->
<node pkg="diagnostic_aggregator" type="aggregator_node" name="diag_agg" />

</launch>
4 changes: 4 additions & 0 deletions computer_hw/conf/ntp_monitor.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<launch>
<node pkg="computer_hw" type="ntp_monitor.py" name="ntp_monitor"
args="fw1 --diag-hostname=my_machine" />
</launch>
8 changes: 8 additions & 0 deletions computer_hw/demo/cpu_monitor.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<launch>
<node name="cpu_monitor" pkg="computer_hw" type="cpu_monitor.py"
args="--diag-hostname=my_machine" >
<param name="check_ipmi_tool" value="false" type="bool" />
<param name="enforce_clock_speed" value="false" type="bool" />
<param name="num_cores" value="-1" type="int" />
</node>
</launch>
1 change: 1 addition & 0 deletions computer_hw/executables/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is the indigo code, and will not work correctly on a precise machine
Loading