diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1aaa3f5f..9b2f005b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -17,6 +17,20 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - + name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build estimator base + uses: docker/build-push-action@v6 + with: + file: Dockerfile.estimator.base + push: true + tags: ghcr.io/yadunund/ibpc/estimator-base:latest - name: Build estimator uses: docker/build-push-action@v6 diff --git a/Dockerfile.estimator b/Dockerfile.estimator index a5df2fb9..51da47ca 100644 --- a/Dockerfile.estimator +++ b/Dockerfile.estimator @@ -1,4 +1,4 @@ -FROM ros:jazzy-perception AS base +FROM ghcr.io/yadunund/ibpc/estimator-base:latest AS base SHELL [ "/bin/bash" , "-c" ] diff --git a/Dockerfile.estimator.base b/Dockerfile.estimator.base new file mode 100644 index 00000000..e656c71d --- /dev/null +++ b/Dockerfile.estimator.base @@ -0,0 +1,34 @@ +FROM ros:jazzy-perception AS base + +ARG DEBIAN_FRONTEND=noninteractive + +# Prerequisites +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget software-properties-common gnupg2 \ + && rm -rf /var/lib/apt/lists/* + +# Enable contrib on debian to get required +# https://packages.debian.org/bullseye/glx-alternative-nvidia + +# Remove cuda from base image for disk space savings +# RUN \ +# wget -q https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb && \ +# dpkg -i cuda-keyring_1.1-1_all.deb && \ +# rm cuda-keyring_1.1-1_all.deb && \ +# apt-get update && \ +# apt-get install -y software-properties-common && \ +# add-apt-repository "deb http://archive.ubuntu.com/ubuntu noble main restricted universe multiverse" && \ +# add-apt-repository "deb http://archive.ubuntu.com/ubuntu noble-updates main restricted universe multiverse" && \ +# add-apt-repository "deb http://archive.ubuntu.com/ubuntu noble contrib non-free-firmware" && \ +# apt-get update && \ +# apt-get -y install cuda-toolkit && \ +# rm -rf /var/lib/apt/lists/* + +# File conflict problem with libnvidia-ml.so.1 and libcuda.so.1 +# https://github.com/NVIDIA/nvidia-docker/issues/1551 +RUN rm -rf /usr/lib/x86_64-linux-gnu/libnv* +RUN rm -rf /usr/lib/x86_64-linux-gnu/libcuda* + +# TODO(tfoote) Add documentation of why these are required +ENV PATH /usr/local/cuda/bin${PATH:+:${PATH}} +ENV LD_LIBRARY_PATH /usr/local/cuda/lib64/stubs:/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}