From ff6136a5a69079bf14fdf6d3e34c5fcaa8f943c2 Mon Sep 17 00:00:00 2001 From: f0reachARR Date: Sat, 10 Aug 2024 23:09:00 +0900 Subject: [PATCH 1/5] Add types --- .github/workflows/ansible-test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ansible-test.yaml b/.github/workflows/ansible-test.yaml index 5840c359d52..c60e30dd51a 100644 --- a/.github/workflows/ansible-test.yaml +++ b/.github/workflows/ansible-test.yaml @@ -2,6 +2,7 @@ name: setup-universe on: pull_request: + types: [opened, synchronize, reopened] jobs: setup-universe: From 7eca6e300aee04f21b4925113171abd23dc6e2a5 Mon Sep 17 00:00:00 2001 From: f0reachARR Date: Sat, 10 Aug 2024 23:17:21 +0900 Subject: [PATCH 2/5] Optimize docker install --- ansible/roles/docker_engine/tasks/main.yaml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/ansible/roles/docker_engine/tasks/main.yaml b/ansible/roles/docker_engine/tasks/main.yaml index 6fe822fa575..973be1e9ec3 100644 --- a/ansible/roles/docker_engine/tasks/main.yaml +++ b/ansible/roles/docker_engine/tasks/main.yaml @@ -35,26 +35,11 @@ url: https://download.docker.com/linux/ubuntu/gpg keyring: /etc/apt/keyrings/docker.gpg -- name: Save result of 'dpkg --print-architecture' - ansible.builtin.command: dpkg --print-architecture - register: docker_engine__deb_architecture - changed_when: false - -- name: Save result of 'lsb_release -cs' - ansible.builtin.command: lsb_release -cs - register: docker_engine__lsb_release_cs - changed_when: false - -- name: Save result of 'lsb_release -is' - ansible.builtin.command: lsb_release -is - register: docker_engine__lsb_release_is - changed_when: false - # echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - name: Add Docker apt repository to source list become: true ansible.builtin.apt_repository: - repo: deb [arch={{ docker_engine__deb_architecture.stdout }} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/{{ docker_engine__lsb_release_is.stdout | lower }} {{ docker_engine__lsb_release_cs.stdout }} stable + repo: deb [arch={{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable filename: docker state: present update_cache: true From d777b1cef82b187cc6cf553dba115b5baf95d60b Mon Sep 17 00:00:00 2001 From: f0reachARR Date: Sat, 10 Aug 2024 23:17:43 +0900 Subject: [PATCH 3/5] Fix CUDA install --- ansible/roles/cuda/vars/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/cuda/vars/main.yaml b/ansible/roles/cuda/vars/main.yaml index ae56156920e..da385ad07d7 100644 --- a/ansible/roles/cuda/vars/main.yaml +++ b/ansible/roles/cuda/vars/main.yaml @@ -1,2 +1,2 @@ --- -cuda__dash_case_cuda_version: '{{ cuda_version | regex_replace("\\.", "-", count=1) }}' +cuda__dash_case_cuda_version: '{{ cuda_version | regex_replace("\\.", "-") }}' From 06145014e5976e493d773424632396ef8566d0c4 Mon Sep 17 00:00:00 2001 From: f0reachARR Date: Sat, 10 Aug 2024 23:20:40 +0900 Subject: [PATCH 4/5] Remove unused --- ansible/playbooks/openadkit.yaml | 48 ------------------- ansible/playbooks/rosdep.yaml | 10 ---- ansible/roles/geographiclib/README.md | 14 ------ .../roles/geographiclib/defaults/main.yaml | 0 ansible/roles/geographiclib/meta/main.yaml | 0 ansible/roles/geographiclib/tasks/main.yaml | 12 ----- 6 files changed, 84 deletions(-) delete mode 100644 ansible/playbooks/openadkit.yaml delete mode 100644 ansible/playbooks/rosdep.yaml delete mode 100644 ansible/roles/geographiclib/README.md delete mode 100644 ansible/roles/geographiclib/defaults/main.yaml delete mode 100644 ansible/roles/geographiclib/meta/main.yaml delete mode 100644 ansible/roles/geographiclib/tasks/main.yaml diff --git a/ansible/playbooks/openadkit.yaml b/ansible/playbooks/openadkit.yaml deleted file mode 100644 index 46a8757229f..00000000000 --- a/ansible/playbooks/openadkit.yaml +++ /dev/null @@ -1,48 +0,0 @@ -- name: Set up source development environments for Autoware Universe - hosts: localhost - connection: local - pre_tasks: - - name: Verify OS - ansible.builtin.fail: - msg: Only Ubuntu 22.04 is supported for this branch. Please refer to https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/source-installation/. - when: ansible_distribution != 'Ubuntu' or ansible_distribution_version != '22.04' - - - name: Print args - ansible.builtin.debug: - msg: - - module: "{{ module }}" - - rosdistro: "{{ rosdistro }}" - - rmw_implementation: "{{ rmw_implementation }}" - - cuda_version: "{{ cuda_version }}" - - cudnn_version: "{{ cudnn_version }}" - - tensorrt_version: "{{ tensorrt_version }}" - roles: - # Autoware base dependencies - - role: autoware.dev_env.rmw_implementation - when: module == 'base' - - role: autoware.dev_env.gdown - 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' - - # Module specific dependencies - - role: autoware.dev_env.geographiclib - when: module == 'perception-localization' or module == 'all' - - role: autoware.dev_env.cuda - 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' - - # Development environment - - role: autoware.dev_env.dev_tools - when: module == 'dev-tools' - - role: autoware.dev_env.ros2_dev_tools - when: module == 'dev-tools' - - # ONNX files and other artifacts - - role: autoware.dev_env.artifacts - when: prompt_download_artifacts == 'y' diff --git a/ansible/playbooks/rosdep.yaml b/ansible/playbooks/rosdep.yaml deleted file mode 100644 index c7c23a245ab..00000000000 --- a/ansible/playbooks/rosdep.yaml +++ /dev/null @@ -1,10 +0,0 @@ -- name: Register rosdep package repositories - hosts: localhost - connection: local - pre_tasks: - - name: Verify OS - ansible.builtin.fail: - msg: Only Ubuntu 22.04 is supported for this branch. Please refer to https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/source-installation/. - when: ansible_distribution != 'Ubuntu' or ansible_distribution_version != '22.04' - roles: - - role: autoware.dev_env.pacmod diff --git a/ansible/roles/geographiclib/README.md b/ansible/roles/geographiclib/README.md deleted file mode 100644 index 8ab94806be3..00000000000 --- a/ansible/roles/geographiclib/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# geographiclib - -## Inputs - -None. - -## Manual Installation - -```bash -sudo apt install geographiclib-tools - -# Add EGM2008 geoid grid to geographiclib -sudo geographiclib-get-geoids egm2008-1 -``` diff --git a/ansible/roles/geographiclib/defaults/main.yaml b/ansible/roles/geographiclib/defaults/main.yaml deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/ansible/roles/geographiclib/meta/main.yaml b/ansible/roles/geographiclib/meta/main.yaml deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/ansible/roles/geographiclib/tasks/main.yaml b/ansible/roles/geographiclib/tasks/main.yaml deleted file mode 100644 index c59e688f538..00000000000 --- a/ansible/roles/geographiclib/tasks/main.yaml +++ /dev/null @@ -1,12 +0,0 @@ -- name: Install geographiclib-tools - become: true - ansible.builtin.apt: - name: geographiclib-tools - state: latest - update_cache: true - -- name: Install egm2008-1 - become: true - ansible.builtin.command: - cmd: geographiclib-get-geoids egm2008-1 - creates: /usr/share/GeographicLib/geoids/egm2008-1.pgm From dc9c5910744db1c278e1cd490482f08eb21b75a0 Mon Sep 17 00:00:00 2001 From: f0reachARR Date: Sat, 10 Aug 2024 23:38:40 +0900 Subject: [PATCH 5/5] Fix --- ansible/roles/cuda/vars/main.yaml | 2 +- .../roles/rmw_implementation/defaults/main.yaml | 2 ++ ansible/roles/rmw_implementation/tasks/main.yaml | 15 +++++---------- ansible/roles/rmw_implementation/vars/main.yaml | 2 ++ ansible/roles/ros2/tasks/main.yaml | 12 +----------- 5 files changed, 11 insertions(+), 22 deletions(-) create mode 100644 ansible/roles/rmw_implementation/vars/main.yaml diff --git a/ansible/roles/cuda/vars/main.yaml b/ansible/roles/cuda/vars/main.yaml index da385ad07d7..a25734446a1 100644 --- a/ansible/roles/cuda/vars/main.yaml +++ b/ansible/roles/cuda/vars/main.yaml @@ -1,2 +1,2 @@ --- -cuda__dash_case_cuda_version: '{{ cuda_version | regex_replace("\\.", "-") }}' +cuda__dash_case_cuda_version: '{{ cuda_version | regex_replace("\.", "-") }}' diff --git a/ansible/roles/rmw_implementation/defaults/main.yaml b/ansible/roles/rmw_implementation/defaults/main.yaml index e69de29bb2d..76868fa481f 100644 --- a/ansible/roles/rmw_implementation/defaults/main.yaml +++ b/ansible/roles/rmw_implementation/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +rmw_implementation: rmw_cyclonedds_cpp diff --git a/ansible/roles/rmw_implementation/tasks/main.yaml b/ansible/roles/rmw_implementation/tasks/main.yaml index e7f23557a0f..0599fcd6749 100644 --- a/ansible/roles/rmw_implementation/tasks/main.yaml +++ b/ansible/roles/rmw_implementation/tasks/main.yaml @@ -1,26 +1,21 @@ -- name: Get dash-case name of rmw_implementation - ansible.builtin.shell: bash -c 'sed -e "s/_/-/g" <<< $(echo {{ rmw_implementation }})' - register: rmw_implementation__dash_case_rmw_implementation - changed_when: false - -- name: Hold check of ros-{{ rosdistro + '-' + rmw_implementation__dash_case_rmw_implementation.stdout }} +- name: Hold check of {{ rmw_implementation__package_name }} ansible.builtin.command: apt-mark showhold register: held_ros_packages changed_when: false -- name: Install ros-{{ rosdistro + '-' + rmw_implementation__dash_case_rmw_implementation.stdout }} +- name: Install {{ rmw_implementation__package_name }} become: true ansible.builtin.apt: - name: ros-{{ rosdistro }}-{{ rmw_implementation__dash_case_rmw_implementation.stdout }} + name: "{{ rmw_implementation__package_name }}" state: latest update_cache: true - when: "'ros-' + rosdistro + '-' + rmw_implementation__dash_case_rmw_implementation.stdout not in held_ros_packages.stdout" + when: "rmw_implementation__package_name not in held_ros_packages.stdout" register: install_result failed_when: false - name: Display warning if ROS 2 RMW package is held ansible.builtin.debug: - msg: ROS 2 RMW package 'ros-{{ rosdistro + '-' + rmw_implementation__dash_case_rmw_implementation.stdout }}' is apt-mark hold. Skipping installation. + msg: ROS 2 RMW package '{{ rmw_implementation__package_name }}' is apt-mark hold. Skipping installation. when: not install_result.changed - name: Add RMW_IMPLEMENTATION to .bashrc diff --git a/ansible/roles/rmw_implementation/vars/main.yaml b/ansible/roles/rmw_implementation/vars/main.yaml new file mode 100644 index 00000000000..1f0957d932f --- /dev/null +++ b/ansible/roles/rmw_implementation/vars/main.yaml @@ -0,0 +1,2 @@ +--- +rmw_implementation__package_name: 'ros-{{ rosdistro }}-{{ rmw_implementation | regex_replace("_", "-") }}' diff --git a/ansible/roles/ros2/tasks/main.yaml b/ansible/roles/ros2/tasks/main.yaml index beeb4cef6b2..6cb7559c995 100644 --- a/ansible/roles/ros2/tasks/main.yaml +++ b/ansible/roles/ros2/tasks/main.yaml @@ -15,21 +15,11 @@ dest: /usr/share/keyrings/ros-archive-keyring.gpg mode: 644 -- name: Save result of 'dpkg --print-architecture' - ansible.builtin.command: dpkg --print-architecture - register: ros2__deb_architecture - changed_when: false - -- name: Save result of 'source /etc/os-release && echo $UBUNTU_CODENAME' - ansible.builtin.shell: bash -c 'source /etc/os-release && echo $UBUNTU_CODENAME' - register: ros2__ubuntu_codename - changed_when: false - # echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null - name: Add ROS 2 apt repository to source list become: true ansible.builtin.apt_repository: - repo: deb [arch={{ ros2__deb_architecture.stdout }} signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu {{ ros2__ubuntu_codename.stdout }} main + repo: deb [arch={{ 'arm64' if ansible_architecture == 'aarch64' else 'amd64' }} signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu {{ ansible_distribution_release }} main filename: ros2 state: present update_cache: true