@@ -191,21 +191,28 @@ def from_service_config(
191
191
additional_configurations .get ("modelFormats" )
192
192
)
193
193
194
- # Parse environment variables from `additional_configurations`.
195
- # Only keys present in the configuration will be added to the result.
196
- config_keys = {
197
- "MODEL_DEPLOY_PREDICT_ENDPOINT" : UNKNOWN ,
198
- "MODEL_DEPLOY_HEALTH_ENDPOINT" : UNKNOWN ,
199
- "PORT" : UNKNOWN ,
200
- "HEALTH_CHECK_PORT" : UNKNOWN ,
201
- "VLLM_USE_V1" : UNKNOWN ,
202
- }
203
-
204
- env_vars = [
205
- {key : additional_configurations .get (key , default )}
206
- for key , default in config_keys .items ()
207
- if key in additional_configurations
208
- ]
194
+ # TODO: Remove the else condition once SMC env variable config is updated everywhere
195
+ if additional_configurations .get ("env_vars" , None ):
196
+ env_vars_dict = json .loads (
197
+ additional_configurations .get ("env_vars" ) or "{}"
198
+ )
199
+ env_vars = [
200
+ {key : str (value )} for key , value in env_vars_dict .items ()
201
+ ]
202
+ else :
203
+ config_keys = {
204
+ "MODEL_DEPLOY_PREDICT_ENDPOINT" : UNKNOWN ,
205
+ "MODEL_DEPLOY_HEALTH_ENDPOINT" : UNKNOWN ,
206
+ "PORT" : UNKNOWN ,
207
+ "HEALTH_CHECK_PORT" : UNKNOWN ,
208
+ "VLLM_USE_V1" : UNKNOWN ,
209
+ }
210
+
211
+ env_vars = [
212
+ {key : additional_configurations .get (key , default )}
213
+ for key , default in config_keys .items ()
214
+ if key in additional_configurations
215
+ ]
209
216
210
217
# Build container spec
211
218
container_item .spec = AquaContainerConfigSpec (
0 commit comments