Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cherry-Pick] add a new gitaction to verify odh-model-controller image tag per branch #236

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/verify-odh-model-controller-img-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Check ODH Model Controller Image Tag

on:
pull_request:
branches: [main, release*]
paths:
- "config/base/params.env"

jobs:
check-image-tag:
runs-on: ubuntu-latest

steps:
- name: Checkout PR branch
uses: actions/checkout@v4

- name: Extract image tag from PR branch
id: extract-pr
run: |
IMAGE_TAG=$(grep '^odh-model-controller' config/base/params.env | cut -d '=' -f 2 | cut -d ':' -f 2 | tr -d ' ')
echo "PR_IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV

- name: Compare image tags
id: compare-tags
run: |
if [ "${{ github.base_ref }}" == "main" ]; then
EXPECTED_TAG="fast"
elif [[ "${{ github.base_ref }}" =~ ^release-(.*) ]]; then
VERSION=${BASH_REMATCH[1]}
EXPECTED_TAG="v$VERSION"
else
echo "Unknown destination branch: ${{ github.base_ref }}"
exit 1
fi

# Check if PR_IMAGE_TAG matches EXPECTED_TAG followed by a dot and digits
PR_IMAGE_TAG=${{ env.PR_IMAGE_TAG }}
if [[ ! "$PR_IMAGE_TAG" =~ ^"$EXPECTED_TAG"(\.[0-9]+)?$ ]]; then
echo "Image tag mismatch! Expected '$EXPECTED_TAG' but found '$PR_IMAGE_TAG'"
exit 1
fi

echo "Image tag ('$PR_IMAGE_TAG') is correct."
2 changes: 1 addition & 1 deletion config/base/params.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
odh-model-controller=quay.io/opendatahub/odh-model-controller:v0.12.0-latest
odh-model-controller=quay.io/opendatahub/odh-model-controller:v0.12.0
caikit-tgis-image=quay.io/opendatahub/caikit-tgis-serving:stable-01d6d99
caikit-standalone-image=quay.io/opendatahub/caikit-nlp:stable-994ec60
tgis-image=quay.io/opendatahub/text-generation-inference:stable-ed9d828
Expand Down