From 4e7f539d0739058697a73c2546d3065fb8682e70 Mon Sep 17 00:00:00 2001 From: oguzkaganozt Date: Fri, 14 Jun 2024 15:35:56 +0300 Subject: [PATCH] feat(docker): fix CUDA compile on devel image and improve run.sh (#4849) * modular containers PR phase1 Signed-off-by: Oguz * style(pre-commit): autofix * add download artifacts to devel and runtime image Signed-off-by: Oguz * Update docker/build.sh Co-authored-by: Yutaka Kondo * style(pre-commit): autofix * build from temp source directory and remove dangling images Signed-off-by: Oguz Ozturk * Revert "build from temp source directory and remove dangling images" This reverts commit c66a1ddf482d44ad8e05d38185a9d57038ab080f. * build containers from temp source and remove dangling images Signed-off-by: Oguz Ozturk * style(pre-commit): autofix * add vcs pull to update Signed-off-by: Oguz Ozturk * style(pre-commit): autofix --------- Signed-off-by: Oguz Signed-off-by: Oguz Ozturk Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Yutaka Kondo --- .gitignore | 3 ++ ansible/playbooks/openadkit.yaml | 4 +- docker/Dockerfile | 4 +- docker/build.sh | 27 +++++++++++ docker/docker-bake.hcl | 9 +++- docker/run.sh | 81 ++++++++++++++++++++------------ 6 files changed, 92 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index 024b426a3b1..1ceb054951d 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,6 @@ capture/ # Node.js node_modules/ + +# Docker build +docker/src diff --git a/ansible/playbooks/openadkit.yaml b/ansible/playbooks/openadkit.yaml index f343d9cef55..46a8757229f 100644 --- a/ansible/playbooks/openadkit.yaml +++ b/ansible/playbooks/openadkit.yaml @@ -24,6 +24,8 @@ when: module == 'base' - role: autoware.dev_env.kisak_mesa when: module == 'base' + - role: autoware.dev_env.pacmod + when: module == 'base' - role: autoware.dev_env.build_tools when: module == 'all' and install_devel=='y' @@ -34,8 +36,6 @@ when: (module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y' - role: autoware.dev_env.tensorrt when: (module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y' - - role: autoware.dev_env.pacmod - when: module == 'planning-control' or module == 'perception-localization' or module == 'all' # Development environment - role: autoware.dev_env.dev_tools diff --git a/docker/Dockerfile b/docker/Dockerfile index 8ada18b521e..646a894f711 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -72,9 +72,7 @@ ENV CCACHE_DIR="/root/.ccache" RUN --mount=type=ssh \ ./setup-dev-env.sh -y --module all ${SETUP_ARGS} --no-cuda-drivers openadkit \ && pip uninstall -y ansible ansible-core \ - && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache \ - && find / -name 'libcu*.a' -delete \ - && find / -name 'libnv*.a' -delete + && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache # Install rosdep dependencies COPY --from=src-imported /rosdep-all-depend-packages.txt /tmp/rosdep-all-depend-packages.txt diff --git a/docker/build.sh b/docker/build.sh index 3d0a417c952..5c2d3e634ee 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -97,6 +97,19 @@ load_env() { fi } +# Clone repositories +clone_repositories() { + cd "$WORKSPACE_ROOT" + if [ ! -d "docker/src" ]; then + mkdir -p docker/src + vcs import docker/src