CI: clean up naming, fix tagging latest (#6832)

The rocm CI step for RCs was incorrectly tagging them as the latest rocm build.
The multiarch manifest was incorrectly tagged twice (with and without the
prefix "v").  Static windows artifacts weren't being carried between build
jobs.  This also fixes the latest tagging script.
This commit is contained in:
Daniel Hiltgen 2024-09-16 16:18:41 -07:00 committed by GitHub
parent 0ec2915ea7
commit 7717bb6a84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 32 deletions

View file

@ -104,6 +104,7 @@ jobs:
path: | path: |
build/**/* build/**/*
build/**/*.a build/**/*.a
llm/build/**/*.a
dist/windows-amd64/** dist/windows-amd64/**
# ROCm generation step # ROCm generation step
@ -421,7 +422,7 @@ jobs:
!dist/*-cov !dist/*-cov
# Container image build # Container image build
build-linux: build-container-image:
environment: release environment: release
strategy: strategy:
matrix: matrix:
@ -459,7 +460,6 @@ jobs:
flavor: | flavor: |
latest=false latest=false
tags: | tags: |
type=ref,event=tag
type=ref,enable=true,priority=600,prefix=0.0.0-pr,suffix=,event=pr type=ref,enable=true,priority=600,prefix=0.0.0-pr,suffix=,event=pr
type=semver,pattern={{version}} type=semver,pattern={{version}}
- name: Set Version - name: Set Version
@ -503,7 +503,7 @@ jobs:
environment: release environment: release
runs-on: linux runs-on: linux
needs: needs:
- build-linux - build-container-image
env: env:
FINAL_IMAGE_REPO: ollama/ollama FINAL_IMAGE_REPO: ollama/ollama
steps: steps:
@ -526,7 +526,6 @@ jobs:
flavor: | flavor: |
latest=false latest=false
tags: | tags: |
type=ref,event=tag
type=ref,enable=true,priority=600,prefix=0.0.0-pr,suffix=,event=pr type=ref,enable=true,priority=600,prefix=0.0.0-pr,suffix=,event=pr
type=semver,pattern={{version}} type=semver,pattern={{version}}
- name: Set Version - name: Set Version
@ -551,7 +550,7 @@ jobs:
- name: Inspect image - name: Inspect image
run: | run: |
docker buildx imagetools inspect ${{ env.FINAL_IMAGE_REPO }}:${{ steps.meta.outputs.version }} docker buildx imagetools inspect ${{ env.FINAL_IMAGE_REPO }}:${{ steps.meta.outputs.version }}
build-linux-rocm: build-container-image-rocm:
environment: release environment: release
runs-on: linux runs-on: linux
env: env:
@ -570,7 +569,6 @@ jobs:
flavor: | flavor: |
latest=false latest=false
tags: | tags: |
type=ref,event=tag
type=ref,enable=true,priority=600,prefix=0.0.0-pr,suffix=,event=pr type=ref,enable=true,priority=600,prefix=0.0.0-pr,suffix=,event=pr
type=semver,pattern={{version}} type=semver,pattern={{version}}
- name: Set Version - name: Set Version
@ -592,7 +590,7 @@ jobs:
target: runtime-rocm target: runtime-rocm
build-args: | build-args: |
GOFLAGS GOFLAGS
tags: ${{ env.FINAL_IMAGE_REPO }}:${{ env.DOCKER_METADATA_OUTPUT_VERSION}}-rocm,${{ env.FINAL_IMAGE_REPO }}:rocm tags: ${{ env.FINAL_IMAGE_REPO }}:${{ env.DOCKER_METADATA_OUTPUT_VERSION}}-rocm
push: true push: true
# Aggregate all the assets and ship a release # Aggregate all the assets and ship a release

View file

@ -2,32 +2,12 @@
set -eu set -eu
# We use 2 different image repositories to handle combining architecture images into multiarch manifest
# (The ROCm image is x86 only and is not a multiarch manifest)
# For developers, you can override the DOCKER_ORG to generate multiarch manifests # For developers, you can override the DOCKER_ORG to generate multiarch manifests
# DOCKER_ORG=jdoe VERSION=0.1.30 PUSH=1 ./scripts/tag_latest.sh # DOCKER_ORG=jdoe VERSION=0.1.30 ./scripts/tag_latest.sh
DOCKER_ORG=${DOCKER_ORG:-"ollama"} DOCKER_ORG=${DOCKER_ORG:-"ollama"}
RELEASE_IMAGE_REPO=${RELEASE_IMAGE_REPO:-"${DOCKER_ORG}/release"}
FINAL_IMAGE_REPO=${FINAL_IMAGE_REPO:-"${DOCKER_ORG}/ollama"} FINAL_IMAGE_REPO=${FINAL_IMAGE_REPO:-"${DOCKER_ORG}/ollama"}
# Set PUSH to a non-empty string to trigger push instead of load echo "Updating ${FINAL_IMAGE_REPO}:latest -> ${FINAL_IMAGE_REPO}:${VERSION}"
PUSH=${PUSH:-""} docker buildx imagetools create -t ${FINAL_IMAGE_REPO}:latest ${FINAL_IMAGE_REPO}:${VERSION}
echo "Updating ${FINAL_IMAGE_REPO}:rocm -> ${FINAL_IMAGE_REPO}:${VERSION}-rocm"
echo "Assembling manifest and tagging latest" docker buildx imagetools create -t ${FINAL_IMAGE_REPO}:rocm ${FINAL_IMAGE_REPO}:${VERSION}-rocm
docker manifest rm ${FINAL_IMAGE_REPO}:latest || true
docker manifest create ${FINAL_IMAGE_REPO}:latest \
${RELEASE_IMAGE_REPO}:$VERSION-amd64 \
${RELEASE_IMAGE_REPO}:$VERSION-arm64
docker pull ${RELEASE_IMAGE_REPO}:$VERSION-rocm
docker tag ${RELEASE_IMAGE_REPO}:$VERSION-rocm ${FINAL_IMAGE_REPO}:rocm
if [ -n "${PUSH}" ]; then
echo "Pushing latest tags up..."
docker manifest push ${FINAL_IMAGE_REPO}:latest
docker push ${FINAL_IMAGE_REPO}:rocm
else
echo "Not pushing ${FINAL_IMAGE_REPO}:latest and ${FINAL_IMAGE_REPO}:rocm"
fi