On Mon, Sep 28, 2020 at 01:23:53PM +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 name is multi-qemu. job's name 'multi-qemu' is case-insensitive matching now. 3) `.yaml` and `.yml` can both match.
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..c27dd99 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 + "*.y{a,}ml"]
extra_job_fields = ["FLUENTD_SERVER_HOST=#{ENV["FLUENTD_SERVER_HOST"]}",
"FLUENTD_SERVER_PORT=#{ENV["FLUENTD_SERVER_PORT"]}"]
jobs.each do |job|
if Path[job].basename =~ /^multi-qemu\.ya?ml/i
Jobfile::Operate.auto_submit_job(job, "testbox: #{tbox_group}", extra_job_fields)
end
Jobfile::Operate.auto_submit_job(job, "testbox: #{tbox_group}")
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")}"
For style format.
Thanks, RenWen
end response += " user=lkp" response += " job=/lkp/scheduled/job.yaml RESULT_ROOT=/result/job rootovl ip=dhcp ro"
-- 2.23.0