-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Build Autoware runtime image | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '41 8 * * *' # Every day at 8:41 UTC | ||
push: | ||
paths: | ||
- containers/autoware-runtime/Dockerfile | ||
- .github/workflows/autoware_runtime.yml # Self-trigger | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: bounverif/autoware-runtime | ||
VERSION: latest | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Log in to the registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: containers/autoware-runtime | ||
build-args: | | ||
VERSION=${{ env.VERSION }} | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} | ||
push: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
FROM ghcr.io/bounverif/autoware-prebuilt:latest as prebuilt | ||
FROM ros:humble-ros-base-jammy | ||
|
||
ARG CUDA_ARCH=x86_64 | ||
ARG CUDA_DISTRO=ubuntu2204 | ||
ARG CUDA_KEYRING_PACKAGE=cuda-keyring_1.1-1_all.deb | ||
ARG CUDA_KEYRING_FILEPATH=https://developer.download.nvidia.com/compute/cuda/repos/${CUDA_DISTRO}/${CUDA_ARCH}/${CUDA_KEYRING_PACKAGE} | ||
|
||
ENV NVIDIA_VISIBLE_DEVICES=all | ||
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility | ||
|
||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install \ | ||
git \ | ||
wget \ | ||
tini \ | ||
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN wget ${CUDA_KEYRING_FILEPATH} && dpkg -i ${CUDA_KEYRING_PACKAGE} && rm ${CUDA_KEYRING_PACKAGE} | ||
|
||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get -y install \ | ||
libcublas-12-2 \ | ||
libcurand-12-2 \ | ||
cuda-cudart-12-2 \ | ||
libnvinfer8 \ | ||
libnvinfer-plugin8 \ | ||
libnvparsers8 \ | ||
libnvonnxparsers8 \ | ||
&& find . -name 'libcu*.a' -delete \ | ||
&& find . -name 'libnv*.a' -delete \ | ||
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy Autoware build artifacts | ||
COPY --from=prebuilt /opt/autoware/humble /opt/autoware/humble | ||
|
||
# Copy the script to the container | ||
COPY ./entrypoint.sh / | ||
RUN chmod +x /entrypoint.sh | ||
|
||
# Tini correctly initialize the shell in the container | ||
# With the -g option, tini kills the child process group. | ||
# This corresponds more closely to what happens when you do ctrl-C | ||
# See: https://github.com/krallin/tini | ||
ENTRYPOINT ["tini", "-g", "--", "/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
# Trigger an error if non-zero exit code is encountered | ||
set -e | ||
|
||
# Source Autoware environment | ||
source /opt/autoware/humble/setup.bash | ||
|
||
# Execute the command | ||
exec ros2 launch "${@}" |