Skip to content

Commit ed1a8c0

Browse files
Update to use make refresh command
1 parent 2456676 commit ed1a8c0

File tree

1 file changed

+34
-43
lines changed

1 file changed

+34
-43
lines changed

.github/workflows/odh-kfto-sdk-notebooks-sync.yaml

+34-43
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,7 @@ jobs:
8282
fi
8383
# replace existing version of cf-sdk with new version in Pipfile
8484
sed -i "s/$package_name = \"==[^\"]*\"/$package_name = \"==${TRAINING_SDK_RELEASE_VERSION}\"/" Pipfile
85-
# Lock dependencies, ensuring pre-release are included and clear previous state
86-
if ! pipenv lock --verbose --pre --clear ; then
87-
echo "Failed to lock dependencies"
88-
exit 1
89-
fi
90-
# remove virtual env and clear cache
91-
if ! pipenv --rm --clear ; then
92-
echo "Failed to remove virtual environment"
93-
exit 1
94-
fi
85+
# restore names as they were before
9586
if [ $# -eq 2 ]; then
9687
mv Pipfile "${1}"
9788
mv Pipfile.lock "${2}"
@@ -111,40 +102,40 @@ jobs:
111102
echo -----------
112103
echo ${#total[@]}
113104
for dir in "${directories[@]}"; do
114-
counter=$((counter+1))
115-
echo "--Processing directory $counter '$dir' of total $total"
116-
cd "$dir"
117-
minimum_supported_python_version_major=$(echo "${MINIMUM_SUPPORTED_PYTHON_VERSION}" | awk -F '.' '{print $1}') #integer of MINIMUM_SUPPORTED_PYTHON_VERSION env variable
118-
minimum_supported_python_version_minor=$(echo "${MINIMUM_SUPPORTED_PYTHON_VERSION}" | awk -F '.' '{print $2}') #decimal of MINIMUM_SUPPORTED_PYTHON_VERSION env variable
119-
if ! [ -f "Pipfile" ]; then
120-
if [ -f "Pipfile.cpu" ]; then
121-
pipfile_python_version=$(grep -E '^python_version' ./Pipfile.cpu | cut -d '"' -f 2) # extracted from pipfile.cpu
122-
fi
123-
else
124-
pipfile_python_version=$(grep -E '^python_version' ./Pipfile | cut -d '"' -f 2) # extracted from pipfile
125-
fi
126-
pipfile_python_version_major=$(echo "$pipfile_python_version" | awk -F '.' '{print $1}')
127-
pipfile_python_version_minor=$(echo "$pipfile_python_version" | awk -F '.' '{print $2}')
128-
if [[ " ${available_python_versions[@]} " =~ " ${pipfile_python_version} " && "$pipfile_python_version_major" -ge "$minimum_supported_python_version_major" && "$pipfile_python_version_minor" -ge "$minimum_supported_python_version_minor" ]]; then
129-
if ! [ -f "Pipfile" ]; then
130-
if [ -f "Pipfile.cpu" ]; then
131-
install_package_using_pipenv Pipfile.cpu Pipfile.lock.cpu
132-
fi
133-
if [ -f "Pipfile.gpu" ]; then
134-
install_package_using_pipenv Pipfile.gpu Pipfile.lock.gpu
135-
fi
136-
else
137-
#install specified package
138-
install_package_using_pipenv
139-
fi
140-
else
141-
echo "Skipped installation of ${package_name} with version ${TRAINING_SDK_RELEASE_VERSION} in $dir"
142-
fi
143-
cd -
144-
echo "$((total-counter)) directories remaining.."
105+
counter=$((counter+1))
106+
echo "--Processing directory $counter '$dir' of total $total"
107+
cd "$dir"
108+
minimum_supported_python_version_major=$(echo "${MINIMUM_SUPPORTED_PYTHON_VERSION}" | awk -F '.' '{print $1}') #integer of MINIMUM_SUPPORTED_PYTHON_VERSION env variable
109+
minimum_supported_python_version_minor=$(echo "${MINIMUM_SUPPORTED_PYTHON_VERSION}" | awk -F '.' '{print $2}') #decimal of MINIMUM_SUPPORTED_PYTHON_VERSION env variable
110+
if ! [ -f "Pipfile" ]; then
111+
if [ -f "Pipfile.cpu" ]; then
112+
pipfile_python_version=$(grep -E '^python_version' ./Pipfile.cpu | cut -d '"' -f 2) # extracted from pipfile.cpu
113+
fi
114+
else
115+
pipfile_python_version=$(grep -E '^python_version' ./Pipfile | cut -d '"' -f 2) # extracted from pipfile
116+
fi
117+
pipfile_python_version_major=$(echo "$pipfile_python_version" | awk -F '.' '{print $1}')
118+
pipfile_python_version_minor=$(echo "$pipfile_python_version" | awk -F '.' '{print $2}')
119+
if [[ " ${available_python_versions[@]} " =~ " ${pipfile_python_version} " && "$pipfile_python_version_major" -ge "$minimum_supported_python_version_major" && "$pipfile_python_version_minor" -ge "$minimum_supported_python_version_minor" ]]; then
120+
if ! [ -f "Pipfile" ]; then
121+
if [ -f "Pipfile.cpu" ]; then
122+
install_package_using_pipenv Pipfile.cpu Pipfile.lock.cpu
123+
fi
124+
if [ -f "Pipfile.gpu" ]; then
125+
install_package_using_pipenv Pipfile.gpu Pipfile.lock.gpu
126+
fi
127+
else
128+
#install specified package
129+
install_package_using_pipenv
130+
fi
131+
else
132+
echo "Skipped installation of ${package_name} with version ${TRAINING_SDK_RELEASE_VERSION} in $dir"
133+
fi
134+
cd -
135+
echo "$((total-counter)) directories remaining.."
145136
done
146-
# Run a script to install micropipenv and format the file changes correctly
147-
cd ./notebooks && bash ./ci/generate_code.sh && cd -
137+
# Refresh Pipfile.Lock for all updates in Pipfiles
138+
make refresh-pipfilelock-files
148139
else
149140
versions_list=$(echo "$versions" | tr '\n' ' ' | sed 's/, $//')
150141
versions="${versions_list%,}"

0 commit comments

Comments
 (0)