Before: Use compass-ci-robot@qq.com as the bisect job subqueue, wait to consume will take a long time. After: User delimiter@localhost as the bisect job subqueue, wait to consume will take a short time.
Signed-off-by: Cao Xueliang caoxl78320@163.com --- container/delimiter/Dockerfile | 2 +- container/delimiter/start | 2 ++ src/delimiter.rb | 4 ++++ src/delimiter/constants.rb | 3 ++- src/delimiter/utils.rb | 6 +++--- 5 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/container/delimiter/Dockerfile b/container/delimiter/Dockerfile index 93c52c6..ab7519d 100644 --- a/container/delimiter/Dockerfile +++ b/container/delimiter/Dockerfile @@ -10,4 +10,4 @@ RUN sed -ri.origin 's|^https?://dl-cdn.alpinelinux.org|http://mirrors.huaweiclou
RUN umask 002 && \ echo ':sources: ["http://rubygems.org"]' >> ~/.gemrc && \ - gem install rest-client activesupport git json yaml threadpool elasticsearch faye-websocket terminal-table mail + gem install rest-client activesupport git json yaml threadpool elasticsearch faye-websocket terminal-table mail io-console diff --git a/container/delimiter/start b/container/delimiter/start index 669923b..2a68df3 100755 --- a/container/delimiter/start +++ b/container/delimiter/start @@ -7,6 +7,8 @@ require 'set' require_relative '../defconfig.rb'
names = Set.new %w[ + ES_HOST + ES_PORT TASKQUEUE_HOST TASKQUEUE_PORT ] diff --git a/src/delimiter.rb b/src/delimiter.rb index bd40775..898fa0e 100644 --- a/src/delimiter.rb +++ b/src/delimiter.rb @@ -2,9 +2,13 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
+require_relative '../lib/build_my_info_client' require_relative './delimiter/delimiter'
begin + build_my_info = BuildMyInfo.new(DELIMITER_EMAIL, DELIMITER_NAME, ENV['lab']) + build_my_info.store_account_info + delimiter = Delimiter.new delimiter.start_delimit rescue StandardError => e diff --git a/src/delimiter/constants.rb b/src/delimiter/constants.rb index 7b14558..23b5053 100644 --- a/src/delimiter/constants.rb +++ b/src/delimiter/constants.rb @@ -6,7 +6,8 @@ LKP_SRC = ENV['LKP_SRC'] || '/c/lkp-tests' GIT_MIRROR_HOST = ENV['GIT_MIRROR_HOST'] || '172.17.0.1' MONITOR_HOST = ENV['MONITOR_HOST'] || '172.17.0.1' MONITOR_PORT = ENV['MONITOR_PORT'] || '11310' -DELIMITER_ACCONUT = ENV['DELIMITER_ACCONUT'] || 'caoxl78320@163.com' +DELIMITER_EMAIL = ENV['DELIMITER_EMAIL'] || 'delimiter@localhost' +DELIMITER_NAME = ENV['DELIMITER_NAME'] || 'delimiter' TMEP_GIT_BASE = '/c/public_git' DELIMITER_TASK_QUEUE = 'delimiter' BISECT_RUN_SCRIPT = "#{ENV['CCI_SRC']}/src/delimiter/find-commit/bisect_run_script.rb" diff --git a/src/delimiter/utils.rb b/src/delimiter/utils.rb index 61fe6ab..aaad394 100644 --- a/src/delimiter/utils.rb +++ b/src/delimiter/utils.rb @@ -118,17 +118,17 @@ module Utils end
def get_account_info - ESQuery.new(index: 'accounts').query_by_id(DELIMITER_ACCONUT) + ESQuery.new(index: 'accounts').query_by_id(DELIMITER_EMAIL) end
def init_job_content(job_id) job_yaml = AssistResult.new.get_job_yaml(job_id) - raise "get job yaml failed, job id: #{job_id} !" unless job_yaml + raise "get job yaml failed, job id: #{job_id}" unless job_yaml
job = JSON.parse job_yaml
account_info = get_account_info - raise "query #{DELIMITER_ACCONUT} account info failed!" unless account_info + raise "query delimiter account info failed: #{DELIMITER_EMAIL}" unless account_info
record_jobs(job['id'], job['upstream_commit'])
--- a/src/delimiter.rb +++ b/src/delimiter.rb @@ -2,9 +2,13 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
+require_relative '../lib/build_my_info_client' require_relative './delimiter/delimiter'
begin
- build_my_info = BuildMyInfo.new(DELIMITER_EMAIL, DELIMITER_NAME, ENV['lab'])
- build_my_info.store_account_info
会不会重复创建帐号? 在sparrow deploy的时候一次性做好?
Thanks, Fengguang
On Fri, Jan 15, 2021 at 10:51:12AM +0800, Wu Fengguang wrote:
--- a/src/delimiter.rb +++ b/src/delimiter.rb @@ -2,9 +2,13 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
+require_relative '../lib/build_my_info_client' require_relative './delimiter/delimiter'
begin
- build_my_info = BuildMyInfo.new(DELIMITER_EMAIL, DELIMITER_NAME, ENV['lab'])
- build_my_info.store_account_info
会不会重复创建帐号? 在sparrow deploy的时候一次性做好?
No account will be created repeatedly.
If I want to change the email, I rather start a container than deploy again.
Thanks, Xueliang
Thanks, Fengguang
On Fri, Jan 15, 2021 at 11:37:34AM +0800, Cao Xueliang wrote:
On Fri, Jan 15, 2021 at 10:51:12AM +0800, Wu Fengguang wrote:
--- a/src/delimiter.rb +++ b/src/delimiter.rb @@ -2,9 +2,13 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
+require_relative '../lib/build_my_info_client' require_relative './delimiter/delimiter'
begin
- build_my_info = BuildMyInfo.new(DELIMITER_EMAIL, DELIMITER_NAME, ENV['lab'])
- build_my_info.store_account_info
会不会重复创建帐号? 在sparrow deploy的时候一次性做好?
No account will be created repeatedly.
store_account_info 是在重复吧,每次跑delimiter.rb就重复一次?
If I want to change the email, I rather start a container than deploy again.
为啥需要change email?
Thanks, Fengguang
On Fri, Jan 15, 2021 at 12:23:22PM +0800, Wu Fengguang wrote:
On Fri, Jan 15, 2021 at 11:37:34AM +0800, Cao Xueliang wrote:
On Fri, Jan 15, 2021 at 10:51:12AM +0800, Wu Fengguang wrote:
--- a/src/delimiter.rb +++ b/src/delimiter.rb @@ -2,9 +2,13 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
+require_relative '../lib/build_my_info_client' require_relative './delimiter/delimiter'
begin
- build_my_info = BuildMyInfo.new(DELIMITER_EMAIL, DELIMITER_NAME, ENV['lab'])
- build_my_info.store_account_info
会不会重复创建帐号? 在sparrow deploy的时候一次性做好?
No account will be created repeatedly.
store_account_info 是在重复吧,每次跑delimiter.rb就重复一次?
Yes, but only have one account, we can search it before create it.
If I want to change the email, I rather start a container than deploy again.
为啥需要change email?
I mean that's more flexible in the container which need a account.
We do that in deploy, we need a accounts file, after the es container is already we store the account info.
Thanks, Xueliang
Thanks, Fengguang
On Fri, Jan 15, 2021 at 03:10:53PM +0800, Cao Xueliang wrote:
On Fri, Jan 15, 2021 at 12:23:22PM +0800, Wu Fengguang wrote:
On Fri, Jan 15, 2021 at 11:37:34AM +0800, Cao Xueliang wrote:
On Fri, Jan 15, 2021 at 10:51:12AM +0800, Wu Fengguang wrote:
--- a/src/delimiter.rb +++ b/src/delimiter.rb @@ -2,9 +2,13 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
+require_relative '../lib/build_my_info_client' require_relative './delimiter/delimiter'
begin
- build_my_info = BuildMyInfo.new(DELIMITER_EMAIL, DELIMITER_NAME, ENV['lab'])
- build_my_info.store_account_info
会不会重复创建帐号? 在sparrow deploy的时候一次性做好?
No account will be created repeatedly.
store_account_info 是在重复吧,每次跑delimiter.rb就重复一次?
Yes, but only have one account, we can search it before create it.
越搞越复杂了。
我们把所有service account集中到一个脚本来创建吧。 sparrow deploy的时候创建一次,或者后面更改了再跑一次即可。
If I want to change the email, I rather start a container than deploy again.
为啥需要change email?
I mean that's more flexible in the container which need a account.
We do that in deploy, we need a accounts file, after the es container is already we store the account info.
就是要集中。随便哪里都可以加帐号的话,以后安全策略不好做。
Thanks, Fengguang
On Fri, Jan 15, 2021 at 03:33:22PM +0800, Wu Fengguang wrote:
On Fri, Jan 15, 2021 at 03:10:53PM +0800, Cao Xueliang wrote:
On Fri, Jan 15, 2021 at 12:23:22PM +0800, Wu Fengguang wrote:
On Fri, Jan 15, 2021 at 11:37:34AM +0800, Cao Xueliang wrote:
On Fri, Jan 15, 2021 at 10:51:12AM +0800, Wu Fengguang wrote:
--- a/src/delimiter.rb +++ b/src/delimiter.rb @@ -2,9 +2,13 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
+require_relative '../lib/build_my_info_client' require_relative './delimiter/delimiter'
begin
- build_my_info = BuildMyInfo.new(DELIMITER_EMAIL, DELIMITER_NAME, ENV['lab'])
- build_my_info.store_account_info
会不会重复创建帐号? 在sparrow deploy的时候一次性做好?
No account will be created repeatedly.
store_account_info 是在重复吧,每次跑delimiter.rb就重复一次?
Yes, but only have one account, we can search it before create it.
越搞越复杂了。
我们把所有service account集中到一个脚本来创建吧。 sparrow deploy的时候创建一次,或者后面更改了再跑一次即可。
Ok.
If I want to change the email, I rather start a container than deploy again.
为啥需要change email?
I mean that's more flexible in the container which need a account.
We do that in deploy, we need a accounts file, after the es container is already we store the account info.
就是要集中。随便哪里都可以加帐号的话,以后安全策略不好做。
Got it.
Thanks, Xueliang
Thanks, Fengguang