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

Apt install one-shot #940

Open
tonynajjar opened this issue Feb 9, 2024 · 6 comments
Open

Apt install one-shot #940

tonynajjar opened this issue Feb 9, 2024 · 6 comments

Comments

@tonynajjar
Copy link

This is more of a suggestion than an issue. I noticed that rosdep runs each apt install individually for each package which is probably more time consuming than running 'apt install package1 package2....'. Can we install them all in one-shot? This small change could save a lot of CI time for a lot of people.

What do you think?

@SubaruArai
Copy link
Contributor

@tonynajjar Made a PR, care to test it out?

@tonynajjar
Copy link
Author

tonynajjar commented Apr 15, 2024

hi @SubaruArai, thanks for tackling this! I tested it out and for my use case it accelerated the rosdep installation by 30 seconds which is a big improvement!

I'm just curious about one thing I see in the logs:

#28 27.51 executing command [sudo -H apt-get install -y python3-imageio python3-mock python3-pytest-cov ros-humble-foxglove-bridge ros-humble-foxglove-msgs ros-humble-nav-2d-msgs ros-humble-nav-2d-utils ros-humble-nav2-behavior-tree ros-humble-nav2-core ros-humble-nav2-costmap-2d ros-humble-phidgets-spatial ros-humble-realsense2-camera-msgs ros-humble-robot-localization ros-humble-rtcm-msgs ros-humble-rviz-imu-plugin ros-humble-rviz-satellite]
#28 27.51 executing command [sudo -H pip3 install -U utm]
#28 27.51 executing command [sudo -H apt-get install -y espeak iputils-ping python3-pygame python3-pykdl python3-shapely python3-sqlalchemy ros-humble-plotjuggler-ros ros-humble-rosbag2-storage-mcap]
#28 27.51 #All required rosdeps installed successfully
#28 DONE 27.7s

I understand why pip3 install is done seperately of course but I wonder why there are still 2 apt-get commands instead of one. It's already a huge improvement from:

#38 58.68 executing command [sudo -H apt-get install -y iputils-ping]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-foxglove-bridge]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-realsense2-camera-msgs]
#38 58.68 executing command [sudo -H apt-get install -y python3-mock]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-rtcm-msgs]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-robot-localization]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-phidgets-spatial]
#38 58.68 executing command [sudo -H pip3 install -U utm]
#38 58.68 executing command [sudo -H apt-get install -y python3-pykdl]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-rosbag2-storage-mcap]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-plotjuggler-ros]
#38 58.68 executing command [sudo -H apt-get install -y espeak]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-foxglove-msgs]
#38 58.68 executing command [sudo -H apt-get install -y python3-pygame]
#38 58.68 executing command [sudo -H apt-get install -y python3-pytest-cov]
#38 58.68 executing command [sudo -H apt-get install -y python3-imageio]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-nav2-behavior-tree]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-nav-2d-utils]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-nav-2d-msgs]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-nav2-core]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-nav2-costmap-2d]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-rviz-imu-plugin]
#38 58.68 executing command [sudo -H apt-get install -y ros-humble-rviz-satellite]
#38 58.68 executing command [sudo -H apt-get install -y python3-sqlalchemy]
#38 58.68 executing command [sudo -H apt-get install -y python3-shapely]
#38 58.68 #All required rosdeps installed successfully
#38 DONE 58.7s

@SubaruArai
Copy link
Contributor

SubaruArai commented Apr 16, 2024

Interesting, gotta dig a bit deeper.
In the original example, iputils-ping and python3-pykdl were before and after the pip command - yet on the new example, they are on the same line (both after pip).

Do you mind to share on what project structure you ran rosdep on, or even better give me a minimal reproducible repo?
Even an output of a run with -v might be helpful.

@tonynajjar
Copy link
Author

tonynajjar commented Apr 16, 2024

Here you go:

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>test_package</name>
  <version>0.0.0</version>
  <description>test_package</description>
  <maintainer email="test">test</maintainer>
  <license>TODO: License declaration</license>

  <depend>rtcm_msgs</depend>
  <depend>robot_localization</depend>
  <depend>phidgets_spatial</depend>
  <depend>python-utm-pip</depend>
  <depend>python3-pykdl</depend>
  <depend>rosbag2_storage_mcap</depend>
  <depend>plotjuggler_ros</depend>
  <depend>utm</depend>

  <test_depend>python3-pytest</test_depend>

  <export>
    <build_type>ament_python</build_type>
  </export>
</package>
rosdep install --from-paths . --ignore-src -s
#[apt] Installation commands:
  apt-get install ros-humble-phidgets-spatial ros-humble-robot-localization ros-humble-rtcm-msgs
#[pip] Installation commands:
  pip3 install -U utm
#[apt] Installation commands:
  apt-get install python3-pykdl ros-humble-plotjuggler-ros ros-humble-rosbag2-storage-mcap

@SubaruArai
Copy link
Contributor

@tonynajjar There's some discussion on why this slow implementation was used in the pr thread (#953), you might be interested to know the rationale behind.

@130s
Copy link

130s commented Sep 11, 2024

Conversation going on in #953

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants