1) submit all idles jobs once use '*' -> submit each idle job once until all done. 2) add two fields into job if job's filename is 'multi-qemu.yaml'. 3) add field 'idle_job' for idle jobs, value is always 'true'.
Two extra fields are used for: monitoring logs of virtual machines started by physical machine.
Signed-off-by: Ren Wen 15991987063@163.com --- src/lib/sched.cr | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/lib/sched.cr b/src/lib/sched.cr index 15f5c9e..984c7db 100644 --- a/src/lib/sched.cr +++ b/src/lib/sched.cr @@ -467,10 +467,20 @@ class Sched end
def auto_submit_idle_job(tbox_group) - full_path_patterns = "#{ENV["CCI_REPOS"]}/lab-#{ENV["lab"]}/allot/idle/#{tbox_group}/*.yaml" - Jobfile::Operate.auto_submit_job( - full_path_patterns, - "testbox: #{tbox_group}") if Dir.glob(full_path_patterns).size > 0 + idle_job_path = "#{ENV["CCI_REPOS"]}/lab-#{ENV["lab"]}/allot/idle/#{tbox_group}/" + + if Dir.exists?(idle_job_path) + jobs = Dir[idle_job_path + "*.yaml"] + + jobs.each do |job| + extra_job_fields = ["idle_job=true"] + if Path[job].basename == "multi-qemu.yaml" + extra_job_fields += ["FLUENTD_SERVER_HOST=#{ENV["FLUENTD_SERVER_HOST"]}", + "FLUENTD_SERVER_PORT=#{ENV["FLUENTD_SERVER_PORT"]}"] + end + Jobfile::Operate.auto_submit_job(job, "testbox: #{tbox_group}", extra_job_fields) + end + end end
private def add_kernel_console_param(arch_tmp) @@ -520,7 +530,7 @@ class Sched "#{JobHelper.service_path("#{SRV_INITRD}/osimage/#{job.os_dir}/vmlinuz")}" else response += "kernel #{os_http_prefix}" + - "#{JobHelper.service_path("#{SRV_OS}/#{job.os_dir}/vmlinuz")}" + "#{JobHelper.service_path("#{SRV_OS}/#{job.os_dir}/vmlinuz")}" end response += " user=lkp" response += " job=/lkp/scheduled/job.yaml RESULT_ROOT=/result/job rootovl ip=dhcp ro"
On Mon, Sep 28, 2020 at 10:41:22PM +0800, Ren Wen wrote:
- submit all idles jobs once use '*'
-> submit each idle job once until all done. 2) add two fields into job if job's filename is 'multi-qemu.yaml'. 3) add field 'idle_job' for idle jobs, value is always 'true'.
Two extra fields are used for: monitoring logs of virtual machines started by physical machine.
Signed-off-by: Ren Wen 15991987063@163.com
src/lib/sched.cr | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/lib/sched.cr b/src/lib/sched.cr index 15f5c9e..984c7db 100644 --- a/src/lib/sched.cr +++ b/src/lib/sched.cr @@ -467,10 +467,20 @@ class Sched end
def auto_submit_idle_job(tbox_group)
- full_path_patterns = "#{ENV["CCI_REPOS"]}/lab-#{ENV["lab"]}/allot/idle/#{tbox_group}/*.yaml"
- Jobfile::Operate.auto_submit_job(
full_path_patterns,
"testbox: #{tbox_group}") if Dir.glob(full_path_patterns).size > 0
- idle_job_path = "#{ENV["CCI_REPOS"]}/lab-#{ENV["lab"]}/allot/idle/#{tbox_group}/"
- if Dir.exists?(idle_job_path)
jobs = Dir[idle_job_path + "*.yaml"]
jobs.each do |job|
extra_job_fields = ["idle_job=true"]
if Path[job].basename == "multi-qemu.yaml"
extra_job_fields += ["FLUENTD_SERVER_HOST=#{ENV["FLUENTD_SERVER_HOST"]}",
"FLUENTD_SERVER_PORT=#{ENV["FLUENTD_SERVER_PORT"]}"]
end
Jobfile::Operate.auto_submit_job(job, "testbox: #{tbox_group}", extra_job_fields)
end
- end
it is eq to: return (??) if !Dir.exists?(idle_job_path)
jobs = Dir[idle_job_path + "*.yaml"] jobs.each do |job| extra_job_fields = ["idle_job=true"] if Path[job].basename == "multi-qemu.yaml" extra_job_fields += ["FLUENTD_SERVER_HOST=#{ENV["FLUENTD_SERVER_HOST"]}", "FLUENTD_SERVER_PORT=#{ENV["FLUENTD_SERVER_PORT"]}"] end Jobfile::Operate.auto_submit_job(job, "testbox: #{tbox_group}", extra_job_fields) end
end
private def add_kernel_console_param(arch_tmp) @@ -520,7 +530,7 @@ class Sched "#{JobHelper.service_path("#{SRV_INITRD}/osimage/#{job.os_dir}/vmlinuz")}" else response += "kernel #{os_http_prefix}" +
"#{JobHelper.service_path("#{SRV_OS}/#{job.os_dir}/vmlinuz")}"
end response += " user=lkp" response += " job=/lkp/scheduled/job.yaml RESULT_ROOT=/result/job rootovl ip=dhcp ro""#{JobHelper.service_path("#{SRV_OS}/#{job.os_dir}/vmlinuz")}"
-- 2.23.0
it is eq to:
return (??) if !Dir.exists?(idle_job_path)
jobs = Dir[idle_job_path + "*.yaml"] jobs.each do |job| extra_job_fields = ["idle_job=true"] if Path[job].basename == "multi-qemu.yaml" extra_job_fields += ["FLUENTD_SERVER_HOST=#{ENV["FLUENTD_SERVER_HOST"]}", "FLUENTD_SERVER_PORT=#{ENV["FLUENTD_SERVER_PORT"]}"] end Jobfile::Operate.auto_submit_job(job, "testbox: #{tbox_group}", extra_job_fields) end
Got it.
Thanks, RenWen
end
private def add_kernel_console_param(arch_tmp) @@ -520,7 +530,7 @@ class Sched "#{JobHelper.service_path("#{SRV_INITRD}/osimage/#{job.os_dir}/vmlinuz")}" else response += "kernel #{os_http_prefix}" +
"#{JobHelper.service_path("#{SRV_OS}/#{job.os_dir}/vmlinuz")}"
end response += " user=lkp" response += " job=/lkp/scheduled/job.yaml RESULT_ROOT=/result/job rootovl ip=dhcp ro""#{JobHelper.service_path("#{SRV_OS}/#{job.os_dir}/vmlinuz")}"
-- 2.23.0
-- Thanks. chief tongqunfeng@huawei.com
On Mon, Sep 28, 2020 at 10:41:22PM +0800, Ren Wen wrote:
- submit all idles jobs once use '*'
-> submit each idle job once until all done.
- add two fields into job if job's filename is 'multi-qemu.yaml'.
Please undo that part. NEVER take special action based on job file name.
- add field 'idle_job' for idle jobs, value is always 'true'.
Better save/use more general queue=idle field into job
Two extra fields are used for: monitoring logs of virtual machines started by physical machine.
On Wed, Sep 30, 2020 at 07:28:23AM +0800, Wu Fengguang wrote:
On Mon, Sep 28, 2020 at 10:41:22PM +0800, Ren Wen wrote:
- submit all idles jobs once use '*'
-> submit each idle job once until all done.
- add two fields into job if job's filename is 'multi-qemu.yaml'.
Please undo that part. NEVER take special action based on job file name.
Got it. New mail has been sent.
- add field 'idle_job' for idle jobs, value is always 'true'.
Better save/use more general queue=idle field into job
Got it, this can be extensible.
Thanks, RenWen
Two extra fields are used for: monitoring logs of virtual machines started by physical machine.
On Wed, Sep 30, 2020 at 12:17:15PM +0800, Ren Wen wrote:
On Wed, Sep 30, 2020 at 07:28:23AM +0800, Wu Fengguang wrote:
On Mon, Sep 28, 2020 at 10:41:22PM +0800, Ren Wen wrote:
- submit all idles jobs once use '*'
-> submit each idle job once until all done.
- add two fields into job if job's filename is 'multi-qemu.yaml'.
Please undo that part. NEVER take special action based on job file name.
Got it. New mail has been sent.
- add field 'idle_job' for idle jobs, value is always 'true'.
Better save/use more general queue=idle field into job
Got it, this can be extensible.
Thanks, RenWen
Two extra fields are used for: monitoring logs of virtual machines started by physical machine.
On Mon, Sep 28, 2020 at 10:41:22PM +0800, Ren Wen wrote:
- submit all idles jobs once use '*'
-> submit each idle job once until all done. 2) add two fields into job if job's filename is 'multi-qemu.yaml'. 3) add field 'idle_job' for idle jobs, value is always 'true'.
Two extra fields are used for: monitoring logs of virtual machines started by physical machine.
Signed-off-by: Ren Wen 15991987063@163.com
src/lib/sched.cr | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/lib/sched.cr b/src/lib/sched.cr index 15f5c9e..984c7db 100644 --- a/src/lib/sched.cr +++ b/src/lib/sched.cr @@ -467,10 +467,20 @@ class Sched end
def auto_submit_idle_job(tbox_group)
- full_path_patterns = "#{ENV["CCI_REPOS"]}/lab-#{ENV["lab"]}/allot/idle/#{tbox_group}/*.yaml"
- Jobfile::Operate.auto_submit_job(
full_path_patterns,
"testbox: #{tbox_group}") if Dir.glob(full_path_patterns).size > 0
- idle_job_path = "#{ENV["CCI_REPOS"]}/lab-#{ENV["lab"]}/allot/idle/#{tbox_group}/"
- if Dir.exists?(idle_job_path)
jobs = Dir[idle_job_path + "*.yaml"]
jobs.each do |job|
extra_job_fields = ["idle_job=true"]
if Path[job].basename == "multi-qemu.yaml"
extra_job_fields += ["FLUENTD_SERVER_HOST=#{ENV["FLUENTD_SERVER_HOST"]}",
"FLUENTD_SERVER_PORT=#{ENV["FLUENTD_SERVER_PORT"]}"]
end
Jobfile::Operate.auto_submit_job(job, "testbox: #{tbox_group}", extra_job_fields)
end
- end end
The above loop may take long time. Will it cause HTTP timeout?
Thanks, Fengguang
On Wed, Sep 30, 2020 at 07:30:48AM +0800, Wu Fengguang wrote:
On Mon, Sep 28, 2020 at 10:41:22PM +0800, Ren Wen wrote:
- submit all idles jobs once use '*'
-> submit each idle job once until all done. 2) add two fields into job if job's filename is 'multi-qemu.yaml'. 3) add field 'idle_job' for idle jobs, value is always 'true'.
def auto_submit_idle_job(tbox_group)
- full_path_patterns = "#{ENV["CCI_REPOS"]}/lab-#{ENV["lab"]}/allot/idle/#{tbox_group}/*.yaml"
- Jobfile::Operate.auto_submit_job(
full_path_patterns,
"testbox: #{tbox_group}") if Dir.glob(full_path_patterns).size > 0
- idle_job_path = "#{ENV["CCI_REPOS"]}/lab-#{ENV["lab"]}/allot/idle/#{tbox_group}/"
- if Dir.exists?(idle_job_path)
jobs = Dir[idle_job_path + "*.yaml"]
jobs.each do |job|
extra_job_fields = ["idle_job=true"]
if Path[job].basename == "multi-qemu.yaml"
extra_job_fields += ["FLUENTD_SERVER_HOST=#{ENV["FLUENTD_SERVER_HOST"]}",
"FLUENTD_SERVER_PORT=#{ENV["FLUENTD_SERVER_PORT"]}"]
end
Jobfile::Operate.auto_submit_job(job, "testbox: #{tbox_group}", extra_job_fields)
end
- end end
The above loop may take long time. Will it cause HTTP timeout?
not sure. we will patch this (submit at backgroud). - normal http timeout is about 1 minutes, but it can set to 1 hours. - it maybe need a "long" time to submit all idle jobs.
Thanks, Fengguang