Skip to content

Commit

Permalink
Update Ansible role names and Docker image tags
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzkaganozt committed Jan 11, 2024
1 parent ac99c60 commit bbc8b65
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 71 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Autoware",
"image": "ghcr.io/autowarefoundation/autoware-openadk:devel-latest"

Check warning on line 3 in .devcontainer/devcontainer.json

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (openadk)

// "remoteUser": "autoware",
}
24 changes: 12 additions & 12 deletions .github/workflows/update-docker-manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions ansible/playbooks/openadk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Check failure on line 41 in ansible/playbooks/openadk.yaml

View workflow job for this annotation

GitHub Actions / pre-commit-ansible

yaml[trailing-spaces]

Trailing spaces
# Development environment
- role: autoware.dev_env.devel
when: install_devel == 'true'
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/devel/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# autoware_core
# devel

This role installs development dependencies for Autoware.

Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/gdown/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/nvidia_docker/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 3 additions & 33 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docker/autoware-openadk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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*

Expand Down
7 changes: 1 addition & 6 deletions docker/autoware-openadk/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
26 changes: 16 additions & 10 deletions docker/autoware-openadk/etc/dev_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docker/autoware-openadk/etc/ros_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"
11 changes: 9 additions & 2 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand Down Expand Up @@ -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=""
Expand All @@ -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
}
Expand Down

0 comments on commit bbc8b65

Please sign in to comment.