From ac99c60ad8bf0c934aa2dabc10ec8769110a7f7e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 11 Jan 2024 12:15:51 +0000 Subject: [PATCH] style(pre-commit): autofix --- .dockerignore | 2 +- .../actions/docker-build-and-push/action.yaml | 2 +- ansible/playbooks/openadk.yaml | 4 +- ansible/roles/cuda/tasks/main.yaml | 4 +- ansible/roles/kisak_mesa/README.md | 2 +- ansible/roles/kisak_mesa/tasks/main.yaml | 4 +- docker/README.md | 60 ++++++++++--------- docker/autoware-openadk/etc/dev_entrypoint.sh | 6 +- docker/build.sh | 2 +- docker/run.sh | 6 +- 10 files changed, 47 insertions(+), 45 deletions(-) diff --git a/.dockerignore b/.dockerignore index 543f467324a..8ae6e191434 100644 --- a/.dockerignore +++ b/.dockerignore @@ -14,4 +14,4 @@ docker-bake.hcl *.lint *.lock *.log -*.out \ No newline at end of file +*.out diff --git a/.github/actions/docker-build-and-push/action.yaml b/.github/actions/docker-build-and-push/action.yaml index 1cab1b86436..330590c70ad 100644 --- a/.github/actions/docker-build-and-push/action.yaml +++ b/.github/actions/docker-build-and-push/action.yaml @@ -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 diff --git a/ansible/playbooks/openadk.yaml b/ansible/playbooks/openadk.yaml index 70ca303f505..ab26d1f696f 100644 --- a/ansible/playbooks/openadk.yaml +++ b/ansible/playbooks/openadk.yaml @@ -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' diff --git a/ansible/roles/cuda/tasks/main.yaml b/ansible/roles/cuda/tasks/main.yaml index e697acd22fb..656810b0e38 100644 --- a/ansible/roles/cuda/tasks/main.yaml +++ b/ansible/roles/cuda/tasks/main.yaml @@ -79,7 +79,7 @@ state: present create: true mode: 0644 - + - name: Create Vulkan directory become: true ansible.builtin.file: @@ -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: diff --git a/ansible/roles/kisak_mesa/README.md b/ansible/roles/kisak_mesa/README.md index 46d8b912f89..937de6afa36 100644 --- a/ansible/roles/kisak_mesa/README.md +++ b/ansible/roles/kisak_mesa/README.md @@ -1,3 +1,3 @@ # Kisak Mesa Fix for Ubuntu 22.04 for Rviz2 -https://github.com/ros2/rviz/issues/948 + diff --git a/ansible/roles/kisak_mesa/tasks/main.yaml b/ansible/roles/kisak_mesa/tasks/main.yaml index badd643655f..910c6f38b62 100644 --- a/ansible/roles/kisak_mesa/tasks/main.yaml +++ b/ansible/roles/kisak_mesa/tasks/main.yaml @@ -12,7 +12,7 @@ - name: Install Mesa libraries become: true ansible.builtin.apt: - name: + name: - libegl-mesa0 - libegl1-mesa-dev - libgbm-dev @@ -21,4 +21,4 @@ - libgl1-mesa-dri - libglapi-mesa - libglx-mesa0 - state: present \ No newline at end of file + state: present diff --git a/docker/README.md b/docker/README.md index 375d11412b8..21dc1e5916e 100644 --- a/docker/README.md +++ b/docker/README.md @@ -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`: @@ -47,6 +48,7 @@ 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 @@ -54,35 +56,35 @@ For more launch options you can edit the launch command `--launch-cmd`: 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 diff --git a/docker/autoware-openadk/etc/dev_entrypoint.sh b/docker/autoware-openadk/etc/dev_entrypoint.sh index 263698e2078..396ab49107d 100644 --- a/docker/autoware-openadk/etc/dev_entrypoint.sh +++ b/docker/autoware-openadk/etc/dev_entrypoint.sh @@ -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 "$@" \ No newline at end of file +exec /usr/sbin/gosu $USER_NAME "$@" diff --git a/docker/build.sh b/docker/build.sh index 72e703233a1..a2a870d306b 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -127,4 +127,4 @@ set_build_options set_platform set_arch_lib_dir load_env -build_images \ No newline at end of file +build_images diff --git a/docker/run.sh b/docker/run.sh index c55cbbd25ef..b5e49f57dce 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -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 "$@" \ No newline at end of file +main "$@"