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

  • 5230 discussions
[PATCH v3 lkp-tests 4/6] iso2rootfs: delete the useless fields
by Yu Chuan 20 Nov '20

20 Nov '20
[Why] The 'os', 'os_arch', 'os_version' fields to be use by test job are the same as the 'iso_os', 'iso_arch', 'iso_version' of the destination iso this time. So delete the 'test_os', 'test_os_arch', 'test_os_version'. Signed-off-by: Yu Chuan <13186087857(a)163.com> --- jobs/iso2rootfs.yaml | 3 --- tests/iso2rootfs | 35 ++++++++--------------------------- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/jobs/iso2rootfs.yaml b/jobs/iso2rootfs.yaml index 1e1dfc862136..629b53febb2f 100644 --- a/jobs/iso2rootfs.yaml +++ b/jobs/iso2rootfs.yaml @@ -22,8 +22,5 @@ iso2rootfs: # submit test yaml related fields test_yaml: - test_os: - test_os_arch: - test_os_version: test_os_mount: test_testbox: diff --git a/tests/iso2rootfs b/tests/iso2rootfs index bb2da3208646..3015c6f62947 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -56,7 +56,7 @@ check_yaml_vars() for yaml_t in "${yaml_vars[@]}" do - [ -n "$(eval echo "\$${yaml_t}")" ] || die "cannot fine value of var: ${yaml_t}." + [ -n "$(eval echo "\$${yaml_t}")" ] || die "cannot find value of var: ${yaml_t}." done } @@ -453,17 +453,8 @@ generate_global_yaml() generate_submit_append_str() { - local wait_add_vars=( - "os" - "os_arch" - "os_version" - "os_mount" - "testbox" - ) - for vt in "${wait_add_vars[@]}" - do - SUBMIT_APPEND_STR="${SUBMIT_APPEND_STR} ${vt}=$(eval echo "\$test_${vt}")" - done + [ "$#" -eq 2 ] || die "generate_submit_append_str: please give 2 parameters." + echo "os=${iso_os} os_arch=${iso_arch} os_version=${iso_version} os_mount=$1 testbox=$2" } submit_test_job_yaml() @@ -474,18 +465,8 @@ submit_test_job_yaml() [ -d "${LKP_SRC}" ] || die "cannot find value of var: LKP_SRC." - local test_yaml_vars=( - "test_os" - "test_os_arch" - "test_os_version" - "test_os_mount" - "test_testbox" - ) - - for yaml_t in "${test_yaml_vars[@]}" - do - [ -n "$(eval echo "\$${yaml_t}")" ] || die "cannot fine value of var: ${yaml_t}." - done + [ -n "${test_os_mount}" ] || die "cannot find value of var: test_os_mount." + [ -n "${test_testbox}" ] || die "cannot find value of var: test_testbox." cd "${LKP_SRC}" && { chmod +x ./sbin/install-dependencies.sh @@ -499,9 +480,9 @@ submit_test_job_yaml() die "cannot find test yaml in LKP_SRC/jobs. test yaml: ${test_yaml}." - generate_submit_append_str - - "${LKP_SRC}/sbin/submit" ${SUBMIT_APPEND_STR} "${test_yaml}" + "${LKP_SRC}/sbin/submit" \ + $(generate_submit_append_str "${test_os_mount}" "${test_testbox}") \ + "${test_yaml}" } log_info "submit ${test_yaml} finished" -- 2.23.0
1 0
0 0
[PATCH v3 lkp-tests 3/6] iso2rootfs: add a switch to configure rootfs
by Yu Chuan 20 Nov '20

20 Nov '20
[Why] In some cases, we do not need to configure the result rootfs, so add a switch to configure rootfs. [How] Add 'config_rootfs' field in job.yaml. And support the following two fields now: - dns: will config /etc/resolv.conf. - no_selinux: will disable selinux in /etc/selinux/config. Signed-off-by: Yu Chuan <13186087857(a)163.com> --- jobs/iso2rootfs.yaml | 6 ++++++ tests/iso2rootfs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/jobs/iso2rootfs.yaml b/jobs/iso2rootfs.yaml index 8796874ce79d..1e1dfc862136 100644 --- a/jobs/iso2rootfs.yaml +++ b/jobs/iso2rootfs.yaml @@ -11,6 +11,12 @@ iso2rootfs: initrd_http_host: initrd_http_port: + # config rootfs related fields + ## supported fields: + ## - dns: will config /etc/resolv.conf. + ## - no_selinux: will disable selinux in /etc/selinux/config. + config_rootfs: + # dailybuild related fields dailybuild_iso_url_file: diff --git a/tests/iso2rootfs b/tests/iso2rootfs index 893c010e6ad5..bb2da3208646 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -351,6 +351,7 @@ run_qcow2rootfs() ############ config rootfs ############ config_dns_resolver() { + echo "${config_rootfs}" | grep -qw 'dns' || return 0 cat <<-EOF > "${ROOTFS_DES_DIR}/etc/resolv.conf" nameserver 114.114.114.114 nameserver 8.8.8.8 @@ -359,6 +360,7 @@ config_dns_resolver() disable_selinux() { + echo "${config_rootfs}" | grep -qw 'no_selinux' || return 0 sed -i 's/^SELINUX=.*/SELINUX=disabled/g' "${ROOTFS_DES_DIR}/etc/selinux/config" } -- 2.23.0
1 0
0 0
[PATCH v3 lkp-tests 2/6] iso2rootfs: allow non-dailybuild jobs to be submitted
by Yu Chuan 20 Nov '20

20 Nov '20
[Why] 1. Decouple the code related to dailybuild. The 'iso_url_file' field is only relate to the dailybuild function, and this field is unnecessary when user only want generate a rootfs from offical distribution. But now if this field is none, this job will failed. 2. Modify the field name. 'iso_url_file' -> 'dailybuild_iso_url_file'. [Addition] if the `iso_url_file` field exists, this job will generate a symbolic link which point to the result rootfs. - symbolic link name: {iso_version}-dailybuild. Signed-off-by: Yu Chuan <13186087857(a)163.com> --- jobs/iso2rootfs.yaml | 4 +++- tests/iso2rootfs | 49 +++++++++++++++++++++++++++++--------------- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/jobs/iso2rootfs.yaml b/jobs/iso2rootfs.yaml index d4f0ffc0e80c..8796874ce79d 100644 --- a/jobs/iso2rootfs.yaml +++ b/jobs/iso2rootfs.yaml @@ -2,7 +2,6 @@ suite: iso2rootfs category: benchmark iso2rootfs: iso2rootfs_cgz: - iso_url_file: iso_os: iso_arch: iso_version: @@ -12,6 +11,9 @@ iso2rootfs: initrd_http_host: initrd_http_port: + # dailybuild related fields + dailybuild_iso_url_file: + # submit test yaml related fields test_yaml: test_os: diff --git a/tests/iso2rootfs b/tests/iso2rootfs index 9c71b8427d90..893c010e6ad5 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -44,7 +44,6 @@ check_yaml_vars() "os_arch" "os_version" "iso2rootfs_cgz" - "iso_url_file" "iso_os" "iso_arch" "iso_version" @@ -105,10 +104,10 @@ check_iso_name() get_daily_iso_checksum() { - ISO_URL="$(curl "${iso_url_file}")" + ISO_URL="$(curl "${dailybuild_iso_url_file}")" [ "${iso_os}" == "openeuler" ] && { - local pub_ip=$(echo "${iso_url_file}" | grep -oEw "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}") - ISO_URL="$(curl "${iso_url_file}" |sed -r "s/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/${pub_ip}/g")" + local pub_ip=$(echo "${dailybuild_iso_url_file}" | grep -oEw "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}") + ISO_URL="$(curl "${dailybuild_iso_url_file}" | sed -r "s/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/${pub_ip}/g")" } ISO_NAME=$(basename "$ISO_URL") @@ -149,15 +148,15 @@ mount_rootfs() get_cache_iso_checksum() { - mount_rootfs - CHECKSUM_FILE_CACHE="${ROOTFS_LOCAL_PATH}/${iso_version}-latest.sha256sum" - [ ! -f "${CHECKSUM_FILE_CACHE}" ] || - SHA256SUM_CACHE=$(awk '{print $1}' "$CHECKSUM_FILE_CACHE") + [ -f "${CHECKSUM_FILE_CACHE}" ] || return 0 + SHA256SUM_CACHE=$(awk '{print $1}' "$CHECKSUM_FILE_CACHE") } check_sha256sum_update() { + [ -n "${dailybuild_iso_url_file}" ] || return 0 + get_cache_iso_checksum get_daily_iso_checksum @@ -183,6 +182,7 @@ check_sha256sum_update() check_os() { log_info "starting check os ..." + echo "${ALLOW_OS[@]}" | grep -wq "${os}" || die "current os is not in allow os. current os: ${os}. @@ -243,7 +243,10 @@ config_iso2rootfs() pre_works() { check_yaml_vars + + mount_rootfs check_sha256sum_update + check_os config_iso2rootfs @@ -274,14 +277,17 @@ config_iso_conf() config_iso_url() { - local iso_url_file="${I2Q_SRC}/conf/iso/net-iso/${iso_os}/${iso_arch}/${iso_version}" - sed -i "s|^iso_url=.*|iso_url=\"${ISO_URL}\"|g" "${iso_url_file}" - sed -i "s|^iso_checksum_url=.*|iso_checksum_url=\"${ISO_CHECKSUM_URL}\"|g" "${iso_url_file}" + [ -n "${dailybuild_iso_url_file}" ] || return 0 + + local i2q_iso_url_file="${I2Q_SRC}/conf/iso/net-iso/${iso_os}/${iso_arch}/${iso_version}" + sed -i "s|^iso_url=.*|iso_url=\"${ISO_URL}\"|g" "${i2q_iso_url_file}" + sed -i "s|^iso_checksum_url=.*|iso_checksum_url=\"${ISO_CHECKSUM_URL}\"|g" "${i2q_iso_url_file}" } config_iso2qcow2() { log_info "starting config iso2qcow2 env ..." + download_iso2qcow2 config_pip_proxy @@ -292,6 +298,7 @@ config_iso2qcow2() run_iso2qcow2() { log_info "starting run iso2qcow2 ..." + ${I2Q_SRC}/auto-install-iso.sh } @@ -313,6 +320,7 @@ config_rootfs_dir() config_qcow2rootfs() { log_info "starting config qcow2rootfs env ..." + download_compass_ci install_pkgs "docker" @@ -332,7 +340,8 @@ config_qcow2rootfs() run_qcow2rootfs() { log_info "starting run qcow2rootfs ..." - local qcow2_path="${I2Q_SRC}/output/${ISO_NAME%.iso}.qcow2" + + local qcow2_path="$(ls ${I2Q_SRC}/output/*.qcow2)" cd "${CCI_SRC}/container/qcow2rootfs" ./run "${qcow2_path}" "${ROOTFS_DES_DIR}" @@ -373,11 +382,11 @@ get_qemu_efi_fd() test_rootfs() { log_info "starting test rootfs ..." + local test_script="${CGZ_PATH}/kvm.sh" local kernel_path=$(realpath "${ROOTFS_DES_DIR}"/boot/vmlinuz) local initrd_lkp_path=$(realpath "${ROOTFS_DES_DIR}"/initrd.lkp) - [ -f "$kernel_path" ] || die "cannot find kernel of rootfs: $kernel_path" [ -f "$initrd_lkp_path" ] || die "cannot find initrd_lkp of rootfs: $initrd_lkp_path" @@ -497,16 +506,22 @@ submit_test_job_yaml() } ############ post works ############ -post_works() +update_dailybuild_soft_link() { - log_info "starting post works ..." + [ -n "${dailybuild_iso_url_file}" ] || return 0 mv "${CHECKSUM_FILE_CACHE}.tmp" "${CHECKSUM_FILE_CACHE}" local soft_link="${iso_version}-dailybuild" cd "${ROOTFS_LOCAL_PATH}" && - rm -f "${soft_link}" && - ln -s "$(basename "${ROOTFS_DES_DIR}")" "${soft_link}" + ln -sfT "$(basename "${ROOTFS_DES_DIR}")" "${soft_link}" +} + +post_works() +{ + log_info "starting post works ..." + + update_dailybuild_soft_link cd / && umount "${ROOTFS_LOCAL_PATH}" -- 2.23.0
1 0
0 0
[PATCH v3 lkp-tests 1/6] iso2rootfs: change how to get the kernel and initrd.lkp of rootfs
by Yu Chuan 20 Nov '20

20 Nov '20
[Why] We use the container in compass-ci repo to generate rootfs from a qcow2, it will generate the follow two symbolic links: - {rootfs_dir}/boot/vmlinuz # for vmlinuz file - {rootfs_dir}/initrd.lkp # for initrd file So we can use the below two symbolic links to get the absolute path of vmlinuz and initrd. [Addition] URL of qcow2rootfs: - https://gitee.com/wu_fengguang/compass-ci/tree/master/container/qcow2rootfs Signed-off-by: Yu Chuan <13186087857(a)163.com> --- tests/iso2rootfs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/iso2rootfs b/tests/iso2rootfs index 05274164f8c1..9c71b8427d90 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -375,8 +375,12 @@ test_rootfs() log_info "starting test rootfs ..." local test_script="${CGZ_PATH}/kvm.sh" - local kernel_path=$(realpath "${ROOTFS_DES_DIR}"/boot/vmlinuz*|grep -v rescue) - local initrd_lkp_path=$(realpath "${ROOTFS_DES_DIR}"/boot/initramfs.lkp*) + local kernel_path=$(realpath "${ROOTFS_DES_DIR}"/boot/vmlinuz) + local initrd_lkp_path=$(realpath "${ROOTFS_DES_DIR}"/initrd.lkp) + + [ -f "$kernel_path" ] || die "cannot find kernel of rootfs: $kernel_path" + [ -f "$initrd_lkp_path" ] || die "cannot find initrd_lkp of rootfs: $initrd_lkp_path" + local root_path case ${rootfs_protocol} in "nfs") -- 2.23.0
1 0
0 0
[PATCH lkp-tests] spec/submit: encapsulate function for submit job yaml
by Wei Jihui 20 Nov '20

20 Nov '20
Signed-off-by: Wei Jihui <weijihuiall(a)163.com> --- spec/submit_spec.rb | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/spec/submit_spec.rb b/spec/submit_spec.rb index 983d050e..f365f35b 100644 --- a/spec/submit_spec.rb +++ b/spec/submit_spec.rb @@ -20,20 +20,24 @@ def traverse_file(output_dir) end end +def submit_job(submit_item) + submit_yaml_path = File.join("#{LKP_SRC}/spec/submit", submit_item) + Dir.glob("#{submit_yaml_path}/*.yaml").each do |yaml_file| + output_dir = File.join(submit_yaml_path, File.basename(yaml_file, '.yaml')) + submit_cmd = [ + "#{LKP_SRC}/sbin/submit", + '-o', output_dir, + '-s', 'lab: spec_lab', + '-s', 'testbox: vm-2p8g--spec_submit', + yaml_file + ] + system(*submit_cmd) + traverse_file(output_dir) + end +end + describe 'submit job spec' do - it 'link jobs spec' do - Dir.glob("#{LKP_SRC}/spec/submit/link_jobs/*.yaml").each do |yaml_file| - job_name = File.basename(yaml_file, '.yaml') - output_dir = "#{LKP_SRC}/spec/submit/link_jobs/#{job_name}" - submit_cmd = [ - "#{LKP_SRC}/sbin/submit", - '-o', output_dir, - '-s', 'lab: spec_lab', - '-s', 'testbox: vm-2p8g--spec_submit', - yaml_file - ] - system(*submit_cmd) - traverse_file(output_dir) - end + it 'link jobs spec' do + submit_job('link_jobs') end end -- 2.23.0
2 1
0 0
[PATCH v8 compass-ci 2/2] lib/matrix2.rb: refactor performance optimization
by Lu Kaiyi 20 Nov '20

20 Nov '20
[why] Avoid to execute some unnecessary operations and improve performance. [how] Keep the value.size condition judgement to the front of block. Signed-off-by: Lu Kaiyi <2392863668(a)qq.com> --- lib/matrix2.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/matrix2.rb b/lib/matrix2.rb index ff4ea31..2065039 100644 --- a/lib/matrix2.rb +++ b/lib/matrix2.rb @@ -116,15 +116,15 @@ def combine_group_query_data(query_data, dims) job_list = query_data['hits']['hits'] groups = auto_group(job_list, dims) groups.each do |group_key, value| + if value.size < 2 + groups.delete(group_key) + next + end suite_list = [] value.each do |dimension_key, jobs| groups[group_key][dimension_key], suites = create_matrix(jobs) suite_list.concat(suites) end - if value.size < 2 - groups.delete(group_key) - next - end suites_list << suite_list end -- 2.23.0
3 4
0 0
[PATCH compass-ci] stats_worker.cr: add blank line after next cmd
by Xu Xijian 20 Nov '20

20 Nov '20
Signed-off-by: Xu Xijian <hdxuxijian(a)163.com> --- src/extract-stats/stats_worker.cr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/extract-stats/stats_worker.cr b/src/extract-stats/stats_worker.cr index 2af07d4..bcf6e52 100644 --- a/src/extract-stats/stats_worker.cr +++ b/src/extract-stats/stats_worker.cr @@ -103,6 +103,7 @@ class StatsWorker next end next if is_exists + new_error_ids << error_id @rc.store_error_info error_id, job_id end @@ -114,6 +115,7 @@ class StatsWorker ERROR_ID_FILES.each do |filename| filepath = File.join(result_root, filename) next unless File.exists?(filepath) + content = File.open(filepath) do |file| JSON.parse(file) end -- 2.23.0
1 0
0 0
[PATCH v4 compass-ci] lib/log.rb: add new class for json log
by Wu Zhende 20 Nov '20

20 Nov '20
[Why] The built-in log system prints logs in string format by default. The logs should be formatted in json format for subsequent analysis and processing. [Example1] use: log.info("test") output: {"level":"INFO","level_num":1,"datetime":"2020-11-19 16:57:17+0800","progname":null,"message":"test"} [Example2] use: log.error({"job_id" => "1", "job_state" => "submit"}.to_json) output: {"level":"ERROR","level_num":3,"datetime":"2020-11-19 16:57:17+0800","progname":null,"message":"", "job_id":"1","job_state":"submit","caller":["/usr/share/ruby/logger.rb:545:in `error'","./test.rb:6:in`<main>'"]} Signed-off-by: Wu Zhende <wuzhende666(a)163.com> --- lib/log.rb | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 lib/log.rb diff --git a/lib/log.rb b/lib/log.rb new file mode 100644 index 0000000..0ffc0f9 --- /dev/null +++ b/lib/log.rb @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. +# frozen_string_literal: true + +require 'logger' +require 'json' + +# log class to print logs in JSON format +class Log < Logger + LEVEL_INFO = { + 'DEBUG' => 0, + 'INFO' => 1, + 'WARN' => 2, + 'ERROR' => 3, + 'FATAL' => 4, + 'UNKNOWN' => 5 + }.freeze + + FORMATTER = proc { |severity, datetime, progname, msg| + puts + level_num = LEVEL_INFO[severity] + begin + message = JSON.parse(msg) + rescue JSON::ParserError + message = { 'message' => msg } + end + h = { + 'level' => severity.to_s, + 'level_num' => level_num, + 'datetime' => datetime, + 'progname' => progname, + 'message' => '' + } + h.merge!(message) + h.merge!({ 'caller' => caller }) if level_num >= 2 + h.to_json + } + + def initialize(logdev = STDOUT, formatter = FORMATTER) + super(logdev, formatter: formatter) + end +end -- 2.23.0
3 2
0 0
[PATCH v2 lkp-tests] common.sh: add function for count input cpu number
by Wei Jihui 20 Nov '20

20 Nov '20
Signed-off-by: Wei Jihui <weijihuiall(a)163.com> --- lib/common.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/common.sh b/lib/common.sh index 2a93aafa..95d7953c 100755 --- a/lib/common.sh +++ b/lib/common.sh @@ -85,6 +85,18 @@ cpu_list_ref() echo $cpu_list | cut -d ' ' -f $((n+1)) } + +# input: 1-3 output: 3 +# input: 1,3 output: 2 +cpu_list_num() +{ + cpu_list="" + for cpu in $(expand_cpu_list $1); do + cpu_list+="$cpu " + done + cpu_list_count "$cpu_list" +} + # if str starts with prefix, output remaining part, otherwise output empty string remove_prefix() { -- 2.23.0
1 0
0 0
[PATCH lkp-tests] sshd: fix error when execute in docker
by Zhang Yale 20 Nov '20

20 Nov '20
error: bash: 1605766611473034209%""+"": syntax error: operand expected (error token is """+""") Signed-off-by: Zhang Yale <ylzhangah(a)qq.com> --- daemon/sshd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/sshd b/daemon/sshd index 1a1d59b4..a3fdf954 100755 --- a/daemon/sshd +++ b/daemon/sshd @@ -77,7 +77,7 @@ set_port() for i in $(seq 1 10) do - port=$(($(date +%s%N)%"$sshr_port_len"+"$sshr_port_base")) + port=$(($(date +%s%N)%${sshr_port_len}+${sshr_port_base})) ssh -o StrictHostKeyChecking=no -o ExitOnForwardFailure=yes -o TCPKeepAlive=yes \ -Nf -R $port:localhost:22 sshr@"$sshr_ip" -p "$sshr_port" &>/dev/null [ $? -eq 0 ] && return -- 2.23.0
2 2
0 0
  • ← Newer
  • 1
  • ...
  • 368
  • 369
  • 370
  • 371
  • 372
  • 373
  • 374
  • ...
  • 523
  • Older →

HyperKitty Powered by HyperKitty