How to check whether a job is cluster job or not at LKP?
should_wait_cluster() { [ -z "$LKP_SERVER" ] && return 1 [ -z "$node_roles" ] && return 1 [ "$cluster" = "cs-localhost" ] && return 1 return 0 }
So when you need a cluster job, the value of cluster field should not be "cs-localhost".
Signed-off-by: Ren Wen 15991987063@163.com --- src/scheduler/submit_job.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/scheduler/submit_job.cr b/src/scheduler/submit_job.cr index 8838e40..1297b57 100644 --- a/src/scheduler/submit_job.cr +++ b/src/scheduler/submit_job.cr @@ -9,10 +9,10 @@ class Sched job = Job.new(job_content, job_content["id"]?) job["commit_date"] = get_commit_date(job)
- # it is not a cluster job if cluster field is empty or - # field's prefix is 'cs-localhost' + # how to execute a cluster job: + # has a cluster field, and the value is not "cs-localhost" cluster_file = job["cluster"] - if cluster_file.empty? || cluster_file.starts_with?("cs-localhost") + if cluster_file.empty? || cluster_file == "cs-localhost" return submit_single_job(job) else cluster_config = get_cluster_config(cluster_file,
On Tue, Nov 17, 2020 at 10:19:29AM +0800, Ren Wen wrote:
How to check whether a job is cluster job or not at LKP?
should_wait_cluster() { [ -z "$LKP_SERVER" ] && return 1 [ -z "$node_roles" ] && return 1 [ "$cluster" = "cs-localhost" ] && return 1 return 0 }
So when you need a cluster job, the value of cluster field should not be "cs-localhost".
Signed-off-by: Ren Wen 15991987063@163.com
src/scheduler/submit_job.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/scheduler/submit_job.cr b/src/scheduler/submit_job.cr index 8838e40..1297b57 100644 --- a/src/scheduler/submit_job.cr +++ b/src/scheduler/submit_job.cr @@ -9,10 +9,10 @@ class Sched job = Job.new(job_content, job_content["id"]?) job["commit_date"] = get_commit_date(job)
- # it is not a cluster job if cluster field is empty or
- # field's prefix is 'cs-localhost'
- # how to execute a cluster job:
- # has a cluster field, and the value is not "cs-localhost" cluster_file = job["cluster"]
- if cluster_file.empty? || cluster_file.starts_with?("cs-localhost")
I think "starts_with?" is better "==", unless "cs-localhost-1" is a cluster job.
Thanks, Xueliang
- if cluster_file.empty? || cluster_file == "cs-localhost" return submit_single_job(job) else cluster_config = get_cluster_config(cluster_file,
-- 2.23.0
- # it is not a cluster job if cluster field is empty or
- # field's prefix is 'cs-localhost'
- # how to execute a cluster job:
- # has a cluster field, and the value is not "cs-localhost" cluster_file = job["cluster"]
- if cluster_file.empty? || cluster_file.starts_with?("cs-localhost")
I think "starts_with?" is better "==", unless "cs-localhost-1" is a cluster job.
'cs-localhost' is a fixed value.
Thanks, RenWen
Thanks, Xueliang
- if cluster_file.empty? || cluster_file == "cs-localhost" return submit_single_job(job) else cluster_config = get_cluster_config(cluster_file,
-- 2.23.0
On Tue, Nov 17, 2020 at 04:52:16PM +0800, Ren Wen wrote:
- # it is not a cluster job if cluster field is empty or
- # field's prefix is 'cs-localhost'
- # how to execute a cluster job:
- # has a cluster field, and the value is not "cs-localhost" cluster_file = job["cluster"]
- if cluster_file.empty? || cluster_file.starts_with?("cs-localhost")
I think "starts_with?" is better "==", unless "cs-localhost-1" is a cluster job.
'cs-localhost' is a fixed value.
Ok.
Thanks, Xueliang
Thanks, RenWen
Thanks, Xueliang
- if cluster_file.empty? || cluster_file == "cs-localhost" return submit_single_job(job) else cluster_config = get_cluster_config(cluster_file,
-- 2.23.0