Ask Your Question
1

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

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

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 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

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

Josh Whitley gravatar image

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

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 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 42 times

Last updated: Apr 02