Use testbox to find and submit idle jobs because of different types of physical machines have different type of jobs.
Before: find and submit idle jobs using tbox_group queues. Now: find and submit using testbox queues.
Example: There has a testbox: taishan200-2280-2s48p-256g--a14 Before: using 'taishan200-2280-2s48p-256g' Now: using 'taishan200-2280-2s48p-256g--a14'
Signed-off-by: Ren Wen 15991987063@163.com --- src/lib/sched.cr | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/lib/sched.cr b/src/lib/sched.cr index 2fbf05d..a61a57b 100644 --- a/src/lib/sched.cr +++ b/src/lib/sched.cr @@ -432,7 +432,7 @@ class Sched
# when find no job at "sched/#{tbox_group}" # try to get from "sched/#{tbox_group}/idle" - return get_idle_job(tbox_group, testbox) + return get_idle_job(tbox, testbox) end
private def prepare_job(queue_name, testbox) @@ -457,20 +457,21 @@ class Sched return job end
- private def get_idle_job(tbox_group, testbox) - job = prepare_job("sched/#{tbox_group}/idle", testbox) + private def get_idle_job(tbox, testbox) + queue_name = "sched/#{tbox}/idle" + job = prepare_job(queue_name, testbox)
# if there has no idle job, auto submit and get 1 if job.nil? - auto_submit_idle_job(tbox_group) - job = prepare_job("sched/#{tbox_group}/idle", testbox) + auto_submit_idle_job(tbox) + job = prepare_job(queue_name, testbox) end
return job end
- def auto_submit_idle_job(tbox_group) - full_path_patterns = "#{ENV["CCI_REPOS"]}/lab-#{ENV["lab"]}/allot/idle/#{tbox_group}/*.yaml" + def auto_submit_idle_job(tbox) + full_path_patterns = "#{ENV["CCI_REPOS"]}/lab-#{ENV["lab"]}/allot/idle/#{tbox}/*.yaml" extra_job_fields = [ "idle_job=true", "FLUENTD_SERVER_HOST=#{ENV["FLUENTD_SERVER_HOST"]}", @@ -479,7 +480,7 @@ class Sched
Jobfile::Operate.auto_submit_job( full_path_patterns, - "testbox: #{tbox_group}", + "testbox: #{tbox}", extra_job_fields) if Dir.glob(full_path_patterns).size > 0 end
On Wed, Oct 14, 2020 at 03:12:47PM +0800, Ren Wen wrote:
Use testbox to find and submit idle jobs because of different types of physical machines have different type of jobs.
Before: find and submit idle jobs using tbox_group queues. Now: find and submit using testbox queues.
Example: There has a testbox: taishan200-2280-2s48p-256g--a14 Before: using 'taishan200-2280-2s48p-256g'
But tbox_group is below value, not the above one.
Now: using 'taishan200-2280-2s48p-256g--a14'
On Wed, Oct 14, 2020 at 04:35:35PM +0800, Wu Fengguang wrote:
On Wed, Oct 14, 2020 at 03:12:47PM +0800, Ren Wen wrote:
Use testbox to find and submit idle jobs because of different types of physical machines have different type of jobs.
Before: find and submit idle jobs using tbox_group queues. Now: find and submit using testbox queues.
Example: There has a testbox: taishan200-2280-2s48p-256g--a14 Before: using 'taishan200-2280-2s48p-256g'
But tbox_group is below value, not the above one.
Um... I have the wrong comprehend.
testbox : taishan200-2280-2s48p-256g--a14-[<sn>] tbox : taishan200-2280-2s48p-256g--a14 tbox_group : taishan200-2280-2s48p-256g
Here i use 'tbox'.
Thanks, RenWen
Now: using 'taishan200-2280-2s48p-256g--a14'
On Wed, Oct 14, 2020 at 04:50:16PM +0800, Ren Wen wrote:
On Wed, Oct 14, 2020 at 04:35:35PM +0800, Wu Fengguang wrote:
On Wed, Oct 14, 2020 at 03:12:47PM +0800, Ren Wen wrote:
Use testbox to find and submit idle jobs because of different types of physical machines have different type of jobs.
Before: find and submit idle jobs using tbox_group queues. Now: find and submit using testbox queues.
Example: There has a testbox: taishan200-2280-2s48p-256g--a14 Before: using 'taishan200-2280-2s48p-256g'
But tbox_group is below value, not the above one.
Um... I have the wrong comprehend.
testbox : taishan200-2280-2s48p-256g--a14-[<sn>] tbox : taishan200-2280-2s48p-256g--a14 tbox_group : taishan200-2280-2s48p-256g
tbox_group is defined in ~/lkp-tests/lib/result.rb
def tbox_group(hostname) # special case 1: $tbox_group contains -N- # hostname: daixiang-HP-ProBook-450-G3-0 # return: daixiang-HP-ProBook-450-G3 # special case 2: $vm_tbox_group--$host_testbox-$seqno # hostname: vm-hi1620-2p8g--taishan200-2280-2s64p-256g-3-0 # return: vm-hi1620-2p8g--taishan200-2280-2s64p-256g hostname.sub(/(-\d+)+$/, '') end
BTW, the '--' rule could be confusing. I'm planning to drop this concept and add explicit "queue" field to decouple testbox name with queue name. Then we no longer need the --$USER trick.
Thanks, Fengguang
On Wed, Oct 14, 2020 at 04:58:05PM +0800, Wu Fengguang wrote:
On Wed, Oct 14, 2020 at 04:50:16PM +0800, Ren Wen wrote:
On Wed, Oct 14, 2020 at 04:35:35PM +0800, Wu Fengguang wrote:
On Wed, Oct 14, 2020 at 03:12:47PM +0800, Ren Wen wrote:
Use testbox to find and submit idle jobs because of different types of physical machines have different type of jobs.
Before: find and submit idle jobs using tbox_group queues. Now: find and submit using testbox queues.
Example: There has a testbox: taishan200-2280-2s48p-256g--a14 Before: using 'taishan200-2280-2s48p-256g'
But tbox_group is below value, not the above one.
Um... I have the wrong comprehend.
testbox : taishan200-2280-2s48p-256g--a14-[<sn>] tbox : taishan200-2280-2s48p-256g--a14 tbox_group : taishan200-2280-2s48p-256g
tbox_group is defined in ~/lkp-tests/lib/result.rb
def tbox_group(hostname) # special case 1: $tbox_group contains -N- # hostname: daixiang-HP-ProBook-450-G3-0 # return: daixiang-HP-ProBook-450-G3 # special case 2: $vm_tbox_group--$host_testbox-$seqno # hostname: vm-hi1620-2p8g--taishan200-2280-2s64p-256g-3-0 # return: vm-hi1620-2p8g--taishan200-2280-2s64p-256g hostname.sub(/(-\d+)+$/, '') end
BTW, the '--' rule could be confusing. I'm planning to drop this concept and add explicit "queue" field to decouple testbox name with queue name. Then we no longer need the --$USER trick.
Now i know : hostname -> tbox_group.
Thanks, RenWen
Thanks, Fengguang