ros-navigation / navigation2

ROS 2 Navigation Framework and System
https://nav2.org/
Other
2.62k stars 1.31k forks source link

nav2 devcontainer on humble branch uses rolling image #3790

Open Ryanf55 opened 1 year ago

Ryanf55 commented 1 year ago

Bug report

Required Info:

git checkout humble
# Open vscode devcontainer and observe the compile failure from trying to compile humble in a rolling environment

Expected behavior

The devcontainer uses a humble base image for Docker.

Actual behavior

The argument for the ROS version is unset, and defaults to rolling regardless of which branch of nav2 you use.

In the dockerfile: ARG FROM_IMAGE=ros:rolling

I would expect FROM_IMAGE is set to humble when using VSCode on the humble branch.

Additional information

Relates to https://github.com/microsoft/vscode-remote-release/issues/3545. The recommended path from that thread is to use docker compose to supply those options.

SteveMacenski commented 1 year ago

@ruffsl

Ryanf55 commented 1 year ago

Please assign this to me; I can take the recommended route to add compose support to nav2. Do you want a docker-compose.yml file at the root of the repo, or in the .devcontainer folder?

SteveMacenski commented 1 year ago

.devcontainer for anything sp to dev containers

ruffsl commented 1 year ago

I would expect FROM_IMAGE is set to humble when using VSCode on the humble branch.

How would you expect to set the build arg dynamically, while remaining agnostic of the docker client? The dev container could be started from Mac or windows, so use of scripts would be out of scope. We could just change/commit the default value for that build arg per branch.

Ryanf55 commented 1 year ago

I would expect FROM_IMAGE is set to humble when using VSCode on the humble branch.

How would you expect to set the build arg dynamically, while remaining agnostic of the docker client? The dev container could be started from Mac or windows, so use of scripts would be out of scope. We could just change/commit the default value for that build arg per branch.

That's what I did; take a look at the draft PR?

Ryanf55 commented 1 year ago

I tried a very specific change to just change the build.cacheFrom argument, however the dockerfile still has an ARG for the ROS distro, and VSCode doesn't support build arguments in devcontainer. https://github.com/microsoft/vscode-remote-release/issues/3545

I don't have a good path forward on this. Even if CI could build the necessary images, that only works if they can be cached, and for local changes, vscode would then build the wrong image.

Ryanf55 commented 10 months ago

We have a path forward. I'd say once the next VSCode version is out of beta and released, we can add build arguments to specify a ros distro. https://github.com/microsoft/vscode-remote-release/issues/3545#issuecomment-1892274755

tonynajjar commented 7 months ago

This should now be possible @Ryanf55 right?

Ryanf55 commented 7 months ago

This should now be possible @Ryanf55 right?

Correct, feel free to submit a PR. I have other priorities right now.