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

Fork Autoware_AI repository and create docker image

asked 2021-04-19 18:33:53 -0500

Vini71 gravatar image

updated 2022-05-01 13:14:34 -0500

lucasw gravatar image

Hi Autoware_AI currently does not include some vehicles that I wish to use to work with python API. I need to make some changes into the code, modify launch files, etc to make my simulation based on Autoware_AI repository https://github.com/Autoware-AI/docker...

It is not feasible change the code, let it inside shared_dir ( folder with access to my desktop and to the docker) and every time when I build the standard Autoware_AI image to remove and add the modified package code with my modifications.

For this reason I wish to fork the original github packages a little bit, and afterwards create an image based on my for and not based on the original repo.

As a solution to work on my codes I was trying to use a branch. However when I exit docker the branch does not exist anymore after issue the cmd below to use docker.

./run.sh -t 1.14.0

the image will build the standard docker image and the created branch no longer exist!

Wha would be the best option do be done? And where can I find a good tutorial for this case involving fork Autoware project?

Thanks in advance!

---------------------------------------------------------------------------------------------------------------------------------------------------------------As solution I tried 2 different approaches:

ATTEMPT 1:

1) To modify the container and save it as described here: https://www.scalyr.com/blog/create-do...

Then using other terminal, trying to add .txt file for Autoware_AI running container, to modify the container, Autoware_AI container does not appear as active (but it is). Just other container are avaialable when I try to copy a file to Autoware_AI:

$ docker cp file.txt (Twice tab): ade: ade_registry.gitlab.com_autowarefoundation_autoware.auto_ade-lgsvl_foxy_2020.06: ade_registry.gitlab.com_autowarefoundation_autoware.auto_autowareauto_amd64_ade-foxy_master: ade_registry.gitlab.com_autowarefoundation_autoware.auto_autowareauto_amd64_binary-foxy_master: hi_mom:

These ade images above are from AutowareAuto, not from AutowareAI, that I wish to use. I have just as external option to access Autoware.Auto images path and the nginx(Hi mom) image (from this tutorial link passed). Unfortunately docker command does not work inside the running container terminal…

But if I list the images I have available, it is possible to see that AutowareAI image was built:

$ docker images:

REPOSITORY                                                                            TAG                             IMAGE ID       CREATED        SIZE
ubuntu                                                                                latest                          26b77e58432b   2 weeks ago    72.9MB
autoware/autoware                                                                     local-melodic-cuda              4997df3ad6dc   2 weeks ago    10.3GB
autoware/autoware                                                                     local-melodic-base-cuda         8fb0b62fcab2   2 weeks ago    6.99GB
autoware/autoware                                                                     local-melodic-base              0d87fce181db   2 weeks ago    3.45GB
registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/amd64/binary-foxy   master                          46ac7d2cbd73   2 weeks ago    144MB
registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/amd64/ade-foxy      master                          acd13c509891   3 weeks ago    4.59GB
lgsvl/simulator-scenarios-runner                                                      simulator-build__2021.1         63c9bdef5e3a   5 weeks ago    413MB
registry.gitlab.com/autowarefoundation/autoware.auto/autowareauto/amd64/ade-foxy      <none>                          6448c91f68e8   6 weeks ago    4.85GB
registry.gitlab.com/autowarefoundation/autoware.auto/ade-lgsvl/foxy                   2020.06                         7be8da9ce3bb   2 months ago   251MB

etc...

However you can check in right upper terminal or in left bottom terminal the Autoware_AI container is running with the name ( autoware/autoware: 1.14.0-melodic-cuda). Different from AutowareAuto project that ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2021-04-29 10:22:04 -0500

Vini71 gravatar image

updated 2021-09-06 15:20:57 -0500

I figured out how to solve the issue:

2 Steps:

A) Work locally with the Autoware.AI repos, installing at first a local image (Case 2 of this website https://github.com/Autoware-AI/autowa...). For that I runned a base container:

$ fork/docker/generic$ ./run.sh -b home/desired_empty_folder

Then I installed the package contained in the official DockerFile (After run the container, inside container):

~/generic$ cd /home/$USERNAME/Autoware
~/generic$ wget https://raw.githubusercontent.com/Autoware-AI/autoware.ai/1.14.0/autoware.ai.repos
~/generic$ source /home/$USERNAME/Autoware/install/local_setup.bash
~/generic$ vcs import src < autoware.ai.repos
~/generic$ source /opt/ros/$ROS_DISTRO/setup.bash
~/generic$ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
~/generic$ source /home/$USERNAME/Autoware/install/local_setup.bash >> /home/$USERNAME/.bashrc

The steps above must be done just the first time you run the base image. Then after exit the container and re-enter other times later...it is required to run just one command to enable ROS pkgs to work:

~/generic$ source /home/$USERNAME/Autoware/install/local_setup.bash

B) Then I worked around and everytime I exited the container, the files are saved wheI enter the container again. However later to build all the project with my custom changed codes and upload to dockerhub, I have built an image, and changed the Dockerfile, as described in steps below:

Basically I needed to build the image and afterwards run the container with a custom Dockerfile (that pulled the code from muy github).

My Dockerfile was:

image description

And After the modification, the Dockerfile became:

image description To dowload the modified ROS codes to my image, instead of autoware repo ROS pkgs, I needed:

1 - Copy the autoware.ai.repos file from here: https://raw.githubusercontent.com/Aut... To my docker local folder (docker/generic) and unwrap them with vcs import command as the Dockerfile displays above...

2- Edit the autoware.ai.repos, in order to change the address of some of the repositories contained in autoware.ai.repos to my personal github:

I Removed the lines:

autoware/visualization: type: git url: https://github.com/Autoware-AI/visual... version: 1.14.0 And replaced by:

autoware/visualization: type: git url: https://github.com/marcusvinicius178/...

Afterwards I followed the build instructions in case 3 here: https://github.com/Autoware-AI/autowa...

$ ./build.sh

$ ./run.sh -t local

I know that may exist a more professional way to work with Docker images, and build a new Dockerfile based on the original one. But I am not that expert in Docker and also in this way my problem was solved.

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2021-04-19 18:33:53 -0500

Seen: 386 times

Last updated: Sep 06 '21