82
82
fi
83
83
# replace existing version of cf-sdk with new version in Pipfile
84
84
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
95
86
if [ $# -eq 2 ]; then
96
87
mv Pipfile "${1}"
97
88
mv Pipfile.lock "${2}"
@@ -111,40 +102,40 @@ jobs:
111
102
echo -----------
112
103
echo ${#total[@]}
113
104
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.."
145
136
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
148
139
else
149
140
versions_list=$(echo "$versions" | tr '\n' ' ' | sed 's/, $//')
150
141
versions="${versions_list%,}"
0 commit comments