Skip to content

Commit

Permalink
Add Autoware runtime image
Browse files Browse the repository at this point in the history
  • Loading branch information
doganulus committed Sep 19, 2023
1 parent d04196c commit 44964ce
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/autoware_runtime.yml
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
45 changes: 45 additions & 0 deletions containers/autoware-runtime/Dockerfile
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"]
9 changes: 9 additions & 0 deletions containers/autoware-runtime/entrypoint.sh
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 "${@}"

0 comments on commit 44964ce

Please sign in to comment.