Skip to content

Commit e575070

Browse files
authored
Merge pull request #339 from harshad16/rsync-2024a
[2024a] sync release-2024a from opendatahub-io:2024a
2 parents 3884ce5 + 27d294a commit e575070

File tree

50 files changed

+12134
-3706
lines changed

Some content is hidden

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

50 files changed

+12134
-3706
lines changed

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

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
env:
2323
# GitHub image registry used for storing $(CONTAINER_ENGINE)'s cache
2424
CACHE: "ghcr.io/${{ github.repository }}/workbench-images/build-cache"
25+
# Targets (and their folder) that should be scanned using FS instead of IMAGE scan due to resource constraints
26+
TRIVY_SCAN_FS_JSON: '{"rocm-jupyter-pytorch-ubi9-python-3.9": "jupyter/rocm/pytorch/ubi9-python-3.9"}'
2527

2628
steps:
2729

@@ -113,10 +115,12 @@ jobs:
113115
114116
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
115117
- name: "push|schedule: make ${{ inputs.target }}"
116-
run: "make ${{ inputs.target }}"
118+
run: |
119+
SANITIZED_REF_NAME=$(echo "${{ github.ref_name }}" | sed 's/[^a-zA-Z0-9._-]/_/g')
120+
export IMAGE_TAG="${SANITIZED_REF_NAME}_${{ github.sha }}"
121+
make ${{ inputs.target }}
117122
if: ${{ fromJson(inputs.github).event_name == 'push' || fromJson(inputs.github).event_name == 'schedule' }}
118123
env:
119-
IMAGE_TAG: "${{ github.ref_name }}_${{ github.sha }}"
120124
IMAGE_REGISTRY: "ghcr.io/${{ github.repository }}/workbench-images"
121125
CONTAINER_BUILD_CACHE_ARGS: "--cache-from ${{ env.CACHE }} --cache-to ${{ env.CACHE }}"
122126

@@ -138,27 +142,42 @@ jobs:
138142
- name: "Show podman images information"
139143
run: podman images
140144

141-
- name: "pull_request|schedule: resolve image name if Trivy scan should run"
142-
id: resolve-image
145+
- name: "pull_request|schedule: resolve target if Trivy scan should run"
146+
id: resolve-target
143147
if: ${{ fromJson(inputs.github).event_name == 'pull_request' || fromJson(inputs.github).event_name == 'schedule' }}
144148
env:
145149
EVENT_NAME: ${{ fromJson(inputs.github).event_name }}
146150
HAS_TRIVY_LABEL: ${{ contains(fromJson(inputs.github).event.pull_request.labels.*.name, 'trivy-scan') }}
151+
FS_SCAN_FOLDER: ${{ fromJson(env.TRIVY_SCAN_FS_JSON)[inputs.target] }}
147152
run: |
148153
if [[ "$EVENT_NAME" == "pull_request" && "$HAS_TRIVY_LABEL" == "true" ]]; then
149-
IMAGE_NAME="localhost:5000/workbench-images:${{ inputs.target }}-${{ github.sha }}"
150-
echo "image=$IMAGE_NAME" >> $GITHUB_OUTPUT
154+
if [[ -n "$FS_SCAN_FOLDER" ]]; then
155+
TARGET="$FS_SCAN_FOLDER"
156+
TYPE="fs"
157+
else
158+
TARGET="localhost:5000/workbench-images:${{ inputs.target }}-${{ github.sha }}"
159+
TYPE="image"
160+
fi
151161
elif [[ "$EVENT_NAME" == "schedule" ]]; then
152-
IMAGE_NAME="ghcr.io/${{ github.repository }}/workbench-images:${{ inputs.target }}-${{ github.ref_name }}_${{ github.sha }}"
153-
echo "image=$IMAGE_NAME" >> $GITHUB_OUTPUT
162+
if [[ -n "$FS_SCAN_FOLDER" ]]; then
163+
TARGET="$FS_SCAN_FOLDER"
164+
TYPE="fs"
165+
else
166+
TARGET="ghcr.io/${{ github.repository }}/workbench-images:${{ inputs.target }}-${{ github.ref_name }}_${{ github.sha }}"
167+
TYPE="image"
168+
fi
154169
fi
155170
156-
if [[ -z "$IMAGE_NAME" ]]; then
171+
if [[ -n "$TARGET" ]]; then
172+
echo "target=$TARGET" >> $GITHUB_OUTPUT
173+
echo "type=$TYPE" >> $GITHUB_OUTPUT
174+
echo "Trivy scan will run on $TARGET ($TYPE)"
175+
else
157176
echo "Trivy scan won't run"
158177
fi
159178
160179
- name: Run Trivy vulnerability scanner
161-
if: ${{ steps.resolve-image.outputs.image }}
180+
if: ${{ steps.resolve-target.outputs.target }}
162181
run: |
163182
TRIVY_VERSION=0.53.0
164183
REPORT_FOLDER=${{ github.workspace }}/report
@@ -168,22 +187,31 @@ jobs:
168187
mkdir -p $REPORT_FOLDER
169188
cp ci/$REPORT_TEMPLATE $REPORT_FOLDER
170189
171-
IMAGE_NAME=${{ steps.resolve-image.outputs.image }}
172-
echo "Scanning $IMAGE_NAME"
190+
SCAN_TARGET=${{ steps.resolve-target.outputs.target }}
191+
SCAN_TYPE=${{ steps.resolve-target.outputs.type }}
192+
echo "Scanning $SCAN_TARGET ($SCAN_TYPE)"
193+
194+
if [[ "$SCAN_TYPE" == "image" ]]; then
195+
SCAN_ARGS="--image-src podman --podman-host /var/run/podman/podman.sock"
196+
PODMAN_ARGS="-v ${PODMAN_SOCK}:/var/run/podman/podman.sock"
197+
elif [[ "$SCAN_TYPE" == "fs" ]]; then
198+
WORKSPACE_FOLDER="/workspace"
199+
SCAN_TARGET="$WORKSPACE_FOLDER/$SCAN_TARGET"
200+
PODMAN_ARGS="-v ${{ github.workspace }}:$WORKSPACE_FOLDER"
201+
fi
173202
174203
# have trivy access podman socket,
175204
# https://github.com/aquasecurity/trivy/issues/580#issuecomment-666423279
176205
podman run --rm \
177-
-v ${PODMAN_SOCK}:/var/run/podman/podman.sock \
206+
$PODMAN_ARGS \
178207
-v ${REPORT_FOLDER}:/report \
179208
docker.io/aquasec/trivy:$TRIVY_VERSION \
180-
image \
181-
--image-src podman \
182-
--podman-host /var/run/podman/podman.sock \
209+
$SCAN_TYPE \
210+
$SCAN_ARGS \
183211
--scanners vuln --ignore-unfixed \
184212
--exit-code 0 --timeout 30m \
185213
--format template --template "@/report/$REPORT_TEMPLATE" -o /report/$REPORT_FILE \
186-
$IMAGE_NAME
214+
$SCAN_TARGET
187215
188216
cat $REPORT_FOLDER/$REPORT_FILE >> $GITHUB_STEP_SUMMARY
189217

.github/workflows/build-notebooks.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,28 @@
471471
},
472472
"secrets": "inherit"
473473
},
474+
"rocm-runtime-pytorch-ubi9-python-3_9": {
475+
"needs": [
476+
"rocm-ubi9-python-3_9"
477+
],
478+
"uses": "./.github/workflows/build-notebooks-TEMPLATE.yaml",
479+
"with": {
480+
"target": "rocm-runtime-pytorch-ubi9-python-3.9",
481+
"github": "${{ toJSON(github) }}"
482+
},
483+
"secrets": "inherit"
484+
},
485+
"rocm-runtime-tensorflow-ubi9-python-3_9": {
486+
"needs": [
487+
"rocm-ubi9-python-3_9"
488+
],
489+
"uses": "./.github/workflows/build-notebooks-TEMPLATE.yaml",
490+
"with": {
491+
"target": "rocm-runtime-tensorflow-ubi9-python-3.9",
492+
"github": "${{ toJSON(github) }}"
493+
},
494+
"secrets": "inherit"
495+
},
474496
"base-anaconda-python-3_8": {
475497
"needs": [],
476498
"uses": "./.github/workflows/build-notebooks-TEMPLATE.yaml",

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,16 @@ rocm-jupyter-tensorflow-ubi9-python-3.9: rocm-jupyter-datascience-ubi9-python-3.
283283
rocm-jupyter-pytorch-ubi9-python-3.9: rocm-jupyter-datascience-ubi9-python-3.9
284284
$(call image,$@,jupyter/rocm/pytorch/ubi9-python-3.9,$<)
285285

286+
# Build and push rocm-jupyter-runtime-pytorch-ubi9-python-3.9 image to the registry
287+
.PHONY: rocm-runtime-pytorch-ubi9-python-3.9
288+
rocm-runtime-pytorch-ubi9-python-3.9: rocm-ubi9-python-3.9
289+
$(call image,$@,runtimes/rocm-pytorch/ubi9-python-3.9,$<)
290+
291+
# Build and push rocm-jupyter-runtime-tensorflow-ubi9-python-3.9 image to the registry
292+
.PHONY: rocm-runtime-tensorflow-ubi9-python-3.9
293+
rocm-runtime-tensorflow-ubi9-python-3.9: rocm-ubi9-python-3.9
294+
$(call image,$@,runtimes/rocm-tensorflow/ubi9-python-3.9,$<)
295+
286296
####################################### Buildchain for Anaconda Python #######################################
287297

288298
# Build and push base-anaconda-python-3.8 image to the registry
@@ -572,6 +582,10 @@ refresh-pipfilelock-files:
572582
cd runtimes/pytorch/ubi8-python-3.8 && pipenv lock
573583
cd runtimes/tensorflow/ubi8-python-3.8 && pipenv lock
574584
cd runtimes/tensorflow/ubi9-python-3.9 && pipenv lock
585+
cd runtimes/rocm-tensorflow/ubi9-python-3.9 && pipenv lock
586+
cd runtimes/rocm-pytorch/ubi9-python-3.9 && pipenv lock
587+
588+
575589

576590
# This is only for the workflow action
577591
# For running manually, set the required environment variables

habana/1.10.0/ubi8-python-3.8/Pipfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pybind11 = "==2.6.2"
3333
elyra-pipeline-editor-extension = "~=3.15.0"
3434
elyra-python-editor-extension = "~=3.15.0"
3535
elyra-code-snippet-extension = "~=3.15.0"
36-
kfp-tekton = "<1.6.0"
36+
kfp-tekton = "==1.5.7" # pinned to avoid upgrade of pyyaml which is required.
3737
boto3 = "~=1.26.165"
3838
kafka-python = "~=2.0.2"
3939
matplotlib = "~=3.6.3"
@@ -45,18 +45,24 @@ scipy = "~=1.10.1"
4545
jupyter-bokeh = "~=3.0.5"
4646
jupyterlab-lsp = "~=3.10.2"
4747
jupyterlab-widgets = "~=3.0.5"
48-
jupyter-resource-usage = "~=0.6.0"
48+
jupyter-resource-usage = "~=0.7.2"
4949

5050
# Parent image requirements to maintain cohesion
5151
jupyterlab = "~=3.5.3"
5252
jupyter-server = "~=2.1.0"
53-
jupyter-server-proxy = "~=3.2.2"
53+
jupyter-server-proxy = "~=3.2.4"
5454
jupyter-server-terminals = "~=0.4.4"
5555
jupyterlab-git = "~=0.41.0"
5656
nbdime = "~=3.1.1"
5757
nbgitpuller = "~=1.1.1"
5858
# ---
5959
wheel = "~=0.38.4"
6060

61+
# conflict between python-lsp-server and following packages
62+
# due to pycodestyle dependency, pinning this, till we get
63+
# a fix from python-lsp-server
64+
autopep8 = "~=2.0.4"
65+
flake8 = "~=7.0.0"
66+
6167
[requires]
6268
python_version = "3.8"

0 commit comments

Comments
 (0)