File tree Expand file tree Collapse file tree 4 files changed +29
-8
lines changed
Expand file tree Collapse file tree 4 files changed +29
-8
lines changed Original file line number Diff line number Diff line change 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'
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 }}"
Original file line number Diff line number Diff line change 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
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 }} \
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"
Original file line number Diff line number Diff line change 55PARENT_IMAGE_TYPE=" "
66PR_NUMBER=" "
77SOURCE_SCRIPT=" pi/settings.sh"
8+ EDIT_DOCKERFILE=false
89
9- while getopts t:p:s: flag
10+ while getopts t:p:s:d: flag
1011do
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
1618done
1719
@@ -40,7 +42,11 @@ PARENT_IMAGE_TYPES=""
4042INCLUDES=" "
4143for 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments