Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

several improvements of workflow #4

Merged
merged 3 commits into from
Apr 25, 2024
Merged

several improvements of workflow #4

merged 3 commits into from
Apr 25, 2024

Conversation

marc-hanheide
Copy link
Member

  • add devcontainer CI build workflow
  • contain an src/ directory, which is where all packages should go, as then the root of the repository can itself serve as a colcon workspace (works best for dev containers)
  • configures .dockerignore and .gitignore to ensure that any colcon-generated files (as repository root is also workspace) don't end up in code base etc.
  • create a post-create command that is executed on container creation and auto-configures the ~/.bashrc with the local workspace and attempts to build the whole colcon workspace. This is to speed up later builds as all packages that can be build already automatically are.
  • updated documentation to match this

* add devcontainer CI build workflow
* contain an `src/` directory, which is where all packages should go, as then the root of the repository can itself serve as a colcon workspace (works best for dev containers)
* configures `.dockerignore` and `.gitignore` to ensure that any colcon-generated files (as repository root is also workspace) don't end up in code base etc.
* create a `post-create` command that is executed on container creation and auto-configures the `~/.bashrc` with the local workspace and attempts to build the whole colcon workspace. This is to speed up later builds as all packages that can be build already automatically are.
* updated documentation to match this
@marc-hanheide marc-hanheide marked this pull request as ready for review April 25, 2024 08:45
@marc-hanheide
Copy link
Member Author

@ibrahimhroob, I think this is an improvement to the template, based on my experience with devcontainers ans ros2 overall. Happy to discuss

Copy link
Member Author

@marc-hanheide marc-hanheide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some explanations, @ibrahimhroob

@@ -10,7 +10,7 @@ RUN apt-get update \

# get the source tree and analyse it for its package.xml only
FROM base as sourcefilter
COPY . /tmp/src
COPY ./src /tmp/src
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now all packages should be under src/

.devcontainer/devcontainer.json Show resolved Hide resolved
.devcontainer/devcontainer.json Show resolved Hide resolved
.devcontainer/devcontainer.json Show resolved Hide resolved
.devcontainer/post-create.sh Show resolved Hide resolved
.devcontainer/post-create.sh Show resolved Hide resolved
bin/
lib/
install/
*~
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore all directories etc that are generated by colcon, also ignore changes to readme etc as they are just documentation

imageName: lcas.lincoln.ac.uk/devcontainer/${{ steps.docker_image_name.outputs.docker_image }}
push: never
imageTag: ${{ env.BRANCH }}
#runCmd: "bash .devcontainer/run-ci.sh"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new CI workflow, that ensures that the devcontainer image can be build. Basically it guarantees that the devcontainer image on the main branch always works

@marc-hanheide marc-hanheide added the enhancement New feature or request label Apr 25, 2024
@ibrahimhroob ibrahimhroob self-assigned this Apr 25, 2024
@ibrahimhroob ibrahimhroob merged commit 7001e11 into main Apr 25, 2024
2 checks passed
Copy link
Collaborator

@ibrahimhroob ibrahimhroob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much @marc-hanheide, all looks great

@ibrahimhroob ibrahimhroob deleted the src_dir branch April 25, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants