Skip to content
Open
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
4 changes: 3 additions & 1 deletion .github/actions/smoke-test/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ if [ -d "${TEST_DIR}" ] ; then
DEST_DIR="${SRC_DIR}/test-project"
mkdir -p ${DEST_DIR}
cp -Rp ${TEST_DIR}/* ${DEST_DIR}
cp -Rp test/test-utils/* ${DEST_DIR}
if [ -d "test/test-utils" ]; then
cp -Rp test/test-utils/* ${DEST_DIR}
fi
fi

export DOCKER_BUILDKIT=1
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:

jobs:
smoke-test:
strategy:
matrix:
template:
- gz
- ros2
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
Expand All @@ -12,11 +17,11 @@ jobs:
steps:
- uses: actions/checkout@v6

- name: Smoke test for "gz"
- name: Smoke test for "${{ matrix.template }}"
id: smoke_test
uses: ./.github/actions/smoke-test
with:
template: "gz"
template: "${{ matrix.template }}"

feature-tests:
runs-on: ubuntu-latest
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

Devcontainer templates repository focused on robotics and simulation.

## Included template
## Included templates

- `templates/src/gz`
- `templates/src/ros2`

The templates are development entry points for the actively maintained
`althack/gz` and `althack/ros2` image collections. ROS 2 is headless by default
so projects can choose their own host GUI integration when needed.

## Included feature

Expand Down
24 changes: 24 additions & 0 deletions templates/src/ros2/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "ROS 2",
"image": "althack/ros2:${templateOption:distro}-${templateOption:imageVariant}",
"remoteUser": "ros",
"updateRemoteUserUID": true,
"runArgs": [
"--network=host",
"--ipc=host",
"--cap-add=SYS_PTRACE",
"--security-opt=seccomp:unconfined",
"--security-opt=apparmor:unconfined"
],
"customizations": {
"vscode": {
"extensions": [
"ms-iot.vscode-ros",
"ms-vscode.cpptools",
"ms-python.python",
"twxs.cmake",
"redhat.vscode-yaml"
]
}
}
}
16 changes: 16 additions & 0 deletions templates/src/ros2/NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Image selection

This template uses the actively maintained
[`althack/ros2`](https://hub.docker.com/r/althack/ros2) image collection.
`distro` and `imageVariant` select the image tag
`<distro>-<imageVariant>`. The default is `jazzy-dev`.

The moving tags follow the latest build of each supported ROS distribution.
For fully reproducible projects, replace the generated image tag with one of
the dated tags published alongside it.

## ROS networking

The template uses host networking and host IPC to support common local ROS
discovery and shared-memory workflows. Review those settings before using the
template with untrusted software.
33 changes: 33 additions & 0 deletions templates/src/ros2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

# ROS 2 (ros2)

ROS 2 development environment backed by the althack/ros2 image collection.

## Options

| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| distro | ROS 2 distribution to use. | string | jazzy |
| imageVariant | Container image variant to use for this ROS 2 distribution. | string | dev |

## Image selection

This template uses the actively maintained
[`althack/ros2`](https://hub.docker.com/r/althack/ros2) image collection.
`distro` and `imageVariant` select the image tag
`<distro>-<imageVariant>`. The default is `jazzy-dev`.

The moving tags follow the latest build of each supported ROS distribution.
For fully reproducible projects, replace the generated image tag with one of
the dated tags published alongside it.

## ROS networking

The template uses host networking and host IPC to support common local ROS
discovery and shared-memory workflows. Review those settings before using the
template with untrusted software.


---

_Note: This file was auto-generated from the [devcontainer-template.json](https://github.com/althack/devcontainers/blob/main/templates/src/ros2/devcontainer-template.json). Add additional notes to a `NOTES.md`._
48 changes: 48 additions & 0 deletions templates/src/ros2/devcontainer-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"id": "ros2",
"version": "0.1.0",
"name": "ROS 2",
"description": "ROS 2 development environment backed by the althack/ros2 image collection.",
"documentationURL": "https://github.com/althack/devcontainers/tree/main/templates/src/ros2",
"licenseURL": "https://github.com/althack/devcontainers/blob/main/LICENSE",
"publisher": "althack",
"keywords": [
"ros",
"ros2",
"robotics",
"ubuntu",
"docker"
],
"platforms": [
"ROS 2",
"Ubuntu",
"C++",
"Python"
],
"options": {
"distro": {
"type": "string",
"description": "ROS 2 distribution to use.",
"proposals": [
"rolling",
"lyrical",
"kilted",
"jazzy",
"humble"
],
"default": "jazzy"
},
"imageVariant": {
"type": "string",
"description": "Container image variant to use for this ROS 2 distribution.",
"proposals": [
"base",
"dev",
"desktop",
"full",
"gazebo"
],
"default": "dev"
}
}
}
6 changes: 6 additions & 0 deletions test/ros2/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail

test "${ROS_DISTRO:-}" = "jazzy"
test "$(id -un)" = "ros"
ros2 --help >/dev/null
Loading