@@ -131,31 +131,20 @@ jobs:
131
131
HEAD_REF : ${{ needs.configure-branch-name.outputs.gh_head_ref }}
132
132
strategy :
133
133
matrix :
134
- include : ${{ fromJson(needs.pi-matrix.outputs.include ) }}
134
+ app : ${{ fromJson(needs.pi-matrix.outputs.app ) }}
135
135
steps :
136
136
- name : Checkout repository
137
137
uses : actions/checkout@v4
138
138
with :
139
139
token : ${{ secrets.GH_TOKEN }}
140
- repository : ' ${{ github.repository_owner }}/refinery-${{ matrix.parent_image_type }} -parent-image '
140
+ repository : ' ${{ github.repository_owner }}/refinery-submodule -parent-images '
141
141
fetch-depth : 0
142
- submodules : ' true'
143
142
144
143
- name : Set up Python
145
144
uses : actions/setup-python@v5
146
145
with :
147
146
python-version : ${{ env.PYTHON_VERSION }}
148
147
149
- - name : Install Dependencies
150
- if : matrix.parent_image_type != 'next'
151
- run : python -m pip install pip-tools
152
-
153
- - name : Compile Requirements
154
- run : |
155
- cd ${{ github.workspace }}/submodules/parent-images
156
- git checkout ${{ env.HEAD_REF }}
157
- pip-compile requirements/${{ matrix.parent_image_type }}-requirements.in
158
-
159
148
- name : Clone cicd-deployment-scripts
160
149
run : git clone https://oauth2:${{ secrets.GH_TOKEN }}@github.com/code-kern-ai/cicd-deployment-scripts.git
161
150
@@ -169,49 +158,44 @@ jobs:
169
158
170
159
git checkout -b ${{ env.HEAD_REF }} || git checkout ${{ env.HEAD_REF }}
171
160
git pull origin ${{ env.HEAD_REF }} || true
172
-
173
- - name : Compile Requirements (Python)
174
- if : matrix.parent_image_type != 'next'
175
- run : |
176
- cd ${{ github.workspace }}/submodules/parent-images
177
- git checkout ${{ env.HEAD_REF }}
178
- pip-compile --quiet \
179
- --output-file ${{ github.workspace }}/${{ matrix.app }}/requirements/${{ matrix.parent_image_type }}-requirements.txt \
180
- requirements/${{ matrix.parent_image_type }}-requirements.in
181
161
182
- - name : Compile Requirements (Next)
183
- if : matrix.parent_image_type == 'next'
162
+ - name : Update parent requirements
184
163
run : |
185
- cd ${{ github.workspace }}
186
- jq --slurp '.[0] * .[1]' \
187
- package.json \
188
- ${{ matrix.app }}/package.json \
189
- > package.json.tmp
190
- mv package.json.tmp ${{ matrix.app }}/package.json
164
+ cd ${{ github.workspace }}/${{ matrix.app }}
165
+ REQUIREMENTS_FILES=$(ls requirements/*.txt)
166
+ for requirement_file in $REQUIREMENTS_FILES; do
167
+ cp ${{ github.workspace }}/refinery-submodule-parent-images/$requirement_file $requirement_file
168
+ done
191
169
192
170
- name : Perform Edit/Git Operations (Python)
193
- if : matrix.parent_image_type != 'next'
194
171
run : |
195
172
cd ${{ github.workspace }}/${{ matrix.app }}
196
173
197
174
bash ${{ github.workspace }}/cicd-deployment-scripts/pi/edit_dockerfile.sh \
198
175
-i "${{ env.PARENT_IMAGE_NAME }}" \
199
- -t "${{ matrix.parent_image_type }}" \
200
176
-l "${{ env.HEAD_REF }}" \
201
177
-r "${{ env.DOCKERHUB_CONTAINER_REGISTRY }}" \
202
178
-d "${{ env.DOCKERFILE }}"
203
179
204
180
bash ${{ github.workspace }}/cicd-deployment-scripts/pi/edit_dockerfile.sh \
205
181
-i "${{ env.PARENT_IMAGE_NAME }}" \
206
- -t "${{ matrix.parent_image_type }}" \
207
182
-l "${{ env.HEAD_REF }}" \
208
183
-r "${{ env.DOCKERHUB_CONTAINER_REGISTRY }}" \
209
184
-d "dev.${{ env.DOCKERFILE }}"
185
+
186
+ if [ -f "gpu.${{ env.DOCKERFILE }}" ]; then
187
+ bash ${{ github.workspace }}/cicd-deployment-scripts/pi/edit_dockerfile.sh \
188
+ -i "${{ env.PARENT_IMAGE_NAME }}" \
189
+ -l "${{ env.HEAD_REF }}" \
190
+ -r "${{ env.DOCKERHUB_CONTAINER_REGISTRY }}" \
191
+ -d "gpu.${{ env.DOCKERFILE }}"
192
+ fi
210
193
211
- git add requirements/${{ matrix.parent_image_type }}-requirements.txt ${{ env.DOCKERFILE }} dev.${{ env.DOCKERFILE }}
212
- git commit -m "ci: update ${{ matrix.parent_image_type }}-requirements.txt and Dockerfile" || true
194
+ git add requirements/*.txt ${{ env.DOCKERFILE }} dev.${{ env.DOCKERFILE }}
195
+ if [ -f "gpu.${{ env.DOCKERFILE }}" ]; then git add gpu.${{ env.DOCKERFILE }}; fi
196
+ git commit -m "ci: update requirements and Dockerfile" || true
213
197
git push origin ${{ env.HEAD_REF }}
214
- echo "::notice::${{ matrix.app }} - updated ${{ matrix.parent_image_type }}-requirements.txt "
198
+ echo "::notice::${{ matrix.app }} - updated requirement files and ${{ env.DOCKERFILE }}s "
215
199
216
200
export exitcode=0
217
201
pip-compile --quiet \
@@ -234,35 +218,3 @@ jobs:
234
218
--base dev \
235
219
--head ${{ env.HEAD_REF }} \
236
220
--repo ${{ github.repository_owner }}/${{ matrix.app }} || true
237
-
238
- - name : Perform Edit/Git Operations (Next)
239
- if : matrix.parent_image_type == 'next'
240
- run : |
241
- cd ${{ github.workspace }}/${{ matrix.app }}
242
-
243
- bash ${{ github.workspace }}/cicd-deployment-scripts/pi/edit_dockerfile.sh \
244
- -i "${{ env.PARENT_IMAGE_NAME }}" \
245
- -t "${{ matrix.parent_image_type }}" \
246
- -l "${{ env.HEAD_REF }}" \
247
- -r "${{ env.DOCKERHUB_CONTAINER_REGISTRY }}" \
248
- -d "${{ env.DOCKERFILE }}"
249
-
250
- bash ${{ github.workspace }}/cicd-deployment-scripts/pi/edit_dockerfile.sh \
251
- -i "${{ env.PARENT_IMAGE_NAME }}" \
252
- -t "${{ matrix.parent_image_type }}" \
253
- -l "${{ env.HEAD_REF }}" \
254
- -r "${{ env.DOCKERHUB_CONTAINER_REGISTRY }}" \
255
- -d "dev.${{ env.DOCKERFILE }}"
256
-
257
- git add package.json
258
- git commit -m "ci: update ${{ matrix.parent_image_type }} package.json" || true
259
- git push origin ${{ env.HEAD_REF }}
260
- echo "::notice::${{ matrix.app }} - updated ${{ matrix.parent_image_type }} package.json"
261
-
262
- gh pr create --draft \
263
- --title "test: parent image updates" \
264
- --body "${{ github.event.pull_request.body }}" \
265
- --base dev \
266
- --head ${{ env.HEAD_REF }} \
267
- --repo ${{ github.repository_owner }}/${{ matrix.app }} || true
268
-
0 commit comments