Skip to content

Commit 3275672

Browse files
committed
fix: dockerfile edit
1 parent 3a0d3a3 commit 3275672

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

.github/workflows/pi_matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ jobs:
5959
run: |
6060
bash cicd-deployment-scripts/pi/matrix.sh \
6161
-p "${{ github.event.pull_request.number || '' }}" \
62-
-s cicd-deployment-scripts/pi/settings.sh \
62+
-s cicd-deployment-scripts/pi/constants.sh \
6363
-t "${{ inputs.parent_image_type }}" \
6464
-d "${{ inputs.edit_dockerfile }}"

pi/settings.sh renamed to pi/constants.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,17 @@ export torch_cpu=(
55
"refinery-ml-exec-env"
66
)
77

8+
export torch_cpu_dockerfile=(
9+
"refinery-embedder"
10+
"refinery-ml-exec-env"
11+
)
12+
813
export torch_cuda=(
914
"refinery-embedder"
1015
)
16+
export torch_cuda_dockerfile=(
17+
"refinery-embedder"
18+
)
1119

1220
export common_dockerfile=(
1321
"refinery-gateway"
@@ -41,6 +49,12 @@ export exec_env=(
4149
"cognition-exec-env"
4250
)
4351

52+
export exec_env_dockerfile=(
53+
"refinery-ac-exec-env"
54+
"refinery-lf-exec-env"
55+
"cognition-exec-env"
56+
)
57+
4458
export next=(
4559
"admin-dashboard"
4660
"cognition-ui"

pi/edit_dockerfile.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
PARENT_IMAGE_NAME="refinery-parent-images"
6-
RELEASE_TAG=""
6+
RELEASE_TAG="parent-image-updates"
77
DOCKER_REGISTRY="kernai"
88
DOCKERFILE="Dockerfile"
99
HEAD_REF="parent-image-updates"
@@ -24,7 +24,8 @@ grep "${DOCKER_REGISTRY}/${PARENT_IMAGE_NAME}" $DOCKERFILE | while read -r line
2424
ALREADY_UPDATED=$(echo $PI_EXISTING_TAG | grep $RELEASE_TAG || true)
2525

2626
if [ -z $ALREADY_UPDATED ] && [ -z $HEAD_REF ]; then
27-
PARENT_IMAGE_TYPE=$(echo $PI_EXISTING_TAG | cut -d '-' -f 2-)
27+
image_version=$(echo $PI_EXISTING_TAG | cut -d '-' -f 1)
28+
PARENT_IMAGE_TYPE=$(echo $PI_EXISTING_TAG | sed "s|${image_version}-||g")
2829
elif [ -n $ALREADY_UPDATED ] && [ -z $HEAD_REF ]; then
2930
PARENT_IMAGE_TYPE=$(echo $PI_EXISTING_TAG | sed "s|${RELEASE_TAG}-||g")
3031
elif [ -n $HEAD_REF ]; then

pi/matrix.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
set -e
44

5+
PR_NUMBER="38"
6+
SOURCE_SCRIPT="pi/constants.sh"
57
PARENT_IMAGE_TYPE=""
6-
PR_NUMBER=""
7-
SOURCE_SCRIPT="pi/settings.sh"
88
EDIT_DOCKERFILE=false
99

1010
while getopts t:p:s:d: flag
@@ -22,7 +22,7 @@ source $SOURCE_SCRIPT
2222
UPDATED_PARENT_TYPES=()
2323

2424
if [ -n $PR_NUMBER ] && [ -z $PARENT_IMAGE_TYPE ]; then
25-
UPDATED_FILES=$(gh pr diff $PR_NUMBER --name-only)
25+
UPDATED_FILES=$(gh pr diff $PR_NUMBER --name-only --repo code-kern-ai/refinery-submodule-parent-images)
2626
while IFS= read -r file; do
2727
if [[ $file != requirements/* ]] || [[ $file != *.in ]]; then
2828
continue
@@ -32,14 +32,16 @@ if [ -n $PR_NUMBER ] && [ -z $PARENT_IMAGE_TYPE ]; then
3232
UPDATED_PARENT_TYPES+=($parent_image_type)
3333

3434
done <<< "$UPDATED_FILES"
35-
echo "::notice::Exporting matrix for parent image types: $UPDATED_PARENT_TYPES"
35+
# TODO: UPDATED_PARENT_TYPES are not resolved correctly
36+
echo -e "::notice::Exporting matrix for parent image types: $UPDATED_PARENT_TYPES"
3637
elif [ -n $PARENT_IMAGE_TYPE ]; then
3738
echo "::notice::Exporting matrix for parent image type: $PARENT_IMAGE_TYPE"
3839
UPDATED_PARENT_TYPES=( $PARENT_IMAGE_TYPE )
3940
fi
4041

4142
PARENT_IMAGE_TYPES=""
4243
UPDATE_APPS=""
44+
INCLUDES=""
4345
for parent_image_type in "${UPDATED_PARENT_TYPES[@]}"; do
4446
PARENT_IMAGE_TYPES+="\"$parent_image_type\","
4547
if [ $EDIT_DOCKERFILE = true ]; then
@@ -51,6 +53,8 @@ for parent_image_type in "${UPDATED_PARENT_TYPES[@]}"; do
5153
if [[ ! "$UPDATE_APPS" == *"$app"* ]]; then
5254
UPDATE_APPS+='"'$app'",'
5355
fi
56+
# Includes require keeping track of constants, but is a controlled approach (instead of UPDATE_APPS)
57+
INCLUDES+='{ "parent_image_type": "'${parent_image_type}'", "app": "'${app}'" },'
5458
done
5559
done
5660

0 commit comments

Comments
 (0)