diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index c9bf168..852e36f 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -84,13 +84,28 @@ jobs: run: | set -euo pipefail B="${{ matrix.backend }}" - APPLY_INPUT="${APPLY_LLAMA_PR_15405:-}" + APPLY_RAW="${APPLY_LLAMA_PR_15405:-}" + APPLY_INPUT="$(echo "${APPLY_RAW}" | tr -d '[:space:]')" + APPLY_VALUE="" + case "${APPLY_INPUT}" in + "") + echo "→ APPLY_LLAMA_PR_15405 not provided; using Dockerfile defaults for ${B}" + ;; + 0|1) + APPLY_VALUE="${APPLY_INPUT}" + ;; + *) + echo "Invalid APPLY_LLAMA_PR_15405 value: '${APPLY_INPUT}'. Expected 0 or 1." + exit 1 + ;; + esac + BUILD_ARGS=() NAME_SUFFIX="" - if [[ -n "${APPLY_INPUT}" ]]; then - BUILD_ARGS+=(--build-arg "APPLY_LLAMA_PR_15405=${APPLY_INPUT}") - if [[ "${APPLY_INPUT}" == "0" ]]; then + if [[ -n "${APPLY_VALUE}" ]]; then + BUILD_ARGS+=(--build-arg "APPLY_LLAMA_PR_15405=${APPLY_VALUE}") + if [[ "${APPLY_VALUE}" == "0" ]]; then NAME_SUFFIX="-no-pr15405" fi fi @@ -102,7 +117,17 @@ jobs: IMM="${DOCKERHUB_REPO}:${TAG}" CHN="${DOCKERHUB_REPO}:${NAME}" - echo "→ Building ${DF}" + if [[ -n "${APPLY_VALUE}" ]]; then + if [[ "${APPLY_VALUE}" == "1" ]]; then + echo "→ Building ${DF} with llama.cpp PR 15405 applied" + else + echo "→ Building ${DF} with llama.cpp PR 15405 skipped" + fi + else + echo "→ Building ${DF} using Dockerfile default PR behavior" + fi + + echo "→ Docker build args: ${BUILD_ARGS[*]:-(default)}" docker build --no-cache "${BUILD_ARGS[@]}" -t "${LI}" -f "${DF}" . echo "→ Tag & push immutable → ${IMM}" diff --git a/toolboxes/Dockerfile.rocm-6.4.4 b/toolboxes/Dockerfile.rocm-6.4.4 index ab8061f..c070959 100644 --- a/toolboxes/Dockerfile.rocm-6.4.4 +++ b/toolboxes/Dockerfile.rocm-6.4.4 @@ -41,10 +41,13 @@ RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git . # build RUN git clean -xdf \ && if [ "${APPLY_LLAMA_PR_15405}" = "1" ]; then \ + echo "Applying llama.cpp PR 15405"; \ git config user.email "builder@localhost"; \ git config user.name "Container Builder"; \ git fetch origin pull/15405/head:pr-15405; \ git merge --no-edit pr-15405; \ + else \ + echo "Skipping llama.cpp PR 15405"; \ fi \ && git submodule update --recursive \ && cmake -S . -B build \ diff --git a/toolboxes/Dockerfile.rocm-6.4.4-rocwmma b/toolboxes/Dockerfile.rocm-6.4.4-rocwmma index 8b5f63f..b885b38 100644 --- a/toolboxes/Dockerfile.rocm-6.4.4-rocwmma +++ b/toolboxes/Dockerfile.rocm-6.4.4-rocwmma @@ -45,10 +45,13 @@ RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git . RUN git clean -xdf \ && if [ "${APPLY_LLAMA_PR_15405}" = "1" ]; then \ + echo "Applying llama.cpp PR 15405"; \ git config user.email "builder@localhost"; \ git config user.name "Container Builder"; \ git fetch origin pull/15405/head:pr-15405; \ git merge --no-edit pr-15405; \ + else \ + echo "Skipping llama.cpp PR 15405"; \ fi \ && git submodule update --recursive diff --git a/toolboxes/Dockerfile.rocm-7.1 b/toolboxes/Dockerfile.rocm-7.1 index b5734be..591c633 100644 --- a/toolboxes/Dockerfile.rocm-7.1 +++ b/toolboxes/Dockerfile.rocm-7.1 @@ -41,10 +41,13 @@ RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git . # build RUN git clean -xdf \ && if [ "${APPLY_LLAMA_PR_15405}" = "1" ]; then \ + echo "Applying llama.cpp PR 15405"; \ git config user.email "builder@localhost"; \ git config user.name "Container Builder"; \ git fetch origin pull/15405/head:pr-15405; \ git merge --no-edit pr-15405; \ + else \ + echo "Skipping llama.cpp PR 15405"; \ fi \ && git submodule update --recursive \ && cmake -S . -B build \ diff --git a/toolboxes/Dockerfile.rocm-7.1-rocwmma b/toolboxes/Dockerfile.rocm-7.1-rocwmma index 99b2bed..9cb6ffb 100644 --- a/toolboxes/Dockerfile.rocm-7.1-rocwmma +++ b/toolboxes/Dockerfile.rocm-7.1-rocwmma @@ -50,10 +50,13 @@ RUN chmod +x /opt/apply-rocwmma-fix.sh && /opt/apply-rocwmma-fix.sh /opt/llama.c # build RUN git clean -xdf \ && if [ "${APPLY_LLAMA_PR_15405}" = "1" ]; then \ + echo "Applying llama.cpp PR 15405"; \ git config user.email "builder@localhost"; \ git config user.name "Container Builder"; \ git fetch origin pull/15405/head:pr-15405; \ git merge --no-edit pr-15405; \ + else \ + echo "Skipping llama.cpp PR 15405"; \ fi \ && git submodule update --recursive \ && cmake -S . -B build \ diff --git a/toolboxes/Dockerfile.rocm-7alpha b/toolboxes/Dockerfile.rocm-7alpha index c3b36f0..3918970 100644 --- a/toolboxes/Dockerfile.rocm-7alpha +++ b/toolboxes/Dockerfile.rocm-7alpha @@ -59,10 +59,13 @@ WORKDIR /opt/llama.cpp RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git . \ && git clean -xdf \ && if [ "${APPLY_LLAMA_PR_15405}" = "1" ]; then \ + echo "Applying llama.cpp PR 15405"; \ git config user.email "builder@localhost"; \ git config user.name "Container Builder"; \ git fetch origin pull/15405/head:pr-15405; \ git merge --no-edit pr-15405; \ + else \ + echo "Skipping llama.cpp PR 15405"; \ fi \ && git submodule update --recursive diff --git a/toolboxes/Dockerfile.rocm-7alpha-rocwmma b/toolboxes/Dockerfile.rocm-7alpha-rocwmma index b82c3ca..3846a2f 100644 --- a/toolboxes/Dockerfile.rocm-7alpha-rocwmma +++ b/toolboxes/Dockerfile.rocm-7alpha-rocwmma @@ -63,10 +63,13 @@ WORKDIR /opt/llama.cpp RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git . \ && git clean -xdf \ && if [ "${APPLY_LLAMA_PR_15405}" = "1" ]; then \ + echo "Applying llama.cpp PR 15405"; \ git config user.email "builder@localhost"; \ git config user.name "Container Builder"; \ git fetch origin pull/15405/head:pr-15405; \ git merge --no-edit pr-15405; \ + else \ + echo "Skipping llama.cpp PR 15405"; \ fi \ && git submodule update --recursive COPY ./apply-rocwmma-fix.sh /opt/apply-rocwmma-fix.sh diff --git a/toolboxes/Dockerfile.rocm-7alpha-rocwmma-improved b/toolboxes/Dockerfile.rocm-7alpha-rocwmma-improved index 3782c93..75606bd 100644 --- a/toolboxes/Dockerfile.rocm-7alpha-rocwmma-improved +++ b/toolboxes/Dockerfile.rocm-7alpha-rocwmma-improved @@ -63,10 +63,13 @@ WORKDIR /opt/llama.cpp RUN git clone --recursive https://github.com/hjc4869/llama.cpp.git . \ && git clean -xdf \ && if [ "${APPLY_LLAMA_PR_15405}" = "1" ]; then \ + echo "Applying llama.cpp PR 15405"; \ git config user.email "builder@localhost"; \ git config user.name "Container Builder"; \ git fetch origin pull/15405/head:pr-15405; \ git merge --no-edit pr-15405; \ + else \ + echo "Skipping llama.cpp PR 15405"; \ fi \ && git submodule update --recursive COPY ./apply-rocwmma-fix.sh /opt/apply-rocwmma-fix.sh diff --git a/toolboxes/Dockerfile.rocm-7rc b/toolboxes/Dockerfile.rocm-7rc index a4d108c..cdb7689 100644 --- a/toolboxes/Dockerfile.rocm-7rc +++ b/toolboxes/Dockerfile.rocm-7rc @@ -58,10 +58,13 @@ WORKDIR /opt/llama.cpp RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git . \ && git clean -xdf \ && if [ "${APPLY_LLAMA_PR_15405}" = "1" ]; then \ + echo "Applying llama.cpp PR 15405"; \ git config user.email "builder@localhost"; \ git config user.name "Container Builder"; \ git fetch origin pull/15405/head:pr-15405; \ git merge --no-edit pr-15405; \ + else \ + echo "Skipping llama.cpp PR 15405"; \ fi \ && git submodule update --recursive diff --git a/toolboxes/Dockerfile.rocm-7rc-rocwmma b/toolboxes/Dockerfile.rocm-7rc-rocwmma index d5c560c..c775add 100644 --- a/toolboxes/Dockerfile.rocm-7rc-rocwmma +++ b/toolboxes/Dockerfile.rocm-7rc-rocwmma @@ -62,10 +62,13 @@ WORKDIR /opt/llama.cpp RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git . \ && git clean -xdf \ && if [ "${APPLY_LLAMA_PR_15405}" = "1" ]; then \ + echo "Applying llama.cpp PR 15405"; \ git config user.email "builder@localhost"; \ git config user.name "Container Builder"; \ git fetch origin pull/15405/head:pr-15405; \ git merge --no-edit pr-15405; \ + else \ + echo "Skipping llama.cpp PR 15405"; \ fi \ && git submodule update --recursive diff --git a/toolboxes/Dockerfile.vulkan-amdvlk b/toolboxes/Dockerfile.vulkan-amdvlk index 291b1ed..ddb4634 100644 --- a/toolboxes/Dockerfile.vulkan-amdvlk +++ b/toolboxes/Dockerfile.vulkan-amdvlk @@ -24,10 +24,13 @@ RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git . # build RUN git clean -xdf \ && if [ "${APPLY_LLAMA_PR_15405}" = "1" ]; then \ + echo "Applying llama.cpp PR 15405"; \ git config user.email "builder@localhost"; \ git config user.name "Container Builder"; \ git fetch origin pull/15405/head:pr-15405; \ git merge --no-edit pr-15405; \ + else \ + echo "Skipping llama.cpp PR 15405"; \ fi \ && git submodule update --recursive \ && cmake -S . -B build -G Ninja \ diff --git a/toolboxes/Dockerfile.vulkan-radv b/toolboxes/Dockerfile.vulkan-radv index 969e2fd..d6cd4ac 100644 --- a/toolboxes/Dockerfile.vulkan-radv +++ b/toolboxes/Dockerfile.vulkan-radv @@ -18,10 +18,13 @@ RUN git clone --recursive https://github.com/ggerganov/llama.cpp.git . # build RUN git clean -xdf \ && if [ "${APPLY_LLAMA_PR_15405}" = "1" ]; then \ + echo "Applying llama.cpp PR 15405"; \ git config user.email "builder@localhost"; \ git config user.name "Container Builder"; \ git fetch origin pull/15405/head:pr-15405; \ git merge --no-edit pr-15405; \ + else \ + echo "Skipping llama.cpp PR 15405"; \ fi \ && git submodule update --recursive \ && cmake -S . -B build -G Ninja \