Skip to content

Commit d0623df

Browse files
ipa-rwuipa-nhg
authored andcommitted
Add delpoyment documentation
1 parent 545a87a commit d0623df

9 files changed

Lines changed: 93 additions & 0 deletions

docu/deployment.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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+
![alt text](images/rostooling_deployment.gif)
34+
35+
Then deployment artifacts will automatically created, as you can find under "src-gen" folder
36+
37+
![alt text](images/pub_sub_ros2_deployment_gen.png)
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+
![alt text](images/rostooling_deployment_jackal.gif)
53+
54+
Then deployment artifacts will automatically created.
55+
56+
![alt text](images/jackal_deployment_gen.png)
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+
![alt text](images/github_secrets.png)
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+
![alt text](images/github_workflows_folder.png)
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+
![alt text](images/rossystem_deployment_repo.png)
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+
![alt text](images/docker-compose.png)
89+
90+
Then you can use the command below to start the system.
91+
```
92+
docker-compose up
93+
```

docu/images/docker-compose.png

35.9 KB
Loading

docu/images/github_secrets.png

99.2 KB
Loading
68.9 KB
Loading
24.6 KB
Loading
26.1 KB
Loading
110 KB
Loading
950 KB
Loading
2.11 MB
Loading

0 commit comments

Comments
 (0)