forked from opendatahub-io/opendatahub-operator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
183 additions
and
1 deletion.
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,16 @@ | ||
{ | ||
"version": "2.10.0", | ||
"codeflare": "test1", | ||
"kuberay": "test2", | ||
"kueue": "test3", | ||
"dspo": "test4", | ||
"dashboard": "test5", | ||
"notebooks": "test", | ||
"notebook-controller": "test", | ||
"kf-notebook-controller": "test", | ||
"trustyai": "tedt", | ||
"model-mesh": "tet", | ||
"odh-model-controller": "tedt5", | ||
"kserve": "release/v10", | ||
"modelregistry": "release/test" | ||
} |
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,37 @@ | ||
#!/bin/bash | ||
|
||
update_tags(){ | ||
MANIFEST_STR=$(cat get_all_manifests.sh | grep $1 | sed 's/ //g') | ||
readarray -d ":" -t STR_ARR <<< "$MANIFEST_STR" | ||
RES="" | ||
for i in "${!STR_ARR[@]}"; do | ||
if [ $i == 2 ]; then | ||
RES+=$2":" | ||
else | ||
RES+=${STR_ARR[$i]}":" | ||
fi | ||
done | ||
echo here | ||
echo "${RES::-2}" | ||
sed -i -r "s|.*$1.*| ${RES::-2}|" get_all_manifests.sh | ||
} | ||
|
||
declare -A COMPONENT_VERSION_MAP=( | ||
["\"codeflare\""]=$1 | ||
["\"ray\""]=$2 | ||
["\"kueue\""]=$3 | ||
["\"data-science-pipelines-operator\""]=$4 | ||
["\"odh-dashboard\""]=$5 | ||
["\"kf-notebook-controller\""]=$6 | ||
["\"odh-notebook-controller\""]=$7 | ||
["\"notebooks\""]=$8 | ||
["\"trustyai\""]=$9 | ||
["\"model-mesh\""]=$10 | ||
["\"odh-model-controller\""]=$11 | ||
["\"kserve\""]=$12 | ||
["\"modelregistry\""]=$13 | ||
) | ||
|
||
for key in ${!COMPONENT_VERSION_MAP[@]}; do | ||
update_tags ${key} ${COMPONENT_VERSION_MAP[${key}]} | ||
done |
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,23 @@ | ||
#!/bin/bash | ||
# | ||
# @param $1 - PR number or URL | ||
# wait for a bit until pr is created, otherwise it throws an error "no checks reported on the 'odh-release/e2e-test' branch" | ||
sleep 10 | ||
|
||
while $(gh pr checks "$1" | grep -q -v 'tide' | grep -q 'pending'); do | ||
printf ":stopwatch: PR checks still pending, retrying in 10 seconds...\n" | ||
sleep 10 | ||
done | ||
|
||
if $(gh pr checks "$1" | grep -q 'fail'); then | ||
printf ":x: PR checks failed!\n" | ||
exit 1 | ||
fi | ||
|
||
if $(gh pr checks "$1" | grep -q 'pass'); then | ||
printf ":white_check_mark: PR checks passed!\n" | ||
exit 0 | ||
fi | ||
|
||
printf ":confused: An unknown error occurred!\n" | ||
exit 1 |
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,54 @@ | ||
name: "Update tags in draft pr" | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
create-e2e-test-pr: | ||
permissions: write-all | ||
name: Create e2e test pr | ||
runs-on: ubuntu-latest | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v4 | ||
# This step needs to be automated | ||
- name: Read json and set env vars | ||
run: | | ||
echo "VERSION=$(cat .github/resources/manifest-versions.json | jq .version )" >> $GITHUB_ENV | ||
echo "CODEFLARE_BRANCH=$(cat .github/resources/manifest-versions.json | jq .codeflare )" >> $GITHUB_ENV | ||
echo "KUBERAY_BRANCH=$(cat .github/resources/manifest-versions.json | jq .kuberay )" >> $GITHUB_ENV | ||
echo "KUEUE_BRANCH=$(cat .github/resources/manifest-versions.json | jq .kueue )" >> $GITHUB_ENV | ||
echo "DSPO_BRANCH=$(cat .github/resources/manifest-versions.json | jq .dspo )" >> $GITHUB_ENV | ||
echo "DASHBOARD_BRANCH=$(cat .github/resources/manifest-versions.json | jq .dashboard )" >> $GITHUB_ENV | ||
echo "NB_BRANCH=$(cat .github/resources/manifest-versions.json | jq .notebooks )" >> $GITHUB_ENV | ||
echo "NB_CONTROLLER_BRANCH=$(cat .github/resources/manifest-versions.json | jq .notebook-controller )" >> $GITHUB_ENV | ||
echo "KF_NB_CONTROLLER_BRANCH=$(cat .github/resources/manifest-versions.json | jq .kf-notebook-controller )" >> $GITHUB_ENV | ||
echo "TRUSTYAI_BRANCH=$(cat .github/resources/manifest-versions.json | jq .trustyai )" >> $GITHUB_ENV | ||
echo "MODEL_MESH_BRANCH =$(cat .github/resources/manifest-versions.json | jq .model-mesh )" >> $GITHUB_ENV | ||
echo "ODH_MODEL_CONTROLLER_BRANCH=$(cat .github/resources/manifest-versions.json | jq .odh-model-controller )" >> $GITHUB_ENV | ||
echo "KSERVE_BRANCH=$(cat .github/resources/manifest-versions.json | jq .kserve )" >> $GITHUB_ENV | ||
echo "MODEL_REGISTRY_BRANCH=$(cat .github/resources/manifest-versions.json | jq .modelregistry )" >> $GITHUB_ENV | ||
- name: Update versions | ||
run: ./.github/scripts/update-manifests-tags.sh ${{ env.CODEFLARE_BRANCH }} ${{ env.KUBERAY_BRANCH }} ${{ env.KUEUE_BRANCH }} ${{ env.DSPO_BRANCH }} ${{ env.DASHBOARD_BRANCH }} ${{ env.KF_NB_CONTROLLER_BRANCH }} ${{ env.NB_CONTROLLER_BRANCH }} ${{ env.NB_BRANCH }} ${{ env.TRUSTYAI_BRANCH }} ${{ env.MODEL_MESH_BRANCH }} ${{ env.ODH_MODEL_CONTROLLER_BRANCH }} ${{ env.KSERVE_BRANCH }} ${{ env.MODEL_REGISTRY_BRANCH }} | ||
- name: Create test pr | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
commit-message: "[DO NOT MERGE] Test ${{ env.VERSION }} Release" | ||
branch: odh-release/e2e-test | ||
delete-branch: true | ||
title: "[DO NOT MERGE] Test ${{ env.VERSION }} Release" | ||
- name: Wait for checks to pass | ||
run: ./.github/scripts/wait-for-checks.sh ${{ steps.cpr.outputs.pull-request-number }} | ||
- name: Close PR | ||
uses: peter-evans/close-pull@v3 | ||
with: | ||
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | ||
comment: Auto-closing pull request after success checks | ||
delete-branch: true | ||
- name: Push version tag to quay.io | ||
run: | | ||
# Need ODH creds | ||
# podman login -u ajaganat -p ${{ secrets.PODMAN_PASSWORD }} quay.io/ajaganat | ||
# podman pull quay.io/ajaganat/opendatahub-operator:pr-23 | ||
# podman push quay.io/ajaganat/opendatahub-operator:pr-23 quay.io/ajaganat/opendatahub-operator:${{ env.VERSION }} |
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,39 @@ | ||
name: "Update versions" | ||
on: | ||
workflow_run: | ||
workflows: ["Update tags in draft pr"] | ||
types: [completed] | ||
jobs: | ||
update-versions: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: Checkout branch | ||
uses: actions/checkout@v4 | ||
- name: Read json and set env vars | ||
run: echo "VERSION=$(cat .github/resources/manifest-versions.json | jq .version )" >> $GITHUB_ENV | ||
- name: Update versions in relevant files | ||
run: | | ||
NEW_VERSION=${{ env.VERSION }} | ||
CURRENT_VERSION=$(cat Makefile | grep -w "VERSION ?=" | cut -d ' ' -f 3) | ||
sed -i -e "s/^VERSION ?=.*/VERSION ?= $NEW_VERSION/g" Makefile | ||
sed -i -e "s|containerImage.*|containerImage: quay.io/opendatahub/opendatahub-operator:v$NEW_VERSION|g" config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml | ||
sed -i -e "s|createdAt.*|createdAt: \"$(date +"%Y-%-m-%dT00:00:00Z")\"|g" config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml | ||
sed -i -e "s|name: opendatahub-operator.v.*|name: opendatahub-operator.v$NEW_VERSION|g" config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml | ||
sed -i -e "s|version: $CURRENT_VERSION.*|version: $NEW_VERSION|g" config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml | ||
sed -i -e "s|replaces.*|replaces: opendatahub-operator.v$CURRENT_VERSION|g" config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml | ||
- name: Run make bundle | ||
run: make bundle | ||
- name: Clean up unwanted changes | ||
run: | | ||
sed -i -e "s|image: quay.io/opendatahub/opendatahub-operator:latest.*|image: REPLACE_IMAGE:latest|g" bundle/manifests/opendatahub-operator.clusterserviceversion.yaml | ||
rm ./config/manager/kustomization.yaml | ||
- name: Create version update pr | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
commit-message: "ODH Release ${{ env.VERSION }}" | ||
branch: odh-release/version-update | ||
delete-branch: true | ||
title: "ODH Release ${{ env.VERSION }}: Version Update" |
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,13 @@ | ||
name: Release ODH | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
jobs: | ||
release-odh: | ||
if: github.event.pull_request.merged == true && startsWith( ${{ github.event.pull_request.title }}, 'ODH Release' ) && endsWith( ${{ github.event.pull_request.title }}, 'Version Update' ) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
echo The PR was merged and now we can trigger a release branch creation |
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