Skip to content

Commit

Permalink
refactor(ansible): rename some variables to conform new lint rules (#…
Browse files Browse the repository at this point in the history
…3988)

Signed-off-by: M. Fatih Cırıt <[email protected]>
  • Loading branch information
xmfcx authored Nov 16, 2023
1 parent d3cd823 commit 439c8cd
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/update-tool-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:

- name: Update clang-format version
run: |
sd '(clang_format_version): .*' '$1: ${{ steps.get-clang-format-version.outputs.version }}' ansible/roles/pre_commit/defaults/main.yaml
sd '(clang_format_version)=.*' '$1=${{ steps.get-clang-format-version.outputs.version }}' ansible/roles/pre_commit/README.md
sd '(pre_commit_clang_format_version): .*' '$1: ${{ steps.get-clang-format-version.outputs.version }}' ansible/roles/pre_commit/defaults/main.yaml
sd '(pre_commit_clang_format_version)=.*' '$1=${{ steps.get-clang-format-version.outputs.version }}' ansible/roles/pre_commit/README.md
- name: Create PR
id: create-pr
Expand Down
2 changes: 1 addition & 1 deletion ansible/playbooks/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
when: prompt_install_nvidia != 'y'
roles:
- role: autoware.dev_env.cuda
when: prompt_install_nvidia == 'y' and install_devel == 'true'
when: prompt_install_nvidia == 'y' and tensorrt_install_devel == 'true'
- role: autoware.dev_env.docker_engine
- role: autoware.dev_env.nvidia_docker
- role: autoware.dev_env.rocker
6 changes: 3 additions & 3 deletions ansible/playbooks/universe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@
# Core
- role: autoware.dev_env.autoware_core
- role: autoware.dev_env.ccache
when: install_devel == 'true'
when: tensorrt_install_devel == 'true'
- role: autoware.dev_env.plotjuggler
- role: autoware.dev_env.pre_commit
when: install_devel == 'true'
when: tensorrt_install_devel == 'true'
- role: autoware.dev_env.ros2
- role: autoware.dev_env.ros2_dev_tools
- role: autoware.dev_env.rmw_implementation

# Universe
- role: autoware.dev_env.autoware_universe
- role: autoware.dev_env.cuda
when: prompt_install_nvidia == 'y' and install_devel == 'true'
when: prompt_install_nvidia == 'y' and tensorrt_install_devel == 'true'
- role: autoware.dev_env.pacmod
when: rosdistro != 'rolling'
- role: autoware.dev_env.tensorrt
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/cuda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This role installs [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) fol
| Name | Required | Description |
| -------------------- | -------- | -------------------------------- |
| cuda_version | true | The version of CUDA Toolkit. |
| install_cuda_drivers | false | Whether to install cuda-drivers. |
| cuda_install_drivers | false | Whether to install cuda-drivers. |

## Manual Installation

Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/cuda/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
install_cuda_drivers: true
cuda_install_drivers: true
2 changes: 1 addition & 1 deletion ansible/roles/cuda/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
name:
- cuda-drivers
update_cache: true
when: install_cuda_drivers | bool
when: cuda_install_drivers | bool

- name: Add PATH to .bashrc
ansible.builtin.lineinfile:
Expand Down
12 changes: 6 additions & 6 deletions ansible/roles/pre_commit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ This role installs dependent tools for [pre-commit](https://pre-commit.com/).

## Inputs

| Name | Required | Description |
| -------------------- | -------- | --------------------------- |
| clang_format_version | false | The version of ClangFormat. |
| Name | Required | Description |
| ------------------------------- | -------- | --------------------------- |
| pre_commit_clang_format_version | false | The version of ClangFormat. |

## Manual Installation

The `clang_format_version` variable can also be found in:
The `pre_commit_clang_format_version` variable can also be found in:
[./defaults/main.yaml](./defaults/main.yaml)

```bash
clang_format_version=17.0.4
pip3 install pre-commit clang-format==${clang_format_version}
pre_commit_clang_format_version=17.0.4
pip3 install pre-commit clang-format==${pre_commit_clang_format_version}

sudo apt install golang
```
2 changes: 1 addition & 1 deletion ansible/roles/pre_commit/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
clang_format_version: 17.0.4
pre_commit_clang_format_version: 17.0.4
2 changes: 1 addition & 1 deletion ansible/roles/pre_commit/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- name: Install clang-format
ansible.builtin.pip:
name: clang-format
version: "{{ clang_format_version }}"
version: "{{ pre_commit_clang_format_version }}"
executable: pip3

- name: Install Go
Expand Down
14 changes: 7 additions & 7 deletions ansible/roles/ros2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ $ apt-cache policy | grep universe

## Inputs

| Name | Required | Description |
| ----------------- | -------- | ------------------------------------------------ |
| rosdistro | true | The ROS distro. |
| installation_type | false | The installation type (`desktop` or `ros-base`). |
| Name | Required | Description |
| ---------------------- | -------- | ------------------------------------------------ |
| rosdistro | true | The ROS distro. |
| ros2_installation_type | false | The installation type (`desktop` or `ros-base`). |

## Manual Installation

The `installation_type` variable can also be found in:
The `ros2_installation_type` variable can also be found in:
[./defaults/main.yaml](./defaults/main.yaml)

For Universe, the `rosdistro` variable can also be found in:
Expand Down Expand Up @@ -57,8 +57,8 @@ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-a
sudo apt update

# Desktop Install
installation_type=desktop
sudo apt install ros-${rosdistro}-${installation_type}
ros2_installation_type=desktop
sudo apt install ros-${rosdistro}-${ros2_installation_type}

# Environment setup
# (Optional) You can source ros2 in the ~/.bashrc file.
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/ros2/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
installation_type: desktop
ros2_installation_type: desktop
4 changes: 2 additions & 2 deletions ansible/roles/ros2/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
state: present
update_cache: true

- name: Install ros-{{ rosdistro + '-' + installation_type }}
- name: Install ros-{{ rosdistro + '-' + ros2_installation_type }}
become: true
ansible.builtin.apt:
name: ros-{{ rosdistro }}-{{ installation_type }}
name: ros-{{ rosdistro }}-{{ ros2_installation_type }}
state: latest
update_cache: true

Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/tensorrt/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
install_devel: true
tensorrt_install_devel: true
4 changes: 2 additions & 2 deletions ansible/roles/tensorrt/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
allow_change_held_packages: true
allow_downgrade: true
update_cache: true
when: install_devel | bool
when: tensorrt_install_devel | bool

# apt-mark hold
- name: Prevent CUDA-related packages from upgrading
Expand All @@ -49,4 +49,4 @@
- libnvinfer-plugin-dev
- libnvparsers-dev
- libnvonnxparsers-dev
when: install_devel | bool
when: tensorrt_install_devel | bool
8 changes: 4 additions & 4 deletions setup-dev-env.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Set up development environment for Autoware Core/Universe.
# Usage: setup-dev-env.sh <installation_type('core' or 'universe')> [-y] [-v] [--no-nvidia]
# Usage: setup-dev-env.sh <ros2_installation_type('core' or 'universe')> [-y] [-v] [--no-nvidia]
# Note: -y option is only for CI.

set -e
Expand Down Expand Up @@ -90,11 +90,11 @@ fi

# Check installation of dev package
if [ "$option_runtime" = "true" ]; then
ansible_args+=("--extra-vars" "install_devel=false")
ansible_args+=("--extra-vars" "tensorrt_install_devel=false")
# ROS installation type, default "desktop"
ansible_args+=("--extra-vars" "installation_type=ros-base")
ansible_args+=("--extra-vars" "ros2_installation_type=ros-base")
else
ansible_args+=("--extra-vars" "install_devel=true")
ansible_args+=("--extra-vars" "tensorrt_install_devel=true")
fi

ansible_args+=("--extra-vars" "data_dir=$option_data_dir")
Expand Down

0 comments on commit 439c8cd

Please sign in to comment.