You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by pi...@apache.org on 2025/12/15 17:25:37 UTC

(iggy) branch master updated: fix(ci): fix Docker build failures for server and connectors (#2488)

This is an automated email from the ASF dual-hosted git repository.

piotr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git


The following commit(s) were added to refs/heads/master by this push:
     new bf8e886e6 fix(ci): fix Docker build failures for server and connectors (#2488)
bf8e886e6 is described below

commit bf8e886e65f1a39fcd4a09c24a7126455f146491
Author: Hubert Gruszecki <h....@gmail.com>
AuthorDate: Mon Dec 15 18:25:32 2025 +0100

    fix(ci): fix Docker build failures for server and connectors (#2488)
    
    - Avoid duplicate cache exports when image equals shared_deps
    - Add hwloc-dev and PKG_CONFIG_ALLOW_CROSS=1 for cross-compilation
---
 .github/actions/utils/docker-buildx/action.yml | 58 +++++++++++++++++---------
 core/connectors/runtime/Dockerfile             |  5 ++-
 core/server/Dockerfile                         |  5 ++-
 3 files changed, 47 insertions(+), 21 deletions(-)

diff --git a/.github/actions/utils/docker-buildx/action.yml b/.github/actions/utils/docker-buildx/action.yml
index ee998611b..0336fdf23 100644
--- a/.github/actions/utils/docker-buildx/action.yml
+++ b/.github/actions/utils/docker-buildx/action.yml
@@ -222,25 +222,45 @@ runs:
         else
           # CI on upstream: use shared deps cache + component-specific cache
           # Order matters: try shared deps first (most likely to have common layers)
-          CACHE_TO=$(
-            printf '%s\n' \
-              "type=registry,ref=${shared_deps}:buildcache-${arch},mode=max" \
-              "type=registry,ref=${img}:buildcache-${arch},mode=max" \
-              "type=inline" \
-              "type=gha,scope=buildkit-deps-${os}-${arch},mode=max" \
-              "type=gha,scope=buildkit-${scope_arch},mode=max"
-          )
-          CACHE_FROM=$(
-            printf '%s\n' \
-              "type=registry,ref=${shared_deps}:buildcache-${arch}" \
-              "type=registry,ref=${shared_deps}:buildcache" \
-              "type=registry,ref=${img}:buildcache-${arch}" \
-              "type=registry,ref=${img}:buildcache" \
-              "type=registry,ref=${img}:latest" \
-              "type=gha,scope=buildkit-deps-${os}-${arch}" \
-              "type=gha,scope=buildkit-${scope_arch}" \
-              "type=gha,scope=buildkit-${scope_os}"
-          )
+          # Avoid duplicates: if img == shared_deps, skip the component-specific registry cache
+          if [ "$img" = "$shared_deps" ]; then
+            CACHE_TO=$(
+              printf '%s\n' \
+                "type=registry,ref=${shared_deps}:buildcache-${arch},mode=max" \
+                "type=inline" \
+                "type=gha,scope=buildkit-deps-${os}-${arch},mode=max" \
+                "type=gha,scope=buildkit-${scope_arch},mode=max"
+            )
+            CACHE_FROM=$(
+              printf '%s\n' \
+                "type=registry,ref=${shared_deps}:buildcache-${arch}" \
+                "type=registry,ref=${shared_deps}:buildcache" \
+                "type=registry,ref=${img}:latest" \
+                "type=gha,scope=buildkit-deps-${os}-${arch}" \
+                "type=gha,scope=buildkit-${scope_arch}" \
+                "type=gha,scope=buildkit-${scope_os}"
+            )
+          else
+            CACHE_TO=$(
+              printf '%s\n' \
+                "type=registry,ref=${shared_deps}:buildcache-${arch},mode=max" \
+                "type=registry,ref=${img}:buildcache-${arch},mode=max" \
+                "type=inline" \
+                "type=gha,scope=buildkit-deps-${os}-${arch},mode=max" \
+                "type=gha,scope=buildkit-${scope_arch},mode=max"
+            )
+            CACHE_FROM=$(
+              printf '%s\n' \
+                "type=registry,ref=${shared_deps}:buildcache-${arch}" \
+                "type=registry,ref=${shared_deps}:buildcache" \
+                "type=registry,ref=${img}:buildcache-${arch}" \
+                "type=registry,ref=${img}:buildcache" \
+                "type=registry,ref=${img}:latest" \
+                "type=gha,scope=buildkit-deps-${os}-${arch}" \
+                "type=gha,scope=buildkit-${scope_arch}" \
+                "type=gha,scope=buildkit-${scope_os}"
+            )
+          fi
         fi
 
         {
diff --git a/core/connectors/runtime/Dockerfile b/core/connectors/runtime/Dockerfile
index c7c1d637f..8f9c6b39d 100644
--- a/core/connectors/runtime/Dockerfile
+++ b/core/connectors/runtime/Dockerfile
@@ -33,7 +33,7 @@ ARG LIBC=glibc
 ARG IGGY_CI_BUILD
 ENV IGGY_CI_BUILD=${IGGY_CI_BUILD}
 
-RUN apk add --no-cache zig make autoconf automake libtool pkgconfig && \
+RUN apk add --no-cache zig make autoconf automake libtool pkgconfig hwloc-dev && \
     cargo install cargo-zigbuild --locked && \
     rustup target add \
     x86_64-unknown-linux-musl \
@@ -41,6 +41,9 @@ RUN apk add --no-cache zig make autoconf automake libtool pkgconfig && \
     x86_64-unknown-linux-gnu \
     aarch64-unknown-linux-gnu
 
+# Allow pkg-config to work in cross-compilation mode (needed for hwlocality-sys)
+ENV PKG_CONFIG_ALLOW_CROSS=1
+
 COPY --from=planner /app/recipe.json recipe.json
 
 #
diff --git a/core/server/Dockerfile b/core/server/Dockerfile
index c04da7c06..a8b4ccd33 100644
--- a/core/server/Dockerfile
+++ b/core/server/Dockerfile
@@ -34,7 +34,7 @@ ARG LIBC=musl
 ARG IGGY_CI_BUILD
 ENV IGGY_CI_BUILD=${IGGY_CI_BUILD}
 
-RUN apk add --no-cache zig make autoconf automake libtool pkgconfig && \
+RUN apk add --no-cache zig make autoconf automake libtool pkgconfig hwloc-dev && \
     cargo install cargo-zigbuild --locked && \
     rustup target add \
     x86_64-unknown-linux-musl \
@@ -42,6 +42,9 @@ RUN apk add --no-cache zig make autoconf automake libtool pkgconfig && \
     x86_64-unknown-linux-gnu \
     aarch64-unknown-linux-gnu
 
+# Allow pkg-config to work in cross-compilation mode (needed for hwlocality-sys)
+ENV PKG_CONFIG_ALLOW_CROSS=1
+
 COPY --from=planner /app/recipe.json recipe.json
 
 RUN --mount=type=cache,target=/usr/local/cargo/registry,id=cargo-registry-${TARGETPLATFORM}-${LIBC} \