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

fix(docker): update build script with respect to multi-container design #5571

Merged
merged 6 commits into from
Dec 23, 2024

Conversation

amadeuszsz
Copy link
Contributor

@amadeuszsz amadeuszsz commented Dec 16, 2024

Description

Fix for #5558 & #5514

How was this PR tested?

Notes for reviewers

None.

Effects on system behavior

None.

Copy link

github-actions bot commented Dec 16, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@amadeuszsz amadeuszsz self-assigned this Dec 16, 2024
@esteve
Copy link
Contributor

esteve commented Dec 18, 2024

@amadeuszsz I can confirm that this worked for me, is there anything that needs to be done before this is ready for review?

@amadeuszsz
Copy link
Contributor Author

amadeuszsz commented Dec 19, 2024

@amadeuszsz I can confirm that this worked for me, is there anything that needs to be done before this is ready for review?

@esteve
I don't know how to specify targets, as it is now. Pointing target results with something which I don't understand:

#16 54.67 Installing 'autoware.dev_env:0.1.0' to '/root/.ansible/collections/ansible_collections/autoware/dev_env'
#16 54.69 Created collection for autoware.dev_env:0.1.0 at /root/.ansible/collections/ansible_collections/autoware/dev_env
#16 54.69 autoware.dev_env:0.1.0 was installed successfully
#16 54.71 �[36mansible-playbook autoware.dev_env.rosdep --extra-vars prompt_install_nvidia=y --extra-vars install_devel=y --extra-vars prompt_download_artifacts=y --extra-vars data_dir=/root/autoware_data --extra-vars rosdistro=humble --extra-vars rmw_implementation=rmw_cyclonedds_cpp --extra-vars base_image=ros:humble-ros-base-jammy --extra-vars autoware_base_image=ghcr.io/autowarefoundation/autoware-base:latest --extra-vars autoware_base_cuda_image=ghcr.io/autowarefoundation/autoware-base:cuda-latest --extra-vars cuda_version=12.4 --extra-vars cudnn_version=8.9.7.29-1+cuda12.2 --extra-vars tensorrt_version=10.7.0.23-1+cuda12.6 --extra-vars pre_commit_clang_format_version=17.0.5 �[m
.
.
.
#19 73.89 Installing 'autoware.dev_env:0.1.0' to '/root/.ansible/collections/ansible_collections/autoware/dev_env'
#19 73.92 Created collection for autoware.dev_env:0.1.0 at /root/.ansible/collections/ansible_collections/autoware/dev_env
#19 73.92 autoware.dev_env:0.1.0 was installed successfully
#19 73.94 �[36mansible-playbook autoware.dev_env.openadkit --extra-vars prompt_install_nvidia=n --extra-vars cuda_install_drivers=false --extra-vars install_devel=y --extra-vars prompt_download_artifacts=N --extra-vars data_dir=/root/autoware_data --extra-vars module=all --extra-vars rosdistro=humble --extra-vars rmw_implementation=rmw_cyclonedds_cpp --extra-vars base_image=ros:humble-ros-base-jammy --extra-vars autoware_base_image=ghcr.io/autowarefoundation/autoware-base:latest --extra-vars autoware_base_cuda_image=ghcr.io/autowarefoundation/autoware-base:cuda-latest --extra-vars cuda_version=12.3 --extra-vars cudnn_version=8.9.5.29-1+cuda12.2 --extra-vars tensorrt_version=8.6.1.6-1+cuda12.0 --extra-vars pre_commit_clang_format_version=17.0.5 �[m

Briefly speaking, I updated amd64.env and tried to rebuild images. In the second part of the log we can see cudnn_version=8.9.5.29-1+cuda12.2 --extra-vars tensorrt_version=8.6.1.6-1+cuda12.0 which doesn't match version specified in updated amd64.env file (see first part of the log) and they (versions in wrong part of the log) don't exist in any of my local file. Even if I cleared all docker builder caches, seems somehow docker layer is loaded from existing images. It's not what I expected (force build all stages till target) and users might not even notice it. At the end, in docker image I see old dependencies versions. If I don't specify target, script proceed with all stages from Dockerfile and everything works correctly.

For this PR I'm removing arguments which don't apply, but I would prefer to keep them if we could force build target with use of local changes. If anyone know how to do it, please revert this commit and apply necessary changes.

What I know is we can't build image using both hcl files at once, otherwise both hcl files will be processed at once resulting pulling repository from github registry, because triggered local build of base images didn't finish yet.

@amadeuszsz amadeuszsz marked this pull request as ready for review December 19, 2024 02:30
@youtalk
Copy link
Member

youtalk commented Dec 19, 2024

Since not only the build.sh but also .hcl files have been modified, it will also affect container image builds in CI.
If you just want to build a specific stage locally, I think you can achieve that by setting environment variables and running docker build --target. Isn’t that sufficient?

@mitsudome-r mitsudome-r added the tag:run-health-check Run health-check label Dec 20, 2024
@amadeuszsz
Copy link
Contributor Author

Since not only the build.sh but also .hcl files have been modified, it will also affect container image builds in CI. If you just want to build a specific stage locally, I think you can achieve that by setting environment variables and running docker build --target. Isn’t that sufficient?

I found why I can't apply my changes into docker images - for docker-bake-base.hcl we need to build both (cuda and non-cuda) images. Otherwise for second docker buildx call in script we will just pull image from github registry.

I modified PR and now I believe we can merge it.

Copy link
Member

@youtalk youtalk 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 for your update.

@youtalk youtalk merged commit c490050 into autowarefoundation:main Dec 23, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag:run-health-check Run health-check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants