Skip to content

Commit

Permalink
Reorganize files
Browse files Browse the repository at this point in the history
  • Loading branch information
doganulus committed Jul 23, 2024
1 parent 5a32a77 commit e023aa1
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 70 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/builder-buildah-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
--cache-to=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
--cache-ttl=24h
containerfiles: |
./Dockerfile
containers/autoware-builder/Dockerfile
- name: Build builder-with-cache container image
id: build-builder-with-cache
Expand All @@ -78,7 +78,7 @@ jobs:
--cache-from=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
--cache-to=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
containerfiles: |
./Dockerfile
containers/autoware-builder/Dockerfile
- name: Log in to the GitHub Container registry
uses: redhat-actions/podman-login@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/runtime-buildah-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
--target autoware-runtime
--cache-from=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/cache
containerfiles: |
./Dockerfile
containers/autoware-runtime/Dockerfile
- name: Push to GitHub Container Repository
id: push-runtime-ghcr
Expand Down
67 changes: 0 additions & 67 deletions Dockerfile → containers/autoware-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -165,70 +165,3 @@ RUN --mount=type=bind,from=autoware-source,source=${AUTOWARE_SOURCE_DIR},target=
&& rm -rf ${AUTOWARE_BUILD_DIR} \
&& rm -rf ${AUTOWARE_INSTALL_DIR} \
&& du -h --max-depth=0 ${CCACHE_DIR}

FROM ghcr.io/bounverif/autoware:latest-builder-with-cache AS autoware-prebuilt

COPY autoware.repos.yml /var/lib/autoware/autoware.repos.yml

RUN mkdir -p ${AUTOWARE_SOURCE_DIR} \
&& vcs import --shallow ${AUTOWARE_SOURCE_DIR} < /var/lib/autoware/autoware.repos.yml && \
ccache --zero-stats && \
. /opt/ros/humble/setup.sh && \
colcon --log-base /dev/null build \
--base-paths ${AUTOWARE_SOURCE_DIR} \
--build-base ${AUTOWARE_BUILD_DIR} \
--install-base ${AUTOWARE_INSTALL_DIR} \
--packages-up-to autoware_launch \
--event-handlers \
console_direct- \
console_stderr+ \
console_cohesion- \
console_start_end- \
console_package_list- \
status- \
summary+ \
desktop_notification- \
--cmake-args \
-DCMAKE_BUILD_TYPE=Release \
" -Wno-dev" \
" --no-warn-unused-cli" \
&& rm -rf ${AUTOWARE_SOURCE_DIR} \
&& rm -rf ${AUTOWARE_BUILD_DIR} \
&& ccache -v --show-stats

FROM autoware-base AS autoware-runtime

# This is not complete. It is just a placeholder for the final image.

ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${CACHEMOUNT_PREFIX}/var/cache/apt \
export DEBIAN_FRONTEND=noninteractive && \
apt-get update && apt-get install -y --no-install-recommends \
libcublas-12-4 \
libcurand-12-4 \
&& apt-get autoremove -y && rm -rf /var/lib/apt/lists/*

COPY --from=autoware-prebuilt ${AUTOWARE_INSTALL_DIR} ${AUTOWARE_INSTALL_DIR}

FROM ghcr.io/bounverif/autoware:latest-builder-with-cache AS autoware-devel

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${CACHEMOUNT_PREFIX}/var/cache/apt \
export DEBIAN_FRONTEND=noninteractive && \
apt-get update && apt-get install -y --no-install-recommends \
ansible-core ansible \
&& apt-get autoremove -y && rm -rf /var/lib/apt/lists/*

USER bounverif
WORKDIR /home/bounverif

ENV AUTOWARE_VERSION=devel
ENV AUTOWARE_SOURCE_DIR=/home/bounverif/autoware/src
ENV AUTOWARE_BUILD_DIR=/tmp/build/autoware
ENV AUTOWARE_INSTALL_DIR=/home/bounverif/autoware/install

ENV AUTOWARE_REPOSITORY_URL=https://github.com/autowarefoundation/autoware.git
ENV AUTOWARE_CORE_REPOSITORY_URL=https://github.com/autowarefoundation/autoware.core.git
ENV AUTOWARE_UNIVERSE_REPOSITORY_URL=https://github.com/autowarefoundation/autoware.universe.git

23 changes: 23 additions & 0 deletions containers/autoware-devel/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM ghcr.io/bounverif/autoware:latest-builder-with-cache AS autoware-devel

RUN wget -qO- "https://keyserver.ubuntu.com/pks/lookup?fingerprint=on&op=get&search=0x6125E2A8C77F2818FB7BD15B93C4A3FD7BB9C367" | gpg --dearmour -o /usr/share/keyrings/ansible-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/ansible-archive-keyring.gpg] http://ppa.launchpad.net/ansible/ansible/ubuntu jammy main" | tee /etc/apt/sources.list.d/ansible.listd

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && apt-get install -qy --no-install-recommends \
ansible-core \
ansible \
&& apt-get autoremove -y && rm -rf /var/lib/apt/lists/*

USER bounverif
WORKDIR /home/bounverif

ENV AUTOWARE_VERSION=devel
ENV AUTOWARE_SOURCE_DIR=/home/bounverif/autoware/src
ENV AUTOWARE_BUILD_DIR=/tmp/build/autoware
ENV AUTOWARE_INSTALL_DIR=/home/bounverif/autoware/install

ENV AUTOWARE_REPOSITORY_URL=https://github.com/autowarefoundation/autoware.git
ENV AUTOWARE_CORE_REPOSITORY_URL=https://github.com/autowarefoundation/autoware.core.git
ENV AUTOWARE_UNIVERSE_REPOSITORY_URL=https://github.com/autowarefoundation/autoware.universe.git

85 changes: 85 additions & 0 deletions containers/autoware-runtime/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
FROM ghcr.io/bounverif/autoware:latest-builder-with-cache AS autoware-prebuilt

COPY autoware.repos.yml /var/lib/autoware/autoware.repos.yml

RUN mkdir -p ${AUTOWARE_SOURCE_DIR} \
&& vcs import --shallow ${AUTOWARE_SOURCE_DIR} < /var/lib/autoware/autoware.repos.yml && \
ccache --zero-stats && \
. /opt/ros/humble/setup.sh && \
colcon --log-base /dev/null build \
--base-paths ${AUTOWARE_SOURCE_DIR} \
--build-base ${AUTOWARE_BUILD_DIR} \
--install-base ${AUTOWARE_INSTALL_DIR} \
--packages-up-to autoware_launch \
--event-handlers \
console_direct- \
console_stderr+ \
console_cohesion- \
console_start_end- \
console_package_list- \
status- \
summary+ \
desktop_notification- \
--cmake-args \
-DCMAKE_BUILD_TYPE=Release \
" -Wno-dev" \
" --no-warn-unused-cli" \
&& rm -rf ${AUTOWARE_SOURCE_DIR} \
&& rm -rf ${AUTOWARE_BUILD_DIR} \
&& ccache -v --show-stats

FROM docker.io/library/ubuntu:22.04 AS autoware-runtime-base

# Metadata
LABEL org.opencontainers.image.vendor="tr.edu.bogazici.cmpe.bounverif"
LABEL org.opencontainers.image.version="0.1.0"
LABEL org.opencontainers.image.authors="Bogazici University System Verification Group"
LABEL org.opencontainers.image.source="https://github.com/bounverif/autoware"
LABEL org.opencontainers.image.title="Autoware Runtime"

# User management
ARG USER=bounverif
ARG USERGROUP=${USER}
ARG UID=1000
ARG GID=${UID}

# CUDA variables
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}

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -qy --no-install-recommends \
sudo \
tini \
wget \
gnupg2 \
ca-certificates \
&& apt-get autoremove -y && rm -rf /var/lib/apt/lists/*

RUN groupadd ${USERGROUP} -g ${GID} && \
useradd -ms /bin/bash ${USER} -g ${USERGROUP} -u ${UID} && \
printf "${USER} ALL= NOPASSWD: ALL\\n" >> /etc/sudoers

# Repository management
RUN wget -qO- "https://raw.githubusercontent.com/ros/rosdistro/master/ros.key" | gpg --dearmour -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu jammy main" > /etc/apt/sources.list.d/ros2.list && \
wget -q ${CUDA_KEYRING_FILEPATH} && dpkg -i ${CUDA_KEYRING_PACKAGE} && rm ${CUDA_KEYRING_PACKAGE}

FROM autoware-runtime-base AS autoware-runtime

# This is not complete. It is just a placeholder for the final image.

COPY --from=autoware-prebuilt ${AUTOWARE_INSTALL_DIR} ${AUTOWARE_INSTALL_DIR}

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=${CACHEMOUNT_PREFIX}/var/cache/apt \
export DEBIAN_FRONTEND=noninteractive && \
apt-get update && apt-get install -y --no-install-recommends \
libcublas-12-4 \
libcurand-12-4 \
&& apt-get autoremove -y && rm -rf /var/lib/apt/lists/*

ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics

0 comments on commit e023aa1

Please sign in to comment.