Skip to content

Commit 66f2552

Browse files
committed
Add two flavors for VS containers
Signed-off-by: oguzkaganozt <oguzkaganozt@gmail.com>
1 parent 70d844e commit 66f2552

File tree

6 files changed

+66
-12
lines changed

6 files changed

+66
-12
lines changed
File renamed without changes.

.devcontainer/base/devcontainer.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "Autoware",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"remoteUser": "autoware",
7+
"hostRequirements": {
8+
"gpu": true
9+
},
10+
"runArgs": [
11+
"--cap-add=SYS_PTRACE",
12+
"--security-opt",
13+
"seccomp=unconfined",
14+
"--net=host",
15+
"--volume=/etc/localtime:/etc/localtime:ro"
16+
],
17+
"customizations": {
18+
"vscode": {
19+
"settings.json": {
20+
"terminal.integrated.profiles.linux": { "bash": { "path": "/bin/bash" } }
21+
}
22+
}
23+
}
24+
}

.devcontainer/cuda/Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM ghcr.io/autowarefoundation/autoware-openadk:latest-devel-cuda
2+
3+
ENV SHELL /bin/bash
4+
5+
ARG USERNAME=autoware
6+
ARG USER_UID=1000
7+
ARG USER_GID=$USER_UID
8+
9+
RUN groupadd --gid $USER_GID $USERNAME \
10+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
11+
&& apt-get update \
12+
&& apt-get install -y sudo \
13+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
14+
&& chmod 0440 /etc/sudoers.d/$USERNAME

.devcontainer/devcontainer.json .devcontainer/cuda/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Autoware",
2+
"name": "Autoware-cuda",
33
"build": {
44
"dockerfile": "Dockerfile"
55
},

ansible/playbooks/openadk.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- name: Verify OS
66
ansible.builtin.fail:
77
msg: Only Ubuntu 22.04 is supported for this branch. Please refer to https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/source-installation/.
8-
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version != '22.04'
8+
when: ansible_distribution != 'Ubuntu' or ansible_distribution_version != '22.04'
99

1010
- name: Print args
1111
ansible.builtin.debug:

docker/README.md

+26-10
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To install without **NVIDIA GPU** support:
3333

3434
## Usage
3535

36-
### Runtime Setup
36+
### Runtime
3737

3838
You can use `run.sh` to run the Autoware runtime container with the map data:
3939

@@ -59,7 +59,7 @@ Inside the container, you can run the Autoware simulation by following these tut
5959

6060
[Rosbag Replay Simulation](../../tutorials/ad-hoc-simulation/rosbag-replay-simulation.md).
6161

62-
### Development Setup
62+
### Development Environment
6363

6464
You can use [VS Code Remote Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) to develop Autoware in the containerized environment with ease. Or you can use `run.sh` manually to run the Autoware development container with the workspace mounted.
6565

@@ -68,18 +68,34 @@ You can use [VS Code Remote Containers](https://marketplace.visualstudio.com/ite
6868
Get the Visual Studio Code's [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension.
6969
And reopen the workspace in the container by selecting `Remote-Containers: Reopen in Container` from the Command Palette (`F1`).
7070

71-
By default devcontainer assumes NVIDIA GPU support, you can change this by deleting these lines within `.devcontainer/devcontainer.json`:
71+
Autoware and Autoware-cuda are available containers for development.
7272

73-
```json
74-
"hostRequirements": {
75-
"gpu": true
76-
},
77-
```
73+
If you want to use CUDA supported dev container, you need to install the NVIDIA Container Toolkit before opening the workspace in the container:
74+
75+
```bash
76+
# Add NVIDIA container toolkit GPG key
77+
sudo apt-key adv --fetch-keys https://nvidia.github.io/libnvidia-container/gpgkey
78+
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg --import /etc/apt/trusted.gpg
79+
80+
# Add NVIDIA container toolkit repository
81+
echo "deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://nvidia.github.io/libnvidia-container/stable/deb/$(dpkg --print-architecture) /" | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
82+
83+
# Update the package list
84+
sudo apt-get update
7885

79-
```json
80-
"--gpus", "all"
86+
# Install NVIDIA Container Toolkit
87+
sudo apt-get install -y nvidia-container-toolkit
88+
89+
# Add NVIDIA runtime support to docker engine
90+
sudo nvidia-ctk runtime configure --runtime=docker
91+
92+
# Restart docker daemon
93+
sudo systemctl restart docker
8194
```
8295

96+
Then, you can use the `Remote-Containers: Reopen in Container` command to open the workspace in the container.
97+
98+
8399
#### Using `run.sh` for Development
84100

85101
```bash

0 commit comments

Comments
 (0)