Add build-and-push workflow

This commit is contained in:
Donato Capitella
2025-08-06 08:56:58 +01:00
parent 4a58483ff9
commit 2c90eac378
4 changed files with 65 additions and 2 deletions
+57
View File
@@ -0,0 +1,57 @@
# File: .github/workflows/build-and-push.yml
name: Build & Push AMD Strix Halo Toolboxes
on:
workflow_dispatch:
env:
DOCKERHUB_REPO: docker.io/kyuz0/amd-strix-halo-toolboxes
LOCAL_PREFIX: llama
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
backend:
- rocm-6.4.2
- rocm-7beta
- rocm-7rc
- vulkan-amdvlk
- vulkan-radv
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set build timestamp
run: echo "BUILD_TS=$(date +%Y%m%dT%H%M%S)" >> $GITHUB_ENV
- name: Build & push ${{ matrix.backend }}
run: |
set -euo pipefail
BACKEND="${{ matrix.backend }}"
DF="toolboxes/Dockerfile.${BACKEND}"
LOCAL_IMAGE="${LOCAL_PREFIX}-${BACKEND}"
BUILD_TAG="${BACKEND}_${BUILD_TS}"
IMMUTABLE_REF="${DOCKERHUB_REPO}:${BUILD_TAG}"
CHANNEL_REF="${DOCKERHUB_REPO}:${BACKEND}"
echo "→ Building ${DF}"
docker build --no-cache -t "${LOCAL_IMAGE}" -f "${DF}" .
echo "→ Tag & push immutable → ${IMMUTABLE_REF}"
docker tag "${LOCAL_IMAGE}" "${IMMUTABLE_REF}"
docker push "${IMMUTABLE_REF}"
echo "→ Tag & push channel → ${CHANNEL_REF}"
docker tag "${IMMUTABLE_REF}" "${CHANNEL_REF}"
docker push "${CHANNEL_REF}"
+2 -2
View File
@@ -24,14 +24,14 @@ Each backend has its own subdirectory and Dockerfile in `toolboxes/`.
```sh ```sh
cd toolboxes cd toolboxes
podman build -t llama-vulkan-radv -f Dockerfile.vulkan-radv . podman build --no-cache -t llama-vulkan-radv -f Dockerfile.vulkan-radv .
``` ```
**Example: Build the ROCm 6.4.2 toolbox image** **Example: Build the ROCm 6.4.2 toolbox image**
```sh ```sh
cd ../rocm-6.4.2 cd ../rocm-6.4.2
podman build -t llama-rocm-6.4.2 -f Dockerfile.rocm-6.4.2 . podman build --no-cache -t llama-rocm-6.4.2 -f Dockerfile.rocm-6.4.2 .
``` ```
> You can use `docker build` if you prefer Docker. > You can use `docker build` if you prefer Docker.
+3
View File
@@ -32,6 +32,9 @@ RUN git clean -xdf \
&& cmake --build build --config Release \ && cmake --build build --config Release \
&& cmake --install build --config Release && cmake --install build --config Release
RUN find /opt/llama.cpp/build -type f -name 'lib*.so*' -exec cp {} /usr/lib64/ \; \
&& ldconfig
COPY gguf-vram-estimator.py /usr/local/bin/gguf-vram-estimator.py COPY gguf-vram-estimator.py /usr/local/bin/gguf-vram-estimator.py
RUN chmod +x /usr/local/bin/gguf-vram-estimator.py RUN chmod +x /usr/local/bin/gguf-vram-estimator.py
+3
View File
@@ -27,6 +27,9 @@ RUN git clean -xdf \
&& cmake --build build --config Release \ && cmake --build build --config Release \
&& cmake --install build --config Release && cmake --install build --config Release
RUN find /opt/llama.cpp/build -type f -name 'lib*.so*' -exec cp {} /usr/lib64/ \; \
&& ldconfig
COPY gguf-vram-estimator.py /usr/local/bin/gguf-vram-estimator.py COPY gguf-vram-estimator.py /usr/local/bin/gguf-vram-estimator.py
RUN chmod +x /usr/local/bin/gguf-vram-estimator.py RUN chmod +x /usr/local/bin/gguf-vram-estimator.py