@@ -825,7 +825,7 @@ def check_affinity():
825825 return False
826826
827827
828- def add_annotations (varname ) :
828+ def add_annotations (varname : str ) -> str :
829829 """
830830 Generate pod annotations YAML.
831831 Equivalent to the bash add_annotations function.
@@ -834,6 +834,7 @@ def add_annotations(varname):
834834 if not annotations :
835835 return ""
836836
837+ #FIXME (This should be extracted "ev" dictionary)
837838 # Determine indentation based on environment type
838839 standalone_active = int (os .environ .get ("LLMDBENCH_CONTROL_ENVIRONMENT_TYPE_STANDALONE_ACTIVE" , 0 ))
839840 modelservice_active = int (os .environ .get ("LLMDBENCH_CONTROL_ENVIRONMENT_TYPE_MODELSERVICE_ACTIVE" , 0 ))
@@ -1172,93 +1173,3 @@ def check_affinity():
11721173 except Exception as e :
11731174 announce (f"❌ Error connecting to Kubernetes: { e } " )
11741175 return False
1175-
1176-
1177- def add_annotations ():
1178- """
1179- Generate pod annotations YAML.
1180- Equivalent to the bash add_annotations function.
1181- """
1182- annotations = os .environ .get ("LLMDBENCH_VLLM_COMMON_ANNOTATIONS" , "" )
1183- if not annotations :
1184- return ""
1185-
1186- # Determine indentation based on environment type
1187- standalone_active = int (os .environ .get ("LLMDBENCH_CONTROL_ENVIRONMENT_TYPE_STANDALONE_ACTIVE" , 0 ))
1188- modelservice_active = int (os .environ .get ("LLMDBENCH_CONTROL_ENVIRONMENT_TYPE_MODELSERVICE_ACTIVE" , 0 ))
1189-
1190- if standalone_active == 1 :
1191- indent = " " # 8 spaces
1192- elif modelservice_active == 1 :
1193- indent = " " # 6 spaces
1194- else :
1195- indent = " " # default 8 spaces
1196-
1197- # Parse annotations (comma-separated key:value pairs)
1198- annotation_lines = []
1199- for entry in annotations .split ("," ):
1200- if ":" in entry :
1201- key , value = entry .split (":" , 1 )
1202- annotation_lines .append (f"{ indent } { key .strip ()} : { value .strip ()} " )
1203-
1204- return "\n " .join (annotation_lines )
1205-
1206-
1207- def add_command_line_options (args_string ):
1208- """
1209- Generate command line options for container args.
1210- Equivalent to the bash add_command_line_options function.
1211- """
1212- current_step = os .environ .get ("LLMDBENCH_CURRENT_STEP" , "" )
1213-
1214- if current_step == "06" :
1215- # For step 06 (standalone), format as YAML list item
1216- if args_string :
1217- return f" - |\n { args_string } "
1218- else :
1219- return " - |"
1220- elif current_step == "09" :
1221- # For step 09 (modelservice), different formatting
1222- if args_string :
1223- return f" { args_string } "
1224- else :
1225- return ""
1226- else :
1227- return args_string or ""
1228-
1229-
1230- def add_additional_env_to_yaml (env_vars_string ):
1231- """
1232- Generate additional environment variables YAML.
1233- Equivalent to the bash add_additional_env_to_yaml function.
1234- """
1235- if not env_vars_string :
1236- return ""
1237-
1238- # Determine indentation based on environment type
1239- standalone_active = int (os .environ .get ("LLMDBENCH_CONTROL_ENVIRONMENT_TYPE_STANDALONE_ACTIVE" , 0 ))
1240- modelservice_active = int (os .environ .get ("LLMDBENCH_CONTROL_ENVIRONMENT_TYPE_MODELSERVICE_ACTIVE" , 0 ))
1241-
1242- if standalone_active == 1 :
1243- name_indent = " " # 8 spaces
1244- value_indent = " " # 10 spaces
1245- elif modelservice_active == 1 :
1246- name_indent = " " # 6 spaces
1247- value_indent = " " # 8 spaces
1248- else :
1249- name_indent = " " # default 8 spaces
1250- value_indent = " " # default 10 spaces
1251-
1252- # Parse environment variables (comma-separated list)
1253- env_lines = []
1254- for envvar in env_vars_string .split ("," ):
1255- envvar = envvar .strip ()
1256- if envvar :
1257- # Remove LLMDBENCH_VLLM_STANDALONE_ prefix if present
1258- clean_name = envvar .replace ("LLMDBENCH_VLLM_STANDALONE_" , "" )
1259- env_value = os .environ .get (envvar , "" )
1260-
1261- env_lines .append (f"{ name_indent } - name: { clean_name } " )
1262- env_lines .append (f"{ value_indent } value: \" { env_value } \" " )
1263-
1264- return "\n " .join (env_lines )
0 commit comments