Post

Testing Other Branches

Testing other branches

This week I learned how to execute Robotics Academy for developers in a specific git branch. I needed to do this to test some changes in those branches. However, you can’t just switch to another branch and run the develop_academy.sh script, you need to generate a RADI for this branch.

Generating a RADI

To generate a new RADI, we need to go to the RADI directory:

1
cd <dir>/RoboticsAcademy/scripts/RADI

Here we will find a script named build.sh, we need to execute this script. Here are the arguments the script can take:

1
./build.sh -a [ROBOTICS_ACADEMY] -i [ROBOTICS_INFRASTRUCTURE] -m [RAM] -r [ROS_DISTRO] -t [IMAGE_TAG]

ROBOTICS_ACADEMY: This is the branch name of the Robotics Academy repository to use. Default value is humble-devel. ROBOTICS_INFRASTRUCTURE: This is the branch name of the Robotics Infrastructure repository to use. Default value is humble-devel. RAM: This is the branch name of the RoboticsApplicationManager repository to use. Default value is main. ROS_DISTRO: This is the ROS distribution to use. The script currently supports noetic and humble. Default value is humble. IMAGE_TAG: This is the tag of the Docker image that will be created. Default value is test.

You can check the other repositories’ branches to see if they have any with the same name as the branch you want to use from the Robotics Academy repository. You will most likely need those, if there isn’t any, the default options should suffice (we can omit those arguments then). The tag is used by the scripts to know which RADI should it use, so I recommend adding the tag argument.

Here is more information about generating RADIs.

It might take a while to generate the RADI, specially if it has to generate the base image first, you can see all the RADI you have available with:

1
docker images

Using the new RADI

Now that we generated the required RADI, we need to make the script use it. For that, we need to edit the compose_file the develop_academy.sh script is using. This file might change, depending if you are using GPU acceleration or not, or if you are using NVIDIA support. The default option is no acceleration, using the dev_humble_cpu compose file, so we are changing that one.

1
cd <dir>/RoboticsAcademy/compose_cfg

Here we will find the dev_humble_cpu.yaml file. To use our RADI, replace the name in the image section to the one we are using, and comment everything in the volumes section (from volumes to tty, this last one not included).

After all that, we can now execute the develop_academy.sh script and check the Robotics Academy branch.

Other problems

Sometimes the build.sh script can give you an error when trying to generate the image if the branch has new dependencies. This is because it’s trying to build the RADI with an old base image, since the script uses an already generated one to save time. To solve this, use the -f argument on the script, which will force it to generate a new base image.

These images take a lot of space. If you aren’t gonna use one anymore, you can delete it with:

1
docker rmi [image_id]
This post is licensed under CC BY 4.0 by the author.

Trending Tags