Skip to content

Commit 4908cdd

Browse files
authored
Merge pull request opendatahub-io#528 from atheo89/sync-main-ds
Sync changes to rhds:main from odh:main
2 parents 2d93640 + 6f32b3f commit 4908cdd

File tree

109 files changed

+17811
-15037
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+17811
-15037
lines changed

.github/workflows/build-notebooks-TEMPLATE.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ name: Build & Publish Notebook Servers (TEMPLATE)
2323

2424
jobs:
2525
build:
26-
strategy:
27-
matrix:
28-
os: [ubuntu-22.04]
29-
runs-on: ${{matrix.os}}
26+
runs-on: ubuntu-24.04
3027
env:
3128
# Some pieces of code (image pulls for example) in podman consult TMPDIR or default to /var/tmp
3229
TMPDIR: /home/runner/.local/share/containers/tmpdir
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
# The aim of this GitHub workflow is to update the params.env and commit.env files
3+
# This GHA works for both orgs and it checks for the tags generated from the main branch.
4+
name: Update Notebook Images and Commits With New SHAs
5+
on: # yamllint disable-line rule:truthy
6+
workflow_dispatch:
7+
inputs:
8+
branch:
9+
required: false
10+
description: "Optional: Provide branch name"
11+
user-hash:
12+
required: false
13+
description: "Optional: Specify a Git hash (it should exists on the branch history)"
14+
15+
env:
16+
USER_HASH: ${{ github.event.inputs.user-hash }}
17+
REPO_ORG: ${{ github.repository_owner }}
18+
REPO_NAME: 'notebooks'
19+
TMP_BRANCH: tmp-digest-sync-${{ github.run_id }}
20+
BRANCH_NAME: ${{ github.event.inputs.branch || 'main' }}
21+
22+
jobs:
23+
update-images:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: write
27+
pull-requests: write
28+
steps:
29+
- name: Install Skopeo CLI
30+
shell: bash
31+
run: |
32+
sudo apt-get -y update
33+
sudo apt-get -y install skopeo
34+
35+
- name: Configure Git
36+
run: |
37+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
38+
git config --global user.name "GitHub Actions"
39+
40+
- name: Checkout branch
41+
uses: actions/checkout@v4
42+
with:
43+
ref: ${{ env.BRANCH_NAME }}
44+
45+
- name: Create a new branch
46+
run: |
47+
echo ${{ env.TMP_BRANCH }}
48+
git checkout -b ${{ env.TMP_BRANCH }}
49+
git push --set-upstream origin ${{ env.TMP_BRANCH }}
50+
51+
- name: Checkout release branch
52+
uses: actions/checkout@v4
53+
with:
54+
ref: ${{ env.TMP_BRANCH }}
55+
fetch-depth: 0
56+
57+
- name: Invoke script to handle the updates
58+
shell: bash
59+
run: |
60+
bash "${GITHUB_WORKSPACE}/ci/notebooks-digest-updater.sh" "${{ env.USER_HASH }}" "${{ env.REPO_ORG }}" "${{ env.BRANCH_NAME }}" "${{ env.REPO_NAME }}"
61+
62+
- name: Commit Changes
63+
run: |
64+
65+
if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then
66+
git fetch origin ${{ env.TMP_BRANCH }} && \
67+
git pull origin ${{ env.TMP_BRANCH }} && \
68+
git add "${GITHUB_WORKSPACE}/manifests/base/params.env" && \
69+
git commit -m "Update images digest hashes via ${{ env.TMP_BRANCH }} GitHub action" && \
70+
git add ""${GITHUB_WORKSPACE}/manifests/base/commit.env"" && \
71+
git commit -m "Update image commits via ${{ env.TMP_BRANCH }} GitHub action" &&\
72+
git push origin ${{ env.TMP_BRANCH }}
73+
else
74+
echo "There were no changes detected in the images for the ${{ env.BRANCH_NAME }}"
75+
fi
76+
77+
- name: pull-request
78+
run: |
79+
gh pr create --repo https://github.com/$REPO_ORG/$REPO_NAME.git \
80+
--title "$pr_title" \
81+
--body "$pr_body" \
82+
--head $REPO_ORG:${{ env.TMP_BRANCH }} \
83+
--base ${{ env.BRANCH_NAME }}
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
pr_title: "[Notebooks Updater Action] Update Notebook Images and commit with new SHAs"
87+
pr_body: |
88+
:rocket: This is an automated Pull Request.
89+
Created by `/.github/workflows/notebooks-digest-updater.yaml`
90+
91+
This PR updates the following files:
92+
- `manifests/base/params.env` file with the latest updated SHA digests of the notebooks.
93+
- `manifests/base/commit.env` file with the latest commit.
94+
95+
:exclamation: **IMPORTANT NOTE**: Remember to delete the `${{ env.TMP_BRANCH }}` branch after merging the changes
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
---
22
# The aim of this GitHub workflow is to update the runtimes ImageStreams
3-
name: Update runtime ImageStreams SHA digests
3+
name: Update Runtime ImageStreams SHA digests
44
on: # yamllint disable-line rule:truthy
55
workflow_dispatch:
66
inputs:
77
branch:
8-
required: true
9-
description: "Which branch do you want to update?"
10-
tag_version:
11-
required: true
12-
description: "Provide tag version: main or YYYYx"
8+
required: false
9+
description: "Optional: Provide branch name"
1310
user-hash:
1411
required: false
15-
description: "Optional: Specify a Git hash (it should exist in the provided branch's history)"
12+
description: "Optional: Specify a Git hash (it should exists on the branch history)"
1613

1714
env:
18-
TMP_BRANCH: tmp-branch-${{ github.run_id }}
19-
BRANCH_NAME: ${{ github.event.inputs.branch || 'main' }}
20-
TAG_VERSION: ${{ github.event.inputs.tag_version || 'main' }}
2115
USER_HASH: ${{ github.event.inputs.user-hash }}
16+
REPO_ORG: ${{ github.repository_owner }}
17+
REPO_NAME: 'notebooks'
18+
TMP_BRANCH: tmp-runtimes-sync-${{ github.run_id }}
19+
BRANCH_NAME: ${{ github.event.inputs.branch || 'main' }}
2220

2321
jobs:
24-
initialize:
22+
update-runtimes:
2523
runs-on: ubuntu-latest
2624
permissions:
2725
contents: write
26+
pull-requests: write
2827
steps:
2928
- name: Install Skopeo CLI
3029
shell: bash
3130
run: |
3231
sudo apt-get -y update
33-
sudo apt-get -y install skopeo yq jq
32+
sudo apt-get -y install skopeo
33+
34+
- name: Configure Git
35+
run: |
36+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
37+
git config --global user.name "GitHub Actions"
3438
3539
- name: Checkout branch
3640
uses: actions/checkout@v4
@@ -43,17 +47,6 @@ jobs:
4347
git checkout -b ${{ env.TMP_BRANCH }}
4448
git push --set-upstream origin ${{ env.TMP_BRANCH }}
4549
46-
update-runtimes:
47-
needs: [initialize]
48-
runs-on: ubuntu-latest
49-
permissions:
50-
contents: write
51-
steps:
52-
- name: Configure Git
53-
run: |
54-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
55-
git config --global user.name "GitHub Actions"
56-
5750
- name: Checkout release branch
5851
uses: actions/checkout@v4
5952
with:
@@ -63,7 +56,7 @@ jobs:
6356
- name: Invoke script to handle the update
6457
shell: bash
6558
run: |
66-
bash ${GITHUB_WORKSPACE}/ci/runtimes-digest-updater.sh ${{ env.TAG_VERSION }} ${{ env.USER_HASH }}
59+
bash ${GITHUB_WORKSPACE}/ci/runtimes-digest-updater.sh "${{ env.USER_HASH }}" "${{ env.REPO_ORG }}" "${{ env.BRANCH_NAME }}" "${{ env.REPO_NAME }}"
6760
6861
- name: Commit the changes
6962
run: |
@@ -77,25 +70,18 @@ jobs:
7770
echo "There were no changes detected in the images for the ${{ env.BRANCH_NAME }}"
7871
fi
7972
80-
open-pull-request:
81-
needs: [update-runtimes]
82-
runs-on: ubuntu-latest
83-
permissions:
84-
pull-requests: write
85-
steps:
86-
- name: Checkout repo
87-
uses: actions/checkout@v4
88-
8973
- name: pull-request
90-
uses: repo-sync/pull-request@v2
91-
with:
92-
source_branch: ${{ env.TMP_BRANCH }}
93-
destination_branch: ${{ env.BRANCH_NAME }}
94-
github_token: ${{ secrets.GITHUB_TOKEN }}
95-
pr_label: "automated pr"
96-
pr_title: "[Digest Updater Action] Update Runtimes ImageStreams"
74+
run: |
75+
gh pr create --repo https://github.com/$REPO_ORG/$REPO_NAME.git \
76+
--title "$pr_title" \
77+
--body "$pr_body" \
78+
--head $REPO_ORG:${{ env.TMP_BRANCH }} \
79+
--base ${{ env.BRANCH_NAME }}
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
pr_title: "[Runtimes Updater Action] Update Runtimes ImageStream files"
9783
pr_body: |
9884
:rocket: This is an automated Pull Request.
99-
Created by `/.github/workflows/runtimes-digest-updater-upstream.yaml`
85+
Created by `/.github/workflows/runtimes-digest-updater.yaml`
10086
10187
:exclamation: **IMPORTANT NOTE**: Remember to delete the ` ${{ env.TMP_BRANCH }}` branch after merging the changes

0 commit comments

Comments
 (0)