Skip to content

Commit

Permalink
docs(ansible): add manual installation steps (autowarefoundation#141)
Browse files Browse the repository at this point in the history
* docs(ansible): add manual installation steps

Signed-off-by: M. Fatih Cırıt <[email protected]>

* ci(pre-commit): autofix

* add one more line

Signed-off-by: M. Fatih Cırıt <[email protected]>

* fix wording

Signed-off-by: M. Fatih Cırıt <[email protected]>

* add cspell ignore

Signed-off-by: M. Fatih Cırıt <[email protected]>

* make links relative

Signed-off-by: M. Fatih Cırıt <[email protected]>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
xmfcx and pre-commit-ci[bot] authored Apr 1, 2022
1 parent fd678c3 commit 545673a
Show file tree
Hide file tree
Showing 10 changed files with 310 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ansible/roles/autoware_core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ This role installs development/runtime dependencies for Autoware Core.
## Inputs

None.

## Manual Installation

```bash
# Install gdown to download files from CMakeLists.txt
pip3 install gdown
```
9 changes: 9 additions & 0 deletions ansible/roles/autoware_universe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@ This role installs development/runtime dependencies for Autoware Universe.
## Inputs

None.

## Manual Installation

```bash
sudo apt install geographiclib-tools

# Add EGM2008 geoid grid to geographiclib
sudo geographiclib-get-geoids egm2008-1
```
27 changes: 27 additions & 0 deletions ansible/roles/cuda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,30 @@ This role installs [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) fol
| Name | Required | Description |
| ------------ | -------- | ---------------------------- |
| cuda_version | true | The version of CUDA Toolkit. |

## Manual Installation

Follow these instructions to download and install the CUDA Toolkit and the corresponding NVIDIA Driver for Ubuntu 20.04.

For Universe, the `cuda_version` version can also be found in:
[../../playbooks/universe.yaml](../../playbooks/universe.yaml)

```bash
# Modified from:
# https://developer.nvidia.com/cuda-11-4-4-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_network
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt-get update
cuda_version=11-4
sudo apt install cuda-${cuda_version} --no-install-recommends
```

Perform the post installation actions:

```bash
# Taken from: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions
echo 'export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}' >> ~/.bashrc
```
125 changes: 125 additions & 0 deletions ansible/roles/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,128 @@ Also, it installs some additional tools:
| Name | Required | Description |
| ---------------------- | -------- | ------------------------------ |
| docker_compose_version | false | The version of Docker Compose. |

## Manual Installation

Install Docker Engine and perform the post-installation steps:

```bash
# Taken from: https://docs.docker.com/engine/install/ubuntu/
# And: https://docs.docker.com/engine/install/linux-postinstall/

# Uninstall old versions
sudo apt-get remove docker docker-engine docker.io containerd runc

# Install using the repository
sudo apt-get update

sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release

# Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

# Install Docker Engine
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

# Verify that Docker Engine is installed correctly by running the hello-world image.
sudo docker run hello-world
# Note: This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.

# Post-installation steps for Linux

# Create the docker group.
sudo groupadd docker

# Add your user to the docker group.
sudo usermod -aG docker $USER

# Log out and log back in so that your group membership is re-evaluated.

# Verify that you can run docker commands without sudo
docker run hello-world
# Note: This command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.
```

Install Nvidia Container Toolkit:

<!-- cspell:ignore Disp, Uncorr -->

```bash
# Taken from https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#setting-up-nvidia-container-toolkit

# Setup the package repository and the GPG key:
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -s -L https://nvidia.github.io/libnvidia-container/gpgkey | sudo apt-key add - \
&& curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

# Install the nvidia-docker2 package (and dependencies) after updating the package listing:
sudo apt-get update
sudo apt-get install -y nvidia-docker2

# Restart the Docker daemon to complete the installation after setting the default runtime:
sudo systemctl restart docker

# At this point, a working setup can be tested by running a base CUDA container:
sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

# This should result in a console output shown below:
# +-----------------------------------------------------------------------------+
# | NVIDIA-SMI 450.51.06 Driver Version: 450.51.06 CUDA Version: 11.0 |
# |-------------------------------+----------------------+----------------------+
# | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
# | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
# | | | MIG M. |
# |===============================+======================+======================|
# | 0 Tesla T4 On | 00000000:00:1E.0 Off | 0 |
# | N/A 34C P8 9W / 70W | 0MiB / 15109MiB | 0% Default |
# | | | N/A |
# +-------------------------------+----------------------+----------------------+
#
# +-----------------------------------------------------------------------------+
# | Processes: |
# | GPU GI CI PID Type Process name GPU Memory |
# | ID ID Usage |
# |=============================================================================|
# | No running processes found |
# +-----------------------------------------------------------------------------+
```

Install Docker Compose:

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

```bash
# Modified from: https://docs.docker.com/compose/cli-command/#install-on-linux

# Run this command to download the Docker Compose:
docker_compose_version=v2.2.2
sudo curl -SL https://github.com/docker/compose/releases/download/${docker_compose_version}/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose

# Apply executable permissions to the binary:
sudo chmod +x /usr/local/bin/docker-compose

# Test the installation.
docker-compose --version
```

Install rocker:

```bash
# Taken from: https://github.com/osrf/rocker#installation

# Add the ROS 2 apt repository to your system. First authorize our GPG key with apt.
sudo apt update && sudo apt install curl gnupg lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

# Then add the repository to your sources list.
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

sudo apt update
sudo apt-get install python3-rocker
```
14 changes: 14 additions & 0 deletions ansible/roles/pacmod/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,17 @@ This role sets up the prerequisites to install pacmod3_msgs following [this page
| Name | Required | Description |
| --------- | -------- | --------------- |
| rosdistro | true | The ROS distro. |

## Manual Installation

For Universe, the `rosdistro` variable can also be found in:
[../../playbooks/universe.yaml](../../playbooks/universe.yaml)

```bash
# Taken from https://github.com/astuff/pacmod3#installation
sudo apt install apt-transport-https
sudo sh -c 'echo "deb [trusted=yes] https://s3.amazonaws.com/autonomoustuff-repo/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/autonomoustuff-public.list'
sudo apt update
rosdistro=galactic
sudo apt install ros-${rosdistro}-pacmod3
```
14 changes: 14 additions & 0 deletions ansible/roles/pre_commit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,17 @@ This role installs dependent tools for [pre-commit](https://pre-commit.com/).
| Name | Required | Description |
| -------------------- | -------- | --------------------------- |
| clang_format_version | false | The version of ClangFormat. |

## Manual Installation

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

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

# Install Golang (Add Go PPA for shfmt)
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt install golang
```
17 changes: 17 additions & 0 deletions ansible/roles/rmw_implementation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,20 @@ This role sets up ROS 2 RMW implementation following [this page](https://docs.ro
| ------------------ | -------- | ------------------- |
| rosdistro | true | The ROS distro. |
| rmw_implementation | true | RMW implementation. |

## Manual Installation

For Universe, the `rosdistro` and `rmw_implementation` variable can also be found in:
[../../playbooks/universe.yaml](../../playbooks/universe.yaml)

```bash
# For details: https://docs.ros.org/en/galactic/How-To-Guides/Working-with-multiple-RMW-implementations.html
sudo apt update
rosdistro=galactic
rmw_implementation=rmw_cyclonedds_cpp
rmw_implementation_dashed=$(eval sed -e "s/_/-/g" <<< "${rmw_implementation}")
sudo apt install ros-${rosdistro}-${rmw_implementation_dashed}

# (Optional) You set the default RMW implementation in the ~/.bashrc file.
echo '' >> ~/.bashrc && echo "export RMW_IMPLEMENTATION=${rmw_implementation}" >> ~/.bashrc
```
43 changes: 43 additions & 0 deletions ansible/roles/ros2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,46 @@ $ apt-cache policy | grep universe
| ----------------- | -------- | ------------------------------------------------ |
| rosdistro | true | The ROS distro. |
| installation_type | false | The installation type (`desktop` or `ros-base`). |

## Manual Installation

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

For Universe, the `rosdistro` variable can also be found in:
[../../playbooks/universe.yaml](../../playbooks/universe.yaml)

```bash
# Taken from: https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html

# You will need to add the ROS 2 apt repository to your system. First, make sure that the Ubuntu Universe repository is enabled by checking the output of this command.
apt-cache policy | grep universe

# The output of the above command should contain following:

# 500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
# release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=universe,b=amd64

# If you don’t see an output line like the one above, then enable the Universe repository with these instructions.
sudo apt install software-properties-common
sudo add-apt-repository universe

# Now add the ROS 2 apt repository to your system. First authorize our GPG key with apt.
sudo apt update && sudo apt install curl gnupg lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg

# Then add the repository to your sources list.
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

# Update your apt repository caches after setting up the repositories.
sudo apt update

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

# Environment setup
# (Optional) You can source ros2 in the ~/.bashrc file.
echo '' >> ~/.bashrc && echo "source /opt/ros/${rosdistro}/setup.bash" >> ~/.bashrc
```
37 changes: 37 additions & 0 deletions ansible/roles/ros2_dev_tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,40 @@ This role installs ROS 2 development tools following [this page](https://docs.ro
## Inputs

None.

## Manual Installation

```bash
# Taken from https://docs.ros.org/en/galactic/Installation/Ubuntu-Development-Setup.html
sudo apt update && sudo apt install -y \
build-essential \
cmake \
git \
python3-colcon-common-extensions \
python3-flake8 \
python3-pip \
python3-pytest-cov \
python3-rosdep \
python3-setuptools \
python3-vcstool \
wget

# Install some pip packages needed for testing
python3 -m pip install -U \
flake8-blind-except \
flake8-builtins \
flake8-class-newline \
flake8-comprehensions \
flake8-deprecated \
flake8-docstrings \
flake8-import-order \
flake8-quotes \
pytest-repeat \
pytest-rerunfailures \
pytest \
setuptools

# Initialize rosdep
sudo rosdep init
rosdep update
```
17 changes: 17 additions & 0 deletions ansible/roles/tensorrt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,20 @@ This role installs TensorRT and cuDNN following [this page](https://docs.nvidia.
| ---------------- | -------- | ------------------------ |
| cudnn_version | true | The version of cuDNN. |
| tensorrt_version | true | The version of TensorRT. |

## Manual Installation

For Universe, the `cudnn_version` and `tensorrt_version` variable can also be found in:
[../../playbooks/universe.yaml](../../playbooks/universe.yaml)

```bash
# Taken from: https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing

cudnn_version="8.2.2.26-1+cuda11.4"
sudo apt-get install libcudnn8=${cudnn_version} libcudnn8-dev=${cudnn_version}
sudo apt-mark hold libcudnn8 libcudnn8-dev

tensorrt_version="8.2.2-1+cuda11.4"
sudo apt-get install libnvinfer8=${tensorrt_version} libnvonnxparsers8=${tensorrt_version} libnvparsers8=${tensorrt_version} libnvinfer-plugin8=${tensorrt_version} libnvinfer-dev=${tensorrt_version} libnvonnxparsers-dev=${tensorrt_version} libnvparsers-dev=${tensorrt_version} libnvinfer-plugin-dev=${tensorrt_version} python3-libnvinfer=${tensorrt_version}
sudo apt-mark hold libnvinfer8 libnvonnxparsers8 libnvparsers8 libnvinfer-plugin8 libnvinfer-dev libnvonnxparsers-dev libnvparsers-dev libnvinfer-plugin-dev python3-libnvinfer
```

0 comments on commit 545673a

Please sign in to comment.