diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..fd54fcb6e3c --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,6 @@ +{ + "name": "Autoware", + "image": "ghcr.io/autowarefoundation/autoware-openadk:devel-latest" + + // "remoteUser": "autoware", +} diff --git a/.github/workflows/update-docker-manifest.yaml b/.github/workflows/update-docker-manifest.yaml index a82929bcdeb..a0ad71e70e0 100644 --- a/.github/workflows/update-docker-manifest.yaml +++ b/.github/workflows/update-docker-manifest.yaml @@ -16,35 +16,35 @@ jobs: - name: Check out repository uses: actions/checkout@v4 - - name: Combine multi arch images for 'autoware-universe' + - name: Combine multi arch images for 'autoware-openadk' uses: ./.github/actions/combine-multi-arch-images with: - package-name: autoware-universe + package-name: autoware-openadk - - name: Create alias from 'autoware-universe:{rosdistro}-latest' to 'autoware-universe:latest' + - name: Create alias from 'autoware-openadk:{rosdistro}-latest' to 'autoware-openadk:latest' uses: ./.github/actions/create-main-distro-alias with: - package-name: autoware-universe + package-name: autoware-openadk rosdistro: ${{ needs.load-env.outputs.rosdistro }} tag-name: latest - - name: Create alias from 'autoware-universe:{rosdistro}-latest-prebuilt' to 'autoware-universe:latest-prebuilt' + - name: Create alias from 'autoware-openadk:{rosdistro}-latest-monorun' to 'autoware-openadk:latest-monorun' uses: ./.github/actions/create-main-distro-alias with: - package-name: autoware-universe + package-name: autoware-openadk rosdistro: ${{ needs.load-env.outputs.rosdistro }} - tag-name: latest-prebuilt + tag-name: latest-monorun - - name: Create alias from 'autoware-universe:{rosdistro}-latest-cuda' to 'autoware-universe:latest-cuda' + - name: Create alias from 'autoware-openadk:{rosdistro}-latest-cuda' to 'autoware-openadk:latest-cuda' uses: ./.github/actions/create-main-distro-alias with: - package-name: autoware-universe + package-name: autoware-openadk rosdistro: ${{ needs.load-env.outputs.rosdistro }} tag-name: latest-cuda - - name: Create alias from 'autoware-universe:{rosdistro}-latest-prebuilt-cuda' to 'autoware-universe:latest-prebuilt-cuda' + - name: Create alias from 'autoware-openadk:{rosdistro}-latest-monorun-cuda' to 'autoware-openadk:latest-monorun-cuda' uses: ./.github/actions/create-main-distro-alias with: - package-name: autoware-universe + package-name: autoware-openadk rosdistro: ${{ needs.load-env.outputs.rosdistro }} - tag-name: latest-prebuilt-cuda + tag-name: latest-monorun-cuda diff --git a/ansible/playbooks/openadk.yaml b/ansible/playbooks/openadk.yaml index ab26d1f696f..1f8a64a43c7 100644 --- a/ansible/playbooks/openadk.yaml +++ b/ansible/playbooks/openadk.yaml @@ -37,8 +37,8 @@ # ONNX files and other artifacts - role: autoware.dev_env.artifacts - when: (module == 'perception-localization' or module == 'all') and prompt_install_nvidia=='y' - + when: module == 'perception-localization' or module == 'all' + # Development environment - role: autoware.dev_env.devel when: install_devel == 'true' diff --git a/ansible/roles/devel/README.md b/ansible/roles/devel/README.md index 5077b31257a..17fb5e1931e 100644 --- a/ansible/roles/devel/README.md +++ b/ansible/roles/devel/README.md @@ -1,4 +1,4 @@ -# autoware_core +# devel This role installs development dependencies for Autoware. diff --git a/ansible/roles/gdown/README.md b/ansible/roles/gdown/README.md index a834adb9e79..4d5e1e5dbab 100644 --- a/ansible/roles/gdown/README.md +++ b/ansible/roles/gdown/README.md @@ -1,6 +1,6 @@ -# autoware_core +# Role: gdown -This role installs development/runtime dependencies for Autoware Core. +This role installs gdown to download files from CMakeLists.txt. ## Inputs diff --git a/ansible/roles/nvidia_docker/tasks/main.yaml b/ansible/roles/nvidia_docker/tasks/main.yaml index 7e7aac2a672..def9b2f2b13 100644 --- a/ansible/roles/nvidia_docker/tasks/main.yaml +++ b/ansible/roles/nvidia_docker/tasks/main.yaml @@ -20,7 +20,7 @@ - nvidia-container-toolkit update_cache: true -- name: Add NVIDIA container toolkit repository +- name: Add NVIDIA runtime support to docker engine ansible.builtin.shell: | sudo nvidia-ctk runtime configure --runtime=docker diff --git a/docker/README.md b/docker/README.md index 21dc1e5916e..6888b894677 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,11 +1,11 @@ # Open AD Kit: Containerized Workloads for the Autoware -Open AD Kit offers two types of Docker image to let you get started with the Autoware quickly: `development` and `monorun`. +Open AD Kit offers two types of Docker image to let you get started with the Autoware quickly: `devel` and `monorun`. -1. The `development` image enables you to develop Autoware without setting up the local development environment. +1. The `devel` image enables you to develop Autoware without setting up the local development environment. 2. The `monorun` image contains only runtime executables and enables you to try out Autoware quickly. -**Note**: Before proceeding, confirm and agree with the [NVIDIA Deep Learning Container license](https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license). By pulling and using the Autoware Universe images, you accept the terms and conditions of the license. +**Note**: Before proceeding, confirm and agree with the [NVIDIA Deep Learning Container license](https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license). By pulling and using the Autoware Open AD Kit images, you accept the terms and conditions of the license. ## Prerequisites @@ -56,36 +56,6 @@ 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 -``` - ## Building Docker images from scratch If you want to build these images locally for development purposes, run the following command: diff --git a/docker/autoware-openadk/Dockerfile b/docker/autoware-openadk/Dockerfile index 1a94fa7d66d..889737189dd 100644 --- a/docker/autoware-openadk/Dockerfile +++ b/docker/autoware-openadk/Dockerfile @@ -124,7 +124,7 @@ RUN --mount=type=ssh \ && find / -name "*.h" -type f -delete \ && find / -name "*.hpp" -type f -delete \ && rm -rf /autoware/src /autoware/ansible /autoware/autoware.repos \ - /root/.local/pipx /opt/ros/humble/include /etc/apt/sources.list.d/cuda*.list \ + /root/.local/pipx /opt/ros/"$ROS_DISTRO"/include /etc/apt/sources.list.d/cuda*.list \ /etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/nvidia-docker.list \ /usr/include /usr/share/doc /usr/lib/gcc /usr/lib/jvm /usr/lib/llvm* diff --git a/docker/autoware-openadk/docker-bake.hcl b/docker/autoware-openadk/docker-bake.hcl index 74f13603e6e..0df8f0422b6 100644 --- a/docker/autoware-openadk/docker-bake.hcl +++ b/docker/autoware-openadk/docker-bake.hcl @@ -15,10 +15,5 @@ target "devel" { target "monorun" { inherits = ["docker-metadata-action-monorun"] dockerfile = "docker/autoware-openadk/Dockerfile" -<<<<<<< HEAD - target = "monolithic" -} -======= target = "monorun" -} ->>>>>>> 5f13c741 (change monolithic to monorun, update readme and run.sh) +} \ No newline at end of file diff --git a/docker/autoware-openadk/etc/dev_entrypoint.sh b/docker/autoware-openadk/etc/dev_entrypoint.sh index 396ab49107d..bd060744d1d 100644 --- a/docker/autoware-openadk/etc/dev_entrypoint.sh +++ b/docker/autoware-openadk/etc/dev_entrypoint.sh @@ -5,17 +5,23 @@ USER_ID=${LOCAL_UID} USER_NAME=${LOCAL_USER} GROUP_ID=${LOCAL_GID} 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 -useradd -u $USER_ID -g $GROUP_ID -s /bin/bash -m -d /home/$USER_NAME $USER_NAME +# Check if any of the variables are empty +if [[ -z $USER_ID || -z $USER_NAME || -z $GROUP_ID || -z $GROUP_NAME ]]; then + exec "$@" +else + echo "Starting with user: $USER_NAME >> UID $USER_ID, GID: $GROUP_ID" -# Add sudo privileges to the user -echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers + # Create group and user with GID/UID + groupadd -g $GROUP_ID $GROUP_NAME + useradd -u $USER_ID -g $GROUP_ID -s /bin/bash -m -d /home/$USER_NAME $USER_NAME -# Source ROS2 -source /opt/ros/humble/setup.bash + # Add sudo privileges to the user + echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers -# Execute the command as the user -exec /usr/sbin/gosu $USER_NAME "$@" + # Source ROS2 + source "/opt/ros/$ROS_DISTRO/setup.bash" + + # Execute the command as the user + exec /usr/sbin/gosu $USER_NAME "$@" +fi diff --git a/docker/autoware-openadk/etc/ros_entrypoint.sh b/docker/autoware-openadk/etc/ros_entrypoint.sh index 9667d6ceb25..e061d9bae78 100644 --- a/docker/autoware-openadk/etc/ros_entrypoint.sh +++ b/docker/autoware-openadk/etc/ros_entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e -source /opt/ros/humble/setup.bash +source "/opt/ros/$ROS_DISTRO/setup.bash" source /autoware/install/setup.bash exec "$@" diff --git a/docker/run.sh b/docker/run.sh index b5e49f57dce..94ab431a407 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -2,6 +2,13 @@ set -e +SCRIPT_DIR=$(readlink -f "$(dirname "$0")") +WORKSPACE_ROOT="$SCRIPT_DIR/../" +source "$WORKSPACE_ROOT/amd64.env" +if [ "$(uname -m)" = "aarch64" ]; then + source "$WORKSPACE_ROOT/arm64.env" +fi + # Function to print help message print_help() { echo "Usage: run.sh [OPTIONS]" @@ -64,7 +71,7 @@ parse_arguments() { # Set image and workspace variables based on options set_variables() { if [ "$option_devel" == "true" ]; then - IMAGE="ghcr.io/autowarefoundation/autoware-openadk:devel-humble-latest" + IMAGE="ghcr.io/autowarefoundation/autoware-openadk:devel-$rosdistro-latest" USER_ID="-e LOCAL_UID=$(id -u) -e LOCAL_GID=$(id -g) -e LOCAL_USER=$(id -un) -e LOCAL_GROUP=$(id -gn)" WORKSPACE="-v ${WORKSPACE_PATH}:/workspace" LAUNCH_CMD="" @@ -74,7 +81,7 @@ set_variables() { exit 1 fi MAP="-v ${MAP_PATH}:/${MAP_PATH}" - IMAGE="ghcr.io/autowarefoundation/autoware-openadk:latest-monorun-humble" + IMAGE="ghcr.io/autowarefoundation/autoware-openadk:monorun-$rosdistro-latest" WORKSPACE="" fi }