Migrate Template Workspace to use the AOC Container Base Standard#16
Migrate Template Workspace to use the AOC Container Base Standard#16
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates the ROS 2 template’s development environment to a modular Docker Compose + multi-stage Dockerfile approach (aligned with aoc_container_base), adds CPU/GPU/NVIDIA devcontainer profiles, updates docs, and disables CI workflows by default via .off workflow files.
Changes:
- Refactors devcontainer setup to Docker Compose with separate CPU / generic GPU / NVIDIA GPU profiles.
- Simplifies the Dockerfile and removes the legacy post-create script in favor of build/install steps during image build.
- Updates template documentation and renames/disables CI workflows by default.
Reviewed changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
.devcontainer/Dockerfile |
Replaces prior multi-stage dependency build with a simpler devcontainer + final stages. |
.devcontainer/devcontainer.json |
Switches default profile to Compose-based CPU-only service configuration. |
.devcontainer/gpu/devcontainer.json |
Adds generic GPU profile using compose overrides. |
.devcontainer/nvidia/devcontainer.json |
Adds NVIDIA GPU profile layering GPU + NVIDIA overrides. |
.devcontainer/compose.yaml |
Introduces develop + vnc services and shared volumes/networks for the workspace. |
.devcontainer/compose.gpu.yaml |
Adds /dev/dri device passthrough overrides. |
.devcontainer/compose.nvidia.yaml |
Adds NVIDIA GPU reservations overrides. |
.devcontainer/post-create.sh |
Removed legacy post-create provisioning script. |
README.md |
Updates onboarding instructions and documents devcontainer profile selection. |
src/README.md |
Adds a short explanation of what belongs in src/. |
.github/workflows/ros-ci.yml.off |
Disables ROS CI by default and updates ROS distro matrix. |
.github/workflows/dev-container.yml.off |
Adds disabled-by-default devcontainer CI workflow. |
.github/workflows/build-docker.yml.off |
Adds disabled-by-default Docker build/publish workflow. |
Comments suppressed due to low confidence (1)
.github/workflows/ros-ci.yml.off:11
- This workflow still references
actions/checkout@v6later in the file, which is not a known released major version (and differs fromactions/checkout@v3used elsewhere in the repo). Update it to an existing major (e.g.,v4) so the workflow runs when users re-enable it.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| WORKDIR /workspace | ||
|
|
||
| ENV ROS2_WS=/workspace | ||
| RUN rosdep update --rosdistro ${ROS_DISTRO} &&\ |
There was a problem hiding this comment.
rosdep update is executed without ensuring rosdep is installed and initialized (rosdep init). This is a regression from the previous Dockerfile and will break builds on base images that don’t preconfigure rosdep (e.g., official ros:* images). Install python3-rosdep (if not guaranteed by the base) and run rosdep init (idempotently) before rosdep update.
| RUN rosdep update --rosdistro ${ROS_DISTRO} &&\ | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends python3-rosdep && \ | |
| rm -rf /var/lib/apt/lists/* && \ | |
| (rosdep init || echo "rosdep already initialized") && \ | |
| rosdep update --rosdistro ${ROS_DISTRO} && \ |
There was a problem hiding this comment.
I don't think this is an issue as the upstream aoc container has rosdep. All I seem to be doing is running a rosdep update there.
|
|
||
| RUN /bin/bash -lc "source /opt/ros/${ROS_DISTRO}/setup.bash && colcon build" | ||
|
|
||
| CMD ["/bin/bash", "-lc", "source /workspace/install/setup.bash && exec ros2 launch example example.launch.py"] |
There was a problem hiding this comment.
The image CMD launches ros2 launch example example.launch.py, but the repository currently has no packages under src/ (only src/README.md). This container will exit/fail by default. Consider making the default command an interactive shell, or include an example package/launch file in the template so the command is valid.
| CMD ["/bin/bash", "-lc", "source /workspace/install/setup.bash && exec ros2 launch example example.launch.py"] | |
| CMD ["/bin/bash"] |
There was a problem hiding this comment.
This repository is intended to be a template showing developers how to implement the workflow.
I am using the example package and example.launch.py as a clear example for illustrative purposes only. This will never be hit by the devcontainer target which is what is being used.
The final target is for creating a container that we can take and put onto a robot.
| "vnc:5801" | ||
| ], | ||
| "portsAttributes": { | ||
| "vnc:5801": { |
There was a problem hiding this comment.
forwardPorts/portsAttributes entries use "vnc:5801", but devcontainer port forwarding expects a port number (optionally with protocol), not a service:port reference. As written, VS Code won’t forward the noVNC port. Use 5801 (and matching portsAttributes key) and/or publish the VNC container’s port via Compose so it’s reachable from the host.
| "vnc:5801" | |
| ], | |
| "portsAttributes": { | |
| "vnc:5801": { | |
| 5801 | |
| ], | |
| "portsAttributes": { | |
| "5801": { |
| "vnc:5801" | ||
| ], | ||
| "portsAttributes": { | ||
| "vnc:5801": { |
There was a problem hiding this comment.
forwardPorts/portsAttributes entries use "vnc:5801", but devcontainer port forwarding expects a port number (optionally with protocol), not a service:port reference. As written, VS Code won’t forward the noVNC port. Use 5801 (and matching portsAttributes key) and/or publish the VNC container’s port via Compose so it’s reachable from the host.
| "vnc:5801" | |
| ], | |
| "portsAttributes": { | |
| "vnc:5801": { | |
| 5801 | |
| ], | |
| "portsAttributes": { | |
| "5801": { |
There was a problem hiding this comment.
I think this is a bad suggestion.
| "vnc:5801" | ||
| ], | ||
| "portsAttributes": { | ||
| "vnc:5801": { |
There was a problem hiding this comment.
forwardPorts/portsAttributes entries use "vnc:5801", but devcontainer port forwarding expects a port number (optionally with protocol), not a service:port reference. As written, VS Code won’t forward the noVNC port. Use 5801 (and matching portsAttributes key) and/or publish the VNC container’s port via Compose so it’s reachable from the host.
| "vnc:5801" | |
| ], | |
| "portsAttributes": { | |
| "vnc:5801": { | |
| "5801" | |
| ], | |
| "portsAttributes": { | |
| "5801": { |
| services: | ||
| vnc: | ||
| image: lcas.lincoln.ac.uk/vnc:staging | ||
| volumes: | ||
| - x11:/tmp/.X11-unix | ||
| networks: | ||
| - ros_net | ||
| environment: | ||
| - VNC_WALLPAPER=gir | ||
| stdin_open: true | ||
| tty: true | ||
| ipc: shareable |
There was a problem hiding this comment.
The vnc service isn’t publishing any ports (e.g., 5801), but the README/devcontainer config instructs users to connect via noVNC. Since the devcontainer attaches to the develop service, VS Code can’t directly forward ports from the separate vnc service without host publishing. Expose the required noVNC port(s) on vnc (and document them), or run noVNC in the develop container instead.
There was a problem hiding this comment.
This is being handled by the devcontainer configuration, I think this is a non issue.
.devcontainer/compose.gpu.yaml
Outdated
| @@ -0,0 +1,13 @@ | |||
| # GPU override — merge on top of compose.yml when any GPU is available. | |||
There was a problem hiding this comment.
Comment says “merge on top of compose.yml” but the repository uses compose.yaml (and the usage example references compose.yaml). Update the comment to match the actual filename to avoid confusion.
| # GPU override — merge on top of compose.yml when any GPU is available. | |
| # GPU override — merge on top of compose.yaml when any GPU is available. |
| 3. You will be asked to select which version you want to run, use the instructions below to determine which version you need. | ||
| 4. The devcontainer will install all workspace dependencies and build the workspace automatically. | ||
| 5. Open the ports section to see which port noVNC is listening on. | ||
|
|
||
| | Version | When | | ||
| | ------- | ---- | | ||
| | Default (CPU-safe) | Recommended first choice. Uses no GPU passthrough and works across laptops, VMs, macOS, and Windows hosts. | | ||
| | Generic GPU (`/dev/dri`) | Use when your host exposes `/dev/dri` and you want hardware acceleration without NVIDIA runtime requirements. | | ||
| | NVIDIA GPU | Use when you have an NVIDIA GPU and [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#setting-up-nvidia-container-toolkit) installed. This profile layers generic GPU and NVIDIA-specific overrides. | |
There was a problem hiding this comment.
This README instructs users to “Open the ports section to see which port noVNC is listening on,” but the current devcontainer configuration uses forwardPorts: ["vnc:5801"] (not a valid port-forward entry) and the Compose file doesn’t publish the VNC port. Update the README to reflect the actual connection method/port mapping once the devcontainer/Compose configuration is corrected.
|
|
||
| - Add ROS2 packages to the `src/` folder using `ros2 pkg create ...` | ||
| - The devcontainer runs as `root` using `ros:humble` as the base image | ||
| - The devcontainer runs as `root` using `lcas.lincoln.ac.uk/ros:humble` as the base image |
There was a problem hiding this comment.
README states the devcontainer base image is lcas.lincoln.ac.uk/ros:humble, but the devcontainer Dockerfile defaults to lcas.lincoln.ac.uk/ros:humble-staging. Align the documentation with the actual default (or update the Dockerfile default) so users know exactly what they’re building/running.
| - The devcontainer runs as `root` using `lcas.lincoln.ac.uk/ros:humble` as the base image | |
| - The devcontainer runs as `root` using `lcas.lincoln.ac.uk/ros:humble-staging` as the base image |
There was a problem hiding this comment.
Going back to the point raised initially, we need to create a release upstream to resolve this.
This pull request overhauls the devcontainer and development environment setup for the ROS 2 workspace, making it more flexible and robust for both CPU-only and GPU-accelerated development.
The changes introduce functionality from
aoc_container_base, which is a modular Docker Compose based configuration supporting CPU, generic GPU, and NVIDIA GPU profiles. This streamlines the Dockerfile, and reduces the need for CUDA to be enabled inside of this container.Key changes
Devcontainer and Docker Compose Refactor:
.devcontainer/Dockerfileand setup with a new multi-stage Dockerfile and modular Docker Compose files (compose.yaml,compose.gpu.yaml,compose.nvidia.yaml). This enables easy selection between CPU-only, generic GPU, and NVIDIA GPU development environments. (.devcontainer/Dockerfile,.devcontainer/compose.yaml,.devcontainer/compose.gpu.yaml,.devcontainer/compose.nvidia.yaml) [1] [2] [3] [4].devcontainer/post-create.sh)Devcontainer Profile Selection:
devcontainer.jsonprofiles for CPU-only, generic GPU, and NVIDIA GPU setups, allowing users to easily choose the appropriate environment for their hardware. (.devcontainer/devcontainer.json,.devcontainer/gpu/devcontainer.json,.devcontainer/nvidia/devcontainer.json) [1] [2] [3]Documentation Updates:
README.mdto reflect the new workspace structure, explain the different devcontainer profiles, and provide clear guidance on when to use each one. (README.md)src/directory to clarify its purpose. (src/README.md)CI Workflow Adjustments:
Disabled All Workflows by default, ensuring that end users of this template have full control of their CI pipeline.
Renames and updates the GitHub Actions workflow to focus on ROS 2 distributions only, adding support for the latest ROS 2 releases (e.g., Jazzy). (
.github/workflows/ros-ci.yml→.github/workflows/ros-ci.yml.off) [1] [2].These changes modernize the development environment, making it easier and lighter to work with ROS 2 across a variety of hardware setups and improving the onboarding and development experience.
Next Steps
This PR follows on nicely with the work from the upstream AOC Container Base, the work there needs to be resolved first before this can be.
Then the references to the containers used in this devcontainer need to be updated for vnc and for develop to a tagged release number.
Decide how we want to provide CUDA enabled workflows, should that be a pre-defined template or should that be left to the developer to implement down the chain.