Signed-off-by: Cao Xueliang caoxl78320@163.com --- container/scheduler/start | 5 +++-- src/scheduler.cr | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/container/scheduler/start b/container/scheduler/start index b13b396..598b263 100755 --- a/container/scheduler/start +++ b/container/scheduler/start @@ -7,6 +7,7 @@ require 'set' require_relative '../defconfig.rb'
names = Set.new %w[ + SCHED_HOST SCHED_PORT SCHED_NODES REDIS_HOST @@ -38,7 +39,7 @@ defaults['SCHED_PORT'] ||= '3000' defaults['MASTER_FLUENTD_PORT'] ||= '24224' defaults['SRV_HTTP_CCI_PORT'] ||= '11307' sched_nodes = defaults.delete('SCHED_NODES') -SCHED_PORT = defaults.delete('SCHED_PORT') +SCHED_PORT = defaults['SCHED_PORT']
sched_nodes.each do |node| docker_rm "s001-alpine-#{node['port']}" @@ -69,7 +70,7 @@ sched_nodes.each do |node| -e CCI_REPOS=#{CCI_REPOS} -e LKP_SRC=#{DEFAULT_LKP} -e CCI_SRC=#{DEFAULT_CCI} - -e SCHED_PORT=#{node_port} + -e NODE_PORT=#{node_port} -v /srv/tmp/public:/c/cci/scheduler/public -v #{ENV['LKP_SRC']}:#{DEFAULT_LKP} -v #{ENV['CCI_SRC']}:#{DEFAULT_CCI} diff --git a/src/scheduler.cr b/src/scheduler.cr index 07b38a3..4e4bf24 100644 --- a/src/scheduler.cr +++ b/src/scheduler.cr @@ -9,7 +9,7 @@ module Scheduler log = JSONLogger.new
begin - Kemal.run(SCHED_PORT) + Kemal.run(ENV["NODE_PORT"].to_i32) rescue e log.error(e) end
names = Set.new %w[
- SCHED_HOST SCHED_PORT SCHED_NODES REDIS_HOST
@@ -38,7 +39,7 @@ defaults['SCHED_PORT'] ||= '3000' defaults['MASTER_FLUENTD_PORT'] ||= '24224' defaults['SRV_HTTP_CCI_PORT'] ||= '11307' sched_nodes = defaults.delete('SCHED_NODES') -SCHED_PORT = defaults.delete('SCHED_PORT') +SCHED_PORT = defaults['SCHED_PORT']
you can add set add set default value in case of there has set no key for SCHED_PORT.
Thanks, Luan Shengde
sched_nodes.each do |node| docker_rm "s001-alpine-#{node['port']}" @@ -69,7 +70,7 @@ sched_nodes.each do |node| -e CCI_REPOS=#{CCI_REPOS} -e LKP_SRC=#{DEFAULT_LKP} -e CCI_SRC=#{DEFAULT_CCI}
- -e SCHED_PORT=#{node_port}
- -e NODE_PORT=#{node_port} -v /srv/tmp/public:/c/cci/scheduler/public -v #{ENV['LKP_SRC']}:#{DEFAULT_LKP} -v #{ENV['CCI_SRC']}:#{DEFAULT_CCI}
diff --git a/src/scheduler.cr b/src/scheduler.cr index 07b38a3..4e4bf24 100644 --- a/src/scheduler.cr +++ b/src/scheduler.cr @@ -9,7 +9,7 @@ module Scheduler log = JSONLogger.new
begin
- Kemal.run(SCHED_PORT)
- Kemal.run(ENV["NODE_PORT"].to_i32) rescue e log.error(e) end
-- 2.23.0
On Tue, Apr 13, 2021 at 02:35:14PM +0800, Luan Shengde wrote:
names = Set.new %w[
- SCHED_HOST SCHED_PORT SCHED_NODES REDIS_HOST
@@ -38,7 +39,7 @@ defaults['SCHED_PORT'] ||= '3000' defaults['MASTER_FLUENTD_PORT'] ||= '24224' defaults['SRV_HTTP_CCI_PORT'] ||= '11307' sched_nodes = defaults.delete('SCHED_NODES') -SCHED_PORT = defaults.delete('SCHED_PORT') +SCHED_PORT = defaults['SCHED_PORT']
you can add set add set default value in case of there has set no key for SCHED_PORT.
If you didn't set the value, we should give a error, default value is not a good value.
Thanks, Xueliang
Thanks, Luan Shengde
sched_nodes.each do |node| docker_rm "s001-alpine-#{node['port']}" @@ -69,7 +70,7 @@ sched_nodes.each do |node| -e CCI_REPOS=#{CCI_REPOS} -e LKP_SRC=#{DEFAULT_LKP} -e CCI_SRC=#{DEFAULT_CCI}
- -e SCHED_PORT=#{node_port}
- -e NODE_PORT=#{node_port} -v /srv/tmp/public:/c/cci/scheduler/public -v #{ENV['LKP_SRC']}:#{DEFAULT_LKP} -v #{ENV['CCI_SRC']}:#{DEFAULT_CCI}
diff --git a/src/scheduler.cr b/src/scheduler.cr index 07b38a3..4e4bf24 100644 --- a/src/scheduler.cr +++ b/src/scheduler.cr @@ -9,7 +9,7 @@ module Scheduler log = JSONLogger.new
begin
- Kemal.run(SCHED_PORT)
- Kemal.run(ENV["NODE_PORT"].to_i32) rescue e log.error(e) end
-- 2.23.0