Skip to content
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
25 changes: 10 additions & 15 deletions src/cloudai/systems/kubernetes/kubernetes_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,23 +310,18 @@ def _run_genai_perf(self, job: KubernetesJob) -> None:

frontend_pod = self._get_dynamo_pod_by_role(role="frontend")

logging.debug(f"Executing genai-perf in pod={frontend_pod} cmd={genai_perf_cmd}")
kubectl_exec_cmd = ["kubectl", "exec", "-n", self.default_namespace, frontend_pod, "--", *genai_perf_cmd]
logging.debug(f"Executing genai-perf in pod={frontend_pod} cmd={kubectl_exec_cmd}")
try:
genai_results = lazy.k8s.stream.stream(
self.core_v1.connect_get_namespaced_pod_exec,
name=frontend_pod,
namespace=self.default_namespace,
command=genai_perf_cmd,
stderr=True,
stdin=False,
stdout=True,
tty=False,
_request_timeout=60 * 10,
)
result = subprocess.run(kubectl_exec_cmd, capture_output=True, text=True, timeout=60 * 10)
logging.debug(f"genai-perf exited with code {result.returncode}")
with (job.test_run.output_path / "genai_perf.log").open("w") as f:
f.write(genai_results)
except lazy.k8s.client.ApiException as e:
logging.error(f"Error executing genai-perf command in pod '{frontend_pod}': {e}")
f.write(result.stdout)
if result.stderr:
f.write("\nSTDERR:\n")
f.write(result.stderr)
except Exception as e:
logging.debug(f"Error executing genai-perf command in pod '{frontend_pod}': {e}")

cp_logs_cmd = " ".join(
[
Expand Down