From 847cc819ddad3c65b47ff1aa56778ffdba9c40cd Mon Sep 17 00:00:00 2001 From: jiaopenglong <44927264+JiaoPL@users.noreply.github.com> Date: Mon, 25 Sep 2023 17:58:32 +0800 Subject: [PATCH] fix(monitor): add volc and aliyun jobid (#338) * add volc and aliyun jobid * rm workspaceid --- internlm/monitor/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internlm/monitor/utils.py b/internlm/monitor/utils.py index f64c7dcb..34360b52 100644 --- a/internlm/monitor/utils.py +++ b/internlm/monitor/utils.py @@ -14,8 +14,10 @@ def get_job_id(): job_id = "none" if os.getenv("SLURM_JOB_ID") is not None: job_id = os.getenv("SLURM_JOB_ID") - elif os.getenv("K8S_WORKSPACE_ID") is not None: - job_id = os.getenv("K8S_WORKSPACE_ID") + elif os.getenv("KUBERNETES_POD_NAME") is not None: + job_id = os.getenv("KUBERNETES_POD_NAME").split("-")[0] + elif os.getenv("MLP_TASK_INSTANCE_ID") is not None: + job_id = os.getenv("MLP_TASK_ID") return job_id