Skip to content

Commit

Permalink
Merge branch '2024a' of https://github.com/opendatahub-io/notebooks i…
Browse files Browse the repository at this point in the history
…nto rsync-2024a
  • Loading branch information
harshad16 committed May 31, 2024
2 parents 70df141 + fffacdf commit d213295
Show file tree
Hide file tree
Showing 36 changed files with 1,968 additions and 1,920 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,18 @@ jobs:
echo "Starting Hadolint"
find . -name "Dockerfile" | xargs ./hadolint --config ./ci/hadolint-config.yaml
echo "Hadolint done"
# This simply checks that the manifests and respective kustomization.yaml finishes without an error.
- name: Check kustomize manifest
id: kustomize-manifests
run: |
kubectl version --client=true
echo "----------------------------------------------------------"
echo "Starting 'kubectl kustomize manifests/base'"
echo "----------------------------------------------------------"
kubectl kustomize manifests/base
echo "----------------------------------------------------------"
echo "Starting 'kubectl kustomize manifests/overlays/additional'"
echo "----------------------------------------------------------"
kubectl kustomize manifests/overlays/additional
1 change: 1 addition & 0 deletions .github/workflows/params-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Validation of image references (image SHAs) in params.env and runtime imag
on: # yamllint disable-line rule:truthy
pull_request:
paths:
- 'manifests/base/commit.env'
- 'manifests/base/params.env'
- 'ci/check-params-env.sh'

Expand Down
8 changes: 7 additions & 1 deletion OWNERS
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
approvers:
- atheo89
- harshad16
- VaishnaviHire

reviewers:
- atheo89
- dibryant
- harshad16
- jiridanek
- jstourac

emeritus_approvers:
- VaishnaviHire

emeritus_reviewers:
- rkpattnaik780
48 changes: 43 additions & 5 deletions ci/check-params-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

# ----------------------------- GLOBAL VARIABLES ----------------------------- #

COMMIT_ENV_PATH="manifests/base/commit.env"
PARAMS_ENV_PATH="manifests/base/params.env"

# This value needs to be updated everytime we deliberately change number of the
Expand All @@ -29,13 +30,13 @@ EXPECTED_NUM_RECORDS=26
# ---------------------------- DEFINED FUNCTIONS ----------------------------- #

function check_variables_uniq() {
local params_env_path="${1}"
local env_file_path="${1}"
local ret_code=0

echo "Checking that all variables in the file '${params_env_path}' are unique and expected"
echo "Checking that all variables in the file '${env_file_path}' are unique and expected"

local content
content=$(sed 's#\(.*\)=.*#\1#' "${params_env_path}" | sort)
content=$(sed 's#\(.*\)=.*#\1#' "${env_file_path}" | sort)

local num_records
num_records=$(echo "${content}" | wc -l)
Expand Down Expand Up @@ -224,6 +225,30 @@ function check_image_variable_matches_name_and_commitref() {
}
}

function check_image_commit_id_matches_metadata() {
local image_variable="${1}"
local image_commit_id="${2}"

local short_image_commit_id
# We're interested only in the first 7 characters of the commit ID
short_image_commit_id=${image_commit_id:0:7}

local file_image_commit_id

file_image_commit_id=$(sed 's#-commit##' "${COMMIT_ENV_PATH}" | grep "${image_variable}=" | cut --delimiter "=" --field 2)
test -n "${file_image_commit_id}" || {
echo "Couldn't retrieve commit id for image variable '${image_variable}' in '${COMMIT_ENV_PATH}'!"
return 1
}

test "${short_image_commit_id}" = "${file_image_commit_id}" || {
echo "Image commit IDs for image variable '${image_variable}' don't equal!"
echo "Image commit ID gathered from image: '${short_image_commit_id}'"
echo "Image commit ID in '${COMMIT_ENV_PATH}': '${file_image_commit_id}'"
return 1
}
}

function check_image() {
local image_variable="${1}"
local image_url="${2}"
Expand All @@ -232,6 +257,7 @@ function check_image() {

local image_metadata
local image_name
local image_commit_id
local image_commitref

image_metadata="$(skopeo inspect --config "docker://${image_url}")" || {
Expand All @@ -242,6 +268,10 @@ function check_image() {
echo "Couldn't parse '.config.Labels.name' from image metadata!"
return 1
}
image_commit_id=$(echo "${image_metadata}" | jq --raw-output '.config.Labels."io.openshift.build.commit.id"') || {
echo "Couldn't parse '.config.Labels."io.openshift.build.commit.id"' from image metadata!"
return 1
}
image_commitref=$(echo "${image_metadata}" | jq --raw-output '.config.Labels."io.openshift.build.commit.ref"') || {
echo "Couldn't parse '.config.Labels."io.openshift.build.commit.ref"' from image metadata!"
return 1
Expand Down Expand Up @@ -273,18 +303,26 @@ function check_image() {

check_image_variable_matches_name_and_commitref "${image_variable}" "${image_name}" "${image_commitref}" "${openshift_build_name}" || return 1

check_image_commit_id_matches_metadata "${image_variable}" "${image_commit_id}" || return 1

echo "---------------------------------------------"
}

# ------------------------------ release-1.2 SCRIPT --------------------------------- #

ret_code=0

echo "Starting check for file: '${PARAMS_ENV_PATH}'"
echo "Starting check of image references in files: '${COMMIT_ENV_PATH}' and '${PARAMS_ENV_PATH}'"
echo "---------------------------------------------"

check_variables_uniq "${COMMIT_ENV_PATH}" || {
echo "ERROR: Variable names in the '${COMMIT_ENV_PATH}' file failed validation!"
echo "----------------------------------------------------"
ret_code=1
}

check_variables_uniq "${PARAMS_ENV_PATH}" || {
echo "ERROR: Variable names in the file failed validation!"
echo "ERROR: Variable names in the '${PARAMS_ENV_PATH}' file failed validation!"
echo "----------------------------------------------------"
ret_code=1
}
Expand Down
2 changes: 1 addition & 1 deletion habana/1.13.0/ubi8-python-3.8/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ scikit-learn = "~=1.3.2"
scipy = "~=1.10.1"
skl2onnx = "~=1.16.0"
onnxconverter-common = "~=1.13.0" # Required for skl2onnx, as upgraded version is not compatible with protobuf
codeflare-sdk = "~=0.16.1"
codeflare-sdk = "~=0.16.2"
# DB connectors
pymongo = "~=4.6.2"
psycopg = "~=3.1.18"
Expand Down
Loading

0 comments on commit d213295

Please sign in to comment.