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

feat(docker): re-organize the autoware docker containers #4072

Merged
merged 17 commits into from
Mar 6, 2024

Conversation

oguzkaganozt
Copy link
Contributor

@oguzkaganozt oguzkaganozt commented Dec 20, 2023

Description

Re-organize the Autoware Docker Containers for:

  • Size reduction for all (devel, prebuilt, runtime) container images
  • Introduce ccache into prebuilt image Autoware full build now takes only 8 mins from 1.5 hours(with CUDA)
  • Use a custom base image based on ros2:humble rather than using plain Ubuntu:22.04
  • Provide a runtime image rather than having a prebuilt image
  • Provide helper scripts to run Autoware on docker environment
  • Modify Ansible scripts to enable modular images with distinct dependencies

Related PRs:

Related links

Tests performed

  • Built containers from scratch using new dockerfile and ansible scripts
  • Tested runtime image on x86 and arm64 machines

Notes for reviewers

Some changes might interfere with some Github Actions

Interface changes

No interface changes

Effects on system behavior

No system effect, CI-CD and container runtime improvements made

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@oguzkaganozt oguzkaganozt added meeting:openadkit-wg Open AD Kit working group type:ci Continuous Integration (CI) processes and testing. type:containers Docker containers, containerization of components, or container orchestration. labels Dec 20, 2023
@oguzkaganozt oguzkaganozt self-assigned this Dec 20, 2023
@oguzkaganozt oguzkaganozt linked an issue Dec 20, 2023 that may be closed by this pull request
15 tasks
@oguzkaganozt oguzkaganozt marked this pull request as draft December 21, 2023 09:41
.github/workflows/docker-build-and-push-main.yaml Outdated Show resolved Hide resolved
ansible/roles/cuda/tasks/main.yaml Show resolved Hide resolved
ansible/roles/devel/README.md Outdated Show resolved Hide resolved
ansible/roles/gdown/README.md Outdated Show resolved Hide resolved
ansible/roles/geographiclib/tasks/main.yaml Outdated Show resolved Hide resolved
ansible/roles/nvidia_docker/tasks/main.yaml Outdated Show resolved Hide resolved
docker/autoware-openadk/Dockerfile Show resolved Hide resolved
docker/autoware-openadk/etc/ros_entrypoint.sh Outdated Show resolved Hide resolved
docker/run.sh Outdated Show resolved Hide resolved
esteve
esteve previously requested changes Jan 11, 2024
ansible/playbooks/openadk.yaml Outdated Show resolved Hide resolved
@mitsudome-r mitsudome-r marked this pull request as ready for review January 22, 2024 07:40
@mitsudome-r
Copy link
Member

@oguzkaganozt Could you also create PR to autoware-documentation to make sure that install instructions for Docker is valid with this PR?

@oguzkaganozt oguzkaganozt force-pushed the 3999-re-organize-the-autoware-docker-containers branch from 0f500ad to 9f1f3ff Compare January 30, 2024 09:13
@oguzkaganozt oguzkaganozt changed the title re organize the autoware docker containers feat(docker): re organize the autoware docker containers Jan 30, 2024
@oguzkaganozt oguzkaganozt dismissed esteve’s stale review January 30, 2024 22:32

Requested changes have been made

setup-dev-env.sh Outdated Show resolved Hide resolved
@mitsudome-r
Copy link
Member

The code looks okay to me.

I have noticed that you have tested the action and it seems passing: https://github.com/autowarefoundation/autoware/actions/runs/7905813792

We can test with autoware.universe and other repositories to see if they can use the docker image for the CIs.

@mitsudome-r
Copy link
Member

I just noticed that update-docker-manifest is failing. It might be due to docker images that were pushed manually for CES demo... https://github.com/autowarefoundation/autoware/actions/runs/7903383046/job/21571162050

@esteve
Copy link
Contributor

esteve commented Feb 16, 2024

@oguzkaganozt let me know if this is this ready for another review. I saw that there are some conflicts with main, shall I wait until those are resolved to review this PR again? Thanks.

@oguzkaganozt oguzkaganozt force-pushed the 3999-re-organize-the-autoware-docker-containers branch from 0183ec2 to 5fd8757 Compare February 19, 2024 12:39
@oguzkaganozt
Copy link
Contributor Author

@oguzkaganozt let me know if this is this ready for another review. I saw that there are some conflicts with main, shall I wait until those are resolved to review this PR again? Thanks.

@esteve Should be resolved, please review now 👍

.devcontainer/Dockerfile Outdated Show resolved Hide resolved
.devcontainer/devcontainer.json Outdated Show resolved Hide resolved
.github/actions/docker-build-and-push/action.yaml Outdated Show resolved Hide resolved
ansible/playbooks/openadk.yaml Outdated Show resolved Hide resolved
ansible/roles/dev_tools/README.md Outdated Show resolved Hide resolved
ansible/playbooks/openadk.yaml Outdated Show resolved Hide resolved
ansible/playbooks/openadk.yaml Show resolved Hide resolved
ansible/roles/tensorrt/README.md Outdated Show resolved Hide resolved
docker/README.md Outdated Show resolved Hide resolved
@xmfcx
Copy link
Contributor

xmfcx commented Mar 6, 2024

I would like to merge this once this last wave of reviews are resolved.

Thanks @oguzkaganozt @ambroise-arm @esteve @mitsudome-r for your reviews and support for this task!

oguzkaganozt and others added 2 commits March 6, 2024 16:43
Signed-off-by: oguzkaganozt <oguzkaganozt@gmail.com>
oguzkaganozt and others added 2 commits March 6, 2024 17:14
Signed-off-by: oguzkaganozt <oguzkaganozt@gmail.com>
Copy link
Contributor Author

@oguzkaganozt oguzkaganozt left a comment

Choose a reason for hiding this comment

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

Made some last changes according to reviews

@xmfcx
Copy link
Contributor

xmfcx commented Mar 6, 2024

@ambroise-arm could you confirm if you are happy with the changes?

@xmfcx
Copy link
Contributor

xmfcx commented Mar 6, 2024

I've confirmed that the the images generated by this PR performs well on the Autoware Universe side.

@@ -0,0 +1,14 @@
FROM ghcr.io/autowarefoundation/autoware-openadk:latest-devel-cuda
Copy link
Collaborator

Choose a reason for hiding this comment

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

If apart from this line the rest of the file is exactly the same as in base/Dockerfile then I think it would be better to keep a single Dockerfile under .devcontainer/ and instead have an ARG TAG or something like that in order to use FROM ghcr.io/autowarefoundation/autoware-openadk:$TAG and then pass it with build.args (https://containers.dev/implementors/json_reference/#image-specific) in the respective devcontainer.json

Copy link
Contributor

@xmfcx xmfcx Mar 6, 2024

Choose a reason for hiding this comment

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

@oguzkaganozt will look into this tomorrow in a follow up PR.

Let's merge this as it is today.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok

.devcontainer/Dockerfile Outdated Show resolved Hide resolved
.devcontainer/devcontainer.json Outdated Show resolved Hide resolved
ansible/playbooks/openadk.yaml Outdated Show resolved Hide resolved
ansible/roles/tensorrt/README.md Outdated Show resolved Hide resolved
docker/build.sh Show resolved Hide resolved
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
Comment on lines +7 to +9
"hostRequirements": {
"gpu": true
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can be removed for this non-GPU file. Although it is not critical because if I remember correctly it just issues a warning in the logs, but doesn't block anything.

Copy link
Collaborator

Choose a reason for hiding this comment

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

resolving following #4072 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not good at VSCode with Containers, I don't know if this affects anything related to RViz. If you think we can remove it safely, I can remove it.

Copy link
Collaborator

@ambroise-arm ambroise-arm Mar 6, 2024

Choose a reason for hiding this comment

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

It won't change how things get setup. From https://containers.dev/implementors/json_reference/#min-host-reqs: "you will be presented with a warning if the requirements are not met". Removing this won't affect whether rviz works or not.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ambroise-arm I see, I will let @oguzkaganozt know this, let's remove it as well in the next PR.

Copy link
Contributor

@xmfcx xmfcx left a comment

Choose a reason for hiding this comment

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

Now it's time for the big merge 🥁🥁🥁🥁

@xmfcx xmfcx merged commit da22bdc into main Mar 6, 2024
11 of 13 checks passed
@xmfcx xmfcx deleted the 3999-re-organize-the-autoware-docker-containers branch March 6, 2024 16:17
@xmfcx
Copy link
Contributor

xmfcx commented Mar 6, 2024

Thanks everyone again for your invaluable comments and efforts!

@oguzkaganozt
Copy link
Contributor Author

I would like to thank everyone again for all of the precious reviews and comments !

HansRobo added a commit to HansRobo/autoware that referenced this pull request Mar 8, 2024
Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
@HansRobo
Copy link
Member

HansRobo commented Mar 8, 2024

@oguzkaganozt
Thank you for this nice pull-request.
build-main and build-main-self-hosted workflows seem to have been left behind at autoware-universe instead of autoware-openadk.
https://github.com/autowarefoundation/autoware/actions/runs/8187823403
https://github.com/autowarefoundation/autoware/actions/runs/8187794780

And I tried a quick fix, but the build step in build-main does not work correctly.
https://github.com/HansRobo/autoware/actions/runs/8198820592

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meeting:openadkit-wg Open AD Kit working group type:ci Continuous Integration (CI) processes and testing. type:containers Docker containers, containerization of components, or container orchestration.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Re-organize the Autoware Docker Containers
6 participants