Skip to content

Commit 60d53b9

Browse files
authored
Merge pull request #480 from atheo89/sync-downstream-24b
release-2024b from opendatahub-io:2024b
2 parents f1e70f6 + 76d322b commit 60d53b9

File tree

367 files changed

+17813
-110604
lines changed

Some content is hidden

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

367 files changed

+17813
-110604
lines changed

.dockerignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.git/
2+
.idea/
3+
.venv/
4+
bin/
5+
ci/
6+
tests/
7+
8+
**/.mypy_cache/
9+
**/.pytest_cache/
10+
**/__pycache__/
11+
**/*.pyc
12+
13+
**/Dockerfile

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# https://editorconfig.org/
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[Makefile]
12+
indent_style = tab

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

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,22 @@ jobs:
3939

4040
- uses: actions/checkout@v4
4141

42+
- run: mkdir -p $TMPDIR
43+
44+
# for bin/buildinputs in scripts/sandbox.py
45+
- uses: actions/setup-go@v5
46+
with:
47+
cache-dependency-path: "**/*.sum"
48+
4249
- name: Login to GitHub Container Registry
4350
uses: docker/login-action@v3
4451
with:
4552
registry: ghcr.io
4653
username: ${{ github.actor }}
4754
password: ${{ secrets.GITHUB_TOKEN }}
4855

56+
# region Free up disk space
57+
4958
- name: Free up additional disk space
5059
# https://docs.github.com/en/actions/learn-github-actions/expressions
5160
if: "${{ contains(inputs.target, 'rocm') || contains(inputs.target, 'cuda') || contains(inputs.target, 'intel') ||
@@ -86,6 +95,10 @@ jobs:
8695
df -h
8796
free -h
8897
98+
# endregion
99+
100+
# region Podman setup
101+
89102
# https://github.com/containers/buildah/issues/2521#issuecomment-884779112
90103
- name: Workaround https://github.com/containers/podman/issues/22152#issuecomment-2027705598
91104
run: sudo apt-get -qq remove podman crun
@@ -156,6 +169,10 @@ jobs:
156169
echo "IMAGE_TAG=${IMAGE_TAG}" >> "$GITHUB_OUTPUT"
157170
echo "OUTPUT_IMAGE=${{ env.IMAGE_REGISTRY}}:${{ inputs.target }}-${IMAGE_TAG}" >> "$GITHUB_OUTPUT"
158171
172+
# endregion
173+
174+
# region Trivy init & DB pre-pull
175+
159176
- name: "pull_request|schedule: resolve target if Trivy scan should run"
160177
id: resolve-target
161178
if: ${{ fromJson(inputs.github).event_name == 'pull_request' || fromJson(inputs.github).event_name == 'schedule' }}
@@ -210,6 +227,10 @@ jobs:
210227
image \
211228
--download-java-db-only
212229
230+
# endregion
231+
232+
# region Image build
233+
213234
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
214235
- name: "push|schedule: make ${{ inputs.target }}"
215236
run: |
@@ -235,10 +256,34 @@ jobs:
235256
- name: "Show podman images information"
236257
run: podman images --digests
237258

259+
# endregion
260+
261+
# region Makefile image tests
262+
238263
- name: "Check if we have tests or not"
239264
id: have-tests
240265
run: "ci/cached-builds/has_tests.py --target ${{ inputs.target }}"
241266

267+
- name: "Change pull policy to IfNotPresent"
268+
run: |
269+
set -Eeuxo pipefail
270+
271+
find . \( -name "statefulset.yaml" -o -name "pod.yaml" \) -type f -exec \
272+
sed -i'' 's/imagePullPolicy: Always/imagePullPolicy: IfNotPresent/g' {} \;
273+
git diff
274+
275+
# [INFO] Running command (('make deploy9-runtimes-rocm-tensorflow-ubi9-python-3.11',), {'shell': True})
276+
# Deploying notebook from runtimes/rocm/tensorflow/ubi9-python-3.11/kustomize/base directory...
277+
# sed: can't read runtimes/rocm/tensorflow/ubi9-python-3.11/kustomize/base/kustomization.yaml: No such file or directory
278+
- name: "Fixup paths that prevent us from running rocm tests"
279+
if: ${{ steps.have-tests.outputs.tests == 'true' }}
280+
run: |
281+
set -Eeuxo pipefail
282+
283+
mkdir -p runtimes/rocm
284+
ln -s ../rocm-tensorflow runtimes/rocm/tensorflow
285+
ln -s ../rocm-pytorch runtimes/rocm/pytorch
286+
242287
# https://cri-o.io/
243288
- name: Install cri-o
244289
if: ${{ steps.have-tests.outputs.tests == 'true' }}
@@ -288,11 +333,11 @@ jobs:
288333
289334
# do this early, it's a good check that cri-o is not completely broken
290335
- name: "Show crio images information"
291-
if: ${{ steps.have-tests.outputs.tests == 'true' }}
336+
if: ${{ steps.have-tests.outputs.tests == 'true' }}
292337
run: sudo crictl images
293338

294339
- name: Install Kubernetes cluster
295-
if: ${{ steps.have-tests.outputs.tests == 'true' }}
340+
if: ${{ steps.have-tests.outputs.tests == 'true' }}
296341
run: |
297342
set -Eeuxo pipefail
298343
@@ -350,6 +395,18 @@ jobs:
350395
kubectl wait deployments --all --all-namespaces --for=condition=Available --timeout=100s
351396
kubectl wait pods --all --all-namespaces --for=condition=Ready --timeout=100s
352397
398+
- name: "Run image tests"
399+
if: ${{ steps.have-tests.outputs.tests == 'true' }}
400+
run: python3 ci/cached-builds/make_test.py --target ${{ inputs.target }}
401+
env:
402+
IMAGE_TAG: "${{ steps.calculated_vars.outputs.IMAGE_TAG }}"
403+
# for make deploy, mandatory to specify for the more exotic cases
404+
NOTEBOOK_TAG: "${{ inputs.target }}-${{ steps.calculated_vars.outputs.IMAGE_TAG }}"
405+
406+
# endregion
407+
408+
# region Trivy vulnerability scan
409+
353410
- name: Run Trivy vulnerability scanner
354411
if: ${{ steps.resolve-target.outputs.target }}
355412
run: |
@@ -391,12 +448,16 @@ jobs:
391448
392449
cat $REPORT_FOLDER/$REPORT_FILE >> $GITHUB_STEP_SUMMARY
393450
451+
# endregion
452+
453+
# region Typescript (browser) image tests
454+
394455
# https://playwright.dev/docs/ci
395456
# https://playwright.dev/docs/docker
396457
# we leave little free disk space after we mount LVM for podman storage
397458
# not enough to install playwright; running playwright in podman uses the space we have
398459
- name: Run Playwright tests
399-
if: ${{ fromJson(inputs.github).event_name == 'pull_request' && contains(inputs.target, 'codeserver') }}
460+
if: ${{ contains(inputs.target, 'codeserver') }}
400461
# --ipc=host because Microsoft says so in Playwright docs
401462
# --net=host because testcontainers connects to the Reaper container's exposed port
402463
# we need to pass through the relevant environment variables
@@ -436,5 +497,7 @@ jobs:
436497
path: tests/browser/playwright-report/
437498
retention-days: 30
438499

500+
# endregion
501+
439502
- run: df -h
440503
if: "${{ !cancelled() }}"

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424

25+
- uses: actions/setup-go@v5
26+
with:
27+
cache-dependency-path: "**/*.sum"
28+
2529
- name: Determine targets to build based on changed files
2630
run: |
2731
set -x

0 commit comments

Comments
 (0)