mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Compass-ci

Threads by month
  • ----- 2025 -----
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
compass-ci@openeuler.org

  • 1 participants
  • 5231 discussions
[PATCH v2 compass-ci 1/2] lib/git_mirror.rb: support more than one upstream repos warehouse
by Li Yuanchao 01 Mar '21

01 Mar '21
Support monitor repos in upstream-repos/ansible-repos/dockerfile-repos/pkgbuild-repos, they are just like upstream-repos. And which to monitor can be configured in file upstream-config. Signed-off-by: Li Yuanchao <lyc163mail(a)163.com> --- lib/git_mirror.rb | 89 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 60 insertions(+), 29 deletions(-) diff --git a/lib/git_mirror.rb b/lib/git_mirror.rb index 22c4e07..6417b52 100644 --- a/lib/git_mirror.rb +++ b/lib/git_mirror.rb @@ -81,7 +81,7 @@ class GitMirror def mirror_sync fork_info = @queue.pop - mirror_dir = "/srv/git/#{fork_info['git_repo']}" + mirror_dir = "/srv/git/#{fork_info['belong']}/#{fork_info['git_repo']}" mirror_dir = "#{mirror_dir}.git" unless fork_info['is_submodule'] possible_new_refs = git_repo_download(fork_info['url'], mirror_dir) feedback(fork_info['git_repo'], possible_new_refs) @@ -107,6 +107,7 @@ class MirrorMain @defaults = {} @git_queue = Queue.new @es_client = Elasticsearch::Client.new(url: "http://#{ES_HOST}:#{ES_PORT}") + clone_upstream_repo load_fork_info connection_init handle_webhook @@ -124,35 +125,37 @@ class MirrorMain @fork_stat[git_repo] = get_fork_stat(git_repo) end - def load_defaults(repodir) + def load_defaults(repodir, belong) defaults_file = "#{repodir}/DEFAULTS" return unless File.exist?(defaults_file) - defaults_key = repodir == REPO_DIR ? 'default' : repodir.delete_prefix("#{REPO_DIR}/") + defaults_key = repodir == "#{REPO_DIR}/#{belong}" ? belong : repodir.delete_prefix("#{REPO_DIR}/#{belong}/") @defaults[defaults_key] = YAML.safe_load(File.open(defaults_file)) - @defaults[defaults_key] = merge_defaults(defaults_key, @defaults[defaults_key]) + @defaults[defaults_key] = merge_defaults(defaults_key, @defaults[defaults_key], belong) end - def traverse_repodir(repodir) + def traverse_repodir(repodir, belong) if File.directory? repodir - load_defaults(repodir) + load_defaults(repodir, belong) entry_list = Dir.children(repodir) - ['DEFAULTS'] entry_list.each do |entry| next if entry.start_with? '.' - traverse_repodir("#{repodir}/#{entry}") + traverse_repodir("#{repodir}/#{entry}", belong) end else return if File.dirname(repodir) == REPO_DIR - project = File.dirname(repodir).delete_prefix("#{REPO_DIR}/") + project = File.dirname(repodir).delete_prefix("#{REPO_DIR}/#{belong}/") fork_name = File.basename(repodir) - load_repo_file(repodir, project, fork_name) + load_repo_file(repodir, project, fork_name, belong) end end def load_fork_info - traverse_repodir(REPO_DIR) + @upstreams['upstreams'].each do |repo| + traverse_repodir("#{REPO_DIR}/#{repo['location']}", repo['location']) + end end def create_workers @@ -182,7 +185,7 @@ class MirrorMain update_fork_stat(git_repo, feedback_info[:possible_new_refs]) return unless feedback_info[:possible_new_refs] - return reload_fork_info if git_repo == 'u/upstream-repos/upstream-repos' + return reload_fork_info(git_repo) if is_upstream_repo?(git_repo) new_refs = check_new_refs(git_repo) return if new_refs[:heads].empty? @@ -221,14 +224,16 @@ end # main thread class MirrorMain - def load_repo_file(repodir, project, fork_name) + def load_repo_file(repodir, project, fork_name, belong) git_repo = "#{project}/#{fork_name}" git_info = YAML.safe_load(File.open(repodir)) return if git_info.nil? || git_info['url'].nil? @git_info[git_repo] = git_info @git_info[git_repo]['git_repo'] = git_repo - @git_info[git_repo] = merge_defaults(git_repo, @git_info[git_repo]) + @git_info[git_repo]['belong'] = belong + @git_info[git_repo] = merge_defaults(git_repo, @git_info[git_repo], belong) + fork_stat_init(git_repo) @priority_queue.push git_repo, @priority @priority += 1 @@ -247,7 +252,7 @@ class MirrorMain def get_cur_refs(git_repo) return if @git_info[git_repo]['is_submodule'] - mirror_dir = "/srv/git/#{git_repo}.git" + mirror_dir = "/srv/git/#{@git_info[git_repo]['belong']}/#{git_repo}.git" show_ref_out = %x(git -C #{mirror_dir} show-ref --heads 2>/dev/null) cur_refs = { heads: {} } show_ref_out.each_line do |line| @@ -266,27 +271,26 @@ class MirrorMain return new_refs end - def reload_fork_info - upstream_repos = 'u/upstream-repos/upstream-repos' + def reload_fork_info(upstream_repos) if @git_info[upstream_repos][:cur_refs].empty? @git_info[upstream_repos][:cur_refs] = get_cur_refs(upstream_repos) else old_commit = @git_info[upstream_repos][:cur_refs][:heads]['refs/heads/master'] new_refs = check_new_refs(upstream_repos) new_commit = new_refs[:heads]['refs/heads/master'] - changed_files = %x(git -C /srv/git/#{upstream_repos}.git diff --name-only #{old_commit}...#{new_commit}) - reload(changed_files) + changed_files = %x(git -C /srv/git/#{@git_info[upstream_repos]['belong']}/#{upstream_repos}.git diff --name-only #{old_commit}...#{new_commit}) + reload(changed_files, @git_info[upstream_repos]['belong']) end end - def reload(file_list) - system("git -C #{REPO_DIR} pull") + def reload(file_list, belong) + system("git -C #{REPO_DIR}/#{belong} pull") file_list.each_line do |file| next if File.basename(file) == '.ignore' file = file.chomp - repo_dir = "#{REPO_DIR}/#{file}" - load_repo_file(repo_dir, File.dirname(file), File.basename(file)) if File.file?(repo_dir) + repo_dir = "#{REPO_DIR}/#{belong}/#{file}" + load_repo_file(repo_dir, File.dirname(file), File.basename(file), belong) if File.file?(repo_dir) end end @@ -357,7 +361,7 @@ class MirrorMain end end - def handle_submodule(submodule) + def handle_submodule(submodule, belong) submodule.each_line do |line| next unless line.include?('url = ') @@ -365,7 +369,7 @@ class MirrorMain git_repo = url.split('://')[1] if url.include?('://') break unless git_repo - @git_info[git_repo] = { 'url' => url, 'git_repo' => git_repo, 'is_submodule' => true } + @git_info[git_repo] = { 'url' => url, 'git_repo' => git_repo, 'is_submodule' => true, 'belong' => belong } fork_stat_init(git_repo) @priority_queue.push git_repo, @priority @priority += 1 @@ -378,11 +382,11 @@ class MirrorMain return true end - mirror_dir = "/srv/git/#{git_repo}.git" + mirror_dir = "/srv/git/#{@git_info[git_repo]['belong']}/#{git_repo}.git" submodule = %x(git -C #{mirror_dir} show HEAD:.gitmodules 2>/dev/null) return if submodule.empty? - handle_submodule(submodule) + handle_submodule(submodule, @git_info[git_repo]['belong']) end def get_fork_stat(git_repo) @@ -453,8 +457,8 @@ end # main thread class MirrorMain - def merge_defaults(object_key, object) - return object if object_key == 'default' + def merge_defaults(object_key, object, belong) + return object if object_key == belong defaults_key = File.dirname(object_key) while defaults_key != '.' @@ -462,8 +466,35 @@ class MirrorMain defaults_key = File.dirname(defaults_key) end - return @defaults['default'].merge(object) if @defaults['default'] + return @defaults[belong].merge(object) if @defaults[belong] return object end + + def clone_upstream_repo + if File.exist?("#{ENV['CCI_SRC']}/sbin/upstream-config") + @upstreams = YAML.safe_load(File.open("#{ENV['CCI_SRC']}/sbin/upstream-config")) + @upstreams['upstreams'].each do |repo| + url = get_url(repo['url']) + %x(git clone #{url} #{REPO_DIR}/#{repo['location']} 2>&1) + end + else + puts 'ERROR: No upstream-config file' + return -1 + end + end + + def get_url(url) + if url.include?('gitee.com/') && File.exist?("/srv/git/#{url.delete_prefix('https://')}") + url = "/srv/git/#{url.delete_prefix('https://')}" + end + return url + end + + def is_upstream_repo?(git_repo) + @upstreams['upstreams'].each do |repo| + return true if git_repo == repo['git_repo'] + end + return false + end end -- 2.23.0
1 0
0 0
[PATCH v4 compass-ci 2/2] sparrow/4-docker/buildall: add $action value "start-only"
by Liu Yinsi 01 Mar '21

01 Mar '21
[usage] ./buildall start-only [how] before: ./buildall run-only: call build_depends(), check images exist or not, then call start_depends() after: ./buildall start-only: only call start_depends() [why] for some users locally deploy compass-ci, they will not build images, and some users can't install lockfile-create command, only run containers, no need to check images exist or not, so only call start_depends(). Signed-off-by: Liu Yinsi <liuyinsi(a)163.com> --- sparrow/4-docker/buildall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sparrow/4-docker/buildall b/sparrow/4-docker/buildall index 8d08603..a7ace65 100755 --- a/sparrow/4-docker/buildall +++ b/sparrow/4-docker/buildall @@ -70,7 +70,7 @@ tmpdir=$(mktemp -d) for dir in $CONTAINER_PATH/*/ do - build_depends $dir + [ "$action" != "start-only" ] && build_depends $dir start_depends $dir done -- 2.23.0
1 0
0 0
[PATCH v4 compass-ci 1/2] sparrow/4-docker/buildall: check whether skip ssh-r
by Liu Yinsi 01 Mar '21

01 Mar '21
[why] for user locally deploy compass-ci, ssh-r is not exists, so check when ssh-r already exists, skip ssh-r. Signed-off-by: Liu Yinsi <liuyinsi(a)163.com> --- sparrow/4-docker/buildall | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sparrow/4-docker/buildall b/sparrow/4-docker/buildall index bb77a1f..8d08603 100755 --- a/sparrow/4-docker/buildall +++ b/sparrow/4-docker/buildall @@ -56,7 +56,10 @@ do_one_run() mkdir $tmpdir/start_$container_name 2>/dev/null && ( cd "$container" - [ "$container_name" == 'ssh-r' ] && exit + [ "$container_name" == "ssh-r" ] && { + container_id=$(docker ps -aqf name="ssh_r") + [ -n "$container_id" ] && exit + } [ -x first-run ] && ./first-run [ -x start ] && ./start [ "$container_name" == 'initrd-lkp' ] && ./run -- 2.23.0
1 0
0 0
[PATCH v2 lkp-tests 2/2] pkg/mysql: delete mysql specified port
by Wei Jihui 01 Mar '21

01 Mar '21
Can not specified port in the my.cnf, user may need to configure it flexibly. Signed-off-by: Wei Jihui <weijihuiall(a)163.com> --- pkg/mysql/PKGBUILD | 2 +- pkg/mysql/my.cnf | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/mysql/PKGBUILD b/pkg/mysql/PKGBUILD index 0f7d8bc8..304f6a4a 100644 --- a/pkg/mysql/PKGBUILD +++ b/pkg/mysql/PKGBUILD @@ -9,7 +9,7 @@ source=("https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-$pkgver.tar.gz" "https://mirrors.huaweicloud.com/kunpeng/archive/openEuler/patch/database/my…" "https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4/rpcsvc-proto…" "my.cnf") -md5sums=('7472a25d91973cbba5d8a8f176a3080b' '6e853850efbd6f887ac3e13b1bf99cc4' 'f13eb11de53616017f7428cc06d4e242' 'df1022ccc5d0aff30b8e505735b4a98b' '7bb0372ec4e9281813a9afc67c6cfc20') +md5sums=('7472a25d91973cbba5d8a8f176a3080b' '6e853850efbd6f887ac3e13b1bf99cc4' 'f13eb11de53616017f7428cc06d4e242' 'df1022ccc5d0aff30b8e505735b4a98b' '1390631a1ea1832f9c27d07fcc1e536e') prepare() { diff --git a/pkg/mysql/my.cnf b/pkg/mysql/my.cnf index 9732af40..d95811dd 100644 --- a/pkg/mysql/my.cnf +++ b/pkg/mysql/my.cnf @@ -13,7 +13,6 @@ socket=/data/mysql/run/mysql.sock tmpdir=/data/mysql/tmp datadir=/data/mysql/data default_authentication_plugin=mysql_native_password -port=3309 user=mysql memlock=on bind-address=0.0.0.0 -- 2.23.0
1 0
0 0
[PATCH v2 lkp-tests 1/2] lib/job2sh.rb: fix tests script args can not be upper letter key
by Wei Jihui 01 Mar '21

01 Mar '21
[input] testcase: ab: 1 AB: 2 [error ouput at job.sh] run_test ab=1 _65__66_=2 ... [how] pry(main)> key="AB" => "AB" pry(main)> key.gsub(/[^a-z0-9_]/) { |m| '_' + m.getbyte(0).to_s +'_' } => "_65__66_" pry(main)> key.gsub(/[^a-zA-Z0-9_]/) { |m| '_' + m.getbyte(0).to_s+ '_' } => "AB" Signed-off-by: Wei Jihui <weijihuiall(a)163.com> --- lib/job2sh.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/job2sh.rb b/lib/job2sh.rb index 82ec7d24..e058483d 100755 --- a/lib/job2sh.rb +++ b/lib/job2sh.rb @@ -20,7 +20,7 @@ def valid_shell_variable?(key) end def shell_encode_keyword(key) - key.gsub(/[^a-z0-9_]/) { |m| '_' + m.getbyte(0).to_s + '_' } + key.gsub(/[^a-zA-Z0-9_]/) { |m| '_' + m.getbyte(0).to_s + '_' } end def shell_escape_expand(val) -- 2.23.0
1 0
0 0
[PATCH lkp-tests] lib/job2sh.rb: fix tests script args can not be upper letter key
by Wei Jihui 01 Mar '21

01 Mar '21
[input] testcase: ab: 1 AB: 2 [error ouput at job.sh] run_test ab=1 _65__66_=2 ... [how] pry(main)> key="AB" => "AB" pry(main)> key.gsub(/[^a-z0-9_]/) { |m| '_' + m.getbyte(0).to_s +'_' } => "_65__66_" pry(main)> key.gsub(/[^a-zA-Z0-9_]/) { |m| '_' + m.getbyte(0).to_s+ '_' } => "AB" Signed-off-by: Wei Jihui <weijihuiall(a)163.com> --- lib/job2sh.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/job2sh.rb b/lib/job2sh.rb index 82ec7d24..e058483d 100755 --- a/lib/job2sh.rb +++ b/lib/job2sh.rb @@ -20,7 +20,7 @@ def valid_shell_variable?(key) end def shell_encode_keyword(key) - key.gsub(/[^a-z0-9_]/) { |m| '_' + m.getbyte(0).to_s + '_' } + key.gsub(/[^a-zA-Z0-9_]/) { |m| '_' + m.getbyte(0).to_s + '_' } end def shell_escape_expand(val) -- 2.23.0
1 0
0 0
[PATCH v3 compass-ci 2/2] container/es/start: call check_service_ready()
by Liu Yinsi 01 Mar '21

01 Mar '21
call container/defconfig.sh: check_service_ready() to accelerate es/logging-es startup time. Signed-off-by: Liu Yinsi <liuyinsi(a)163.com> --- container/es/start | 7 +++---- container/logging-es/start | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/container/es/start b/container/es/start index d84ad33..67d6531 100755 --- a/container/es/start +++ b/container/es/start @@ -20,7 +20,6 @@ cmd=( "${cmd[@]}" -echo "Please wait 60s for setting index" -sleep 60 - -set_es_indices +# set index +check_service_ready 9200 +find $CCI_SRC/sbin/ -name "es-*-mapping.sh" -exec sh {} \; diff --git a/container/logging-es/start b/container/logging-es/start index 66464e6..efd89de 100755 --- a/container/logging-es/start +++ b/container/logging-es/start @@ -20,9 +20,8 @@ cmd=( "${cmd[@]}" -echo "Please wait 60s for setting index" -sleep 60 - +# set index +check_service_ready 9202 curl -sSH "Content-Type: application/json" -XPUT "localhost:9202/_settings" -d ' { "index": { -- 2.23.0
1 0
0 0
[PATCH v3 compass-ci 1/2] container/defconfig.sh: check service ready
by Liu Yinsi 01 Mar '21

01 Mar '21
[why] check service ready or not every 2s, if ok, continue next step, rather than sleep 60s, it can save time. Signed-off-by: Liu Yinsi <liuyinsi(a)163.com> --- container/defconfig.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/container/defconfig.sh b/container/defconfig.sh index c33a790..50446d8 100755 --- a/container/defconfig.sh +++ b/container/defconfig.sh @@ -28,9 +28,15 @@ docker_rm() docker rm -f $container } -set_es_indices() +check_service_ready() { - find $CCI_SRC/sbin/ -name "es-*-mapping.sh" -exec sh {} \; + local port=$1 + local i + for i in {1..30} + do + curl -s localhost:$port > /dev/null && return + sleep 2 + done } push_image() -- 2.23.0
1 0
0 0
[PATCH v3 compass-ci 2/2] sparrow/4-docker/buildall: add $action value "start-only"
by Liu Yinsi 01 Mar '21

01 Mar '21
[usage] ./buildall start-only [how] before: ./buildall run-only: call build_depends(), check images exist or not, then call start_depends() after: ./buildall start-only: only call start_depends() [why] for some users locally deploy compass-ci, they will not build images, and some users can't install lockfile-create command, only run containers, no need to check images exist or not, so only call start_depends(). Signed-off-by: Liu Yinsi <liuyinsi(a)163.com> --- sparrow/4-docker/buildall | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sparrow/4-docker/buildall b/sparrow/4-docker/buildall index aa48bce..74016d7 100755 --- a/sparrow/4-docker/buildall +++ b/sparrow/4-docker/buildall @@ -69,7 +69,7 @@ tmpdir=$(mktemp -d) for dir in $CONTAINER_PATH/*/ do - build_depends $dir + [ "$action" != "start-only" ] && build_depends $dir start_depends $dir done -- 2.23.0
1 0
0 0
[PATCH v2 compass-ci 2/2] container/es/start: call check_es_ready()
by Liu Yinsi 01 Mar '21

01 Mar '21
call container/defconfig.sh:check_service_ready() to accelerate es/logging-es startup time. Signed-off-by: Liu Yinsi <liuyinsi(a)163.com> --- container/es/start | 7 +++---- container/logging-es/start | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/container/es/start b/container/es/start index d84ad33..67d6531 100755 --- a/container/es/start +++ b/container/es/start @@ -20,7 +20,6 @@ cmd=( "${cmd[@]}" -echo "Please wait 60s for setting index" -sleep 60 - -set_es_indices +# set index +check_service_ready 9200 +find $CCI_SRC/sbin/ -name "es-*-mapping.sh" -exec sh {} \; diff --git a/container/logging-es/start b/container/logging-es/start index 66464e6..efd89de 100755 --- a/container/logging-es/start +++ b/container/logging-es/start @@ -20,9 +20,8 @@ cmd=( "${cmd[@]}" -echo "Please wait 60s for setting index" -sleep 60 - +# set index +check_service_ready 9202 curl -sSH "Content-Type: application/json" -XPUT "localhost:9202/_settings" -d ' { "index": { -- 2.23.0
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • ...
  • 524
  • Older →

HyperKitty Powered by HyperKitty