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

Optimize dockerfile (building and caching) #294

Merged
merged 68 commits into from
Jun 11, 2024
Merged

Conversation

msz-rai
Copy link
Collaborator

@msz-rai msz-rai commented Jun 3, 2024

PR:

  • introduces multistage dockerfile for the build process
  • decouples dependency installation from compilation scripts (improves caching)
  • enables compilation without an internet connection
  • adjusts CI to introduced changes

msz-rai and others added 30 commits May 28, 2024 14:13
internet should not be required when compiling
as apt does not have a stable CLI
and thus unsuitable for scripting
- https://unix.stackexchange.com/a/590703/213124
to avoid needless busting build cache of unrelated stages
to flush out all non-determinism
given offline caching is impractical otherwise
For both docker and github actions.
This should:
- auto open a PR when new nvidia tags are available
- as well as keep Github actions versions up to date
to robustly ignore randomly named IDE files and temp folders
Required by cmake_git_version_tracking
@msz-rai msz-rai force-pushed the feature/rework-dockerfile branch from 6ff4b21 to 106f8a7 Compare June 10, 2024 13:49
@msz-rai msz-rai force-pushed the feature/rework-dockerfile branch from 106f8a7 to 3984ba8 Compare June 10, 2024 13:55
@msz-rai msz-rai marked this pull request as ready for review June 10, 2024 14:19
@msz-rai msz-rai requested a review from PawelLiberadzki June 10, 2024 14:19
@msz-rai msz-rai merged commit dddd04f into develop Jun 11, 2024
20 checks passed
@msz-rai msz-rai deleted the feature/rework-dockerfile branch June 11, 2024 10:46
msz-rai added a commit that referenced this pull request Jun 11, 2024
* Introduce multistage dockerfile for build process (core only)

* Update .dockerignore

* Update README

* Do not apt update at build time
internet should not be required when compiling

* Use apt-get instead of apt
as apt does not have a stable CLI
and thus unsuitable for scripting
- https://unix.stackexchange.com/a/590703/213124

* Automate apt-get yes prompts for non-interactive scripting

* Use placeholder stage for dependabot automation

* Rename stages uniquely for locatability
and mark for readability

* Move ARG to appropriate scope
to avoid needless busting build cache of unrelated stages

* Disable internet for build time
to flush out all non-determinism
given offline caching is impractical otherwise

* Edit apt config for caching and update once

* Bootstrap and cache tools for install scripts

* Add missing implicit dependency

* Add pseudo code to install dependencies only in pepper stage

* Add dependabot config
For both docker and github actions.
This should:
- auto open a PR when new nvidia tags are available
- as well as keep Github actions versions up to date

* Simplify docker ignore config by inverting exclusion set
to robustly ignore randomly named IDE files and temp folders

* Exclude .git from .dockerignore
Required by cmake_git_version_tracking

* Separate dependencies script from compilation script

* WIP - RGL extensions handling

* Add ROS2 installation

* Add build command argument

* Add ros2 standalone libs and rgl executables to exporter

* Fix pcl deps

* Fix ros2 extension compilation

* Fix CMakeLists for tests

* Add ORIGIN rpath to test/tools executables

* Do not change current working directory for extension install_deps scripts

* Improve docs

* Bring back support for taped test

* Formatting

* Adjust CI

* Add dependencies installation info to README

* Ignore Dockerfile in .dockerignore

* Remove unused components from CI

* Fix CI

* Output libraries to lib folder

* Output executables to bin folder

* Simplify exporter stage by cache dancing

* Formatting alpha sort

* Output libraries to lib folder
kind of hacky
should probably simplify using better CMake

* Simplify ROS install
as timezone and LC_ALL setup is more for running
and shouldn't be needed if only just building

* Simplify ROS install
remove unnecessary packages

* Formatting

* Use ROS_DISTRO ARG
and set ENV if ever needed for later after docker build

* Drop pinned package version

* Formatting

* Simplify ROS install
by using minimal build dependency set

* Alpha sort package sub lists

* Simplify RUN directive via shell

* Simplify RUN directive via shell

* Revert to installing core
as `radar_msgs` has a number of other msg dependencies
though rosdep should eventually be used here

* Formatting

* Avoid hard coded ubuntu code name

* Simplify RUN directives

* Cache apt update

* Format package use septate lines for version control

* Update README.md

Co-authored-by: Mateusz Szczygielski <112629916+msz-rai@users.noreply.github.com>

* Revert "Remove Disable DNS"

This partially reverts commit 74317d5.

* Simplify CMake for INSTALL_DESTINATION_DIR

* Revert "Revert "Remove Disable DNS""

This reverts commit 32016bb0b0683769fefd0962ab32d67ca968ae8a.

* Add missing dep for ros2-standalone

* Adjust CI

* Fix CI: use dot instead of source

* Fix CI: source sh file

* Improve ROS2 check

* Use new dev docker to test

* Fix formatting (some packages weren't installed)

* Use ROS_DISTRO instead of fixed version

---------

Co-authored-by: ruffsl <roxfoxpox@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants