Skip to content
Draft
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
25 changes: 20 additions & 5 deletions MAIA/maia_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import asyncio
import base64
import binascii
import json
import os
import subprocess
Expand Down Expand Up @@ -429,15 +430,29 @@ def create_maia_namespace_values(namespace_config, cluster_config, config_folder
if mlflow_configs:
maia_namespace_values["mlflow"] = {
"enabled": True,
#"user": base64.b64decode(mlflow_configs["mlflow_user"]).decode("ascii"),
# "user": base64.b64decode(mlflow_configs["mlflow_user"]).decode("ascii"),
"user": mlflow_configs["mlflow_user"],
"password": mlflow_configs["mlflow_password"]
#"password": base64.b64decode(mlflow_configs["mlflow_password"]).decode("ascii"),
"password": mlflow_configs["mlflow_password"],
# "password": base64.b64decode(mlflow_configs["mlflow_password"]).decode("ascii"),
}

enable_cifs = namespace_config.get("extra_configs", {}).get("enable_cifs", False)
if enable_cifs:
maia_namespace_values["cifs"] = {"enabled": True, "encryption": {"publicKey": ""}} # base64 encoded}
# Read and decode CIFS encryption key from environment variable
cifs_encryption_key_b64 = os.environ.get("CIFS_ENCRYPTION_KEY", "")
public_key = ""

if cifs_encryption_key_b64:
try:
public_key = base64.b64decode(cifs_encryption_key_b64).decode("ascii")
except (binascii.Error, UnicodeDecodeError) as e:
print(f"⚠️ Warning: Failed to decode CIFS_ENCRYPTION_KEY: {e}")
print(" Using empty public key as fallback.")
else:
print("⚠️ Warning: CIFS_ENCRYPTION_KEY environment variable is not set.")
print(" Using empty public key as fallback.")

maia_namespace_values["cifs"] = {"enabled": True, "encryption": {"publicKey": public_key}}
namespace_id = namespace_config["group_ID"].lower().replace("_", "-")
Path(config_folder).joinpath(namespace_config["group_ID"], "maia_namespace_values").mkdir(parents=True, exist_ok=True)
with open(
Expand Down Expand Up @@ -1253,7 +1268,7 @@ def create_maia_dashboard_values(config_folder, project_id, cluster_config_dict,

if "discord_url" in maia_config_dict:
maia_dashboard_values["dashboard"]["discord_url"] = maia_config_dict["discord_url"]
#if "discord_signup_url" in maia_config_dict:
# if "discord_signup_url" in maia_config_dict:
# maia_dashboard_values["dashboard"]["discord_signup_url"] = maia_config_dict["discord_signup_url"]
if "discord_support_url" in maia_config_dict:
maia_dashboard_values["dashboard"]["discord_support_url"] = maia_config_dict["discord_support_url"]
Expand Down