diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml new file mode 100644 index 0000000..c98baf7 --- /dev/null +++ b/.github/workflows/build_and_publish.yml @@ -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}" diff --git a/docs/building.md b/docs/building.md index af3f888..6a181fb 100644 --- a/docs/building.md +++ b/docs/building.md @@ -24,14 +24,14 @@ Each backend has its own subdirectory and Dockerfile in `toolboxes/`. ```sh 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** ```sh 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. diff --git a/toolboxes/Dockerfile.vulkan-amdvlk b/toolboxes/Dockerfile.vulkan-amdvlk index b057f3a..facd6da 100644 --- a/toolboxes/Dockerfile.vulkan-amdvlk +++ b/toolboxes/Dockerfile.vulkan-amdvlk @@ -32,6 +32,9 @@ RUN git clean -xdf \ && cmake --build 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 RUN chmod +x /usr/local/bin/gguf-vram-estimator.py diff --git a/toolboxes/Dockerfile.vulkan-radv b/toolboxes/Dockerfile.vulkan-radv index e5f52c3..09a568a 100644 --- a/toolboxes/Dockerfile.vulkan-radv +++ b/toolboxes/Dockerfile.vulkan-radv @@ -27,6 +27,9 @@ RUN git clean -xdf \ && cmake --build 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 RUN chmod +x /usr/local/bin/gguf-vram-estimator.py