Skip to content

Commit e6c6dcb

Browse files
committed
doc: Enhance preparation of Hosts and directory structure overview in README
1 parent a6a2a5c commit e6c6dcb

1 file changed

Lines changed: 103 additions & 30 deletions

File tree

README.md

Lines changed: 103 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Before running the local quick start, check the following:
6262

6363
- Ubuntu 24.04 on the local development machine.
6464
- Docker (with Compose) is available on the local machine.
65-
- Follow the official [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/) guide to install Docker.
65+
- Follow the official [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/) guide.
6666
- To run Docker commands as a non-root user, add your user to the `docker` group: `sudo usermod -aG docker $USER`
6767
- Python 3 is available to run management and benchmark scripts.
6868
- NumPy is required for analysis scripts (install with `sudo apt install -y python3-numpy`).
@@ -103,17 +103,111 @@ This runs 3 trials, each lasting 60 seconds.
103103
- Logs: `<ws-dir>/<scenario>/results/latest/logs/trial<N>/`
104104
- CSV: `<ws-dir>/<scenario>/results/latest/csv/`
105105

106-
Want to know more about these steps and output results?
107-
Need multi-host operation, native execution, and REST automation?
108-
Let's go to the next section [Usage in Details](#usage-in-details).
106+
Need multi-host operation, Docker or native execution, and REST automation?
107+
Want to learn more about these steps and output metrics?
108+
Let’s move on to the following sections to explore the full capabilities of this framework!
109109

110110
## Usage in Details
111111

112-
### Shared Docker Image
112+
This section walks you through the full usage of the framework in detail, from generating execution scripts to running multi-host benchmarks via REST in either Docker or native environments.
113113

114-
Use the published GitHub Packages image [`ghcr.io/hal-lab-u-tokyo/ros2-perf-multihost:latest`](https://github.com/hal-lab-u-tokyo/ros2-perf-multihost/pkgs/container/ros2-perf-multihost).
115-
Generated `local_compose.yaml` and `host{N}_compose.yaml` files reference this image.
116-
For image build and push steps, see `docker/README.md`.
114+
### Directory Structure
115+
116+
Before starting multi-host benchmarks, it is helpful to understand an overview of the main directories and their roles in the framework.
117+
118+
| Directory | Role |
119+
|---|---|
120+
| `manager_scripts/` | Topology-specific execution artifact generator; includes helper scripts for distribution and router operation. |
121+
| `remote_hosts_scripts/` | REST server, remote execution coordinator, and host metrics collector for remote hosts. |
122+
| `performance_test/` | Trial automation, log collection, and CSV aggregation/analysis. |
123+
| `performance_ws/` | Working directory for generated scenarios, execution scripts, and run results. Auto-generated on first use; not present in the repository. |
124+
| `topology_example/` | Example topology JSON files and schema guidance. |
125+
| `ros2_node_impl_ws/` | ROS 2 node implementation workspace for generated execution scripts. |
126+
| `docker/` | Shared Docker image definition and Compose-related assets. |
127+
128+
### Preparation of Hosts
129+
130+
This section describes the requirements and setup steps for each host to run this framework.
131+
132+
#### Requirements
133+
134+
Here is the baseline environment we have tested so far.
135+
136+
- Ubuntu 24.04
137+
- Verified devices: Raspberry Pi 4 and Raspberry Pi 5.
138+
- Other devices or servers should also work if Ubuntu 24.04 is available.
139+
- User and repository path assumption:
140+
- Scripts and examples in this repository assume user `ubuntu` and `/home/ubuntu/ros2-perf-multihost`.
141+
- If your username and path differ, how to override these settings is described later.
142+
143+
#### SSH access (on the Manager)
144+
145+
This framework assumes that the Manager can SSH into each Host by hostname only, without a password (using key-based authentication).
146+
Therefore, configure the following settings on the Manager machine to meet this requirement.
147+
148+
- Generate and register SSH keys (e.g., `ssh-keygen -t ed25519 && ssh-copy-id ubuntu@host1`).
149+
- Ensure hostnames are resolvable from the Manager.
150+
- Recommended Manager-side configuration examples:
151+
- `/etc/hosts`:
152+
```text
153+
192.168.10.11 host1
154+
192.168.10.12 host2
155+
192.168.10.13 host3
156+
```
157+
- `~/.ssh/config`:
158+
```text
159+
Host host1
160+
User ubuntu
161+
IdentityFile ~/.ssh/id_ed25519
162+
Host host2
163+
User ubuntu
164+
IdentityFile ~/.ssh/id_ed25519
165+
Host host3
166+
User ubuntu
167+
IdentityFile ~/.ssh/id_ed25519
168+
```
169+
170+
#### Docker and the published image
171+
172+
Install Docker Engine and enable non-root usage.
173+
174+
- Follow the official [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/) guide.
175+
- To run Docker commands as a non-root user, add your user to the `docker` group:
176+
```bash
177+
sudo usermod -aG docker $USER
178+
```
179+
180+
Pull the published GitHub Packages image [`ghcr.io/hal-lab-u-tokyo/ros2-perf-multihost:latest`](https://github.com/hal-lab-u-tokyo/ros2-perf-multihost/pkgs/container/ros2-perf-multihost).
181+
182+
```bash
183+
docker pull ghcr.io/hal-lab-u-tokyo/ros2-perf-multihost:latest
184+
```
185+
186+
For details on the Docker image, see [docker/README.md](docker/README.md).
187+
188+
#### [Optional] Native ROS 2 Environment
189+
190+
If you want to evaluate native execution mode as well, install ROS 2 and build the package.
191+
192+
Follow the official [ROS 2 Jazzy Installation steps](https://docs.ros.org/en/jazzy/Installation/Ubuntu-Install-Debs.html).
193+
Other ROS 2 distributions may also work, but they are not officially tested yet.
194+
195+
Then, build the ROS 2 package used by this framework in `ros2_node_impl_ws/` (see [ros2_node_impl_ws/README.md](ros2_node_impl_ws/README.md) for details on ROS 2 node features).
196+
197+
```bash
198+
source /opt/ros/jazzy/setup.bash
199+
cd ros2_node_impl_ws
200+
colcon build --packages-select ros2_perf_multihost_nodes
201+
```
202+
203+
#### Python dependencies
204+
205+
Install dependencies for the REST server on each target host:
206+
207+
```bash
208+
sudo apt update
209+
sudo apt install -y python3-flask python3-requests
210+
```
117211

118212
### Generate Execution Scripts
119213

@@ -228,13 +322,6 @@ You can override the target paths on the command line.
228322

229323
In a multi-host setup, each Raspberry Pi runs a REST server implemented by `rest_server.py`. A controller script sends requests to those servers to automate benchmark execution.
230324

231-
Install required packages on each target host before starting the REST server:
232-
233-
```bash
234-
sudo apt update
235-
sudo apt install -y python3-flask python3-requests
236-
```
237-
238325
1. Start the REST server on every Raspberry Pi.
239326

240327
```bash
@@ -265,7 +352,7 @@ When using Zenoh as the RMW, start the router on the manager host before running
265352
./manager_scripts/operate_zenoh_router.sh foreground
266353
```
267354

268-
### Results and Output Files
355+
## Results and Analysis
269356

270357
`performance_test.py` launches node groups via REST for each trial, then collects logs from each host with `scp`.
271358

@@ -274,20 +361,6 @@ On prepare, the manager creates `<ws-dir>/<scenario>/results/<session_timestamp>
274361
- Trial logs are collected under `<ws-dir>/<scenario>/results/latest/logs/trial<N>/`.
275362
- Aggregated outputs such as `total_latency.csv`, `throughput.csv`, `host_trials_usage.csv`, and `host_usage_summary.csv` are written under `<ws-dir>/<scenario>/results/latest/csv/`.
276363

277-
## Directory Structure
278-
279-
The main directories and their roles are as follows:
280-
281-
| Directory | Role |
282-
|---|---|
283-
| `manager_scripts/` | Generates topology-specific execution artifacts and provides helper scripts for distribution and router operation. |
284-
| `remote_hosts_scripts/` | Runs on each host (REST server, remote start orchestration, and host metrics collection). |
285-
| `performance_test/` | Executes trial automation, log collection, and CSV aggregation/analysis. |
286-
| `performance_ws/` | Stores generated scenarios, execution scripts, and run results. |
287-
| `topology_example/` | Provides example topology JSON files and schema guidance. |
288-
| `ros2_node_impl_ws/` | ROS 2 node implementation workspace used by generated execution scripts. |
289-
| `docker/` | Shared Docker image definition and compose-related assets. |
290-
291364
## Related Documents
292365

293366
For detailed usage in subdomains, see the following documents:

0 commit comments

Comments
 (0)