[Why] Now, we have "sub-fluentd" and "fluentd". "fluentd" doesn't show the relationship well. Use "sub-fluentd" and "master-fluentd" can ben better. "sub-fluentd" send logs to "master-fluentd". And use MASTER_FLUENTD_HOST(PORT) replace FLUENTD_SERVER_HOST(PORT). When we see MASTER_FLUENTD_HOST can know it means master-fluentd's host
Signed-off-by: Wu Zhende wuzhende666@163.com --- container/{fluentd => master-fluentd}/Dockerfile | 0 container/{fluentd => master-fluentd}/build | 0 container/{fluentd => master-fluentd}/build-depends | 0 .../{fluentd => master-fluentd}/docker-fluentd.conf | 0 container/{fluentd => master-fluentd}/start | 0 container/scheduler/start | 10 +++++----- container/sub-fluentd/docker-fluentd.conf | 8 ++++---- container/sub-fluentd/start | 8 ++++---- sparrow/3-code/dev-env | 8 ++++---- src/lib/sched.cr | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) rename container/{fluentd => master-fluentd}/Dockerfile (100%) rename container/{fluentd => master-fluentd}/build (100%) rename container/{fluentd => master-fluentd}/build-depends (100%) rename container/{fluentd => master-fluentd}/docker-fluentd.conf (100%) rename container/{fluentd => master-fluentd}/start (100%)
diff --git a/container/fluentd/Dockerfile b/container/master-fluentd/Dockerfile similarity index 100% rename from container/fluentd/Dockerfile rename to container/master-fluentd/Dockerfile diff --git a/container/fluentd/build b/container/master-fluentd/build similarity index 100% rename from container/fluentd/build rename to container/master-fluentd/build diff --git a/container/fluentd/build-depends b/container/master-fluentd/build-depends similarity index 100% rename from container/fluentd/build-depends rename to container/master-fluentd/build-depends diff --git a/container/fluentd/docker-fluentd.conf b/container/master-fluentd/docker-fluentd.conf similarity index 100% rename from container/fluentd/docker-fluentd.conf rename to container/master-fluentd/docker-fluentd.conf diff --git a/container/fluentd/start b/container/master-fluentd/start similarity index 100% rename from container/fluentd/start rename to container/master-fluentd/start diff --git a/container/scheduler/start b/container/scheduler/start index 8ca12f0..6898d4b 100755 --- a/container/scheduler/start +++ b/container/scheduler/start @@ -20,8 +20,8 @@ names = Set.new %w[ TASKQUEUE_PORT TASKQUEUE_HOST GIT_SERVER - FLUENTD_SERVER_HOST - FLUENTD_SERVER_PORT + MASTER_FLUENTD_HOST + MASTER_FLUENTD_PORT SSHR_PORT SSHR_PORT_BASE SSHR_PORT_LEN @@ -40,7 +40,7 @@ DEFAULT_CCI = "#{CCI_REPOS}/compass-ci" LAB = defaults['lab'] || 'z9' SCHED_PORT = defaults['SCHED_PORT'] || '3000' SCHED_HOST = defaults['SCHED_HOST'] || '172.17.0.1' -FLUENTD_SERVER_PORT = defaults['FLUENTD_SERVER_PORT'] || '24224' +MASTER_FLUENTD_PORT = defaults['MASTER_FLUENTD_PORT'] || '24224' DEFAULT_CONFIG_DIR = '/etc/compass-ci/defaults'
docker_rm "s001-alpine-#{SCHED_PORT}" @@ -64,8 +64,8 @@ cmd = %W[ -e SCHED_HOST=#{SCHED_HOST} -e SCHED_PORT=#{SCHED_PORT} -e GIT_SERVER=#{defaults["GIT_SERVER"]} - -e FLUENTD_SERVER_HOST=#{defaults["FLUENTD_SERVER_HOST"]} - -e FLUENTD_SERVER_PORT=#{FLUENTD_SERVER_PORT} + -e MASTER_FLUENTD_HOST=#{defaults["MASTER_FLUENTD_HOST"]} + -e MASTER_FLUENTD_PORT=#{MASTER_FLUENTD_PORT} -v #{ENV['LKP_SRC']}:#{DEFAULT_LKP} -v #{ENV['CCI_SRC']}:#{DEFAULT_CCI} -v #{DEFAULT_CONFIG_DIR}:#{DEFAULT_CONFIG_DIR}:ro diff --git a/container/sub-fluentd/docker-fluentd.conf b/container/sub-fluentd/docker-fluentd.conf index 0092982..c674fb1 100644 --- a/container/sub-fluentd/docker-fluentd.conf +++ b/container/sub-fluentd/docker-fluentd.conf @@ -21,8 +21,8 @@ keepalive true <server> name myserver - host "#{ENV['FLUENTD_SERVER_HOST']}" - port "#{ENV['FLUENTD_SERVER_PORT']}" + host "#{ENV['MASTER_FLUENTD_HOST']}" + port "#{ENV['MASTER_FLUENTD_PORT']}" </server> <buffer tag> chunk_limit_size 1M @@ -62,8 +62,8 @@ hard_timeout 60 <server> master-fluentd - host "#{ENV['FLUENTD_SERVER_HOST']}" - port "#{ENV['FLUENTD_SERVER_PORT']}" + host "#{ENV['MASTER_FLUENTD_HOST']}" + port "#{ENV['MASTER_FLUENTD_PORT']}" </server> </store> </match> diff --git a/container/sub-fluentd/start b/container/sub-fluentd/start index 53a74c4..adbfbc3 100755 --- a/container/sub-fluentd/start +++ b/container/sub-fluentd/start @@ -7,14 +7,14 @@ require 'set' require_relative '../defconfig.rb'
names = Set.new %w[ - FLUENTD_SERVER_HOST - FLUENTD_SERVER_PORT + MASTER_FLUENTD_HOST + MASTER_FLUENTD_PORT ]
defaults = relevant_defaults(names) -defaults['FLUENTD_SERVER_PORT'] ||= '24224' +defaults['MASTER_FLUENTD_PORT'] ||= '24224' env = docker_env(defaults) -raise 'must config FLUENTD_SERVER_HOST' unless defaults['FLUENTD_SERVER_HOST'] +raise 'must config MASTER_FLUENTD_HOST' unless defaults['MASTER_FLUENTD_HOST']
docker_rm 'sub-fluentd'
diff --git a/sparrow/3-code/dev-env b/sparrow/3-code/dev-env index 11c7fb0..87431be 100755 --- a/sparrow/3-code/dev-env +++ b/sparrow/3-code/dev-env @@ -8,8 +8,8 @@ server_ip=$(ip route get 1.2.3.4 | awk '{print $7; exit}') : ${sched_port:=3000} : ${gitcache_host:=$server_ip} : ${gitcache_port:=5000} -: ${FLUENTD_SERVER_HOST:=$server_ip} -: ${FLUENTD_SERVER_PORT:=24224} +: ${MASTER_FLUENTD_HOST:=$server_ip} +: ${MASTER_FLUENTD_PORT:=24224} : ${DOCKER_REGISTRY_HOST:=$server_ip} : ${DOCKER_REGISTRY_PORT:=5001}
@@ -22,8 +22,8 @@ INITRD_HTTP_HOST: $initrd_http_host INITRD_HTTP_PORT: $initrd_http_port GITCACHE_HOST: $gitcache_host GITCACHE_PORT: $gitcache_port -FLUENTD_SERVER_HOST: $FLUENTD_SERVER_HOST -FLUENTD_SERVER_PORT: $FLUENTD_SERVER_PORT +MASTER_FLUENTD_HOST: $MASTER_FLUENTD_HOST +MASTER_FLUENTD_PORT: $MASTER_FLUENTD_PORT DOCKER_REGISTRY_HOST: $DOCKER_REGISTRY_HOST DOCKER_REGISTRY_PORT: $DOCKER_REGISTRY_PORT EOF diff --git a/src/lib/sched.cr b/src/lib/sched.cr index c32091f..feedef3 100644 --- a/src/lib/sched.cr +++ b/src/lib/sched.cr @@ -488,8 +488,8 @@ class Sched full_path_patterns = "#{ENV["CCI_REPOS"]}/lab-#{ENV["lab"]}/allot/idle/#{tbox_group}/*.yaml" extra_job_fields = [ "idle_job=true", - "FLUENTD_SERVER_HOST=#{ENV["FLUENTD_SERVER_HOST"]}", - "FLUENTD_SERVER_PORT=#{ENV["FLUENTD_SERVER_PORT"]}", + "MASTER_FLUENTD_HOST=#{ENV["MASTER_FLUENTD_HOST"]}", + "MASTER_FLUENTD_PORT=#{ENV["MASTER_FLUENTD_PORT"]}", ]
Jobfile::Operate.auto_submit_job(