From 821f488ce93ec40d9e5560b85f9723421a6a4658 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Wed, 20 Nov 2024 22:32:07 +0900 Subject: [PATCH 01/14] refactor(docker): refine CUDA related packages build (#5458) * refine cuda related pkgs build Signed-off-by: Yutaka Kondo * fix '' Signed-off-by: Yutaka Kondo * fix option Signed-off-by: Yutaka Kondo * disable shellcheck Signed-off-by: Yutaka Kondo --------- Signed-off-by: Yutaka Kondo --- docker/Dockerfile | 16 +++------------- docker/scripts/build_and_clean.sh | 5 ++++- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8e9c9532a9..2a9047076c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -272,21 +272,11 @@ COPY --from=universe-sensing-perception-devel /opt/autoware /opt/autoware # hadolint ignore=SC1091 RUN --mount=type=cache,target=${CCACHE_DIR} \ - # TODO(youtalk): Move CUDA related packages into a dedicated directory - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_bytetrack,target=/autoware/src/universe/autoware.universe/perception/autoware_bytetrack \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_lidar_apollo_instance_segmentation,target=/autoware/src/universe/autoware.universe/perception/autoware_lidar_apollo_instance_segmentation \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_lidar_centerpoint,target=/autoware/src/universe/autoware.universe/perception/autoware_lidar_centerpoint \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_lidar_transfusion,target=/autoware/src/universe/autoware.universe/perception/autoware_lidar_transfusion \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_shape_estimation,target=/autoware/src/universe/autoware.universe/perception/autoware_shape_estimation \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_classifier,target=/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_classifier \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_common,target=/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_common \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_yolox,target=/autoware/src/universe/autoware.universe/perception/autoware_tensorrt_yolox \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_traffic_light_classifier,target=/autoware/src/universe/autoware.universe/perception/autoware_traffic_light_classifier \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception/autoware_traffic_light_fine_detector,target=/autoware/src/universe/autoware.universe/perception/autoware_traffic_light_fine_detector \ - --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/sensing/autoware_cuda_utils,target=/autoware/src/universe/autoware.universe/sensing/autoware_cuda_utils \ + --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/perception,target=/autoware/src/universe/autoware.universe/perception \ + --mount=type=bind,from=rosdep-universe-sensing-perception-depend,source=/autoware/src/universe/autoware.universe/sensing,target=/autoware/src/universe/autoware.universe/sensing \ source /opt/ros/"$ROS_DISTRO"/setup.bash \ && source /opt/autoware/setup.bash \ - && /autoware/build_and_clean.sh ${CCACHE_DIR} /opt/autoware + && /autoware/build_and_clean.sh ${CCACHE_DIR} /opt/autoware "--packages-above-and-dependencies autoware_tensorrt_common" ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] diff --git a/docker/scripts/build_and_clean.sh b/docker/scripts/build_and_clean.sh index 53c968ef72..e9d5ec6168 100755 --- a/docker/scripts/build_and_clean.sh +++ b/docker/scripts/build_and_clean.sh @@ -3,14 +3,17 @@ function build_and_clean() { local ccache_dir=$1 local install_base=$2 + local colcon_build_args=$3 + # shellcheck disable=SC2086 du -sh "$ccache_dir" && ccache -s && colcon build --cmake-args \ " -Wno-dev" \ " --no-warn-unused-cli" \ --merge-install \ --install-base "$install_base" \ - --mixin release compile-commands ccache && + --mixin release compile-commands ccache \ + $colcon_build_args && du -sh "$ccache_dir" && ccache -s && rm -rf /autoware/build /autoware/log } From 6a284d00c0db05cb9ee67a3cfd792d357b711c7b Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Thu, 21 Nov 2024 10:34:42 +0900 Subject: [PATCH 02/14] chore(autoware.repos): update TODO comment (#5463) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove todo Signed-off-by: Yutaka Kondo * Update autoware.repos Co-authored-by: M. Fatih Cırıt --------- Signed-off-by: Yutaka Kondo Co-authored-by: M. Fatih Cırıt --- autoware.repos | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoware.repos b/autoware.repos index 66feaa178b..2ad1eb7bbe 100644 --- a/autoware.repos +++ b/autoware.repos @@ -38,7 +38,7 @@ repositories: type: git url: https://github.com/autowarefoundation/autoware.universe.git version: main - universe/external/tier4_ad_api_adaptor: # TODO(TIER IV): Migrate to AD API + universe/external/tier4_ad_api_adaptor: # TODO(TIER IV): Migrate to AD API and remove this repository entry. type: git url: https://github.com/tier4/tier4_ad_api_adaptor.git version: tier4/universe From 6ae172a9938af8ee0726e6d5e45b06a840aaface Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" <43976882+isamu-takagi@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:59:12 +0900 Subject: [PATCH 03/14] feat(autoware.repos): change autoware_adapi_msgs version (#5459) Signed-off-by: Takagi, Isamu --- autoware.repos | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoware.repos b/autoware.repos index 2ad1eb7bbe..17d2e85d8b 100644 --- a/autoware.repos +++ b/autoware.repos @@ -7,7 +7,7 @@ repositories: core/autoware_adapi_msgs: type: git url: https://github.com/autowarefoundation/autoware_adapi_msgs.git - version: 1.3.0 + version: beta/1.7.0 core/autoware_internal_msgs: type: git url: https://github.com/autowarefoundation/autoware_internal_msgs.git From 4a479b1a3959be71d7e8855bd2a616f218690f58 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" <43976882+isamu-takagi@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:38:18 +0900 Subject: [PATCH 04/14] feat: add autoware_adapi_msgs to nightly.repos (#5466) Signed-off-by: Takagi, Isamu --- autoware-nightly.repos | 4 ++++ autoware.repos | 1 + 2 files changed, 5 insertions(+) diff --git a/autoware-nightly.repos b/autoware-nightly.repos index 0b58999fd4..49da4fee81 100644 --- a/autoware-nightly.repos +++ b/autoware-nightly.repos @@ -1,4 +1,8 @@ repositories: + core/autoware_adapi_msgs: + type: git + url: https://github.com/autowarefoundation/autoware_adapi_msgs.git + version: main core/autoware.core: type: git url: https://github.com/autowarefoundation/autoware.core.git diff --git a/autoware.repos b/autoware.repos index 17d2e85d8b..17ad277cf9 100644 --- a/autoware.repos +++ b/autoware.repos @@ -4,6 +4,7 @@ repositories: type: git url: https://github.com/autowarefoundation/autoware_msgs.git version: 1.2.0 + # TODO (isamu-takagi): Use a released version when autoware.universe uses a released version. core/autoware_adapi_msgs: type: git url: https://github.com/autowarefoundation/autoware_adapi_msgs.git From ef74e19c5a60027146e49e83341d5639038e048b Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Thu, 21 Nov 2024 16:59:46 +0900 Subject: [PATCH 05/14] fix(docker): fix `cleanup_apt.sh` (#5467) * echo Signed-off-by: Yutaka Kondo * fix Signed-off-by: Yutaka Kondo * remove echo Signed-off-by: Yutaka Kondo * style(pre-commit): autofix --------- Signed-off-by: Yutaka Kondo Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- docker/scripts/cleanup_apt.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/scripts/cleanup_apt.sh b/docker/scripts/cleanup_apt.sh index 883df9ba8a..0b0d43fea1 100755 --- a/docker/scripts/cleanup_apt.sh +++ b/docker/scripts/cleanup_apt.sh @@ -1,11 +1,11 @@ #!/bin/bash -function cleanup() { - local remove_var_lib_apt_lists=false +function cleanup_apt() { + local remove_var_lib_apt_lists=$1 apt-get autoremove -y && rm -rf "$HOME"/.cache - if "$remove_var_lib_apt_lists"; then + if [[ $remove_var_lib_apt_lists == true ]]; then rm -rf /var/lib/apt/lists/* fi } -cleanup "$@" +cleanup_apt "$@" From f3d27bf6fcaea810320ccf2297207ee7f76ffdd3 Mon Sep 17 00:00:00 2001 From: Ryuta Kambe Date: Thu, 21 Nov 2024 17:36:08 +0900 Subject: [PATCH 06/14] ci(clang-tidy): use minimum clang-tidy configuration for CI (#5465) Signed-off-by: veqcc --- .clang-tidy-ci | 480 +------------------------------------------------ 1 file changed, 3 insertions(+), 477 deletions(-) diff --git a/.clang-tidy-ci b/.clang-tidy-ci index c6dfcdb37c..b5928f0473 100644 --- a/.clang-tidy-ci +++ b/.clang-tidy-ci @@ -1,483 +1,9 @@ Checks: " -*, - boost-use-to-string, - bugprone-argument-comment, - bugprone-assert-side-effect, - bugprone-bad-signal-to-kill-thread, - bugprone-bool-pointer-implicit-conversion, - bugprone-branch-clone, - bugprone-copy-constructor-init, - bugprone-dangling-handle, - bugprone-dynamic-static-initializers, - bugprone-exception-escape, - bugprone-fold-init-type, - bugprone-forward-declaration-namespace, - bugprone-forwarding-reference-overload, - bugprone-inaccurate-erase, - bugprone-incorrect-roundings, - bugprone-integer-division, - bugprone-lambda-function-name, - bugprone-macro-parentheses, - bugprone-macro-repeated-side-effects, - bugprone-misplaced-operator-in-strlen-in-alloc, - bugprone-misplaced-widening-cast, - bugprone-move-forwarding-reference, - bugprone-multiple-statement-macro, - bugprone-not-null-terminated-result, - bugprone-parent-virtual-call, - bugprone-posix-return, - bugprone-signed-char-misuse, - bugprone-sizeof-container, - bugprone-sizeof-expression, - bugprone-string-constructor, - bugprone-string-integer-assignment, - bugprone-string-literal-with-embedded-nul, - bugprone-suspicious-enum-usage, - bugprone-suspicious-memset-usage, - bugprone-suspicious-missing-comma, - bugprone-suspicious-semicolon, - bugprone-suspicious-string-compare, - bugprone-swapped-arguments, - bugprone-terminating-continue, - bugprone-throw-keyword-missing, - bugprone-too-small-loop-variable, - bugprone-unchecked-optional-access, - bugprone-undefined-memory-manipulation, - bugprone-undelegated-constructor, - bugprone-unhandled-self-assignment, - bugprone-unused-raii, - bugprone-unused-return-value, - bugprone-use-after-move, - bugprone-virtual-near-miss, - cppcoreguidelines-avoid-goto, - cppcoreguidelines-init-variables, - cppcoreguidelines-interfaces-global-init, - cppcoreguidelines-macro-usage, - cppcoreguidelines-narrowing-conversions, - cppcoreguidelines-no-malloc, - cppcoreguidelines-pro-bounds-pointer-arithmetic, - cppcoreguidelines-pro-type-const-cast, - cppcoreguidelines-pro-type-cstyle-cast, - cppcoreguidelines-pro-type-member-init, - cppcoreguidelines-pro-type-reinterpret-cast, - cppcoreguidelines-pro-type-static-cast-downcast, - cppcoreguidelines-pro-type-union-access, - cppcoreguidelines-slicing, - cppcoreguidelines-special-member-functions, - google-build-explicit-make-pair, - google-build-namespaces, - google-build-using-namespace, - google-explicit-constructor, - google-global-names-in-headers, - google-upgrade-googletest-case, - hicpp-exception-baseclass, - hicpp-multiway-paths-covered, - hicpp-no-assembler, - hicpp-signed-bitwise, - llvm-namespace-comment, - misc-definitions-in-headers, - misc-misplaced-const, - misc-new-delete-overloads, - misc-non-copyable-objects, - misc-redundant-expression, - misc-static-assert, - misc-throw-by-value-catch-by-reference, - misc-unconventional-assign-operator, - misc-uniqueptr-reset-release, - misc-unused-alias-decls, - misc-unused-parameters, - misc-unused-using-decls, - modernize-concat-nested-namespaces, - modernize-deprecated-headers, - modernize-deprecated-ios-base-aliases, - modernize-loop-convert, - modernize-make-shared, - modernize-make-unique, - modernize-pass-by-value, - modernize-raw-string-literal, - modernize-redundant-void-arg, - modernize-replace-auto-ptr, - modernize-replace-disallow-copy-and-assign-macro, - modernize-replace-random-shuffle, - modernize-return-braced-init-list, - modernize-shrink-to-fit, - modernize-unary-static-assert, - modernize-use-auto, - modernize-use-bool-literals, - modernize-use-default-member-init, - modernize-use-emplace, - modernize-use-equals-default, - modernize-use-equals-delete, - modernize-use-nodiscard, - modernize-use-noexcept, - modernize-use-nullptr, - modernize-use-override, - modernize-use-transparent-functors, - modernize-use-uncaught-exceptions, - modernize-use-using, - openmp-use-default-none, - performance-faster-string-find, - performance-for-range-copy, - performance-implicit-conversion-in-loop, - performance-inefficient-algorithm, - performance-inefficient-string-concatenation, - performance-inefficient-vector-operation, - performance-move-const-arg, - performance-move-constructor-init, - performance-no-automatic-move, - performance-no-int-to-ptr, - performance-noexcept-move-constructor, - performance-trivially-destructible, - performance-type-promotion-in-math-fn, - performance-unnecessary-copy-initialization, - performance-unnecessary-value-param, - portability-simd-intrinsics, - readability-const-return-type, - readability-container-size-empty, - readability-convert-member-functions-to-static, - readability-delete-null-pointer, - readability-else-after-return, - readability-function-cognitive-complexity, - readability-identifier-naming, - readability-inconsistent-declaration-parameter-name, - readability-isolate-declaration, - readability-make-member-function-const, - readability-misleading-indentation, - readability-misplaced-array-index, - readability-non-const-parameter, - readability-redundant-access-specifiers, - readability-redundant-control-flow, - readability-redundant-declaration, - readability-redundant-function-ptr-dereference, - readability-redundant-member-init, - readability-redundant-smartptr-get, - readability-redundant-string-cstr, - readability-redundant-string-init, - readability-simplify-boolean-expr, - readability-simplify-subscript-expr, - readability-static-accessed-through-instance, - readability-static-definition-in-anonymous-namespace, - readability-string-compare, - readability-uniqueptr-delete-release" + bugprone-dangling-handle" -WarningsAsErrors: " - // severity: HIGH - bugprone-dangling-handle, - bugprone-fold-init-type, - bugprone-inaccurate-erase, - // bugprone-incorrect-roundings, - // bugprone-misplaced-widening-cast, - bugprone-sizeof-container, - bugprone-sizeof-expression, - bugprone-string-constructor, - bugprone-suspicious-enum-usage, - bugprone-suspicious-memset-usage, - bugprone-suspicious-missing-comma, - bugprone-suspicious-semicolon, - bugprone-swapped-arguments, - bugprone-unchecked-optional-access, - // bugprone-unused-raii, - bugprone-use-after-move, - misc-non-copyable-objects, - misc-throw-by-value-catch-by-reference, - - // severity: MEDIUM - bugprone-assert-side-effect, - bugprone-bad-signal-to-kill-thread, - bugprone-copy-constructor-init, - bugprone-dynamic-static-initializers, - // bugprone-exception-escape, - // bugprone-integer-division, - // bugprone-macro-parentheses, - bugprone-macro-repeated-side-effects, - bugprone-misplaced-operator-in-strlen-in-alloc, - bugprone-move-forwarding-reference, - bugprone-multiple-statement-macro, - bugprone-not-null-terminated-result, - // bugprone-parent-virtual-call, - bugprone-posix-return, - // bugprone-signed-char-misuse, - bugprone-string-literal-with-embedded-nul, - bugprone-suspicious-string-compare, - bugprone-terminating-continue, - // bugprone-throw-keyword-missing, - bugprone-too-small-loop-variable, - bugprone-undefined-memory-manipulation, - bugprone-undelegated-constructor, - bugprone-unhandled-self-assignment, - bugprone-unused-return-value, - bugprone-virtual-near-miss, - // cppcoreguidelines-init-variables, - // cppcoreguidelines-narrowing-conversions, - google-build-explicit-make-pair, - google-build-namespaces, - // google-explicit-constructor, - misc-definitions-in-headers, - misc-new-delete-overloads, - misc-redundant-expression, - misc-unconventional-assign-operator, - misc-uniqueptr-reset-release, - performance-inefficient-algorithm, - // performance-move-const-arg, - performance-move-constructor-init, - performance-noexcept-move-constructor, - // readability-simplify-boolean-expr" - -HeaderFilterRegex: ^(?!\/usr)(?!\/opt) +WarningsAsErrors: "*" ExtraArgs: - -std=c++17 - -CheckOptions: - - key: bugprone-argument-comment.CommentBoolLiterals - value: "0" - - key: bugprone-argument-comment.CommentCharacterLiterals - value: "0" - - key: bugprone-argument-comment.CommentFloatLiterals - value: "0" - - key: bugprone-argument-comment.CommentIntegerLiterals - value: "0" - - key: bugprone-argument-comment.CommentNullPtrs - value: "0" - - key: bugprone-argument-comment.CommentStringLiterals - value: "0" - - key: bugprone-argument-comment.CommentUserDefinedLiterals - value: "0" - - key: bugprone-argument-comment.IgnoreSingleArgument - value: "0" - - key: bugprone-argument-comment.StrictMode - value: "0" - - key: bugprone-assert-side-effect.AssertMacros - value: assert - - key: bugprone-assert-side-effect.CheckFunctionCalls - value: "0" - - key: bugprone-dangling-handle.HandleClasses - value: std::basic_string_view;std::experimental::basic_string_view - - key: bugprone-dynamic-static-initializers.HeaderFileExtensions - value: ",h,hh,hpp,hxx" - - key: bugprone-exception-escape.FunctionsThatShouldNotThrow - value: "" - - key: bugprone-exception-escape.IgnoredExceptions - value: "" - - key: bugprone-misplaced-widening-cast.CheckImplicitCasts - value: "0" - - key: bugprone-not-null-terminated-result.WantToUseSafeFunctions - value: "1" - - key: bugprone-signed-char-misuse.CharTypdefsToIgnore - value: "" - - key: bugprone-sizeof-expression.WarnOnSizeOfCompareToConstant - value: "1" - - key: bugprone-sizeof-expression.WarnOnSizeOfConstant - value: "1" - - key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression - value: "0" - - key: bugprone-sizeof-expression.WarnOnSizeOfThis - value: "1" - - key: bugprone-string-constructor.LargeLengthThreshold - value: "8388608" - - key: bugprone-string-constructor.WarnOnLargeLength - value: "1" - - key: bugprone-suspicious-enum-usage.StrictMode - value: "0" - - key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens - value: "5" - - key: bugprone-suspicious-missing-comma.RatioThreshold - value: "0.200000" - - key: bugprone-suspicious-missing-comma.SizeThreshold - value: "5" - - key: bugprone-suspicious-string-compare.StringCompareLikeFunctions - value: "" - - key: bugprone-suspicious-string-compare.WarnOnImplicitComparison - value: "1" - - key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison - value: "0" - - key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit - value: "16" - - key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField - value: "1" - - key: bugprone-unused-return-value.CheckedFunctions - value: ::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty - - key: cert-dcl16-c.NewSuffixes - value: L;LL;LU;LLU - - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField - value: "0" - - key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors - value: "1" - - key: cppcoreguidelines-macro-usage.AllowedRegexp - value: ^DEBUG_* - - key: cppcoreguidelines-macro-usage.CheckCapsOnly - value: "0" - - key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros - value: "1" - - key: cppcoreguidelines-no-malloc.Allocations - value: ::malloc;::calloc - - key: cppcoreguidelines-no-malloc.Deallocations - value: ::free - - key: cppcoreguidelines-no-malloc.Reallocations - value: ::realloc - - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic - value: "1" - - key: cppcoreguidelines-pro-type-member-init.IgnoreArrays - value: "0" - - key: cppcoreguidelines-pro-type-member-init.UseAssignment - value: "0" - - key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions - value: "0" - - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor - value: "0" - - key: google-readability-braces-around-statements.ShortStatementLines - value: "1" - - key: google-readability-function-size.StatementThreshold - value: "800" - - key: google-readability-namespace-comments.ShortNamespaceLines - value: "10" - - key: google-readability-namespace-comments.SpacesBeforeComments - value: "2" - - key: hicpp-multiway-paths-covered.WarnOnMissingElse - value: "0" - - key: hicpp-signed-bitwise.IgnorePositiveIntegerLiterals - value: "0" - - key: misc-definitions-in-headers.HeaderFileExtensions - value: ",h,hh,hpp,hxx" - - key: misc-definitions-in-headers.UseHeaderFileExtension - value: "1" - - key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries - value: "1" - - key: misc-unused-parameters.StrictMode - value: "0" - - key: modernize-loop-convert.MaxCopySize - value: "16" - - key: modernize-loop-convert.MinConfidence - value: reasonable - - key: modernize-loop-convert.NamingStyle - value: CamelCase - - key: modernize-make-shared.IgnoreMacros - value: "1" - - key: modernize-make-shared.IncludeStyle - value: google - - key: modernize-make-shared.MakeSmartPtrFunction - value: std::make_shared - - key: modernize-make-shared.MakeSmartPtrFunctionHeader - value: memory - - key: modernize-make-unique.IgnoreMacros - value: "1" - - key: modernize-make-unique.IncludeStyle - value: google - - key: modernize-make-unique.MakeSmartPtrFunction - value: std::make_unique - - key: modernize-make-unique.MakeSmartPtrFunctionHeader - value: memory - - key: modernize-pass-by-value.IncludeStyle - value: google - - key: modernize-pass-by-value.ValuesOnly - value: "0" - - key: modernize-raw-string-literal.ReplaceShorterLiterals - value: "0" - - key: modernize-replace-auto-ptr.IncludeStyle - value: google - - key: modernize-replace-random-shuffle.IncludeStyle - value: google - - key: modernize-use-auto.MinTypeNameLength - value: "5" - - key: modernize-use-auto.RemoveStars - value: "0" - - key: modernize-use-default-member-init.IgnoreMacros - value: "1" - - key: modernize-use-default-member-init.UseAssignment - value: "0" - - key: modernize-use-emplace.ContainersWithPushBack - value: ::std::vector;::std::list;::std::deque - - key: modernize-use-emplace.SmartPointers - value: ::std::shared_ptr;::std::unique_ptr;::std::auto_ptr;::std::weak_ptr - - key: modernize-use-emplace.TupleMakeFunctions - value: ::std::make_pair;::std::make_tuple - - key: modernize-use-emplace.TupleTypes - value: ::std::pair;::std::tuple - - key: modernize-use-equals-default.IgnoreMacros - value: "1" - - key: modernize-use-equals-delete.IgnoreMacros - value: "1" - - key: modernize-use-nodiscard.ReplacementString - value: "[[nodiscard]]" - - key: modernize-use-noexcept.ReplacementString - value: "" - - key: modernize-use-noexcept.UseNoexceptFalse - value: "1" - - key: modernize-use-nullptr.NullMacros - value: "NULL" - - key: modernize-use-override.AllowOverrideAndFinal - value: "0" - - key: modernize-use-override.FinalSpelling - value: final - - key: modernize-use-override.IgnoreDestructors - value: "0" - - key: modernize-use-override.OverrideSpelling - value: override - - key: modernize-use-transparent-functors.SafeMode - value: "0" - - key: modernize-use-using.IgnoreMacros - value: "1" - - key: performance-faster-string-find.StringLikeClasses - value: std::basic_string - - key: performance-for-range-copy.AllowedTypes - value: "" - - key: performance-for-range-copy.WarnOnAllAutoCopies - value: "0" - - key: performance-inefficient-string-concatenation.StrictMode - value: "0" - - key: performance-inefficient-vector-operation.EnableProto - value: "0" - - key: performance-inefficient-vector-operation.VectorLikeClasses - value: ::std::vector - - key: performance-move-const-arg.CheckTriviallyCopyableMove - value: "1" - - key: performance-move-constructor-init.IncludeStyle - value: google - - key: performance-no-automatic-move.AllowedTypes - value: "" - - key: performance-type-promotion-in-math-fn.IncludeStyle - value: google - - key: performance-unnecessary-copy-initialization.AllowedTypes - value: "" - - key: performance-unnecessary-value-param.AllowedTypes - value: .*Ptr;.*SharedFuture - - key: performance-unnecessary-value-param.IncludeStyle - value: google - - key: portability-simd-intrinsics.Std - value: "" - - key: portability-simd-intrinsics.Suggest - value: "0" - - key: readability-function-cognitive-complexity.IgnoreMacros - value: "1" - - key: readability-else-after-return.WarnOnUnfixable - value: "1" - - key: readability-identifier-naming.NamespaceCase - value: lower_case - - key: readability-identifier-naming.ClassCase - value: CamelCase - - key: readability-identifier-naming.PrivateMemberSuffix - value: _ - - key: readability-identifier-naming.StructCase - value: CamelCase - - key: readability-identifier-naming.FunctionCase - value: lower_case - - key: readability-identifier-naming.VariableCase - value: lower_case - - key: readability-identifier-naming.GlobalConstantCase - value: lower_case - - key: readability-identifier-naming.GlobalConstantPrefix - value: g_ - - key: readability-identifier-naming.ConstexprVariableCase - value: lower_case - - key: readability-inconsistent-declaration-parameter-name.IgnoreMacros - value: "1" - - key: readability-inconsistent-declaration-parameter-name.Strict - value: "0" - - key: readability-redundant-smartptr-get.IgnoreMacros - value: "1" - - key: readability-redundant-string-init.StringNames - value: ::std::basic_string - - key: readability-simplify-subscript-expr.Types - value: ::std::basic_string;::std::basic_string_view;::std::vector;::std::array - - key: readability-static-accessed-through-instance.NameSpecifierNestingThreshold - value: "3" + - -Wno-c11-extensions From 497c9c4a0b276db3e6722efeca95ae0bb6a20c31 Mon Sep 17 00:00:00 2001 From: "awf-autoware-bot[bot]" <94889083+awf-autoware-bot[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 13:20:28 +0000 Subject: [PATCH 07/14] feat(autoware.repos): patch update autowarefoundation/autoware_lanelet2_extension to 0.6.2 (#5470) Signed-off-by: github-actions Co-authored-by: github-actions --- autoware.repos | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoware.repos b/autoware.repos index 17ad277cf9..ede2fa655c 100644 --- a/autoware.repos +++ b/autoware.repos @@ -29,7 +29,7 @@ repositories: core/autoware_lanelet2_extension: type: git url: https://github.com/autowarefoundation/autoware_lanelet2_extension.git - version: 0.6.1 + version: 0.6.2 core/autoware.core: type: git url: https://github.com/autowarefoundation/autoware.core.git From bf7552483e8ad0346e934dcd0624b302c9959e56 Mon Sep 17 00:00:00 2001 From: Ryohsuke Mitsudome <43976834+mitsudome-r@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:46:41 +0900 Subject: [PATCH 08/14] ci: use AWS CodeBuild to run docker-build-and-push-cuda (#5475) Signed-off-by: Ryohsuke Mitsudome --- .github/workflows/docker-build-and-push.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-and-push.yaml b/.github/workflows/docker-build-and-push.yaml index ad185aac5c..a2a96872d1 100644 --- a/.github/workflows/docker-build-and-push.yaml +++ b/.github/workflows/docker-build-and-push.yaml @@ -63,7 +63,7 @@ jobs: docker-build-and-push-cuda: needs: [load-env, docker-build-and-push] - runs-on: ubuntu-22.04 + runs-on: codebuild-autoware-us-east-1-${{ github.run_id }}-${{ github.run_attempt }}-ubuntu-7.0-large steps: - name: Check out repository uses: actions/checkout@v4 From 413912769a3417e576b0f45b40dc9c57e29a2967 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 25 Nov 2024 14:34:37 +0900 Subject: [PATCH 09/14] feat(docker): introduce `autoware-base` images (#5476) * add base image workflow Signed-off-by: Yutaka Kondo * MUST REVERT Signed-off-by: Yutaka Kondo * rename Signed-off-by: Yutaka Kondo * rename Signed-off-by: Yutaka Kondo * fix with Signed-off-by: Yutaka Kondo * change run Signed-off-by: Yutaka Kondo * fix hcl Signed-off-by: Yutaka Kondo * add platform Signed-off-by: Yutaka Kondo * fix description Signed-off-by: Yutaka Kondo * remove checkout Signed-off-by: Yutaka Kondo * Revert "MUST REVERT" This reverts commit bb9f18a787535831d1bbe162774b2f3328311229. * set schedule Signed-off-by: Yutaka Kondo * style(pre-commit): autofix * use ubuntu-22.04 Signed-off-by: Yutaka Kondo * remove entrypoint Signed-off-by: Yutaka Kondo * remove entrypoint Signed-off-by: Yutaka Kondo --------- Signed-off-by: Yutaka Kondo Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .../docker-build-and-push-base/action.yaml | 63 +++++++++++++++++++ .github/workflows/autoware-base.yaml | 29 +++++++++ docker/Dockerfile | 1 - docker/Dockerfile.base | 47 ++++++++++++++ docker/docker-bake-base.hcl | 22 +++++++ 5 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 .github/actions/docker-build-and-push-base/action.yaml create mode 100644 .github/workflows/autoware-base.yaml create mode 100644 docker/Dockerfile.base create mode 100644 docker/docker-bake-base.hcl diff --git a/.github/actions/docker-build-and-push-base/action.yaml b/.github/actions/docker-build-and-push-base/action.yaml new file mode 100644 index 0000000000..8a5a779904 --- /dev/null +++ b/.github/actions/docker-build-and-push-base/action.yaml @@ -0,0 +1,63 @@ +name: docker-build-and-push-base +description: Composite action to build and push base images to registry. + +inputs: + target-image: + description: Target docker image name in the registry. + required: true + build-args: + description: Additional build args. + required: false + +runs: + using: composite + steps: + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Get current date + id: date + run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT + shell: bash + + - name: Docker meta for autoware-base:latest + id: meta-base + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=${{ steps.date.outputs.date }} + bake-target: docker-metadata-action-base + flavor: | + latest=true + + - name: Docker meta for autoware-base:cuda-latest + id: meta-base-cuda + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.target-image }} + tags: | + type=raw,value=cuda-latest + type=raw,value=cuda-${{ steps.date.outputs.date }} + bake-target: docker-metadata-action-base-cuda + flavor: | + latest=false + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ github.token }} + + - name: Build and Push to GitHub Container Registry + uses: docker/bake-action@v5 + with: + push: true + files: | + docker/docker-bake-base.hcl + ${{ steps.meta-base.outputs.bake-file }} + ${{ steps.meta-base-cuda.outputs.bake-file }} + provenance: false + set: | + ${{ inputs.build-args }} diff --git a/.github/workflows/autoware-base.yaml b/.github/workflows/autoware-base.yaml new file mode 100644 index 0000000000..c4ec32e189 --- /dev/null +++ b/.github/workflows/autoware-base.yaml @@ -0,0 +1,29 @@ +name: autoware-base + +on: + schedule: + - cron: 0 0 15 * * # every 15th of the month + workflow_dispatch: + +jobs: + load-env: + uses: ./.github/workflows/load-env.yaml + + docker-build-and-push-base: + needs: load-env + runs-on: ubuntu-22.04 + steps: + - name: Check out this repository + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Build Autoware's base images + uses: ./.github/actions/docker-build-and-push-base + with: + target-image: autoware-base + build-args: | + *.platform=linux/amd64,linux/arm64 + *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} + *.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }} diff --git a/docker/Dockerfile b/docker/Dockerfile index 2a9047076c..8a82503b6d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -36,7 +36,6 @@ RUN --mount=type=ssh \ # Create entrypoint COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh RUN chmod +x /ros_entrypoint.sh -ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] FROM base AS base-cuda diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base new file mode 100644 index 0000000000..dca6fb8a0f --- /dev/null +++ b/docker/Dockerfile.base @@ -0,0 +1,47 @@ +ARG BASE_IMAGE + +# hadolint ignore=DL3006 +FROM $BASE_IMAGE AS base +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ARG ROS_DISTRO + +# Copy files +COPY setup-dev-env.sh ansible-galaxy-requirements.yaml amd64.env arm64.env /autoware/ +COPY ansible/ /autoware/ansible/ +COPY docker/scripts/cleanup_apt.sh /autoware/cleanup_apt.sh +RUN chmod +x /autoware/cleanup_apt.sh +WORKDIR /autoware + +# Install apt packages and add GitHub to known hosts for private repositories +RUN rm -f /etc/apt/apt.conf.d/docker-clean \ + && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ + gosu \ + ssh \ + && /autoware/cleanup_apt.sh \ + && mkdir -p ~/.ssh \ + && ssh-keyscan github.com >> ~/.ssh/known_hosts + +# Set up base environment +RUN --mount=type=ssh \ + --mount=type=cache,target=/var/cache/apt,sharing=locked \ + ./setup-dev-env.sh -y --module base --no-nvidia --no-cuda-drivers --runtime openadkit \ + && pip uninstall -y ansible ansible-core \ + && /autoware/cleanup_apt.sh \ + && echo "source /opt/ros/${ROS_DISTRO}/setup.bash" > /etc/bash.bashrc + +# Create entrypoint +COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh +RUN chmod +x /ros_entrypoint.sh +CMD ["/bin/bash"] + +FROM base AS base-cuda +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# Set up CUDA runtime environment and artifacts +# hadolint ignore=SC2002 +RUN --mount=type=ssh \ + ./setup-dev-env.sh -y --module base --download-artifacts --no-cuda-drivers --runtime openadkit \ + && pip uninstall -y ansible ansible-core \ + && /autoware/cleanup_apt.sh true diff --git a/docker/docker-bake-base.hcl b/docker/docker-bake-base.hcl new file mode 100644 index 0000000000..43cb7facc0 --- /dev/null +++ b/docker/docker-bake-base.hcl @@ -0,0 +1,22 @@ +group "default" { + targets = [ + "base", + "base-cuda" + ] +} + +// For docker/metadata-action +target "docker-metadata-action-base" {} +target "docker-metadata-action-base-cuda" {} + +target "base" { + inherits = ["docker-metadata-action-base"] + dockerfile = "docker/Dockerfile.base" + target = "base" +} + +target "base-cuda" { + inherits = ["docker-metadata-action-base-cuda"] + dockerfile = "docker/Dockerfile.base" + target = "base-cuda" +} From 0fd30c529b692529e5a7055cbd0bc1b2dd976dea Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Mon, 25 Nov 2024 14:35:03 +0900 Subject: [PATCH 10/14] fix(.github): add `--force` option to `vcs import` (#5478) add force option Signed-off-by: Yutaka Kondo --- .github/actions/docker-build/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/docker-build/action.yaml b/.github/actions/docker-build/action.yaml index df338a836d..d5bda73b4f 100644 --- a/.github/actions/docker-build/action.yaml +++ b/.github/actions/docker-build/action.yaml @@ -38,7 +38,7 @@ runs: - name: Import additional repositories if: ${{ inputs.additional-repos != '' }} run: | - vcs import src < ${{ inputs.additional-repos }} + vcs import --force src < ${{ inputs.additional-repos }} shell: bash - name: Cache ccache From c5c37e487e5e94c0d45b921be33e82b7ed8c2f06 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Tue, 26 Nov 2024 13:13:29 +0900 Subject: [PATCH 11/14] chore(.github): update changed files list to include `docker-build-and-push-cuda` files (#5472) update changed candidates Signed-off-by: Yutaka Kondo --- .github/workflows/docker-build-and-push-arm64.yaml | 4 ++-- .github/workflows/docker-build-and-push.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-build-and-push-arm64.yaml b/.github/workflows/docker-build-and-push-arm64.yaml index e8eba9440f..afdeabd76e 100644 --- a/.github/workflows/docker-build-and-push-arm64.yaml +++ b/.github/workflows/docker-build-and-push-arm64.yaml @@ -38,7 +38,7 @@ jobs: files: | *.env *.repos - .github/actions/docker-build-and-push/action.yaml + .github/actions/docker-build-and-push*/action.yaml .github/workflows/docker-build-and-push*.yaml ansible-galaxy-requirements.yaml ansible/** @@ -88,7 +88,7 @@ jobs: files: | *.env *.repos - .github/actions/docker-build-and-push/action.yaml + .github/actions/docker-build-and-push*/action.yaml .github/workflows/docker-build-and-push*.yaml ansible-galaxy-requirements.yaml ansible/** diff --git a/.github/workflows/docker-build-and-push.yaml b/.github/workflows/docker-build-and-push.yaml index a2a96872d1..d36b24cf98 100644 --- a/.github/workflows/docker-build-and-push.yaml +++ b/.github/workflows/docker-build-and-push.yaml @@ -33,7 +33,7 @@ jobs: files: | *.env *.repos - .github/actions/docker-build-and-push/action.yaml + .github/actions/docker-build-and-push*/action.yaml .github/workflows/docker-build-and-push*.yaml ansible-galaxy-requirements.yaml ansible/** @@ -83,7 +83,7 @@ jobs: files: | *.env *.repos - .github/actions/docker-build-and-push/action.yaml + .github/actions/docker-build-and-push*/action.yaml .github/workflows/docker-build-and-push*.yaml ansible-galaxy-requirements.yaml ansible/** From cab53fc7d9cb2ba543e85aead082bc920832ab54 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Tue, 26 Nov 2024 13:15:38 +0900 Subject: [PATCH 12/14] feat(docker): copy `cleanup_system.sh` to `autoware-base` images (#5482) copy cleanup_system.sh Signed-off-by: Yutaka Kondo --- docker/Dockerfile.base | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index dca6fb8a0f..516870c7bb 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -10,6 +10,8 @@ COPY setup-dev-env.sh ansible-galaxy-requirements.yaml amd64.env arm64.env /auto COPY ansible/ /autoware/ansible/ COPY docker/scripts/cleanup_apt.sh /autoware/cleanup_apt.sh RUN chmod +x /autoware/cleanup_apt.sh +COPY docker/scripts/cleanup_system.sh /autoware/cleanup_system.sh +RUN chmod +x /autoware/cleanup_system.sh WORKDIR /autoware # Install apt packages and add GitHub to known hosts for private repositories From 9266f10335beeb998b3293870d9f3d7fd64811a8 Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Tue, 26 Nov 2024 13:16:04 +0900 Subject: [PATCH 13/14] feat(.github): separate `autoware-base` jobs (#5487) * copy cleanup_system.sh Signed-off-by: Yutaka Kondo * separate jobs Signed-off-by: Yutaka Kondo * free disk space Signed-off-by: Yutaka Kondo --------- Signed-off-by: Yutaka Kondo --- .github/workflows/autoware-base.yaml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/autoware-base.yaml b/.github/workflows/autoware-base.yaml index c4ec32e189..e3d9720bcc 100644 --- a/.github/workflows/autoware-base.yaml +++ b/.github/workflows/autoware-base.yaml @@ -9,13 +9,35 @@ jobs: load-env: uses: ./.github/workflows/load-env.yaml - docker-build-and-push-base: + autoware-base-amd64: needs: load-env runs-on: ubuntu-22.04 steps: - name: Check out this repository uses: actions/checkout@v4 + - name: Free disk space + uses: ./.github/actions/free-disk-space + + - name: Build Autoware's base images + uses: ./.github/actions/docker-build-and-push-base + with: + target-image: autoware-base + build-args: | + *.platform=linux/amd64 + *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} + *.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }} + + autoware-base-arm64: + needs: [load-env, autoware-base-amd64] + runs-on: ubuntu-22.04 + steps: + - name: Check out this repository + uses: actions/checkout@v4 + + - name: Free disk space + uses: ./.github/actions/free-disk-space + - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -24,6 +46,6 @@ jobs: with: target-image: autoware-base build-args: | - *.platform=linux/amd64,linux/arm64 + *.platform=linux/arm64 *.args.ROS_DISTRO=${{ needs.load-env.outputs.rosdistro }} *.args.BASE_IMAGE=${{ needs.load-env.outputs.base_image }} From 0e44b14187196ab0fd75a69bf0eee27b086d3b47 Mon Sep 17 00:00:00 2001 From: "awf-autoware-bot[bot]" <94889083+awf-autoware-bot[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:38:58 +0900 Subject: [PATCH 14/14] feat(autoware.repos): minor update autowarefoundation/autoware_msgs to 1.3.0 (#5491) Signed-off-by: github-actions Co-authored-by: github-actions --- autoware.repos | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoware.repos b/autoware.repos index ede2fa655c..cbe72148e2 100644 --- a/autoware.repos +++ b/autoware.repos @@ -3,7 +3,7 @@ repositories: core/autoware_msgs: type: git url: https://github.com/autowarefoundation/autoware_msgs.git - version: 1.2.0 + version: 1.3.0 # TODO (isamu-takagi): Use a released version when autoware.universe uses a released version. core/autoware_adapi_msgs: type: git