diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b9d226a2..69157505e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -477,12 +477,31 @@ jobs: token: ${{ secrets.CLI_RELEASE_PAT }} fetch-depth: 0 - - name: Bump docker-model version in build.json + - name: Fetch latest llamacpp version from Docker Hub + id: llamacpp + run: | + TAGS_JSON=$(curl -s "https://hub.docker.com/v2/repositories/docker/docker-model-backend-llamacpp/tags?page_size=25&ordering=last_updated") + LLAMACPP_VERSION=$(echo "$TAGS_JSON" | jq -r ' + (.results[] | select(.name == "latest-cpu") | .digest) as $d | + .results[] | select(.name != "latest-cpu" and (.name | test("^v[0-9]+\\.[0-9]+\\.[0-9]+-cpu$")) and .digest == $d) | .name | split("-")[0] + ') + if [ -z "$LLAMACPP_VERSION" ] || [ "$LLAMACPP_VERSION" = "null" ]; then + echo "::error::Failed to fetch latest llamacpp version from Docker Hub" + exit 1 + fi + echo "version=$LLAMACPP_VERSION" >> "$GITHUB_OUTPUT" + echo "📦 Latest llamacpp version: $LLAMACPP_VERSION" + + - name: Bump docker-model and llamacpp versions in build.json env: VERSION: ${{ needs.prepare.outputs.version }} + LLAMACPP_VERSION: ${{ steps.llamacpp.outputs.version }} run: | NEW_VERSION="v${VERSION}" - jq --arg v "$NEW_VERSION" '.["docker-model"].version = $v' build.json > build.json.tmp + jq --arg model_v "$NEW_VERSION" --arg llama_v "$LLAMACPP_VERSION" ' + .["docker-model"].version = $model_v | + .["llamacpp"].version = $llama_v + ' build.json > build.json.tmp mv build.json.tmp build.json - name: Create pull request @@ -490,9 +509,9 @@ jobs: with: token: ${{ secrets.CLI_RELEASE_PAT }} base: main - commit-message: "chore: bump docker-model to v${{ needs.prepare.outputs.version }}" + commit-message: "chore: bump docker-model to v${{ needs.prepare.outputs.version }} and llamacpp to ${{ steps.llamacpp.outputs.version }}" branch: bump-docker-model-v${{ needs.prepare.outputs.version }} - title: "Bump docker-model to v${{ needs.prepare.outputs.version }}" + title: "Bump docker-model to v${{ needs.prepare.outputs.version }} and llamacpp to ${{ steps.llamacpp.outputs.version }}" body: | ### Ticket(s) @@ -500,7 +519,8 @@ jobs: ### What this PR does - Bumps docker-model version to v${{ needs.prepare.outputs.version }} in build.json. + - Bumps docker-model version to v${{ needs.prepare.outputs.version }} in build.json. + - Bumps llamacpp version to ${{ steps.llamacpp.outputs.version }} in build.json (latest from [Docker Hub](https://hub.docker.com/r/docker/docker-model-backend-llamacpp/tags)). ### Notes for the reviewer @@ -540,6 +560,15 @@ jobs: echo "changed=false" >> "$GITHUB_OUTPUT" fi + - name: Checkout model-runner + if: steps.check-docs.outputs.changed == 'true' + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + + - name: Load GO version + if: steps.check-docs.outputs.changed == 'true' + id: versions + uses: ./.github/actions/load-go-version + - name: Checkout docs if: steps.check-docs.outputs.changed == 'true' uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd @@ -548,10 +577,6 @@ jobs: token: ${{ secrets.CLI_RELEASE_PAT }} fetch-depth: 0 - - name: Load GO version - id: versions - uses: ./.github/actions/load-go-version - - name: Set up Go if: steps.check-docs.outputs.changed == 'true' uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c