|
15 | 15 | UNKNOWN_JSON_STR,
|
16 | 16 | )
|
17 | 17 | from ads.common.extended_enum import ExtendedEnum
|
| 18 | +from ads.common.utils import UNKNOWN |
18 | 19 |
|
19 | 20 |
|
20 | 21 | class Usage(ExtendedEnum):
|
@@ -189,10 +190,28 @@ def from_service_config(
|
189 | 190 | container_item.model_formats.append(
|
190 | 191 | additional_configurations.get("modelFormats")
|
191 | 192 | )
|
192 |
| - env_vars_dict = json.loads( |
193 |
| - additional_configurations.get("env_vars") or "{}" |
194 |
| - ) |
195 |
| - env_vars = [{key: str(value)} for key, value in env_vars_dict.items()] |
| 193 | + |
| 194 | + if additional_configurations.get("env_vars", None): |
| 195 | + env_vars_dict = json.loads( |
| 196 | + additional_configurations.get("env_vars") or "{}" |
| 197 | + ) |
| 198 | + env_vars = [ |
| 199 | + {key: str(value)} for key, value in env_vars_dict.items() |
| 200 | + ] |
| 201 | + else: |
| 202 | + config_keys = { |
| 203 | + "MODEL_DEPLOY_PREDICT_ENDPOINT": UNKNOWN, |
| 204 | + "MODEL_DEPLOY_HEALTH_ENDPOINT": UNKNOWN, |
| 205 | + "PORT": UNKNOWN, |
| 206 | + "HEALTH_CHECK_PORT": UNKNOWN, |
| 207 | + "VLLM_USE_V1": UNKNOWN, |
| 208 | + } |
| 209 | + |
| 210 | + env_vars = [ |
| 211 | + {key: additional_configurations.get(key, default)} |
| 212 | + for key, default in config_keys.items() |
| 213 | + if key in additional_configurations |
| 214 | + ] |
196 | 215 |
|
197 | 216 | # Build container spec
|
198 | 217 | container_item.spec = AquaContainerConfigSpec(
|
|
0 commit comments