From 1566f478c2f653ab8c685dd9f8bdd37900684aa3 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Tue, 7 Jan 2025 16:01:49 +0100 Subject: [PATCH 01/10] disable build cache --- .github/workflows/docker-build-opengl.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/docker-build-opengl.yaml b/.github/workflows/docker-build-opengl.yaml index 9dec344..1f81cae 100644 --- a/.github/workflows/docker-build-opengl.yaml +++ b/.github/workflows/docker-build-opengl.yaml @@ -93,8 +93,6 @@ jobs: file: ./nvidia.dockerfile platforms: linux/amd64 push: true - cache-from: type=registry,ref=lcas.lincoln.ac.uk/cache/lcas/ros:${{ matrix.push_tag }} - cache-to: type=registry,ref=lcas.lincoln.ac.uk/cache/lcas/ros:${{ matrix.push_tag }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | @@ -180,8 +178,6 @@ jobs: context: . file: ./nvidia.dockerfile platforms: linux/arm64 - cache-from: type=registry,ref=lcas.lincoln.ac.uk/cache/lcas/ros:${{ matrix.push_tag }} - cache-to: type=registry,ref=lcas.lincoln.ac.uk/cache/lcas/ros:${{ matrix.push_tag }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 98e8119b26c21c479b4040bd6a70fab2f2413ca0 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Tue, 7 Jan 2025 18:50:56 +0000 Subject: [PATCH 02/10] add caching support to Docker build workflow for OpenGL --- .github/workflows/docker-build-opengl.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/docker-build-opengl.yaml b/.github/workflows/docker-build-opengl.yaml index 1f81cae..b322a8f 100644 --- a/.github/workflows/docker-build-opengl.yaml +++ b/.github/workflows/docker-build-opengl.yaml @@ -93,6 +93,9 @@ jobs: file: ./nvidia.dockerfile platforms: linux/amd64 push: true + load: true + cache-from: type=local,src=/tmp/cache + cache-to: type=local,src=/tmp/cache tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | @@ -179,6 +182,9 @@ jobs: file: ./nvidia.dockerfile platforms: linux/arm64 push: true + load: true + cache-from: type=local,src=/tmp/cache + cache-to: type=local,src=/tmp/cache tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | From d4e19907d1c98cc2c19536c05e985520b5ce1397 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Tue, 7 Jan 2025 19:03:05 +0000 Subject: [PATCH 03/10] fix: update cache-to destination in Docker build workflow for OpenGL --- .github/workflows/docker-build-opengl.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-opengl.yaml b/.github/workflows/docker-build-opengl.yaml index b322a8f..fc037ff 100644 --- a/.github/workflows/docker-build-opengl.yaml +++ b/.github/workflows/docker-build-opengl.yaml @@ -95,7 +95,7 @@ jobs: push: true load: true cache-from: type=local,src=/tmp/cache - cache-to: type=local,src=/tmp/cache + cache-to: type=local,dest=/tmp/cache tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | @@ -184,7 +184,7 @@ jobs: push: true load: true cache-from: type=local,src=/tmp/cache - cache-to: type=local,src=/tmp/cache + cache-to: type=local,dest=/tmp/cache tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | From e8813d6709383e8edeafc2c1bef8de6f376e6897 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Tue, 7 Jan 2025 19:34:40 +0000 Subject: [PATCH 04/10] trigger reuild --- .github/workflows/docker-build-opengl.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-opengl.yaml b/.github/workflows/docker-build-opengl.yaml index fc037ff..04a1286 100644 --- a/.github/workflows/docker-build-opengl.yaml +++ b/.github/workflows/docker-build-opengl.yaml @@ -70,10 +70,10 @@ jobs: labels: | org.opencontainers.image.description=L-CAS ROS2 Docker Image with virtual X11 embedded (flavour: ${{ matrix.push_tag }}) org.opencontainers.image.authors=L-CAS Team - # list of Docker images to use as base name for tags + images: | lcas.lincoln.ac.uk/lcas/ros - # generate Docker tags based on the following events/attributes + tags: | type=raw,value=${{ matrix.push_tag }}-staging type=raw,enable=${{ github.event_name != 'pull_request' }},value=${{ matrix.push_tag }} From afd6c19dc285e0efd8f1bbc23c21cb1d7c9705c4 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Wed, 8 Jan 2025 20:28:52 +0000 Subject: [PATCH 05/10] fix: add python3-setuptools to nvidia.dockerfile for improved package management (earlier in an attempt to avoid segfault on arm, see https://github.com/LCAS/ros-docker-images/actions/runs/12658081212/job/35333290362?pr=15#step:8:3162) --- nvidia.dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/nvidia.dockerfile b/nvidia.dockerfile index 2e6c41c..e6a56cb 100644 --- a/nvidia.dockerfile +++ b/nvidia.dockerfile @@ -34,6 +34,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ gnupg2 \ lsb-release \ sudo \ + python3-setuptools \ software-properties-common \ wget \ && rm -rf /var/lib/apt/lists/* From 307431d69309ff01cc93b9bea0f96ccd8ece0061 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Wed, 8 Jan 2025 20:42:37 +0000 Subject: [PATCH 06/10] fix: update cache-to configuration in Docker build workflow for OpenGL --- .github/workflows/docker-build-opengl.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-opengl.yaml b/.github/workflows/docker-build-opengl.yaml index 04a1286..25c7906 100644 --- a/.github/workflows/docker-build-opengl.yaml +++ b/.github/workflows/docker-build-opengl.yaml @@ -95,7 +95,7 @@ jobs: push: true load: true cache-from: type=local,src=/tmp/cache - cache-to: type=local,dest=/tmp/cache + cache-to: type=local,dest=/tmp/cache,mode=max tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | @@ -184,7 +184,7 @@ jobs: push: true load: true cache-from: type=local,src=/tmp/cache - cache-to: type=local,dest=/tmp/cache + cache-to: type=local,dest=/tmp/cache,mode=max tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | From 2d8408c81fdc95fe72775a8d41c698c5144a9e12 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Wed, 8 Jan 2025 21:01:27 +0000 Subject: [PATCH 07/10] fix: update cache-from and cache-to configurations in Docker build workflow for OpenGL --- .github/workflows/docker-build-opengl.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-opengl.yaml b/.github/workflows/docker-build-opengl.yaml index 25c7906..6366851 100644 --- a/.github/workflows/docker-build-opengl.yaml +++ b/.github/workflows/docker-build-opengl.yaml @@ -94,8 +94,8 @@ jobs: platforms: linux/amd64 push: true load: true - cache-from: type=local,src=/tmp/cache - cache-to: type=local,dest=/tmp/cache,mode=max + cache-from: type=registry,ref=lcas.lincoln.ac.uk/cache/lcas_ros:${{ matrix.push_tag }}-staging + cache-to: type=registry,ref=lcas.lincoln.ac.uk/cache/lcas_ros:${{ matrix.push_tag }}-staging,mode=max tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | From 9cf37692f648df0b88beabe94931ab6ccbe73c44 Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Wed, 8 Jan 2025 21:24:44 +0000 Subject: [PATCH 08/10] fix: update Docker build workflow to use repository name for image caching --- .github/workflows/docker-build-opengl.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-build-opengl.yaml b/.github/workflows/docker-build-opengl.yaml index 6366851..de50ab9 100644 --- a/.github/workflows/docker-build-opengl.yaml +++ b/.github/workflows/docker-build-opengl.yaml @@ -86,6 +86,10 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: "image name from repo name" + id: docker_image_name + run: echo "docker_image=${{ github.repository }}" | tr '[:upper:]' '[:lower:]' |sed 's/[^0-9,a-z,A-Z,=,_,\/]/-/g' >>${GITHUB_OUTPUT} + - name: Build Docker Image uses: docker/build-push-action@v6 with: @@ -93,9 +97,8 @@ jobs: file: ./nvidia.dockerfile platforms: linux/amd64 push: true - load: true - cache-from: type=registry,ref=lcas.lincoln.ac.uk/cache/lcas_ros:${{ matrix.push_tag }}-staging - cache-to: type=registry,ref=lcas.lincoln.ac.uk/cache/lcas_ros:${{ matrix.push_tag }}-staging,mode=max + cache-from: type=registry,ref=cache:5000/${{ steps.docker_image_name.outputs.docker_image }}:${{ matrix.push_tag }} + cache-to: type=registry,ref=cache:5000/${{ steps.docker_image_name.outputs.docker_image }}:${{ matrix.push_tag }},mode=max tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | @@ -175,6 +178,10 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: "image name from repo name" + id: docker_image_name + run: echo "docker_image=${{ github.repository }}" | tr '[:upper:]' '[:lower:]' |sed 's/[^0-9,a-z,A-Z,=,_,\/]/-/g' >>${GITHUB_OUTPUT} + - name: Build Docker Image uses: docker/build-push-action@v6 with: @@ -182,9 +189,8 @@ jobs: file: ./nvidia.dockerfile platforms: linux/arm64 push: true - load: true - cache-from: type=local,src=/tmp/cache - cache-to: type=local,dest=/tmp/cache,mode=max + cache-from: type=registry,ref=cache:5000/${{ steps.docker_image_name.outputs.docker_image }}:${{ matrix.push_tag }} + cache-to: type=registry,ref=cache:5000/${{ steps.docker_image_name.outputs.docker_image }}:${{ matrix.push_tag }},mode=max tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | From 59084a235ee9b3be015771b9f69a0786a859014c Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Wed, 8 Jan 2025 22:14:44 +0000 Subject: [PATCH 09/10] fix: configure Docker Buildx to use insecure HTTP for cache registry --- .github/workflows/docker-build-opengl.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-opengl.yaml b/.github/workflows/docker-build-opengl.yaml index de50ab9..1994e67 100644 --- a/.github/workflows/docker-build-opengl.yaml +++ b/.github/workflows/docker-build-opengl.yaml @@ -85,7 +85,12 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - + with: + buildkitd-config-inline: | + [registry."cache"] + http = true + insecure = true + - name: "image name from repo name" id: docker_image_name run: echo "docker_image=${{ github.repository }}" | tr '[:upper:]' '[:lower:]' |sed 's/[^0-9,a-z,A-Z,=,_,\/]/-/g' >>${GITHUB_OUTPUT} From 92054fd565860aad94b7fe3c888e257cdb4bb61b Mon Sep 17 00:00:00 2001 From: Marc Hanheide Date: Wed, 8 Jan 2025 22:18:19 +0000 Subject: [PATCH 10/10] fix: update Docker Buildx configuration to specify cache registry port --- .github/workflows/docker-build-opengl.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-opengl.yaml b/.github/workflows/docker-build-opengl.yaml index 1994e67..c30909d 100644 --- a/.github/workflows/docker-build-opengl.yaml +++ b/.github/workflows/docker-build-opengl.yaml @@ -87,7 +87,7 @@ jobs: uses: docker/setup-buildx-action@v3 with: buildkitd-config-inline: | - [registry."cache"] + [registry."cache:5000"] http = true insecure = true