On Mon, Oct 26, 2020 at 11:44:25AM +0800, Xiao Shenwei wrote:
[why] after one job submit, it will be add specified queue before: use tbox_group to discriminate now : use queue field to discriminate
so, we should add this field into job.yaml it's come from user's specify(job.yaml) or dafault then put the task into the queue
Signed-off-by: Xiao Shenwei xiaoshenwei96@163.com
src/lib/job.cr | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 8f5dd36..14e6ec7 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -139,6 +139,7 @@ class Job set_kernel_params() set_lkp_server() set_sshr_port()
- set_queue()
the @hash is come from submit_job's job_content, that include ["queue"] - as default, no need to set_queue - here is default enry
end
private def append_init_field @@ -199,6 +200,22 @@ class Job self["result_service"] = "raw_upload" end
- private def set_queue
- if @hash.has_key?("queue")
if !@hash["queue"].to_s.starts_with?(tbox_group)
raise "an incorrect queue-prefix is specified: #{queue}"
end
if has ["queue"], let it be, no need to recheck.
return
- end
- # set default value
- if tbox_group.to_s.starts_with?("vm") || tbox_group.to_s.starts_with?("dc")
self["queue"] = "#{tbox_group}.#{arch}"
- else
tbox_group? this is about how to get/set tbox_group. not set_queue.
self["queue"] = tbox_group
- end
- end
- # if not assign tbox_group, set it to a match result from testbox # ?if job special testbox, should we just set tbox_group=textbox private def update_tbox_group_from_testbox
-- 2.23.0