On Mon, Oct 19, 2020 at 04:20:09PM +0800, Ren Wen wrote:
On Mon, Oct 19, 2020 at 03:56:41PM +0800, Zhang Yuhang wrote:
On Mon, Oct 19, 2020 at 12:10:46PM +0800, Ren Wen wrote:
- when a job without 'cluster' (a job field), or has 'cluster'
but starts with 'cs-localhost', the job is a normal job; otherwise, it's a cluster job.
- alter the numbers of return values of 'get_cluster_config' function,
to only return 'cluster config'. Because the conditions how to judge a job is whether a cluster job are changed.
Signed-off-by: Ren Wen 15991987063@163.com
src/lib/sched.cr | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-)
job = Job.new(job_content, job_content["id"]?)
job = Job.new(job_content, job_content["id"]?) ^ What this "?" mean in here? Thanks.
It's a part of instance method, 'Job' here is a class in '$CCI_SRC/src/lib/job.cr':
def []?(key : String) @hash.[key]? end
Thanks, RenWen
OK.
Thanks, Zhang Yuhang
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' cluster_file = job["cluster"]
if cluster_file != ""
cluster_config, hosts_size = get_cluster_config(
cluster_file, job.lkp_initrd_user, job.os_arch)
return submit_cluster_job(
job, cluster_config.not_nil!) if hosts_size >= 2
if cluster_file.empty? || cluster_file.starts_with?("cs-localhost")
return submit_single_job(job)
else
cluster_config = get_cluster_config(cluster_file,
job.lkp_initrd_user,
job.os_arch)
return submit_cluster_job(job, cluster_config) end
rescue ex puts ex.inspect_with_backtrace return [{return submit_single_job(job)
-- 2.23.0