[PATCH compass-ci] src/lib: for multitask like multi-qemu

[why] when the job.yaml like multi-qemu.yaml: multi-qemu-0: multi-qemu-1: the scheduler can not find the program multi-qemu-0 and the program multi-qemu-1 Signed-off-by: Li Ping <15396232681@163.com> --- src/lib/job.cr | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/job.cr b/src/lib/job.cr index 1e44d15..e563ddf 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -399,6 +399,10 @@ class Job if @hash["pp"]? program_params = @hash["pp"].as_h program_params.keys.each do |program| + program_num = program.match(/(.*)(\-\d{1,}$)/) + if program_num != nil + program = program_num.not_nil![1] + end deps_dest_file = "#{SRV_INITRD}/deps/#{mount_type}/#{os_dir}/#{program}.cgz" pkg_dest_file = "#{SRV_INITRD}/pkg/#{mount_type}/#{os_dir}/#{program}.cgz" @@ -412,8 +416,8 @@ class Job end end - self["initrd_deps"] = initrd_deps_arr.join(" ") - self["initrd_pkg"] = initrd_pkg_arr.join(" ") + self["initrd_deps"] = initrd_deps_arr.uniq!.join(" ") + self["initrd_pkg"] = initrd_pkg_arr.uniq!.join(" ") end def update_tbox_group(tbox_group) -- 2.23.0

On Mon, Oct 19, 2020 at 09:36:23PM +0800, Li Ping wrote:
[why] when the job.yaml like multi-qemu.yaml: multi-qemu-0: multi-qemu-1: the scheduler can not find the program multi-qemu-0 and the program multi-qemu-1
The reason cant support you code, the code need multi-qemu, not the multi-qemu-x. Thanks, Xueliang
Signed-off-by: Li Ping <15396232681@163.com> --- src/lib/job.cr | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 1e44d15..e563ddf 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -399,6 +399,10 @@ class Job if @hash["pp"]? program_params = @hash["pp"].as_h program_params.keys.each do |program| + program_num = program.match(/(.*)(\-\d{1,}$)/) + if program_num != nil + program = program_num.not_nil![1] + end deps_dest_file = "#{SRV_INITRD}/deps/#{mount_type}/#{os_dir}/#{program}.cgz" pkg_dest_file = "#{SRV_INITRD}/pkg/#{mount_type}/#{os_dir}/#{program}.cgz"
@@ -412,8 +416,8 @@ class Job end end
- self["initrd_deps"] = initrd_deps_arr.join(" ") - self["initrd_pkg"] = initrd_pkg_arr.join(" ") + self["initrd_deps"] = initrd_deps_arr.uniq!.join(" ") + self["initrd_pkg"] = initrd_pkg_arr.uniq!.join(" ") end
def update_tbox_group(tbox_group) -- 2.23.0

On Tue, Oct 20, 2020 at 09:53:29AM +0800, Cao Xueliang wrote:
On Mon, Oct 19, 2020 at 09:36:23PM +0800, Li Ping wrote:
[why] when the job.yaml like multi-qemu.yaml: multi-qemu-0: multi-qemu-1: the scheduler can not find the program multi-qemu-0 and the program multi-qemu-1
The reason cant support you code, the code need multi-qemu, not the multi-qemu-x.
Ok, i got it. Thanks, Ping
Thanks, Xueliang
Signed-off-by: Li Ping <15396232681@163.com> --- src/lib/job.cr | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 1e44d15..e563ddf 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -399,6 +399,10 @@ class Job if @hash["pp"]? program_params = @hash["pp"].as_h program_params.keys.each do |program| + program_num = program.match(/(.*)(\-\d{1,}$)/) + if program_num != nil + program = program_num.not_nil![1] + end deps_dest_file = "#{SRV_INITRD}/deps/#{mount_type}/#{os_dir}/#{program}.cgz" pkg_dest_file = "#{SRV_INITRD}/pkg/#{mount_type}/#{os_dir}/#{program}.cgz"
@@ -412,8 +416,8 @@ class Job end end
- self["initrd_deps"] = initrd_deps_arr.join(" ") - self["initrd_pkg"] = initrd_pkg_arr.join(" ") + self["initrd_deps"] = initrd_deps_arr.uniq!.join(" ") + self["initrd_pkg"] = initrd_pkg_arr.uniq!.join(" ") end
def update_tbox_group(tbox_group) -- 2.23.0
participants (3)
-
Cao Xueliang
-
Li Ping
-
Wu Fengguang