Skip to content

Commit 10d97bf

Browse files
committed
perf: update release workflow
1 parent d7d30bc commit 10d97bf

File tree

4 files changed

+29
-8
lines changed

4 files changed

+29
-8
lines changed

.github/workflows/pi_matrix.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ on:
1818
required: false
1919
type: string
2020
default: ''
21+
edit_dockerfile:
22+
description: 'If set to true, "include" only outputs apps associated to this parent image type with no internal dependencies (e.g. common -> mini)'
23+
required: false
24+
type: boolean
25+
default: false
2126
outputs:
2227
parent_image_type:
2328
description: 'List[str] of parent image types'
@@ -55,4 +60,5 @@ jobs:
5560
bash cicd-deployment-scripts/pi/matrix.sh \
5661
-p "${{ github.event.pull_request.number || '' }}" \
5762
-s cicd-deployment-scripts/pi/settings.sh \
58-
-t "${{ inputs.parent_image_type }}"
63+
-t "${{ inputs.parent_image_type }}" \
64+
-d "${{ inputs.edit_dockerfile }}"

.github/workflows/pi_release.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
with:
2020
repository: ${{ github.repository }}
2121
parent_image_type: ${{ vars.PARENT_IMAGE_TYPE }}
22+
edit_dockerfile: true
2223

2324
pi-edit:
2425
name: 'Parent Images: Dockerfile' # suffix populated by matrix
@@ -48,6 +49,9 @@ jobs:
4849

4950
- name: Perform Edit/Git Operations
5051
run: |
52+
git branch -D "$HEAD_REF" || true
53+
git checkout -b "$HEAD_REF"
54+
5155
bash cicd-deployment-scripts/pi/edit_dockerfile.sh \
5256
-i ${{ env.PARENT_IMAGE_NAME }} \
5357
-t ${{ matrix.parent_image_type }} \
@@ -63,9 +67,6 @@ jobs:
6367
git config user.email "[email protected]"
6468
git config user.name "GitHub Actions"
6569
66-
git branch -D "$HEAD_REF" || true
67-
git checkout -b "$HEAD_REF"
68-
6970
git add ${{ env.DOCKERFILE }}
7071
git commit -m "$PR_TITLE" || true
7172
git push --force origin "$HEAD_REF"

pi/matrix.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ set -e
55
PARENT_IMAGE_TYPE=""
66
PR_NUMBER=""
77
SOURCE_SCRIPT="pi/settings.sh"
8+
EDIT_DOCKERFILE=false
89

9-
while getopts t:p:s: flag
10+
while getopts t:p:s:d: flag
1011
do
1112
case "${flag}" in
1213
t) PARENT_IMAGE_TYPE=${OPTARG};;
1314
p) PR_NUMBER=${OPTARG};;
1415
s) SOURCE_SCRIPT=${OPTARG};;
16+
d) EDIT_DOCKERFILE=${OPTARG};;
1517
esac
1618
done
1719

@@ -40,7 +42,11 @@ PARENT_IMAGE_TYPES=""
4042
INCLUDES=""
4143
for parent_image_type in "${UPDATED_PARENT_TYPES[@]}"; do
4244
PARENT_IMAGE_TYPES+="\"$parent_image_type\","
43-
eval 'APP_REPOS=( "${'$(echo ${parent_image_type} | sed "s|-|_|g")'[@]}" )'
45+
if [ $EDIT_DOCKERFILE = true ]; then
46+
eval 'APP_REPOS=( "${'$(echo ${parent_image_type}_dockerfile | sed "s|-|_|g")'[@]}" )'
47+
else
48+
eval 'APP_REPOS=( "${'$(echo ${parent_image_type} | sed "s|-|_|g")'[@]}" )'
49+
fi
4450
for app in "${APP_REPOS[@]}"; do
4551
INCLUDES+='{ "parent_image_type": "'${parent_image_type}'", "app": "'${app}'" },'
4652
done

pi/settings.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,29 @@ export torch_cuda=(
99
"refinery-embedder"
1010
)
1111

12-
export common=(
12+
export common_dockerfile=(
1313
"refinery-gateway"
1414
"refinery-neural-search"
1515
"refinery-tokenizer"
1616
"refinery-updater"
1717
"refinery-weak-supervisor"
1818
"refinery-model-provider"
1919
"cognition-gateway"
20+
)
21+
22+
export common=(
23+
"${common_dockerfile[@]}"
2024
"${torch_cpu[@]}"
2125
"${torch_cuda[@]}"
2226
)
2327

24-
export mini=(
28+
export mini_dockerfile=(
2529
"refinery-authorizer"
2630
"refinery-gateway-proxy"
31+
)
32+
33+
export mini=(
34+
"${mini_dockerfile[@]}"
2735
"${common[@]}"
2836
)
2937

0 commit comments

Comments
 (0)