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

[autoware.auto] How to make apt packages persist in ADE?

asked 2020-03-27 11:24:25 -0600

If I'm working in ADE and I use apt to install something that is not already included, how can I make sure that what I install sticks around after I stop ADE? At the moment, I am having to re-install everything every time I stop and restart ADE.

I'm sure it's something simple and I tried looking through documentation for Docker, but I don't know enough about how it works to really know what to look for.

edit retag flag offensive close merge delete

Comments

I'm not familiar with autoware.auto nor ADE. However, I use a docker image for autoware.ai. In my case I found two solutions for persisting apt packages: 1) put the package in the Dockerfile, so when the docker is built, the packages are all there. 2) start and run the docker container without the --rm flag, so the container is not deleted after you exit it, and install everything you need there; then you can use the docker commit to create a new container with the packages you installed. then you can either start and attach to the container, or delete it, restore the --rm flag on your script, and start the container you committed from scratch everytime (using whatever name you gave to it). There might be better solutions, but I'm happy with that. Cheers.

pedroexe gravatar image pedroexe  ( 2020-04-01 20:09:16 -0600 )edit

2 Answers

Sort by » oldest newest most voted
3

answered 2020-04-02 17:45:55 -0600

Josh Whitley gravatar image

updated 2020-04-02 17:52:03 -0600

This is a consequence of using Docker images. The .aderc file in your AutowareAuto repo specifies the list of Docker images to use when ade start is run. That portion of the file should look something like this:

export ADE_IMAGES="
  registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/ade:master
  registry.gitlab.com/apexai/ade-atom:latest
  registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto:master
"

When you run ade start, ade looks for those images in your Docker daemon (you can see what images you have already downloaded with the command docker image ls). When you run a Docker image, you're creating a container which is ephemeral. However, the changes you make to the container are not lost when you shut it down (for example, with ade stop), they're just not easily visible. If you run docker container ls while ade is running, you should see something like the following:

CONTAINER ID        IMAGE                                                                          COMMAND                  CREATED             STATUS              PORTS               NAMES

`ee3e44533985        registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/ade:master   "/ade_entrypoint /bi…"   27 hours ago        Up 27 hours                             ade`

`b7d35ddaacaf        registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto:master       "/bin/sh -c 'trap 'e…"   27 hours ago        Up 27 hours                             ade_registry.gitlab.com_autowarefoundation_autoware.auto_autowareauto_master`

`89fa0b5f53b1        registry.gitlab.com/apexai/ade-atom:latest                                     "/bin/sh -c 'trap 'e…"   12 days ago         Up 27 hours                             ade_registry.gitlab.com_apexai_ade-atom_latest`

Now, if you run ade stop, the command docker container ls will show nothing because it only lists running containers. However, if you add the -a (all) flag, you should get:

CONTAINER ID        IMAGE                                                                                COMMAND                  CREATED             STATUS                       PORTS               NAMES
ef9dc36ee388        126c6aa92603                                                                         "/bin/sh -c 'apt-get…"   21 hours ago        Exited (100) 21 hours ago                        flamboyant_carson
ee3e44533985        registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/ade:master         "/ade_entrypoint /bi…"   27 hours ago        Exited (147) 5 seconds ago                       ade
b7d35ddaacaf        registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto:master             "/bin/sh -c 'trap 'e…"   27 hours ago        Exited (147) 5 seconds ago                       ade_registry.gitlab.com_autowarefoundation_autoware.auto_autowareauto_master
af22583e202a        1c1c55d72635                                                                         "gitlab-runner-helpe…"   2 days ago          Exited (0) 2 days ago                            runner--project-0-concurrent-0-cache-c33bcaa1fd2c77edfc3893b41966cea8
54ddde93b780        registry.gitlab.com/apexai/ade-lgsvl:2020.01                                         "/bin/sh -c 'trap 'e…"   6 days ago          Exited (147) 5 seconds ago                       ade_registry.gitlab.com_apexai_ade-lgsvl_2020.01
...

The formatting is a bit of a mess but you're looking for the image with the IMAGE name of registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/ade:master. This is the actual container that you made your changes in when running ade. You can then _save_ the changes you made to that container as a new image. In my example below, the _container_ that is running the ade image is also named ade. To save that container with the changes you made as a new image, you just have to commit it with a tag like this: docker commit ade my-username/my-repo:ade (replacing my-username with a username that you choose). Now, if you replace the first image entry in your .aderc (registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/ade:master) with your new image (my-username/my-repo:ade), when ... (more)

edit flag offensive delete link more

Comments

Thanks, Josh!

Jeffrey Kane Johnson gravatar image Jeffrey Kane Johnson  ( 2020-04-02 21:12:36 -0600 )edit

@Josh Whitley, i ve tried your method but im getting error of 'useradd: user 'user' already exists'.

Vivan gravatar image Vivan  ( 2020-07-17 04:14:19 -0600 )edit

@Vivan At what point in the steps are you getting this error?

Josh Whitley gravatar image Josh Whitley  ( 2020-07-17 17:59:59 -0600 )edit

@Josh Whitley, i got the error after the step of replacing the image entry in the .aderc file.

Vivan gravatar image Vivan  ( 2020-07-19 20:52:41 -0600 )edit

Hi, i'm getting the same error, any suggestion?

ltruaisch gravatar image ltruaisch  ( 2020-08-04 03:13:24 -0600 )edit

Have either of you recently updated your base ade images with ade start --update when your .aderc file is set to use the default images? Also, please keep in mind that any image you create using the method above will not automatically be updated when the ade images are updated. This is more of a temporary hack. The more correct way to do this is to create a Dockerfile which starts with FROM registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/ade:master and a set of RUN commands which install the additional tools that you want in the image. That way, you can rebuild the image periodically and have it build on the latest ade image.

Josh Whitley gravatar image Josh Whitley  ( 2020-08-05 23:29:39 -0600 )edit

Thank you for the advice! I created a Dockerfile and works well.

ltruaisch gravatar image ltruaisch  ( 2020-08-06 08:35:22 -0600 )edit

Thanks for the answer @Josh Whitley, but I've met the same 'user alrady exists' error, tried to delete 'useradd' cmd from ade_entrypoint but also failed.. any solution?

OpaOparator gravatar image OpaOparator  ( 2021-09-12 22:08:26 -0600 )edit
0

answered 2022-08-04 06:10:27 -0600

jorai gravatar image

I solved the problem by the following. Hope it can help you. https://www.powu3.com/autoware_tx2/

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-03-27 11:24:25 -0600

Seen: 877 times

Last updated: Apr 02 '20