Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 11, 2024
1 parent 37b8059 commit ac99c60
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ docker-bake.hcl
*.lint
*.lock
*.log
*.out
*.out
2 changes: 1 addition & 1 deletion .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ runs:
latest=false
prefix=${{ inputs.tag-prefix }}
suffix=${{ inputs.tag-suffix }}
- name: Docker meta for monorun
id: meta-monorun
uses: docker/metadata-action@v4
Expand Down
4 changes: 2 additions & 2 deletions ansible/playbooks/openadk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
when: (module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y'
- role: autoware.dev_env.pacmod
when: module == 'planning-control' or module == 'perception-localization' or module == 'all'

# ONNX files and other artifacts
- role: autoware.dev_env.artifacts
when: (module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y'

# Development environment
- role: autoware.dev_env.devel
when: install_devel == 'true'
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/cuda/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
state: present
create: true
mode: 0644

- name: Create Vulkan directory
become: true
ansible.builtin.file:
Expand Down Expand Up @@ -133,7 +133,7 @@
path: "/etc/OpenCL/vendors/nvidia.icd"
state: "touch"
mode: "0644"

- name: Set permissions for OpenCL GPU vendors
become: true
ansible.builtin.lineinfile:
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/kisak_mesa/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Kisak Mesa Fix for Ubuntu 22.04 for Rviz2

https://github.com/ros2/rviz/issues/948
<https://github.com/ros2/rviz/issues/948>
4 changes: 2 additions & 2 deletions ansible/roles/kisak_mesa/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- name: Install Mesa libraries
become: true
ansible.builtin.apt:
name:
name:
- libegl-mesa0
- libegl1-mesa-dev
- libgbm-dev
Expand All @@ -21,4 +21,4 @@
- libgl1-mesa-dri
- libglapi-mesa
- libglx-mesa0
state: present
state: present
60 changes: 31 additions & 29 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ You can use `run.sh` to run the Autoware runtime container with the map data:
```bash
./docker/run.sh --map-path path_to_map_data
```

**Note**: You can use `--no-nvidia` to run without NVIDIA GPU support, and `--headless` to run without display that means no RViz visualization.

For more launch options you can edit the launch command `--launch-cmd`:
Expand All @@ -47,42 +48,43 @@ For more launch options you can edit the launch command `--launch-cmd`:
```bash
./docker/run.sh --devel
```

**Note**: By default workspace mounted on the container will be current directory, you can change the workspace path by `--workspace path_to_workspace`. For development environments without NVIDIA GPU support use `--no-nvidia`.

#### Using VS Code Remote Containers for Development

Get the Visual Studio Code's [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension.
Refer to [this document](https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user) for more details.

```json
// .devcontainer/devcontainer.json
{
"name": "Autoware",
"build": {
"dockerfile": "Dockerfile"
},
"remoteUser": "autoware",
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
}
}
```

```docker
# .devcontainer/Dockerfile
FROM ghcr.io/autowarefoundation/autoware-universe:latest
ARG USERNAME=autoware
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
```
```json
// .devcontainer/devcontainer.json
{
"name": "Autoware",
"build": {
"dockerfile": "Dockerfile"
},
"remoteUser": "autoware",
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
}
}
```

```docker
# .devcontainer/Dockerfile
FROM ghcr.io/autowarefoundation/autoware-universe:latest
ARG USERNAME=autoware
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
```

## Building Docker images from scratch

Expand Down
6 changes: 3 additions & 3 deletions docker/autoware-openadk/etc/dev_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ GROUP_NAME=${LOCAL_GROUP}
echo "Starting with user: $USER_NAME >> UID $USER_ID, GID: $GROUP_ID"

# Create group and user with GID/UID
groupadd -g $GROUP_ID $GROUP_NAME
groupadd -g $GROUP_ID $GROUP_NAME
useradd -u $USER_ID -g $GROUP_ID -s /bin/bash -m -d /home/$USER_NAME $USER_NAME

# Add sudo privileges to the user
echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers

# Source ROS2
source /opt/ros/humble/setup.bash

# Execute the command as the user
exec /usr/sbin/gosu $USER_NAME "$@"
exec /usr/sbin/gosu $USER_NAME "$@"
2 changes: 1 addition & 1 deletion docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ set_build_options
set_platform
set_arch_lib_dir
load_env
build_images
build_images
6 changes: 3 additions & 3 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ main() {

# Launch Autoware with custom map
docker run -it --rm --net=host ${GPU_FLAG} ${USER_ID} ${MOUNT_X} \
${WORKSPACE} ${MAP} ${IMAGE} \
${LAUNCH_CMD}
${WORKSPACE} ${MAP} ${IMAGE} \
${LAUNCH_CMD}
}

# Execute the main script
main "$@"
main "$@"

0 comments on commit ac99c60

Please sign in to comment.