Skip to content

Commit

Permalink
Entry two added
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanFernandezEva committed Oct 20, 2024
1 parent 32d5c2e commit cbfc407
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/_posts/2024-10-15-Week1.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ From there, you can add more content to your website. You can also use custom de

## Robotics Academy for users

I installed the user version of Robotics Academy first, following these [instructions](https://jderobot.github.io/RoboticsAcademy/user_guide/). I installed it on two different PCs, one with Windows and the other with Linux (Ubuntu). I didn't encounter any problems in the installation of this versión.
I installed the user version of Robotics Academy first, following these [instructions](https://jderobot.github.io/RoboticsAcademy/user_guide/). I installed it on two different PCs, one with Windows and the other with Linux (Ubuntu). I didn't encounter any problems in the installation of this version.

## Robotics Academy for developers

Expand Down
67 changes: 67 additions & 0 deletions docs/_posts/2024-10-20-Week2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Testing Other Branches
date: 2024-10-20 20:30:00 +0100
tags: [weekly progress]
author: juan
img_path: /assets/img/
toc: true
comments: true
---

## 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:

```bash
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:

```bash
./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](https://github.com/JdeRobot/RoboticsAcademy/blob/humble-devel/docs/generate_a_radi.md) 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:

```bash
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.

```bash
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:

```bash
docker rmi [image_id]
```

0 comments on commit cbfc407

Please sign in to comment.