@@ -67,57 +67,61 @@ jobs:
67
67
68
68
- name : Update the param.env file
69
69
run : |
70
- echo Latest commit is: ${{ steps.hash-n.outputs.HASH_N }} on ${{ env.RELEASE_VERSION_N}}
71
- IMAGES=("odh-minimal-notebook-image-n"
72
- "odh-minimal-gpu-notebook-image-n"
73
- "odh-pytorch-gpu-notebook-image-n"
74
- "odh-generic-data-science-notebook-image-n"
75
- "odh-tensorflow-gpu-notebook-image-n"
76
- "odh-trustyai-notebook-image-n"
77
- "odh-codeserver-notebook-image-n"
78
- "odh-rstudio-notebook-image-n"
79
- "odh-rstudio-gpu-notebook-image-n")
80
-
81
- for ((i=0;i<${#IMAGES[@]};++i)); do
82
- image=${IMAGES[$i]}
83
- echo "CHECKING: " $image
84
- img=$(cat manifests/base/params.env | grep -E "${image}=" | cut -d '=' -f2)
85
- registry=$(echo $img | cut -d '@' -f1)
86
- src_tag=$(skopeo inspect docker://$img | jq '.Env[] | select(startswith("OPENSHIFT_BUILD_NAME=")) | split("=")[1]' | tr -d '"' | sed 's/-amd64$//')
87
- regex="$src_tag-${{ env.RELEASE_VERSION_N}}-\d+-${{ steps.hash-n.outputs.HASH_N }}"
88
- latest_tag=$(skopeo inspect docker://$img | jq -r --arg regex "$regex" '.RepoTags | map(select(. | test($regex))) | .[0]')
89
- digest=$(skopeo inspect docker://$registry:$latest_tag | jq .Digest | tr -d '"')
90
- output=$registry@$digest
91
- echo "NEW:" $output
92
- sed -i "s|${image}=.*|${image}=$output|" manifests/base/params.env
70
+ PARAMS_ENV_PATH="manifests/base/params.env"
71
+
72
+ echo Latest commit is: ${{ steps.hash-n.outputs.HASH_N }} on ${{ env.RELEASE_VERSION_N }}
73
+
74
+ # Get the complete list of images N-version to update
75
+ IMAGES=$(cat "${PARAMS_ENV_PATH}" | grep "\-n=" | cut -d "=" -f 1)
76
+
77
+ for image in ${IMAGES}; do
78
+ echo "CHECKING: '${image}'"
79
+ img=$(grep -E "${image}=" "${PARAMS_ENV_PATH}" | cut -d '=' -f2)
80
+ registry=$(echo "${img}" | cut -d '@' -f1)
81
+
82
+ skopeo_metadata=$(skopeo inspect --retry-times 3 "docker://${img}")
83
+
84
+ src_tag=$(echo "${skopeo_metadata}" | jq '.Env[] | select(startswith("OPENSHIFT_BUILD_NAME=")) | split("=")[1]' | tr -d '"' | sed 's/-amd64$//')
85
+ regex="^$src_tag-${{ env.RELEASE_VERSION_N}}-\d+-${{ steps.hash-n.outputs.HASH_N }}\$"
86
+ latest_tag=$(echo "${skopeo_metadata}" | jq -r --arg regex "$regex" '.RepoTags | map(select(. | test($regex))) | .[0]')
87
+ # use `--no-tags` for skopeo once available in newer version
88
+ digest=$(skopeo inspect --retry-times 3 "docker://${registry}:${latest_tag}" | jq .Digest | tr -d '"')
89
+ output="${registry}@${digest}"
90
+ echo "NEW: ${output}"
91
+ sed -i "s|${image}=.*|${image}=${output}|" "${PARAMS_ENV_PATH}"
93
92
done
93
+
94
94
if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then
95
- git fetch origin ${{ env.DIGEST_UPDATER_BRANCH }} && git pull origin ${{ env.DIGEST_UPDATER_BRANCH }} && git add manifests/base/params.env && git commit -m "Update images for release N via ${{ env.DIGEST_UPDATER_BRANCH }} GitHub action" && git push origin ${{ env.DIGEST_UPDATER_BRANCH }}
95
+ git fetch origin ${{ env.DIGEST_UPDATER_BRANCH }} && \
96
+ git pull origin ${{ env.DIGEST_UPDATER_BRANCH }} && \
97
+ git add "${PARAMS_ENV_PATH}" && \
98
+ git commit -m "Update images for release N via ${{ env.DIGEST_UPDATER_BRANCH }} GitHub action" && \
99
+ git push origin ${{ env.DIGEST_UPDATER_BRANCH }}
96
100
else
97
- echo "There were no changes detected in the images for the ${{ env.RELEASE_VERSION_N}}"
101
+ echo "There were no changes detected in the images for the ${{ env.RELEASE_VERSION_N }}"
98
102
fi
99
103
100
104
- name : Update the commit.env file
101
105
run : |
102
- echo Latest commit is: ${{ steps.hash-n.outputs.HASH_N }} on ${{ env.RELEASE_VERSION_N}}
103
- COMMIT=("odh-minimal-notebook-image-commit-n"
104
- "odh-minimal-gpu-notebook-image-commit-n"
105
- "odh-pytorch-gpu-notebook-image-commit-n"
106
- "odh-generic-data-science-notebook-image-commit-n"
107
- "odh-tensorflow-gpu-notebook-image-commit-n"
108
- "odh-trustyai-notebook-image-commit-n"
109
- "odh-codeserver-notebook-image-commit-n"
110
- "odh-rstudio-notebook-image-commit-n"
111
- "odh-rstudio-gpu-notebook-image-commit-n")
112
-
113
- for val in "${COMMIT[@]}"; do
114
- echo $val
115
- sed -i "s|${val}=.*|${val}=${{ steps.hash-n.outputs.HASH_N }}|" manifests/base/commit.env
106
+ COMMIT_ENV_PATH="manifests/base/commit.env"
107
+
108
+ echo Latest commit is: ${{ steps.hash-n.outputs.HASH_N }} on ${{ env.RELEASE_VERSION_N }}
109
+ # Get the complete list of images N-1-version to update
110
+ COMMIT=$(grep "\-n=" "${COMMIT_ENV_PATH}" | cut -d "=" -f 1)
111
+
112
+ for val in ${COMMIT}; do
113
+ echo "${val}"
114
+ sed -i "s|${val}=.*|${val}=${{ steps.hash-n.outputs.HASH_N }}|" "${COMMIT_ENV_PATH}"
116
115
done
116
+
117
117
if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then
118
- git fetch origin ${{ env.DIGEST_UPDATER_BRANCH }} && git pull origin ${{ env.DIGEST_UPDATER_BRANCH }} && git add manifests/base/commit.env && git commit -m "Update image commits for release N via ${{ env.DIGEST_UPDATER_BRANCH }} GitHub action" && git push origin ${{ env.DIGEST_UPDATER_BRANCH }}
118
+ git fetch origin ${{ env.DIGEST_UPDATER_BRANCH }} && \
119
+ git pull origin ${{ env.DIGEST_UPDATER_BRANCH }} && \
120
+ git add "${COMMIT_ENV_PATH}" && \
121
+ git commit -m "Update image commits for release N via ${{ env.DIGEST_UPDATER_BRANCH }} GitHub action" && \
122
+ git push origin ${{ env.DIGEST_UPDATER_BRANCH }}
119
123
else
120
- echo "There were no changes detected in the images for the ${{ env.RELEASE_VERSION_N}}"
124
+ echo "There were no changes detected in the images for the ${{ env.RELEASE_VERSION_N }}"
121
125
fi
122
126
123
127
update-n-1-version :
@@ -147,56 +151,61 @@ jobs:
147
151
148
152
- name : Update the param.env file
149
153
run : |
150
- echo Latest commit is: ${{ steps.hash-n-1.outputs.HASH_N_1 }} on ${{ env.RELEASE_VERSION_N_1}}
151
- IMAGES=("odh-minimal-notebook-image-n-1"
152
- "odh-minimal-gpu-notebook-image-n-1"
153
- "odh-pytorch-gpu-notebook-image-n-1"
154
- "odh-generic-data-science-notebook-image-n-1"
155
- "odh-tensorflow-gpu-notebook-image-n-1"
156
- "odh-trustyai-notebook-image-n-1"
157
- "odh-codeserver-notebook-image-n-1"
158
- "odh-rstudio-notebook-image-n-1"
159
- "odh-rstudio-gpu-notebook-image-n-1")
160
-
161
- for ((i=0;i<${#IMAGES[@]};++i)); do
162
- image=${IMAGES[$i]}
163
- echo "CHECKING: " $image
164
- img=$(cat manifests/base/params.env | grep -E "${image}=" | cut -d '=' -f2)
165
- registry=$(echo $img | cut -d '@' -f1)
166
- src_tag=$(skopeo inspect docker://$img | jq '.Env[] | select(startswith("OPENSHIFT_BUILD_NAME=")) | split("=")[1]' | tr -d '"' | sed 's/-amd64$//')
167
- regex="$src_tag-${{ env.RELEASE_VERSION_N_1}}-\d+-${{ steps.hash-n-1.outputs.HASH_N_1 }}"
168
- latest_tag=$(skopeo inspect docker://$img | jq -r --arg regex "$regex" '.RepoTags | map(select(. | test($regex))) | .[0]')
169
- digest=$(skopeo inspect docker://$registry:$latest_tag | jq .Digest | tr -d '"')
170
- output=$registry@$digest
171
- echo "NEW:" $output
172
- sed -i "s|${image}=.*|${image}=$output|" manifests/base/params.env
154
+ PARAMS_ENV_PATH="manifests/base/params.env"
155
+
156
+ echo Latest commit is: ${{ steps.hash-n-1.outputs.HASH_N_1 }} on ${{ env.RELEASE_VERSION_N_1 }}
157
+
158
+ # Get the complete list of images N-1-version to update
159
+ IMAGES=$(cat "${PARAMS_ENV_PATH}" | grep "\-n-1=" | cut -d "=" -f 1)
160
+
161
+ for image in ${IMAGES}; do
162
+ echo "CHECKING: '${image}'"
163
+ img=$(grep -E "${image}=" "${PARAMS_ENV_PATH}" | cut -d '=' -f2)
164
+ registry=$(echo "${img}" | cut -d '@' -f1)
165
+
166
+ skopeo_metadata=$(skopeo inspect --retry-times 3 "docker://${img}")
167
+
168
+ src_tag=$(echo "${skopeo_metadata}" | jq '.Env[] | select(startswith("OPENSHIFT_BUILD_NAME=")) | split("=")[1]' | tr -d '"' | sed 's/-amd64$//')
169
+ regex="^$src_tag-${{ env.RELEASE_VERSION_N_1}}-\d+-${{ steps.hash-n-1.outputs.HASH_N_1 }}\$"
170
+ latest_tag=$(echo "${skopeo_metadata}" | jq -r --arg regex "$regex" '.RepoTags | map(select(. | test($regex))) | .[0]')
171
+ # use `--no-tags` for skopeo once available in newer version
172
+ digest=$(skopeo inspect --retry-times 3 "docker://${registry}:${latest_tag}" | jq .Digest | tr -d '"')
173
+ output="${registry}@${digest}"
174
+ echo "NEW: ${output}"
175
+ sed -i "s|${image}=.*|${image}=${output}|" "${PARAMS_ENV_PATH}"
173
176
done
177
+
174
178
if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then
175
- git fetch origin ${{ env.DIGEST_UPDATER_BRANCH }} && git pull origin ${{ env.DIGEST_UPDATER_BRANCH }} && git add manifests/base/params.env && git commit -m "Update images for release N-1 via ${{ env.DIGEST_UPDATER_BRANCH }} GitHub action" && git push origin ${{ env.DIGEST_UPDATER_BRANCH }}
179
+ git fetch origin ${{ env.DIGEST_UPDATER_BRANCH }} && \
180
+ git pull origin ${{ env.DIGEST_UPDATER_BRANCH }} && \
181
+ git add "${PARAMS_ENV_PATH}" && \
182
+ git commit -m "Update images for release N-1 via ${{ env.DIGEST_UPDATER_BRANCH }} GitHub action" && \
183
+ git push origin ${{ env.DIGEST_UPDATER_BRANCH }}
176
184
else
177
- echo "There were no changes detected in the images for the ${{ env.RELEASE_VERSION_N_1}}"
185
+ echo "There were no changes detected in the images for the ${{ env.RELEASE_VERSION_N_1 }}"
178
186
fi
187
+
179
188
- name : Update the commit.env file
180
189
run : |
181
- echo Latest commit is: ${{ steps.hash-n-1.outputs.HASH_N_1 }} on ${{ env.RELEASE_VERSION_N_1}}
182
- COMMIT=("odh-minimal-notebook-image-commit-n-1"
183
- "odh-minimal-gpu-notebook-image-commit-n-1"
184
- "odh-pytorch-gpu-notebook-image-commit-n-1"
185
- "odh-generic-data-science-notebook-image-commit-n-1"
186
- "odh-tensorflow-gpu-notebook-image-commit-n-1"
187
- "odh-trustyai-notebook-image-commit-n-1"
188
- "odh-codeserver-notebook-image-commit-n-1"
189
- "odh-rstudio-notebook-image-commit-n-1"
190
- "odh-rstudio-gpu-notebook-image-commit-n-1")
191
-
192
- for val in "${COMMIT[@]}"; do
193
- echo $val
194
- sed -i "s|${val}=.*|${val}=${{ steps.hash-n-1.outputs.HASH_N_1 }}|" manifests/base/commit.env
190
+ COMMIT_ENV_PATH="manifests/base/commit.env"
191
+
192
+ echo Latest commit is: ${{ steps.hash-n-1.outputs.HASH_N_1 }} on ${{ env.RELEASE_VERSION_N_1 }}
193
+ # Get the complete list of images N-1-version to update
194
+ COMMIT=$(grep "\-n-1=" "${COMMIT_ENV_PATH}" | cut -d "=" -f 1)
195
+
196
+ for val in ${COMMIT}; do
197
+ echo "${val}"
198
+ sed -i "s|${val}=.*|${val}=${{ steps.hash-n-1.outputs.HASH_N_1 }}|" "${COMMIT_ENV_PATH}"
195
199
done
200
+
196
201
if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then
197
- git fetch origin ${{ env.DIGEST_UPDATER_BRANCH }} && git pull origin ${{ env.DIGEST_UPDATER_BRANCH }} && git add manifests/base/commit.env && git commit -m "Update image commits for release N via ${{ env.DIGEST_UPDATER_BRANCH }} GitHub action" && git push origin ${{ env.DIGEST_UPDATER_BRANCH }}
202
+ git fetch origin ${{ env.DIGEST_UPDATER_BRANCH }} && \
203
+ git pull origin ${{ env.DIGEST_UPDATER_BRANCH }} && \
204
+ git add "${COMMIT_ENV_PATH}" && \
205
+ git commit -m "Update image commits for release N via ${{ env.DIGEST_UPDATER_BRANCH }} GitHub action" && \
206
+ git push origin ${{ env.DIGEST_UPDATER_BRANCH }}
198
207
else
199
- echo "There were no changes detected in the images for the ${{ env.RELEASE_VERSION_N}}"
208
+ echo "There were no changes detected in the images for the ${{ env.RELEASE_VERSION_N }}"
200
209
fi
201
210
202
211
open-pull-request :
0 commit comments