Skip to content

Commit b5cf05d

Browse files
authored
Merge pull request opendatahub-io#556 from daniellutz/sync-main
Sync odh/main into rhds/main
2 parents fe10644 + 455bcd9 commit b5cf05d

File tree

144 files changed

+27973
-27166
lines changed

Some content is hidden

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

144 files changed

+27973
-27166
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ trim_trailing_whitespace = true
1010

1111
[Makefile]
1212
indent_style = tab
13+
14+
[*.py]
15+
max_line_length = 120

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

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ jobs:
3939
TRIVY_VULNDB: "/home/runner/.local/share/containers/trivy_db"
4040
# Targets (and their folder) that should be scanned using FS instead of IMAGE scan due to resource constraints
4141
TRIVY_SCAN_FS_JSON: '{}'
42-
# Poetry version for use in running tests
43-
POETRY_VERSION: '2.0.0'
4442

4543
steps:
4644

@@ -315,33 +313,26 @@ jobs:
315313

316314
# region Pytest image tests
317315

318-
- name: Install poetry
319-
if: steps.cache-poetry-restore.outputs.cache-hit != 'true'
320-
run: pipx install poetry==${{ env.POETRY_VERSION }}
321-
env:
322-
PIPX_HOME: /home/runner/.local/pipx
323-
PIPX_BIN_DIR: /home/runner/.local/bin
324-
325-
- name: Check poetry is installed correctly
326-
run: poetry env info
327-
328-
- name: Set up Python
329-
id: setup-python
330-
uses: actions/setup-python@v5
316+
# https://github.com/astral-sh/setup-uv
317+
- name: Install the latest version of uv
318+
uses: astral-sh/setup-uv@v5
331319
with:
332-
python-version: '3.12'
333-
cache: 'poetry'
320+
version: "latest"
321+
python-version: "3.12"
322+
enable-cache: true
323+
cache-dependency-glob: "uv.lock"
324+
pyproject-file: "pyproject.toml"
334325

335-
- name: Configure poetry
336-
run: poetry env use "${{ steps.setup-python.outputs.python-path }}"
326+
- name: Check uv is installed correctly
327+
run: uv version
337328

338329
- name: Install deps
339-
run: poetry install --sync
330+
run: uv sync --locked
340331

341332
- name: Run Testcontainers container tests (in PyTest)
342333
run: |
343334
set -Eeuxo pipefail
344-
poetry run pytest --capture=fd tests/containers -m 'not openshift' --image="${{ steps.calculated_vars.outputs.OUTPUT_IMAGE }}"
335+
uv run pytest --capture=fd tests/containers -m 'not openshift' --image="${{ steps.calculated_vars.outputs.OUTPUT_IMAGE }}"
345336
env:
346337
DOCKER_HOST: "unix:///var/run/podman/podman.sock"
347338
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: "/var/run/podman/podman.sock"
@@ -511,7 +502,7 @@ jobs:
511502
if: ${{ steps.have-tests.outputs.tests == 'true' }}
512503
run: |
513504
set -Eeuxo pipefail
514-
poetry run pytest --capture=fd tests/containers -m 'openshift' --image="${{ steps.calculated_vars.outputs.OUTPUT_IMAGE }}"
505+
uv run pytest --capture=fd tests/containers -m 'openshift' --image="${{ steps.calculated_vars.outputs.OUTPUT_IMAGE }}"
515506
env:
516507
# TODO(jdanek): this Testcontainers stuff should not be necessary but currently it has to be there
517508
DOCKER_HOST: "unix:///var/run/podman/podman.sock"

.github/workflows/build-notebooks-pr-rhel.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414
env:
1515
# language=json
1616
contributors: |
17-
["atheo89", "andyatmiami", "caponetto", "daniellutz", "dibryant", "harshad16", "jesuino", "jiridanek", "jstourac", "paulovmr"]
17+
["atheo89", "andyatmiami", "caponetto", "daniellutz", "dibryant", "harshad16", "jesuino", "jiridanek", "jstourac", "paulovmr", "Fiona-Waters"]
1818
1919
jobs:
2020
gen:

.github/workflows/code-quality.yaml

Lines changed: 18 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -31,49 +31,31 @@ jobs:
3131
3232
pytest-tests:
3333
runs-on: ubuntu-latest
34-
env:
35-
poetry_version: '1.8.3'
3634
steps:
3735
- uses: actions/checkout@v4
3836

39-
- name: Cache poetry in ~/.local
40-
uses: actions/cache/restore@v4
41-
id: cache-poetry-restore
37+
# https://github.com/astral-sh/setup-uv
38+
- name: Install the latest version of uv
39+
uses: astral-sh/setup-uv@v5
4240
with:
43-
path: ~/.local
44-
key: "${{ runner.os }}-local-${{ env.poetry_version }}"
45-
46-
- name: Install poetry
47-
if: steps.cache-poetry-restore.outputs.cache-hit != 'true'
48-
run: pipx install poetry==${{ env.poetry_version }}
49-
env:
50-
PIPX_HOME: /home/runner/.local/pipx
51-
PIPX_BIN_DIR: /home/runner/.local/bin
52-
53-
- name: Check poetry is installed correctly
54-
run: poetry env info
55-
56-
- name: Save cache
57-
if: steps.cache-poetry-restore.outputs.cache-hit != 'true'
58-
uses: actions/cache/save@v4
59-
with:
60-
path: ~/.local
61-
key: ${{ steps.cache-poetry-restore.outputs.cache-primary-key }}
62-
63-
- name: Set up Python
64-
id: setup-python
65-
uses: actions/setup-python@v5
66-
with:
67-
python-version: '3.12'
68-
cache: 'poetry'
41+
version: "latest"
42+
python-version: "3.12"
43+
enable-cache: true
44+
cache-dependency-glob: "uv.lock"
45+
pyproject-file: "pyproject.toml"
6946

70-
- name: Configure poetry
71-
run: poetry env use "${{ steps.setup-python.outputs.python-path }}"
47+
- name: Check uv is installed correctly
48+
run: uv version
7249

7350
- name: Install deps
74-
run: poetry install --sync
51+
run: uv sync --locked
52+
53+
# https://github.com/pre-commit/action
54+
- name: Run pre-commit on all files
55+
run: |
56+
uv run pre-commit run --all-files
7557
76-
- run: poetry run pytest
58+
- run: uv run pytest
7759

7860
code-static-analysis:
7961
runs-on: ubuntu-latest
@@ -125,23 +107,7 @@ jobs:
125107
echo "Hadolint done"
126108
127109
# This simply checks that the manifests and respective kustomization.yaml finishes without an error.
128-
# Version of the kustomize that operator use in runtime to apply these changes is determined by:
129-
# https://github.com/red-hat-data-services/rhods-operator/blob/7ccc405135f99c014982d7e297b8949e970dd750/go.mod#L28-L29
130-
# and then to match appropriate kustomize release https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv5.0.2
131110
- name: Check kustomize manifest
132111
id: kustomize-manifests
133112
run: |
134-
KUSTOMIZE_VERSION=5.0.2
135-
wget "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_amd64.tar.gz"
136-
tar -xvf kustomize*
137-
138-
./kustomize version
139-
echo "----------------------------------------------------------"
140-
echo "Starting './kustomize build manifests/base'"
141-
echo "----------------------------------------------------------"
142-
./kustomize build manifests/base
143-
144-
echo "----------------------------------------------------------"
145-
echo "Starting './kustomize build manifests/overlays/additional'"
146-
echo "----------------------------------------------------------"
147-
./kustomize build manifests/overlays/additional
113+
./ci/kustomize.sh

.github/workflows/docs.yaml

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,17 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020

21-
- name: Cache poetry in ~/.local
22-
uses: actions/cache/restore@v4
23-
id: cache-poetry-restore
21+
# https://github.com/astral-sh/setup-uv
22+
- name: Install the latest version of uv
23+
uses: astral-sh/setup-uv@v5
2424
with:
25-
path: ~/.local
26-
key: "${{ runner.os }}-local-${{ env.poetry_version }}"
27-
28-
- name: Install poetry
29-
if: steps.cache-poetry-restore.outputs.cache-hit != 'true'
30-
run: pipx install poetry==${{ env.poetry_version }}
31-
env:
32-
PIPX_HOME: /home/runner/.local/pipx
33-
PIPX_BIN_DIR: /home/runner/.local/bin
34-
35-
- name: Check poetry is installed correctly
36-
run: poetry env info
37-
38-
- name: Save cache
39-
if: steps.cache-poetry-restore.outputs.cache-hit != 'true'
40-
uses: actions/cache/save@v4
41-
with:
42-
path: ~/.local
43-
key: ${{ steps.cache-poetry-restore.outputs.cache-primary-key }}
44-
45-
- name: Set up Python
46-
id: setup-python
47-
uses: actions/setup-python@v5
48-
with:
49-
python-version: '3.12'
50-
cache: 'poetry'
51-
52-
- name: Configure poetry
53-
run: poetry env use "${{ steps.setup-python.outputs.python-path }}"
54-
55-
- name: Install deps
56-
run: poetry install --sync
25+
version: "latest"
26+
python-version: "3.12"
27+
enable-cache: true
28+
cache-dependency-glob: "uv.lock"
29+
pyproject-file: "pyproject.toml"
5730

5831
- name: Run the release notes script
5932
run: |
6033
set -Eeuxo pipefail
61-
poetry run ci/package_versions.py | tee ${GITHUB_STEP_SUMMARY}
34+
uv run ci/package_versions.py | tee ${GITHUB_STEP_SUMMARY}

.github/workflows/notebooks-digest-updater.yaml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# The aim of this GitHub workflow is to update the params.env and commit.env files
33
# 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
4+
name: Update Notebook and Runtime Images as well as the Commits With New SHAs
55
on: # yamllint disable-line rule:truthy
66
workflow_dispatch:
77
inputs:
@@ -54,42 +54,60 @@ jobs:
5454
ref: ${{ env.TMP_BRANCH }}
5555
fetch-depth: 0
5656

57-
- name: Invoke script to handle the updates
57+
- name: Invoke ci/sha-digest-updater.sh script to handle the updates
5858
shell: bash
5959
run: |
60-
bash "${GITHUB_WORKSPACE}/ci/notebooks-digest-updater.sh" "${{ env.USER_HASH }}" "${{ env.REPO_ORG }}" "${{ env.BRANCH_NAME }}" "${{ env.REPO_NAME }}"
60+
bash "${GITHUB_WORKSPACE}/ci/sha-digest-updater.sh" "${{ env.USER_HASH }}" "${{ env.REPO_ORG }}" "${{ env.BRANCH_NAME }}" "${{ env.REPO_NAME }}"
6161
6262
- name: Commit Changes
6363
run: |
6464
6565
if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then
6666
git fetch origin ${{ env.TMP_BRANCH }} && \
6767
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" &&\
68+
git add manifests/base/ && \
69+
git commit -m "Update image related sha digests via notebooks-digest-updater GitHub action" && \
7270
git push origin ${{ env.TMP_BRANCH }}
7371
else
7472
echo "There were no changes detected in the images for the ${{ env.BRANCH_NAME }}"
7573
fi
7674
75+
- name: Capture skipped images log (if any)
76+
id: skipped_log
77+
run: |
78+
if [[ -f ${GITHUB_WORKSPACE}/skipped-images.txt && -s ${GITHUB_WORKSPACE}/skipped-images.txt ]]; then
79+
echo "Found skipped images. Preparing message."
80+
echo 'log<<EOF' >> $GITHUB_OUTPUT
81+
cat ${GITHUB_WORKSPACE}/skipped-images.txt >> $GITHUB_OUTPUT
82+
echo 'EOF' >> $GITHUB_OUTPUT
83+
else
84+
echo "log=" >> $GITHUB_OUTPUT
85+
fi
86+
7787
- name: pull-request
7888
run: |
89+
90+
body="${PR_BODY}"
91+
92+
if [[ -n "${{ steps.skipped_log.outputs.log }}" ]]; then
93+
body+="
94+
95+
:warning: The following images were skipped during update, please push them manually or retriger the GitHub action:
96+
${{ steps.skipped_log.outputs.log }}
97+
"
98+
fi
99+
79100
gh pr create --repo https://github.com/$REPO_ORG/$REPO_NAME.git \
80-
--title "$pr_title" \
81-
--body "$pr_body" \
101+
--title "$PR_TITLE" \
102+
--body "$body" \
82103
--head $REPO_ORG:${{ env.TMP_BRANCH }} \
83104
--base ${{ env.BRANCH_NAME }}
84105
env:
85106
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86-
pr_title: "[Notebooks Updater Action] Update Notebook Images and commit with new SHAs"
87-
pr_body: |
107+
PR_TITLE: "[Updater Action] Update Notebook and Runtime Images as well as the Commits With New SHAs"
108+
PR_BODY: |
88109
:rocket: This is an automated Pull Request.
89110
Created by `/.github/workflows/notebooks-digest-updater.yaml`
90-
91-
This PR updates the following files:
92111
- `manifests/base/params.env` file with the latest updated SHA digests of the notebooks.
112+
- `manifests/base/runtime-*.yamls` file with the latest updated SHA digests of the runtimes.
93113
- `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

.github/workflows/params-env.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on: # yamllint disable-line rule:truthy
88
- 'manifests/base/params.env'
99
- 'ci/check-params-env.sh'
1010
- 'ci/check-runtime-images.sh'
11+
- 'manifests/base/runtime-*-imagestream.yaml'
1112
workflow_dispatch:
1213

1314
permissions:

0 commit comments

Comments
 (0)