diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 97168f1..fccee6d 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -3,7 +3,7 @@ name: Build Containers on: # time has no specific meaning, trying to time it after # the llama.cpp daily packages are published - # https://github.com/ggerganov/llama.cpp/blob/master/.github/workflows/docker.yml + # https://github.com/ggml-org/llama.cpp/blob/master/.github/workflows/docker.yml schedule: - cron: "37 5 * * *" @@ -31,4 +31,4 @@ jobs: - name: Run build-container env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./docker/build-container.sh ${{ matrix.platform }} \ No newline at end of file + run: ./docker/build-container.sh ${{ matrix.platform }} true \ No newline at end of file diff --git a/docker/build-container.sh b/docker/build-container.sh index efd6c4d..d7c02c4 100755 --- a/docker/build-container.sh +++ b/docker/build-container.sh @@ -3,6 +3,7 @@ cd $(dirname "$0") ARCH=$1 +PUSH_IMAGES=${2:-false} # List of allowed architectures ALLOWED_ARCHS=("intel" "vulkan" "musa" "cuda" "cpu") @@ -28,10 +29,12 @@ if [ "$ARCH" == "cpu" ]; then CONTAINER_LATEST="ghcr.io/mostlygeek/llama-swap:cpu" echo "Building ${CONTAINER_LATEST} $LS_VER" docker build -f llama-swap.Containerfile --build-arg BASE_TAG=server --build-arg LS_VER=${LS_VER} -t ${CONTAINER_LATEST} . - docker push ${CONTAINER_LATEST} + if [ "$PUSH_IMAGES" == "true" ]; then + docker push ${CONTAINER_LATEST} + fi else LCPP_TAG=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ - "https://api.github.com/users/ggerganov/packages/container/llama.cpp/versions" \ + "https://api.github.com/users/ggml-org/packages/container/llama.cpp/versions" \ | jq -r --arg arch "$ARCH" '.[] | select(.metadata.container.tags[] | startswith("server-\($arch)")) | .metadata.container.tags[]' \ | sort -r | head -n1 | awk -F '-' '{print $3}') @@ -39,6 +42,8 @@ else CONTAINER_LATEST="ghcr.io/mostlygeek/llama-swap:${ARCH}" echo "Building ${CONTAINER_TAG} $LS_VER" docker build -f llama-swap.Containerfile --build-arg BASE_TAG=server-${ARCH}-${LCPP_TAG} --build-arg LS_VER=${LS_VER} -t ${CONTAINER_TAG} -t ${CONTAINER_LATEST} . - docker push ${CONTAINER_TAG} - docker push ${CONTAINER_LATEST} + if [ "$PUSH_IMAGES" == "true" ]; then + docker push ${CONTAINER_TAG} + docker push ${CONTAINER_LATEST} + fi fi \ No newline at end of file diff --git a/docker/llama-swap.Containerfile b/docker/llama-swap.Containerfile index be8a2e4..53ea82a 100644 --- a/docker/llama-swap.Containerfile +++ b/docker/llama-swap.Containerfile @@ -1,5 +1,5 @@ ARG BASE_TAG=server-cuda -FROM ghcr.io/ggerganov/llama.cpp:${BASE_TAG} +FROM ghcr.io/ggml-org/llama.cpp:${BASE_TAG} # has to be after the FROM ARG LS_VER=89