Skip to content

Commit 76e70f3

Browse files
[Setup/Standup] fix: Switch to pykube-ng in an attempt to restore CI/CD (llm-d#328)
* [Setup/Standup] fix: Switch to `pykube-ng` in an attempt to restore CI/CD Also, temporarily disable skip schema validation for step 9 --------- Signed-off-by: maugustosilva <maugusto.silva@gmail.com>
1 parent 2834df4 commit 76e70f3

File tree

5 files changed

+5
-94
lines changed

5 files changed

+5
-94
lines changed
File renamed without changes.

setup/functions.py

Lines changed: 2 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

setup/install_deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ if ! command -v pip3 &> /dev/null; then
135135
echo "pip3 installed successfully."
136136
fi
137137

138-
python_deps="kubernetes pykube kubernetes-asyncio GitPython requests PyYAML"
138+
python_deps="kubernetes pykube-ng kubernetes-asyncio GitPython requests PyYAML"
139139

140140
for dep in $python_deps; do
141141
# use pip3 show to check if the package is already installed

setup/steps/06_deploy_vllm_standalone_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def generate_deployment_yaml(ev, model, model_label):
250250
affinity_key, affinity_value = ev["vllm_common_affinity"].split(":", 1)
251251

252252
# Generate command line options
253-
args = add_command_line_options(ev.get("vllm_standalone_args", ""))
253+
args = add_command_line_options(ev["vllm_standalone_args"])
254254

255255
# Generate additional environment variables
256256
additional_env = add_additional_env_to_yaml(ev.get("vllm_common_envvars_to_yaml", ""))

setup/steps/09_deploy_via_modelservice.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ EOF
246246
rm -f $LLMDBENCH_CONTROL_WORK_DIR/setup/helm/${LLMDBENCH_VLLM_MODELSERVICE_RELEASE}/${MODEL_NUM}/ms-rules.yaml
247247

248248
announce "🚀 Installing helm chart \"ms-${LLMDBENCH_VLLM_MODELSERVICE_RELEASE}\" via helmfile..."
249-
llmdbench_execute_cmd "helmfile --namespace ${LLMDBENCH_VLLM_COMMON_NAMESPACE} --kubeconfig ${LLMDBENCH_CONTROL_WORK_DIR}/environment/context.ctx --selector name=${LLMDBENCH_DEPLOY_CURRENT_MODEL_ID_LABEL}-ms apply -f $LLMDBENCH_CONTROL_WORK_DIR/setup/helm/${LLMDBENCH_VLLM_MODELSERVICE_RELEASE}/helmfile-${MODEL_NUM}.yaml --skip-diff-on-install" ${LLMDBENCH_CONTROL_DRY_RUN} ${LLMDBENCH_CONTROL_VERBOSE}
249+
llmdbench_execute_cmd "helmfile --namespace ${LLMDBENCH_VLLM_COMMON_NAMESPACE} --kubeconfig ${LLMDBENCH_CONTROL_WORK_DIR}/environment/context.ctx --selector name=${LLMDBENCH_DEPLOY_CURRENT_MODEL_ID_LABEL}-ms apply -f $LLMDBENCH_CONTROL_WORK_DIR/setup/helm/${LLMDBENCH_VLLM_MODELSERVICE_RELEASE}/helmfile-${MODEL_NUM}.yaml --skip-diff-on-install --skip-schema-validation" ${LLMDBENCH_CONTROL_DRY_RUN} ${LLMDBENCH_CONTROL_VERBOSE}
250250
announce "${LLMDBENCH_VLLM_COMMON_NAMESPACE}-${LLMDBENCH_DEPLOY_CURRENT_MODEL_ID_LABEL}-ms helm chart deployed successfully"
251251

252252
if [[ $LLMDBENCH_VLLM_MODELSERVICE_DECODE_REPLICAS -gt 0 ]]; then

0 commit comments

Comments
 (0)