[why] There no default config yaml in scheduler container, when submit idle job use the submit script.
[how] Mount default config dir in scheduler container.
Signed-off-by: Cao Xueliang caoxl78320@163.com --- container/scheduler/start | 3 +++ src/scheduler/jobfile_operate.cr | 10 +++------- 2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/container/scheduler/start b/container/scheduler/start index d61616a..6a2a4b0 100755 --- a/container/scheduler/start +++ b/container/scheduler/start @@ -45,6 +45,8 @@ SCHED_HOST = defaults['SCHED_HOST'] || '172.17.0.1' FLUENTD_HOST = defaults['FLUENTD_HOST'] || '172.17.0.1' FLUENTD_PORT = defaults['FLUENTD_PORT'] || '24224' FLUENTD_SERVER_PORT = defaults['FLUENTD_SERVER_PORT'] || '24224' +DEFAULT_CONFIG_DIR = '/etc/compass-ci/defaults' + docker_rm "s001-alpine-#{SCHED_PORT}"
bind_list = [] @@ -70,6 +72,7 @@ cmd = %W[ -e FLUENTD_SERVER_PORT=#{FLUENTD_SERVER_PORT} -v #{ENV['LKP_SRC']}:#{DEFAULT_LKP} -v #{ENV['CCI_SRC']}:#{DEFAULT_CCI} + -v #{DEFAULT_CONFIG_DIR}:#{DEFAULT_CONFIG_DIR}:ro -v #{CCI_REPOS}/lab-#{LAB}:#{CCI_REPOS}/lab-#{LAB} -v /srv/cci/scheduler/alpine:/srv/cci/scheduler -v /etc/localtime:/etc/localtime:ro diff --git a/src/scheduler/jobfile_operate.cr b/src/scheduler/jobfile_operate.cr index e0e298f..d3c26c5 100644 --- a/src/scheduler/jobfile_operate.cr +++ b/src/scheduler/jobfile_operate.cr @@ -202,14 +202,10 @@ module Jobfile::Operate end
def self.auto_submit_job(job_file, override_parameter, other_parameters = nil) - job_fields = ["SCHED_HOST=#{ENV["SCHED_HOST"]}", - "SCHED_PORT=#{ENV["SCHED_PORT"]}", - "GIT_SERVER=#{ENV["GIT_SERVER"]}", - "lab=#{ENV["lab"]}"] - - job_fields.concat(other_parameters) if other_parameters cmd = "#{ENV["LKP_SRC"]}/sbin/submit " - cmd += job_fields.join(" ") + if other_parameters + cmd += other_parameters.join(" ") + end cmd += " -s '#{override_parameter}' #{job_file}" puts `#{cmd}` end