Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…to rsync-main
  • Loading branch information
harshad16 committed Nov 8, 2024
2 parents e9c4ba4 + 0278938 commit 726e501
Show file tree
Hide file tree
Showing 79 changed files with 32,383 additions and 29,558 deletions.
2 changes: 2 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
approvers:
- atheo89
- caponetto
- daniellutz
- harshad16
- jiridanek
- jstourac
Expand All @@ -9,6 +10,7 @@ approvers:
reviewers:
- atheo89
- caponetto
- daniellutz
- dibryant
- harshad16
- jiridanek
Expand Down
6 changes: 3 additions & 3 deletions base/ubi9-python-3.11/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 46 additions & 23 deletions ci/check-json.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This script serves to check YAML files in this repository that contain particular
# key fields where JSON string is expected. Such JSON strings are extracted and
Expand All @@ -10,7 +10,19 @@
# In case of the PR on GitHub, this check is tied to GitHub actions automatically,
# see `.github/workflows` directory.

shopt -s globstar
if ! shopt -s globstar; then
echo "macOS ships bash-3.2 that does not know shopt -s globstar; install newer bash from homebrew"
exit 1
fi

# yq: `brew install yq` or `apt-get install yq`
# json_verify: `brew install yajl` or `apt-get install yajl-tools`
for dep in yq json_verify; do
if ! which -- ${dep} >/dev/null; then
echo "the dependency ${dep} is not installed; install it now"
exit 1
fi
done

function check_json() {
local f="${1}"
Expand All @@ -22,15 +34,19 @@ function check_json() {
echo "Checking: '${f}' - for '${string}':"

if grep --quiet --extended-regexp "${string}" "${f}"; then
#if $(grep -e "${string}" "${f}"); then
jsons=$(yq -r ".spec.tags[].annotations.\"${string}\"" "${f}")

while IFS= read -r json; do
echo " ${json}"
echo -n " > "; echo "${json}" | json_verify || ret_code="${?}"
done <<< "${jsons}"
local tmp_dir
tmp_dir=$(mktemp --directory -t check-jsons-in-file-XXXXXXXXXX-)
if ! (cd "${tmp_dir}"; yq --split-exp "\$index" --unwrapScalar ".spec.tags[].annotations.\"${string}\"" "${f}"); then
echo "yq failed to run"
return 1
fi

for json in "${tmp_dir}"/*.yml; do
echo " "; cat "${json}"
echo -n " > "; json_verify < "${json}" || ret_code="${?}"
done
else
echo " Ignoring as this file doesn't contain necessary key field '${string}' for check"
echo " Ignoring as this file doesn't contain necessary key field '${string}' for check"
fi

return "${ret_code}"
Expand All @@ -48,20 +64,27 @@ function split_yaml_file() {
return 0
}

ret_code=0
function main() {
local ret_code=0

# Some yaml files can contain more definitions.
# This is a problem for `yq` tool so we need to split these into separate files.
local tmp_dir
tmp_dir=$(mktemp --directory -t check-json-XXXXXXXXXX-)
for f in **/*.yaml; do
echo "Splitting the '${f}' file."
split_yaml_file "${f}" "${tmp_dir}" || ret_code="${?}"
done

# Some yaml files can contain more definitions.
# This is a problem for `yq` tool so we need to split these into separate files.
tmp_dir=$(mktemp --directory --suffix=-check-json)
for f in **/*.yaml; do
echo "Splitting the '${f}' file."
split_yaml_file "${f}" "${tmp_dir}" || ret_code="${?}"
done
for f in "${tmp_dir}"/*; do
check_json "${f}" "opendatahub.io/notebook-software" || ret_code="${?}"
check_json "${f}" "opendatahub.io/notebook-python-dependencies" || ret_code="${?}"
done

for f in "${tmp_dir}"/*; do
check_json "${f}" "opendatahub.io/notebook-software" || ret_code="${?}"
check_json "${f}" "opendatahub.io/notebook-python-dependencies" || ret_code="${?}"
done
exit "${ret_code}"
}

exit "${ret_code}"
# allows sourcing the script into interactive session without executing it
if [[ "${0}" == "${BASH_SOURCE[0]}" ]]; then
main
fi
1,353 changes: 719 additions & 634 deletions codeserver/ubi9-python-3.11/Pipfile.lock

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions codeserver/ubi9-python-3.11/run-code-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source ${SCRIPT_DIR}/utils/*.sh
run-nginx.sh &
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &

# Add .bashrc for custom promt if not present
# Add .bashrc for custom prompt if not present
if [ ! -f "/opt/app-root/src/.bashrc" ]; then
echo 'PS1="\[\033[34;1m\][\$(pwd)]\[\033[0m\]\n\[\033[1;0m\]$ \[\033[0m\]"' > /opt/app-root/src/.bashrc
fi
Expand Down Expand Up @@ -42,16 +42,22 @@ create_dir_and_file() {
# Define universal settings
universal_dir="/opt/app-root/src/.local/share/code-server/User/"
user_settings_filepath="${universal_dir}settings.json"
universal_json_settings='{
universal_json_settings='// vscode settings are written in json-with-comments
/* https://code.visualstudio.com/docs/languages/json#_json-with-comments */
{
"python.defaultInterpreterPath": "/opt/app-root/bin/python3",
"telemetry.telemetryLevel": "off",
"telemetry.enableTelemetry": false,
"workbench.enableExperiments": false,
"extensions.autoCheckUpdates": false,
"extensions.autoUpdate": false
"extensions.autoUpdate": false,
// RHOAIENG-14518: Disable the "Do you trust the authors [...]" startup prompt
"security.workspace.trust.enabled": false,
"security.workspace.trust.startupPrompt": "never"
}'

# Define python debuger settings
# Define python debugger settings
vscode_dir="/opt/app-root/src/.vscode/"
settings_filepath="${vscode_dir}settings.json"
launch_filepath="${vscode_dir}launch.json"
Expand All @@ -72,7 +78,7 @@ json_settings='{
"python.defaultInterpreterPath": "/opt/app-root/bin/python3"
}'

# Create necessary directories and files for python debuger and universal settings
# Create necessary directories and files for python debugger and universal settings
create_dir_and_file "$universal_dir" "$user_settings_filepath" "$universal_json_settings"
create_dir_and_file "$vscode_dir" "$settings_filepath" "$json_settings"
create_dir_and_file "$vscode_dir" "$launch_filepath" "$json_launch_settings"
Expand Down
2 changes: 2 additions & 0 deletions codeserver/ubi9-python-3.11/supervisord/supervisord.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[supervisord]
nodaemon=true
logfile=/tmp/supervisord.log
pidfile=/tmp/supervisord.pid

[program:fcgiwrap]
command=/usr/sbin/fcgiwrap -s unix:/var/run/fcgiwrap.socket
Expand Down
16 changes: 11 additions & 5 deletions codeserver/ubi9-python-3.9/run-code-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source ${SCRIPT_DIR}/utils/*.sh
run-nginx.sh &
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &

# Add .bashrc for custom promt if not present
# Add .bashrc for custom prompt if not present
if [ ! -f "/opt/app-root/src/.bashrc" ]; then
echo 'PS1="\[\033[34;1m\][\$(pwd)]\[\033[0m\]\n\[\033[1;0m\]$ \[\033[0m\]"' > /opt/app-root/src/.bashrc
fi
Expand Down Expand Up @@ -42,16 +42,22 @@ create_dir_and_file() {
# Define universal settings
universal_dir="/opt/app-root/src/.local/share/code-server/User/"
user_settings_filepath="${universal_dir}settings.json"
universal_json_settings='{
universal_json_settings='// vscode settings are written in json-with-comments
/* https://code.visualstudio.com/docs/languages/json#_json-with-comments */
{
"python.defaultInterpreterPath": "/opt/app-root/bin/python3",
"telemetry.telemetryLevel": "off",
"telemetry.enableTelemetry": false,
"workbench.enableExperiments": false,
"extensions.autoCheckUpdates": false,
"extensions.autoUpdate": false
"extensions.autoUpdate": false,
// RHOAIENG-14518: Disable the "Do you trust the authors [...]" startup prompt
"security.workspace.trust.enabled": false,
"security.workspace.trust.startupPrompt": "never"
}'

# Define python debuger settings
# Define python debugger settings
vscode_dir="/opt/app-root/src/.vscode/"
settings_filepath="${vscode_dir}settings.json"
launch_filepath="${vscode_dir}launch.json"
Expand All @@ -72,7 +78,7 @@ json_settings='{
"python.defaultInterpreterPath": "/opt/app-root/bin/python3"
}'

# Create necessary directories and files for python debuger and universal settings
# Create necessary directories and files for python debugger and universal settings
create_dir_and_file "$universal_dir" "$user_settings_filepath" "$universal_json_settings"
create_dir_and_file "$vscode_dir" "$settings_filepath" "$json_settings"
create_dir_and_file "$vscode_dir" "$launch_filepath" "$json_launch_settings"
Expand Down
2 changes: 2 additions & 0 deletions codeserver/ubi9-python-3.9/supervisord/supervisord.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[supervisord]
nodaemon=true
logfile=/tmp/supervisord.log
pidfile=/tmp/supervisord.pid

[program:fcgiwrap]
command=/usr/sbin/fcgiwrap -s unix:/var/run/fcgiwrap.socket
Expand Down
6 changes: 0 additions & 6 deletions cuda/ubi9-python-3.11/cuda.repo-arm64

This file was deleted.

2 changes: 1 addition & 1 deletion intel/runtimes/ml/ubi9-python-3.11/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plotly = "~=5.16.1"
scipy = "~=1.11.2"
scikit-learn = "~=1.3.1"
skl2onnx = "~=1.15.0"
codeflare-sdk = "~=0.22.0"
codeflare-sdk = "~=0.23.1"
# DB connectors
pymongo = "~=4.5.0"
psycopg = "~=3.1.10"
Expand Down
Loading

0 comments on commit 726e501

Please sign in to comment.