Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 60 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
YAMLLINT_CONFIG="{extends: relaxed, rules: {line-length: {max: 120}}}"
find . \( -name "*.yaml" -o -name "*.yml" \) -type f | xargs yamllint -d "$YAMLLINT_CONFIG"

docker-build:
build-and-test-sensor:
runs-on: ubuntu-24.04
steps:
- name: Show triggering source
Expand All @@ -54,20 +54,65 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and start sensor_diagnostics demo
working-directory: demos/sensor_diagnostics
run: docker compose --profile ci up -d --build sensor-demo-ci

- name: Build Sensor Diagnostics demo image
run: |
cd demos/sensor_diagnostics
docker build -t sensor-diagnostics-demo:test -f Dockerfile .
- name: Run smoke tests
run: ./tests/smoke_test.sh

- name: Build TurtleBot3 demo image
run: |
cd demos/turtlebot3_integration
docker build -t turtlebot3-medkit-demo:test -f Dockerfile .
- name: Show container logs on failure
if: failure()
working-directory: demos/sensor_diagnostics
run: docker compose --profile ci logs sensor-demo-ci --tail=200

- name: Build MoveIt Pick-and-Place demo image
run: |
cd demos/moveit_pick_place
docker build -t moveit-pick-place-demo:test -f Dockerfile .
- name: Teardown
if: always()
working-directory: demos/sensor_diagnostics
run: docker compose --profile ci down

build-and-test-turtlebot:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build and start turtlebot3 demo
working-directory: demos/turtlebot3_integration
run: docker compose --profile ci up -d --build turtlebot3-demo-ci

- name: Run smoke tests
run: ./tests/smoke_test_turtlebot3.sh

- name: Show container logs on failure
if: failure()
working-directory: demos/turtlebot3_integration
run: docker compose --profile ci logs turtlebot3-demo-ci --tail=200

- name: Teardown
if: always()
working-directory: demos/turtlebot3_integration
run: docker compose --profile ci down

build-and-test-moveit:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build and start moveit demo
working-directory: demos/moveit_pick_place
run: docker compose --profile ci up -d --build moveit-demo-ci

- name: Run smoke tests
run: ./tests/smoke_test_moveit.sh

- name: Show container logs on failure
if: failure()
working-directory: demos/moveit_pick_place
run: docker compose --profile ci logs moveit-demo-ci --tail=200

- name: Teardown
if: always()
working-directory: demos/moveit_pick_place
run: docker compose --profile ci down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,19 @@ curl http://localhost:8080/api/v1/faults | jq

See individual demo READMEs for more examples.

## Testing

Each demo has automated smoke tests that verify the gateway starts and the REST API works correctly:

```bash
# Run smoke tests against a running demo (default: http://localhost:8080)
./tests/smoke_test.sh # Sensor diagnostics (21 tests, incl. fault injection)
./tests/smoke_test_turtlebot3.sh # TurtleBot3 (entity discovery)
./tests/smoke_test_moveit.sh # MoveIt pick-and-place (entity discovery)
```

CI runs all 3 demos in parallel - each job builds the Docker image, starts the container, and runs the smoke tests against it. See [CI workflow](.github/workflows/ci.yml).

## Related Projects

- [ros2_medkit](https://github.com/selfpatch/ros2_medkit) — Core diagnostics library with SOVD-compliant gateway
Expand Down
9 changes: 3 additions & 6 deletions demos/moveit_pick_place/config/medkit_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ diagnostics:
allow_credentials: false
max_age_seconds: 86400

max_parallel_topic_samples: 10

# Discovery configuration
discovery_mode: "hybrid" # runtime_only, manifest_only, or hybrid
manifest_path: "" # Will be set via launch argument
manifest_strict_validation: true

discovery:
mode: "hybrid" # runtime_only, manifest_only, or hybrid
manifest_path: "" # Will be set via launch argument
manifest_strict_validation: true
runtime:
create_synthetic_components: false # Manifest defines components

Expand Down
17 changes: 17 additions & 0 deletions demos/moveit_pick_place/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,23 @@ services:
source /root/demo_ws/install/setup.bash &&
ros2 launch moveit_medkit_demo $${LAUNCH_FILE} headless:=$${HEADLESS}"

# For CI testing - fake hardware (no Gazebo), tests run externally
moveit-demo-ci:
profiles: ["ci"]
build:
context: .
dockerfile: Dockerfile
container_name: moveit_medkit_demo_ci
environment:
- ROS_DOMAIN_ID=40
ports:
- "8080:8080"
command: >
bash -c "mkdir -p /var/lib/ros2_medkit/rosbags &&
source /opt/ros/jazzy/setup.bash &&
source /root/demo_ws/install/setup.bash &&
ros2 launch moveit_medkit_demo demo.launch.py headless:=true"

# SOVD Web UI — pre-built from GHCR
sovd-web-ui:
image: ghcr.io/selfpatch/sovd_web_ui:latest
Expand Down
2 changes: 1 addition & 1 deletion demos/moveit_pick_place/launch/demo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def generate_launch_description():
medkit_params_file,
{
"use_sim_time": use_sim_time,
"manifest_path": manifest_file,
"discovery.manifest_path": manifest_file,
},
],
),
Expand Down
2 changes: 1 addition & 1 deletion demos/moveit_pick_place/launch/demo_gazebo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def generate_launch_description():
medkit_params_file,
{
"use_sim_time": True,
"manifest_path": manifest_file,
"discovery.manifest_path": manifest_file,
},
],
),
Expand Down
9 changes: 3 additions & 6 deletions demos/sensor_diagnostics/config/medkit_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ diagnostics:
allow_credentials: false
max_age_seconds: 86400

max_parallel_topic_samples: 10

# Discovery configuration
discovery_mode: "hybrid" # runtime_only, manifest_only, or hybrid
manifest_path: "" # Will be set via launch argument
manifest_strict_validation: true

discovery:
mode: "hybrid" # runtime_only, manifest_only, or hybrid
manifest_path: "" # Will be set via launch argument
manifest_strict_validation: true
runtime:
create_synthetic_components: false # Manifest defines components

Expand Down
8 changes: 2 additions & 6 deletions demos/sensor_diagnostics/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
depends_on:
- sensor-demo

# For CI testing - headless mode with quick exit
# For CI testing - headless mode, tests run externally
sensor-demo-ci:
profiles: ["ci"]
build:
Expand All @@ -43,8 +43,4 @@ services:
bash -c "mkdir -p /var/lib/ros2_medkit/rosbags &&
source /opt/ros/jazzy/setup.bash &&
source /root/demo_ws/install/setup.bash &&
ros2 launch sensor_diagnostics_demo demo.launch.py &
sleep 10 &&
curl -sf http://localhost:8080/api/v1/health &&
curl -sf http://localhost:8080/api/v1/apps | jq '.items[] | .id' &&
echo 'CI validation passed!'"
ros2 launch sensor_diagnostics_demo demo.launch.py"
2 changes: 1 addition & 1 deletion demos/sensor_diagnostics/launch/demo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def generate_launch_description():
parameters=[
medkit_params_file,
{"use_sim_time": use_sim_time},
{"manifest_path": manifest_file},
{"discovery.manifest_path": manifest_file},
],
),
# ===== Fault Manager (at root namespace) =====
Expand Down
9 changes: 3 additions & 6 deletions demos/turtlebot3_integration/config/medkit_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ diagnostics:
allow_credentials: false
max_age_seconds: 86400

max_parallel_topic_samples: 10

# Discovery configuration
discovery_mode: "hybrid" # runtime_only, manifest_only, or hybrid
manifest_path: "" # Will be set via launch argument
manifest_strict_validation: true

discovery:
mode: "hybrid" # runtime_only, manifest_only, or hybrid
manifest_path: "" # Will be set via launch argument
manifest_strict_validation: true
runtime:
create_synthetic_components: false # Manifest defines components

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@ diagnostics:
allow_credentials: false
max_age_seconds: 86400

max_parallel_topic_samples: 10

# Discovery configuration
discovery_mode: "hybrid" # runtime_only, manifest_only, or hybrid
manifest_path: "" # Will be set via launch argument
manifest_strict_validation: true

discovery:
mode: "hybrid" # runtime_only, manifest_only, or hybrid
manifest_path: "" # Will be set via launch argument
manifest_strict_validation: true
runtime:
create_synthetic_components: false # Manifest defines components

Expand Down
19 changes: 19 additions & 0 deletions demos/turtlebot3_integration/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,25 @@ services:
export TURTLEBOT3_MODEL=burger &&
ros2 launch turtlebot3_medkit_demo demo.launch.py headless:=$${HEADLESS}"

# For CI testing - headless Gazebo, tests run externally
turtlebot3-demo-ci:
profiles: ["ci"]
build:
context: .
dockerfile: Dockerfile
container_name: turtlebot3_medkit_demo_ci
environment:
- TURTLEBOT3_MODEL=burger
- ROS_DOMAIN_ID=30
ports:
- "8080:8080"
command: >
bash -c "mkdir -p /var/lib/ros2_medkit/rosbags &&
source /opt/ros/jazzy/setup.bash &&
source /root/demo_ws/install/setup.bash &&
export TURTLEBOT3_MODEL=burger &&
ros2 launch turtlebot3_medkit_demo demo.launch.py headless:=true"

sovd-web-ui:
image: ghcr.io/selfpatch/sovd_web_ui:latest
container_name: sovd_web_ui
Expand Down
2 changes: 1 addition & 1 deletion demos/turtlebot3_integration/launch/demo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def generate_launch_description():
medkit_params_file,
{
"use_sim_time": use_sim_time,
"manifest_path": manifest_file,
"discovery.manifest_path": manifest_file,
},
],
),
Expand Down
Loading