Skip to content

Commit

Permalink
add support for ghcr.io/huggingface/text-generation-inference
Browse files Browse the repository at this point in the history
Signed-off-by: Sun, Xuehao <[email protected]>
  • Loading branch information
XuehaoSun committed Aug 19, 2024
1 parent 722f9fd commit 5dc7644
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/manual-freeze-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
description: "Tag to apply to images"
required: true
type: string
text-generation-inference-tag:
default: "latest"
description: "Tag of ghcr.io/huggingface/text-generation-inference"
required: true
type: string

jobs:
freeze-tag:
Expand All @@ -36,6 +41,7 @@ jobs:
- name: Run script
run: |
find . -name "*.md" | xargs sed -i "s|^docker\ compose|TAG=${{ github.event.inputs.tag }}\ docker\ compose|g"
find . -name "*.md" | xargs sed -i "s|ghcr.io/huggingface/text-generation-inference:latest[a-Z0-9\-]*|ghcr.io/huggingface/text-generation-inference:${{ github.event.inputs.text-generation-inference-tag }}|g"
- name: Commit changes
run: |
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/scripts/freeze_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

declare -A dict
dict["langchain/langchain"]="docker://docker.io/langchain/langchain"
# dict["ghcr.io/huggingface/text-generation-inference"]="docker://ghcr.io/huggingface/text-generation-inference"
dict["ghcr.io/huggingface/text-generation-inference"]="docker://ghcr.io/huggingface/text-generation-inference"

function get_latest_version() {
repo_image=$1
versions=$(skopeo list-tags ${dict[$repo_image]} | jq -r '.Tags[]')
printf "version list:\n$versions\n"
latest_version=$(printf "%s\n" "${versions[@]}" | grep -E '^[\.rc0-9\-]+$' | sort -V | tail -n 1)
latest_version=$(printf "%s\n" "${versions[@]}" | grep -E '^[\.0-9]+$' | sort -V | tail -n 1)
echo "latest version: $latest_version"
replace_image_version $repo_image $latest_version
}
Expand All @@ -23,7 +23,8 @@ function replace_image_version() {
echo "version is empty"
else
echo "replace $repo_image:latest with $repo_image:$version"
find . -name "Dockerfile" | xargs sed -i "s|$repo_image:latest|$repo_image:$version|g"
find . -name "Dockerfile" | xargs sed -i "s|$repo_image:latest.*|$repo_image:$version|g"
find . -name "*.yaml" | xargs sed -i "s|$repo_image:latest[a-Z0-9\-]*|$repo_image:$version|g"
fi
}

Expand Down

0 comments on commit 5dc7644

Please sign in to comment.