From 6247345d001853c3369fb1a5944cc7c9ca454568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Dutheillet-Lamonth=C3=A9zie?= Date: Fri, 6 Sep 2024 09:16:43 +0200 Subject: [PATCH] #97: fix of ubuntu 24 docker image mesa drivers version --- ci/docker/make-base-ubuntu.dockerfile | 12 ++++ ...e_ubuntu_24.04-gcc_13-vtk_9.3.1-py_3.8.yml | 69 +++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 ci/docker/pushbasedockerimage_ubuntu_24.04-gcc_13-vtk_9.3.1-py_3.8.yml diff --git a/ci/docker/make-base-ubuntu.dockerfile b/ci/docker/make-base-ubuntu.dockerfile index 5f26f009b..2719a2801 100644 --- a/ci/docker/make-base-ubuntu.dockerfile +++ b/ci/docker/make-base-ubuntu.dockerfile @@ -83,6 +83,18 @@ RUN mkdir -p /opt/src/vtk RUN git clone --recursive --branch v${VTK_VERSION} https://gitlab.kitware.com/vtk/vtk.git /opt/src/vtk # Build VTK + +# Fix Ubuntu 24.04 Mesa driver issue by downloading recent version +RUN if [[ $(uname -a) != *"Darwin"* ]]; then \ + . /etc/lsb-release \ + if [ "$DISTRIB_RELEASE" == "24.04" ]; then \ + echo "Installing recent MESA drivers" \ + sudo add-apt-repository ppa:oibaf/graphics-drivers -y && \ + sudo apt update && \ + sudo apt upgrade \ + fi \ + fi + RUN mkdir -p /opt/scripts COPY ci/vtk_build.sh /opt/scripts/vtk_build.sh RUN VTK_DIR=${VTK_DIR} bash /opt/scripts/vtk_build.sh diff --git a/ci/docker/pushbasedockerimage_ubuntu_24.04-gcc_13-vtk_9.3.1-py_3.8.yml b/ci/docker/pushbasedockerimage_ubuntu_24.04-gcc_13-vtk_9.3.1-py_3.8.yml new file mode 100644 index 000000000..c84797766 --- /dev/null +++ b/ci/docker/pushbasedockerimage_ubuntu_24.04-gcc_13-vtk_9.3.1-py_3.8.yml @@ -0,0 +1,69 @@ +name: Build & push base Docker image (add ubuntu_24.04-gcc_12-vtk_9.3.1-py_3.8 image) + +on: + push: + branches: + - 97-add-more-environments-to-test-in-ci + +jobs: + push_to_registry: + name: Build & Push + runs-on: ubuntu-latest + env: + DOCKER_REPOSITORY: lifflander1/vt + strategy: + matrix: + image: [ ubuntu_24.04-gcc_13-vtk_9.3.1-py_3.8 ] + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Extract build configuration + # If workflow dispatch event replace `matrix.image` by `inputs.image` + run: | + IFS='_-' read -r -a CONFIG <<< "${{ matrix.image }}" + echo "BASE_IMAGE=${CONFIG[0]}:${CONFIG[1]}" >> $GITHUB_ENV + echo "CC=${CONFIG[2]}-${CONFIG[3]}" >> $GITHUB_ENV + if [[ "${CONFIG[2]}" == "gcc" ]]; then + echo "CXX=g++-${CONFIG[3]}" >> $GITHUB_ENV + echo "GCOV=gcov-${CONFIG[3]}" >> $GITHUB_ENV + elif [[ "${CONFIG[2]}" == "clang" ]]; then + echo "CXX=clang++-${CONFIG[3]}" >> $GITHUB_ENV + echo "GCOV=gcov" >> $GITHUB_ENV + else + exit 1 + fi + echo "VTK_VERSION=${CONFIG[5]}" >> $GITHUB_ENV + echo "PYTHON_VERSION=${CONFIG[7]}" >> $GITHUB_ENV + echo "DOCKER_TAG=${{ matrix.image }}" >> $GITHUB_ENV + + - name: Build configuration + run: | + echo "Base image: $BASE_IMAGE" + echo "C Compiler: $CC" + echo "CXX Compiler: $CXX" + echo "GCOV: $GCOV" + echo "VTK: $VTK_VERSION" + echo "Python: $PYTHON_VERSION" + echo "Docker tag: $DOCKER_TAG" + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Build and push to Docker Hub + uses: docker/build-push-action@v6 + with: + context: . + build-args: | + BASE_IMAGE=${{ env.BASE_IMAGE }} + CC=${{ env.CC }} + CXX=${{ env.CXX }} + GCOV=${{ env.GCOV }} + VTK_VERSION=${{ env.VTK_VERSION }} + PYTHON_VERSION=${{ env.PYTHON_VERSION }} + file: ci/docker/make-base-ubuntu.dockerfile + push: true + tags: "${{ env.DOCKER_REPOSITORY }}:${{ env.DOCKER_TAG }}"