From f04d43bea6bf2b90a2eddd4358b824d5e7f0d02d Mon Sep 17 00:00:00 2001 From: ruffsl Date: Wed, 26 Apr 2023 18:13:23 +0200 Subject: [PATCH 1/8] Split overlay setup into multiple steps by skipping slower to build leaf packages during preparation, then store cache and repeat setup without skipping packages --- .circleci/config.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 822daab957..daf93dfdf3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -123,6 +123,8 @@ _commands: type: string mixins: type: string + skip: + type: string build: default: true type: boolean @@ -191,6 +193,7 @@ _commands: . << parameters.underlay >>/install/setup.sh colcon build \ --packages-select ${BUILD_PACKAGES} \ + --packages-skip < parameters.skip > \ --mixin << parameters.mixins >> - ccache_stats: workspace: << parameters.workspace >> @@ -364,6 +367,13 @@ _steps: install_dependencies: underlay: /opt/underlay_ws workspace: /opt/overlay_ws + prep_overlay_workspace: &prep_overlay_workspace + setup_workspace: &setup_workspace_overlay + key: overlay_ws + underlay: /opt/underlay_ws + workspace: /opt/overlay_ws + mixins: ${OVERLAY_MIXINS} + skip: nav2_system_tests setup_overlay_workspace: &setup_overlay_workspace setup_workspace: &setup_workspace_overlay key: overlay_ws @@ -417,6 +427,7 @@ commands: build_source: description: "Build Source" steps: + - *prep_overlay_workspace - *setup_overlay_workspace restore_build: description: "Restore Build" From 46673ca2d02819cc1793b69400cbd0ceceb45b13 Mon Sep 17 00:00:00 2001 From: ruffsl Date: Wed, 26 Apr 2023 18:19:51 +0200 Subject: [PATCH 2/8] Skip restore steps after already preping overlay to avoid needlessly downloading the same overlay cache --- .circleci/config.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index daf93dfdf3..3c4970bba2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -125,15 +125,21 @@ _commands: type: string skip: type: string + restore: + default: true + type: boolean build: default: true type: boolean steps: - store_artifacts: path: << parameters.workspace >>/lockfile.txt - - restore_from_cache: - key: << parameters.key >> - workspace: << parameters.workspace >> + - when: + condition: << parameters.restore >> + steps: + - restore_from_cache: + key: << parameters.key >> + workspace: << parameters.workspace >> - when: condition: << parameters.build >> steps: @@ -380,6 +386,7 @@ _steps: underlay: /opt/underlay_ws workspace: /opt/overlay_ws mixins: ${OVERLAY_MIXINS} + restore: false restore_overlay_workspace: &restore_overlay_workspace setup_workspace: <<: *setup_workspace_overlay From 44375a1c6ef6e730e47e30c7d910a15145d4ee2f Mon Sep 17 00:00:00 2001 From: ruffsl Date: Wed, 26 Apr 2023 18:27:34 +0200 Subject: [PATCH 3/8] Revert resource_class to default medium as the build resource usage seldom maxes out 4 cores nor uses more than 2GB RAM --- .circleci/config.yml | 2 +- .circleci/defaults.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3c4970bba2..468b612852 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -476,7 +476,7 @@ executors: release_exec: docker: - image: ghcr.io/ros-planning/navigation2:main - resource_class: large + resource_class: medium working_directory: /opt/overlay_ws environment: <<: *common_environment diff --git a/.circleci/defaults.yaml b/.circleci/defaults.yaml index e1d62a04d2..e0d946f78e 100644 --- a/.circleci/defaults.yaml +++ b/.circleci/defaults.yaml @@ -6,7 +6,7 @@ _common: &common "build": <<: *common "executor": "parallel" - "parallel-workers": 4 + "parallel-workers": 2 "symlink-install": true "test": <<: *common From 1f57fa443dcf52cb67c5e660d818fb8a8e1a2d7a Mon Sep 17 00:00:00 2001 From: ruffsl Date: Wed, 26 Apr 2023 18:38:06 +0200 Subject: [PATCH 4/8] Fix circleci config syntax by setting skip default as empty string to keep it an optional parameter --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 468b612852..d4cc6bd0f1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -124,6 +124,7 @@ _commands: mixins: type: string skip: + default: "" type: string restore: default: true From 12dab8f08dc48c7d529396bbfa4352db9a89538d Mon Sep 17 00:00:00 2001 From: ruffsl Date: Wed, 26 Apr 2023 18:58:32 +0200 Subject: [PATCH 5/8] Fix circleci config syntax missing angle brackets --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d4cc6bd0f1..23ad564b6e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -200,7 +200,7 @@ _commands: . << parameters.underlay >>/install/setup.sh colcon build \ --packages-select ${BUILD_PACKAGES} \ - --packages-skip < parameters.skip > \ + --packages-skip << parameters.skip >> \ --mixin << parameters.mixins >> - ccache_stats: workspace: << parameters.workspace >> From 189a69948742e9ffad5d7d3d83c24a089c3c6677 Mon Sep 17 00:00:00 2001 From: Joshua Wallace Date: Tue, 25 Apr 2023 11:55:00 -0400 Subject: [PATCH 6/8] ignore warning --- nav2_msgs/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nav2_msgs/CMakeLists.txt b/nav2_msgs/CMakeLists.txt index 72c84682eb..9779a97453 100644 --- a/nav2_msgs/CMakeLists.txt +++ b/nav2_msgs/CMakeLists.txt @@ -12,6 +12,9 @@ find_package(action_msgs REQUIRED) nav2_package() +# TODO(jwallace42): This is a work around for https://github.com/ros2/rosidl_typesupport_fastrtps/issues/28 +add_compile_options(-Wno-error=deprecated) + rosidl_generate_interfaces(${PROJECT_NAME} "msg/CollisionMonitorState.msg" "msg/Costmap.msg" From 4049798d07edb327fcc2376c1b19270e57de03db Mon Sep 17 00:00:00 2001 From: ruffsl Date: Wed, 26 Apr 2023 23:14:45 +0200 Subject: [PATCH 7/8] Revert "Revert resource_class to default medium" This reverts commit 44375a1c6ef6e730e47e30c7d910a15145d4ee2f. --- .circleci/config.yml | 2 +- .circleci/defaults.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 23ad564b6e..852f0df6cd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -477,7 +477,7 @@ executors: release_exec: docker: - image: ghcr.io/ros-planning/navigation2:main - resource_class: medium + resource_class: large working_directory: /opt/overlay_ws environment: <<: *common_environment diff --git a/.circleci/defaults.yaml b/.circleci/defaults.yaml index e0d946f78e..e1d62a04d2 100644 --- a/.circleci/defaults.yaml +++ b/.circleci/defaults.yaml @@ -6,7 +6,7 @@ _common: &common "build": <<: *common "executor": "parallel" - "parallel-workers": 2 + "parallel-workers": 4 "symlink-install": true "test": <<: *common From f066c2b8ed9586b0e4010a6412754578614a7f81 Mon Sep 17 00:00:00 2001 From: ruffsl Date: Wed, 26 Apr 2023 23:48:33 +0200 Subject: [PATCH 8/8] Fix nested defaults to avoid dropping of cache after storing during test jobs by ensuring restore_overlay_workspace still sets restore: true --- .circleci/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 852f0df6cd..6649a1e5ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -374,19 +374,19 @@ _steps: install_dependencies: underlay: /opt/underlay_ws workspace: /opt/overlay_ws - prep_overlay_workspace: &prep_overlay_workspace - setup_workspace: &setup_workspace_overlay - key: overlay_ws - underlay: /opt/underlay_ws - workspace: /opt/overlay_ws - mixins: ${OVERLAY_MIXINS} - skip: nav2_system_tests setup_overlay_workspace: &setup_overlay_workspace setup_workspace: &setup_workspace_overlay key: overlay_ws underlay: /opt/underlay_ws workspace: /opt/overlay_ws mixins: ${OVERLAY_MIXINS} + setup_workspace_overlay_1: &setup_workspace_overlay_1 + setup_workspace: + <<: *setup_workspace_overlay + skip: nav2_system_tests + setup_workspace_overlay_2: &setup_workspace_overlay_2 + setup_workspace: + <<: *setup_workspace_overlay restore: false restore_overlay_workspace: &restore_overlay_workspace setup_workspace: @@ -435,8 +435,8 @@ commands: build_source: description: "Build Source" steps: - - *prep_overlay_workspace - - *setup_overlay_workspace + - *setup_workspace_overlay_1 + - *setup_workspace_overlay_2 restore_build: description: "Restore Build" steps: