forked from ollama/ollama
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI automation for tagging latest images
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: latest | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
update-latest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: fetch images | ||
env: | ||
ARCH_IMAGE_REPO: dhiltgen/release | ||
FINAL_IMAGE_REPO: dhiltgen/ollama | ||
# PUSH: "1" | ||
run: | | ||
export "VERSION=${GITHUB_REF_NAME#v}" | ||
env | ||
./scripts/tag_latest.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/sh | ||
|
||
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 | ||
# DOCKER_ORG=jdoe PUSH=1 ./scripts/build_docker.sh | ||
DOCKER_ORG=${DOCKER_ORG:-"ollama"} | ||
ARCH_IMAGE_REPO=${ARCH_IMAGE_REPO:-"${DOCKER_ORG}/release"} | ||
FINAL_IMAGE_REPO=${FINAL_IMAGE_REPO:-"${DOCKER_ORG}/ollama"} | ||
|
||
# Set PUSH to a non-empty string to trigger push instead of load | ||
PUSH=${PUSH:-""} | ||
|
||
echo "Assembling manifest and tagging latest" | ||
docker manifest rm ${FINAL_IMAGE_REPO}:latest || true | ||
docker manifest create ${FINAL_IMAGE_REPO}:latest \ | ||
${ARCH_IMAGE_REPO}:$VERSION-amd64 \ | ||
${ARCH_IMAGE_REPO}:$VERSION-arm64 | ||
|
||
docker pull ${ARCH_IMAGE_REPO}:$VERSION-rocm | ||
docker tag ${ARCH_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 | ||
|
||
|