Skip to content

Commit 9d0c257

Browse files
committed
Build only if build is set to true in config.json
1 parent 4409b61 commit 9d0c257

File tree

2 files changed

+41
-18
lines changed

2 files changed

+41
-18
lines changed

.github/workflows/gh-packages-parallel.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,21 @@ jobs:
6060
run: |
6161
image_names=$(jq -r '.models[].serviceName' ./config.json)
6262
paths=$(jq -r '.models[].modelBasePath' ./config.json)
63+
builds=$(jq -r '.models[].build' ./config.json)
6364
readarray -t image_array <<< "$image_names"
6465
readarray -t paths_array <<< "$paths"
66+
readarray -t build_array <<< "$builds"
6567
lowercase_actor=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
6668
job=${{ matrix.job }}
6769
image="${image_array[job-1]}"
6870
path="${paths_array[job-1]}"
69-
docker build "./$path" -t "${{ env.REGISTRY }}/$lowercase_actor/$image:latest"
70-
docker push "${{ env.REGISTRY }}/$lowercase_actor/$image:latest"
71+
build="${build_array[job-1]}"
72+
if [ "$build" = true ]; then
73+
docker build "./$path" -t "${{ env.REGISTRY }}/$lowercase_actor/$image:latest"
74+
docker push "${{ env.REGISTRY }}/$lowercase_actor/$image:latest"
75+
fi
76+
77+
7178
7279
7380

config.json

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
"apiBasePath": "/search/word_score/local",
77
"containerPort": 8000,
88
"environment": {},
9-
"nginx": []
9+
"nginx": [],
10+
"build": false
1011
},
1112
{
1213
"serviceName": "spell_check",
1314
"modelBasePath": "src/spell_check/kenlm/local/.",
1415
"apiBasePath": "spell_check/kenlm/local/",
1516
"containerPort": 8000,
1617
"environment": {},
17-
"nginx": []
18+
"nginx": [],
19+
"build": false
1820
},
1921
{
2022
"serviceName": "flow_classification",
@@ -23,7 +25,8 @@
2325
"containerPort": 8000,
2426
"environment": {},
2527
"nginx": [],
26-
"constraints": ["node.role==worker"]
28+
"constraints": ["node.role==worker"],
29+
"build": false
2730
},
2831
{
2932
"serviceName": "text_translation_azure_dict",
@@ -33,7 +36,8 @@
3336
"environment": {
3437
"AZURE_TRANSLATE_KEY": "${AZURE_TRANSLATE_KEY}"
3538
},
36-
"nginx": []
39+
"nginx": [],
40+
"build": false
3741
},
3842
{
3943
"serviceName": "dict_aug_generate_sent",
@@ -44,7 +48,8 @@
4448
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
4549
},
4650
"nginx": [],
47-
"constraints": ["node.labels.node_vm_type==gpu"]
51+
"constraints": ["node.labels.node_vm_type==gpu"],
52+
"build": false
4853
},
4954
{
5055
"serviceName": "coref_spacy",
@@ -53,7 +58,8 @@
5358
"containerPort": 8000,
5459
"environment": {},
5560
"nginx": [],
56-
"constraints": ["node.labels.node_vm_type==gpu"]
61+
"constraints": ["node.labels.node_vm_type==gpu"],
62+
"build": false
5763
},
5864
{
5965
"serviceName": "coref_bart",
@@ -62,7 +68,8 @@
6268
"containerPort": 8000,
6369
"environment": {},
6470
"nginx": [],
65-
"constraints": ["node.labels.node_vm_type==gpu"]
71+
"constraints": ["node.labels.node_vm_type==gpu"],
72+
"build": false
6673
},
6774
{
6875
"serviceName": "text_translation_azure",
@@ -73,7 +80,8 @@
7380
"AZURE_TRANSLATE_KEY": "${AZURE_TRANSLATE_KEY}"
7481
},
7582
"nginx": [],
76-
"constraints": ["node.labels.node_vm_type==gpu"]
83+
"constraints": ["node.labels.node_vm_type==gpu"],
84+
"build": false
7785
},
7886
{
7987
"serviceName": "asr_mms",
@@ -82,7 +90,8 @@
8290
"containerPort": 8000,
8391
"environment": {},
8492
"nginx": ["client_max_body_size 100M;", "proxy_read_timeout 600;", "proxy_connect_timeout 600;", "proxy_send_timeout 600;"],
85-
"constraints": ["node.labels.node_vm_type==gpu"]
93+
"constraints": ["node.labels.node_vm_type==gpu"],
94+
"build": false
8695
},
8796
{
8897
"serviceName": "coref_fcoref",
@@ -91,7 +100,8 @@
91100
"containerPort": 8000,
92101
"environment": {},
93102
"nginx": [],
94-
"constraints": ["node.labels.node_vm_type==gpu"]
103+
"constraints": ["node.labels.node_vm_type==gpu"],
104+
"build": false
95105
},
96106
{
97107
"serviceName": "text_translation_bhashini",
@@ -100,23 +110,26 @@
100110
"containerPort": 8000,
101111
"environment": {},
102112
"nginx": [],
103-
"constraints": ["node.labels.node_vm_type==gpu"]
113+
"constraints": ["node.labels.node_vm_type==gpu"],
114+
"build": false
104115
},
105116
{
106117
"serviceName": "text_translation_ai4bharat",
107118
"modelBasePath": "src/text_translation/ai4bharat/remote/.",
108119
"apiBasePath": "src/text_translation/ai4bharat/remote",
109120
"containerPort": 8000,
110121
"environment": {},
111-
"constraints": ["node.labels.node_vm_type==gpu"]
122+
"constraints": ["node.labels.node_vm_type==gpu"],
123+
"build": false
112124
},
113125
{
114126
"serviceName": "text_lang_detection_bhashini",
115127
"modelBasePath": "src/text_lang_detection/bhashini/remote/.",
116128
"apiBasePath": "/text_lang_detection/bhashini/remote",
117129
"containerPort": 8000,
118130
"environment": {},
119-
"constraints": ["node.labels.node_vm_type==gpu"]
131+
"constraints": ["node.labels.node_vm_type==gpu"],
132+
"build": false
120133
},
121134
{
122135
"serviceName": "chunking_mpnet",
@@ -127,7 +140,8 @@
127140
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
128141
},
129142
"nginx": ["client_max_body_size 100M;", "proxy_read_timeout 600;", "proxy_connect_timeout 600;", "proxy_send_timeout 600;"],
130-
"constraints": ["node.labels.node_vm_type==gpu"]
143+
"constraints": ["node.labels.node_vm_type==gpu"],
144+
"build": false
131145
},
132146
{
133147
"serviceName": "embedding_instructor",
@@ -138,7 +152,8 @@
138152
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
139153
},
140154
"nginx": ["client_max_body_size 100M;", "proxy_read_timeout 600;", "proxy_connect_timeout 600;", "proxy_send_timeout 600;"],
141-
"constraints": ["node.labels.node_vm_type==gpu"]
155+
"constraints": ["node.labels.node_vm_type==gpu"],
156+
"build": false
142157
},
143158
{
144159
"serviceName": "llm_openai_gpt3",
@@ -149,7 +164,8 @@
149164
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
150165
},
151166
"nginx": [],
152-
"constraints": ["node.labels.node_vm_type==gpu"]
167+
"constraints": ["node.labels.node_vm_type==gpu"],
168+
"build": true
153169
}
154170
]
155171
}

0 commit comments

Comments
 (0)