- def set_host_mac(mac : String, hostname : String)
- def set_host_mac(mac : String, hostname : String, queues : String)
- puts "queues: #{queues}"
looks puts only a debug msg, can it be delete?
-------- Thanks Yu Chuan
@redis.hash_set("sched/mac2host", normalize_mac(mac), hostname)
@redis.hash_set("sched/mac2queues", normalize_mac(mac), queues) end
def del_host_mac(mac : String) @redis.hash_del("sched/mac2host", normalize_mac(mac))
@redis.hash_del("sched/mac2queues", normalize_mac(mac)) end
# return:
@@ -251,24 +254,24 @@ class Sched # success: [{"job_id" => job_id, "message" => "", job_state => "submit"}] # failure: [{"job_id" => "0", "message" => err_msg, job_state => "submit"}] def submit_single_job(job)
- tbox_group = job.tbox_group
- queue = job.queue return [{ "job_id" => "0",
"message" => "get tbox group failed",
"message" => "get queue failed", "job_state" => "submit",
- }] unless tbox_group
}] unless queue
# only single job will has "idle job" and "execute rate limiter" if job["idle_job"].empty?
tbox_group += "#{job.get_uuid_tag}"
elsequeue += "#{job.get_uuid_tag}"
tbox_group = "#{tbox_group}/idle"
endqueue = "#{queue}/idle"
- job_id = add_task(tbox_group, job.lab)
- job_id = add_task(queue, job.lab) return [{ "job_id" => "0",
"message" => "add task queue sched/#{tbox_group} failed",
}] unless job_id"message" => "add task queue sched/#{queue} failed", "job_state" => "submit",
@@ -372,7 +375,7 @@ class Sched hostname = @redis.hash_get("sched/mac2host", normalize_mac(api_param)) if hostname.nil? # auto name new/unknown machine hostname = "sut-#{api_param}"
set_host_mac(api_param, hostname)
set_host_mac(api_param, hostname, "") # auto submit a job to collect the host information # grub hostname is link with ":", like "00:01:02:03:04:05"
-- 2.23.0