|
| 1 | +## How to get deployment artifacts |
| 2 | + |
| 3 | + |
| 4 | +### Preparation |
| 5 | + |
| 6 | +Please be sure that the tool is installed and your workspace setup, see the [installation guide](../README.md) for further details. |
| 7 | + |
| 8 | +Import the example project pub_sub_ros2 (from the [ros-model-examples](https://github.com/ipa-nhg/ros-model-examples) repository) to the workbench of your application: |
| 9 | + |
| 10 | +``` |
| 11 | +pub_sub_ros2 |
| 12 | +``` |
| 13 | + |
| 14 | +Import the example project agriculture_demo_sprint2 (from the [ros-model-examples](https://github.com/ipa-nhg/ros-model-examples) repository) to the workbench of your application: |
| 15 | + |
| 16 | +``` |
| 17 | +agriculture_demo_sprint2 |
| 18 | +``` |
| 19 | + |
| 20 | +Install docker and docker-compose |
| 21 | + |
| 22 | +### Get get deployment artifacts |
| 23 | + |
| 24 | +To create deployment artifacts you need to right click "*.rossystem" file. |
| 25 | + |
| 26 | +#### Rossystem without parameters |
| 27 | +In this case, you need to right click "communication.rossystem". Then you need to choose "Deployment Artifacts Generator". |
| 28 | + |
| 29 | +A dialog will be open and ask you to select a ROS Distro. In this case, the rossystem doesn't contain parameters, so you only need to choose a ROS Distro. |
| 30 | + |
| 31 | +This process is as shown blow. |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +Then deployment artifacts will automatically created, as you can find under "src-gen" folder |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +#### Rossystem with parameters |
| 41 | + |
| 42 | +In some case, you need to choose device ports based on parameters defined in a rossystem. |
| 43 | + |
| 44 | +For example, if you want to run teleop with a joystick in a docker container, docker need to know which port is the joystick connect to. |
| 45 | + |
| 46 | +In this case, you need to right click "communication.rossystem". Then you need to choose "Deployment Artifacts Generator". |
| 47 | + |
| 48 | +A dialog will be open and ask you to select a ROS Distro. In this case, the rossystem contains parameters, you need to choose the corresponding parameter to the joystick port value. |
| 49 | + |
| 50 | +This process is as shown blow. |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +Then deployment artifacts will automatically created. |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +### Use github action to generate docker images |
| 59 | + |
| 60 | +Once you get deployment artifacts, you can use git action to build and release docker images automatically. |
| 61 | + |
| 62 | +If you already have a repository in github, you can use it. If not, you need to create a repository. For example, we use ("rossystem-deployment" repository)[https://github.com/ipa-rwu/rossystem-deployment. |
| 63 | + |
| 64 | +You also need a dockerhub account. Once you have dockerhub account, you need to add your Docker ID as a secret to GitHub. |
| 65 | +1. Add your Docker ID as a secret to GitHub. Navigate to your GitHub repository and click Settings > Secrets > New secret. |
| 66 | +2. Create DOCKER_USERNAME and DOCKER_PASSWORD |
| 67 | + |
| 68 | +The result should looks like below. |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +In this repository, you need to create a folder ".github/workflows". Then you need to put a file with suffix "_workflow.yml" from a generated folder to this folder. For example, you can put "communication_foxy_workflow.yml" or "agriculture_robot_sprint3_noetic_workflow.yml" under ".github/workflows" folder, as shown below. |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | +Then you need to put the generated folder in this repository. For example, we put "communication_ros2" and "agriculture_robot_sprint3" in the repository. The locations of these two folder as shown below. |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | +You can push them to github. Github action will build docker image and push images in dockerhub. |
| 82 | + |
| 83 | +### Start the system |
| 84 | + |
| 85 | +Before starting the system, you need to modify "docker-compose" file. You need to add your docker account as prefix before a docker image name. |
| 86 | +For example, we add "kogrob2" (docker hub account name) in front of "communication_foxy:latest", as shown below. |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | +Then you can use the command below to start the system. |
| 91 | +``` |
| 92 | +docker-compose up |
| 93 | +``` |
0 commit comments