0
$\begingroup$

Rosanswers logo

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.git

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-docker-image/

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 I used to issue the cmd:

$ ade --rc .aderc-amd64-foxy start --update --enter

Then the image was built and I further accessed it.

In Autoware_AI I need to run a .sh entrypoint:

$ ./run.sh -t 1.14.0

I am still stuck to be able to modify the Autoware/src packages present inside this “image” and then save this image for further creation of a modified container.

Different from AutowareAuto project that I used to issue the cmd:

$ ade --rc .aderc-amd64-foxy start --update --enter

Then the image was built and I further accessed it.

In Autoware_AI I need to run a .sh entrypoint:

$ ./run.sh -t 1.14.0

For me this command sounds that I am executing a program (.sh) and not actually running a container ??? Not completely understood the difference.

Do I need to make another install type of Autoware_AI project? I mean build from source on my OS? I thought just docker would be enough…besides that I am using ubuntu 20.04 and I know that Autoware_AI stopped just on Ubuntu 18.04 (I am almost sure I will have broken pkgs, compatibility issues if I try to install on ubuntu 20.04).

Someone has any other idea how to solve this issue?

I believe I need to do something similar to this:

https://stackoverflow.com/questions/19585028/i-lose-my-data-when-the-container-exits

ATTEMPT 2:

  1. Commit Changes To a Docker Image: https://phoenixnap.com/kb/how-to-commit-changes-to-docker-image

With this attempt I was able to creat a new image based on Autoware_AI container. However after finish all tutorial steps, I got an error "Connection Refused" to launch Autoware_AI packages. I do not understand what can be done to get access to their server with my custom_image created. I have done the following steps:

A) Extracted the image_ID and runned with docker cmd:

$ sudo docker images 
[sudo] senha para autoware-auto-ros1: 
REPOSITORY                                                                            TAG                             IMAGE ID       CREATED        SIZE
autoware_ai_changed_image                                                             latest                          8a61bf4e20f4   3 hours ago    10.3GB
change_image_test                                                                     latest                          7143875f8440   3 hours ago    72.9MB
hi_mom_nginx                                                                          latest                          2c89904348df   5 hours ago    22.6MB
nginx                                                                                 alpine                          a64a6e03b055   5 days ago     22.6MB
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

B) Selected the Image_ID of autoware/autoware local-melodic-cuda: 4997df3ad6dc and thenrunned:

$ sudo docker run -it 4997df3ad6dc 

Afterwards inside the container I listed the files inside it:

 Autoware@0448a42dedae: /home/autoware $ ls
Autoware

C) Modified the original docker container adding a .txt file (just to test a modification):

Autoware@0448a42dedae: /home/autoware $ vim author.txt
Autoware@0448a42dedae: /home/autoware $ ls
Autoware author.tx

D) Exited the image and then Added a commit to the image:

Autoware@0448a42dedae: /home/autoware $ exit home $ sudo docker commit 0488a42dedae autoware_ai_changed_image

e) Entered the image again and Tried to use the contents of the image ( Runtime manager interface)

home $ sudo docker run -it autoware_ai_changed_image Autoware@0448a42dedae: /home/autoware $ roslaunch runtime_manager runtime_manager.launch

And then I got this error msg:

... logging to /home/autoware/.ros/log/bac95566-a1f4-11eb-b56a-0242ac110002/roslaunch-7bdf40bf24c5-42.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://7bdf40bf24c5:40463/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.10

NODES
  /
    run (runtime_manager/run)

auto-starting new master
process[master]: started with pid [52]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to bac95566-a1f4-11eb-b56a-0242ac110002
process[rosout-1]: started with pid [63]
started core service [/rosout]
process[run-2]: started with pid [66]
***Unable to init server: Could not connect: Connection refused
[run-2] process has died [pid 66, exit code 1, cmd /home/autoware/Autoware/install/runtime_manager/share/runtime_manager/scripts/run __name:=run __log:=/home/autoware/.ros/log/bac95566-a1f4-11eb-b56a-0242ac110002/run-2.log].
log file: /home/autoware/.ros/log/bac95566-a1f4-11eb-b56a-0242ac110002/run-2*.log***

There is a problem of server connection that I did not have when building the standard Autoware_AI container with the standard cmd:

home:~/docker/generic$ .run.sh -t 1.14.0

home/autoware$ roslaunch runtime_manager runtime_manager.launch

... logging to /home/autoware/.ros/log/2f40e752-a20d-11eb-a087-c82158f9534e/roslaunch-marcus-ros2-foxy-72.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://marcus-ros2-foxy:45207/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.6

NODES
  /
    run (runtime_manager/run)

auto-starting new master
process[master]: started with pid [82]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 2f40e752-a20d-11eb-a087-c82158f9534e
process[rosout-1]: started with pid [93]
started core service [/rosout]
process[run-2]: started with pid [96]
[run-2] process has finished cleanly
log file: /home/autoware/.ros/log/2f40e752-a20d-11eb-a087-c82158f9534e/run-2*.log

I am kind of new in forking,changing docker images. I do not understand how to fix this, find a solution for create my custom docker image and make it functional.

Thanks in advance.


Originally posted by Vini71 on ROS Answers with karma: 266 on 2021-04-19

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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/autoware.ai/wiki/Generic-x86-Docker#run-an-autoware-docker-container). 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/Autoware-AI/autoware.ai/1.14.0/autoware.ai.repos 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/visualization.git version: 1.14.0 And replaced by:

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

Afterwards I followed the build instructions in case 3 here: https://github.com/Autoware-AI/autoware.ai/wiki/Generic-x86-Docker#run-an-autoware-docker-container

$ ./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.


Originally posted by Vini71 with karma: 266 on 2021-04-29

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.