Skip to content

[Ready to review] Refactoring SMC env variable config #1232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions ads/aqua/config/container_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,21 +191,28 @@ def from_service_config(
additional_configurations.get("modelFormats")
)

# Parse environment variables from `additional_configurations`.
# Only keys present in the configuration will be added to the result.
config_keys = {
"MODEL_DEPLOY_PREDICT_ENDPOINT": UNKNOWN,
"MODEL_DEPLOY_HEALTH_ENDPOINT": UNKNOWN,
"PORT": UNKNOWN,
"HEALTH_CHECK_PORT": UNKNOWN,
"VLLM_USE_V1": UNKNOWN,
}

env_vars = [
{key: additional_configurations.get(key, default)}
for key, default in config_keys.items()
if key in additional_configurations
]
# TODO: Remove the else condition once SMC env variable config is updated everywhere
if additional_configurations.get("env_vars", None):
env_vars_dict = json.loads(
additional_configurations.get("env_vars") or "{}"
)
env_vars = [
{key: str(value)} for key, value in env_vars_dict.items()
]
else:
config_keys = {
"MODEL_DEPLOY_PREDICT_ENDPOINT": UNKNOWN,
"MODEL_DEPLOY_HEALTH_ENDPOINT": UNKNOWN,
"PORT": UNKNOWN,
"HEALTH_CHECK_PORT": UNKNOWN,
"VLLM_USE_V1": UNKNOWN,
}

env_vars = [
{key: additional_configurations.get(key, default)}
for key, default in config_keys.items()
if key in additional_configurations
]

# Build container spec
container_item.spec = AquaContainerConfigSpec(
Expand Down