ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to depend on apt install that requires a source list file?

asked 2019-12-20 14:54:29 -0500

updated 2019-12-22 08:06:18 -0500

I'm looking for the "ros correct" way (wstool or rosdep compatible) way to depend on a debian package that is installed via a addition to the source lists? Here is the dependency I'm trying to add: https://docs.openvinotoolkit.org/late...


Edit:

The reason I want to do this is for an automated CI system where I need this dependency to compile the repo. I am currently running my CI system in the docker image moveit/moveit:master-ci and could extend this via a Dockerfile that is built as part of my CI system. The reason I'm looking for a different solution is I'm trying to keep the CI configuration as simple as possible to make it easier to maintain/extend for myself and others.


Edit 2:

This was for gitlab-ci and this is the solution I eventually ended on (in .gitlab.ci-yml):

before_script:
  # Install Intel OpenVINO toolkit for Linux
  - wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB | sudo apt-key add -
  - echo "deb https://apt.repos.intel.com/openvino/2019/ all main" | sudo tee -a /etc/apt/sources.list.d/intel-openvino-2019.list > /dev/null
  - sudo apt update -qq
  - sudo apt --yes -qq install intel-openvino-dev-ubuntu18-2019.3.376
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-12-20 15:14:55 -0500

gvdhoorn gravatar image

updated 2019-12-22 06:59:07 -0500

If I understand your question correctly, this is not supported (at the moment).

You can ask your users to add the extra repository, but the buildfarm will not do this.

There have been packages in the past that used rdmanifest scripts for this, but personally I would not do that any more: it's very ugly and (imo) a big security risk. I also doubt it's supported on the buildfarm.


Edit:

I was hoping for a more automated install for my CI environment

could you please add these sort of "details" in the OP of future questions, just so we can avoid an xy-problem?

Your original question gave the impression that you were asking this in the context of regular use / to release a package. Your comment here clarifies that this is for CI purposes. Those are two entirely different scenarios, and my answer would have been completely different as well.

CI setups (using something like Travis or Github actions) typically support executing scripts before running the actual configuration phase. You should be able to use add-apt-repository to add the deb repository needed, then proceed as normal.

Alternatively, you could do something like this:

echo "deb http://host/path/to/deb/repo/ubuntu $DISTRO $COMPONENT" >> /etc/apt/sources.list.d/your_repo.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ABCDEF123456

That would be essentially what add-apt-repository does for you. Provided you have supplied the required rules, rosdep should then be able to resolve your dependencies even with this "custom" repository.

so I could avoid having to create/maintain my own docker image for this project

I don't see a direct need for a Docker image, but if that seems like the best approach to you then it would of course work as well.


Edit 2:

I am currently running my CI system in the docker image moveit/moveit:master-ci and could extend this via a Dockerfile that is built as part of my CI system.

Doesn't seem to be needed: moveit_ci supports BEFORE_SCRIPT which is documented as (from here):

Used to specify shell commands or scripts that run in docker, just after setting up the ROS workspace and before actually starting the build processes. In contrast to BEFORE_DOCKER_SCRIPT, this script runs in the context of the docker container.

So you should be able to add the repository there.

You'll have to verify whether "setting up the ROS workspace" includes running rosdep though. If it does, then BEFORE_SCRIPT is probably too late. Perhaps one of the maintainers of moveit_ci could help you figure this one out.

edit flag offensive delete link more

Comments

See #q255238 for a Q&A about rdmanifests and how they are (were?) used in the pylon_camera package.

gvdhoorn gravatar image gvdhoorn  ( 2019-12-20 15:15:31 -0500 )edit

Thank you, I'm ok with the solution of asking users to install via the README. I was hoping for a more automated install for my CI environment so I could avoid having to create/maintain my own docker image for this project however that looks like the best answer for now.

tyler-picknik gravatar image tyler-picknik  ( 2019-12-22 06:30:11 -0500 )edit

Thank you for helping me with this, I'm not using moveit_ci in the "default" way (setting IN_DOCKER=1 and using the gitlab docker executor to manage starting the docker image), so BEFORE_DOCKER_SCRIPT won't run in my case. This seems to be getting a bit off topic, I'll just create a script and call it from my ci yaml. The reason I didn't give more context when I wrote this question was because I knew my context was non-standard/complicated.

tyler-picknik gravatar image tyler-picknik  ( 2019-12-22 07:12:04 -0500 )edit

The reason I didn't give more context when I wrote this question was because I knew my context was non-standard/complicated.

I would still recommend you add this sort of details, as even if it complicates things, it also provides important contextual information.

I've had to guess twice now what it was you wanted to do.

gvdhoorn gravatar image gvdhoorn  ( 2019-12-22 08:08:06 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-12-20 14:54:29 -0500

Seen: 462 times

Last updated: Dec 22 '19