fix(monitor): add volc and aliyun jobid (#338)

* add volc and aliyun jobid

* rm workspaceid
pull/367/head
jiaopenglong 2023-09-25 17:58:32 +08:00 committed by GitHub
parent 064965527b
commit 847cc819dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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