diff --git a/doc/images/obs_broken_package.png b/doc/images/obs_broken_package.png new file mode 100644 index 0000000000000000000000000000000000000000..ab943754c13dc254252e624e5754c6dc3db29c31 Binary files /dev/null and b/doc/images/obs_broken_package.png differ diff --git "a/doc/jenkins-comment\351\205\215\347\275\256\350\257\264\346\230\216.md" "b/doc/jenkins-comment\351\205\215\347\275\256\350\257\264\346\230\216.md" index ba237891c77cea2598f7505cb39788dbc2ae3044..ca78bcf187a6ae4f27b4db123752acf576248bf7 100644 --- "a/doc/jenkins-comment\351\205\215\347\275\256\350\257\264\346\230\216.md" +++ "b/doc/jenkins-comment\351\205\215\347\275\256\350\257\264\346\230\216.md" @@ -121,9 +121,9 @@ set +e 此操作重新安排失败的构建。 注意:立即重新安排失败的构建, 配置适当的延迟或限制最大重试次数。 -**Fixed delay:**对不稳定的构建和失败重新运行构建,延迟时间为60秒 +**Fixed delay:** 对不稳定的构建和失败重新运行构建,延迟时间为60秒 -**Maximum number of successive failed builds:**限制连续失败的构建重试。 设置为 0 表示没有限制。 +**Maximum number of successive failed builds:** 限制连续失败的构建重试。 设置为 0 表示没有限制。 diff --git "a/doc/trigger\351\205\215\347\275\256\346\214\207\345\257\274.md" "b/doc/trigger\351\205\215\347\275\256\346\214\207\345\257\274.md" index 24bf35e858dab0f057ae9bba068c0a516557f2fc..161bb9f438b00e5af47cba643830249dd7a7b901 100644 --- "a/doc/trigger\351\205\215\347\275\256\346\214\207\345\257\274.md" +++ "b/doc/trigger\351\205\215\347\275\256\346\214\207\345\257\274.md" @@ -48,7 +48,7 @@ https://openeulerjenkins.osinfra.cn/job/multiarch/job/src-openeuler/job/trigger/ ### 构建主流程代码配置 -此处为构建的主要流程,当前代码路径在https://gitee.com/openeuler/openeuler-jenkins/blob/master/src/lib/trigger.sh,该代码在门禁docker创建上会自动部署。 +此处为构建的主要流程,当前代码路径在https://gitee.com/openeuler/openeuler-jenkins/blob/master/src/lib/trigger.sh ,该代码在门禁docker创建上会自动部署。 其中如果需要自己调试的话,可以放开下面注释内容,把代码换成自己要验证的代码路径 @@ -64,7 +64,7 @@ https://openeulerjenkins.osinfra.cn/job/multiarch/job/src-openeuler/job/trigger/ ### 构建后操作 -**Projects to build:**trigger工程完成后会自动启动此处配置的工程,一般为x86和aarch64两个架构的build工程。如果只需要某个仓库只支持一个架构构建,此处只填写支持架构的工程即可,另外需要在https://gitee.com/openeuler/openeuler-jenkins/blob/master/src/jobs/soe_exclusive_config.yaml里的arch_config把这个包加上。 +**Projects to build:**trigger工程完成后会自动启动此处配置的工程,一般为x86和aarch64两个架构的build工程。如果只需要某个仓库只支持一个架构构建,此处只填写支持架构的工程即可,另外需要在https://gitee.com/openeuler/openeuler-jenkins/blob/master/src/jobs/soe_exclusive_config.yaml 里的arch_config把这个包加上。 **Trigger when build is:**Stable,unstable or failed,but not aborted @@ -114,5 +114,5 @@ SSH Username with private key - SSH 公钥/私钥对 Certificate - a PKCS#12 证书文件 和可选密码 -**ID:**在 ID 字段中,必须指定一个有意义的Credential ID,注意: 该字段是可选的。 如果没有指定值, Jenkins 则Jenkins会分配一个全局唯一ID(GUID)值。 +**ID:** 在 ID 字段中,必须指定一个有意义的Credential ID,注意: 该字段是可选的。 如果没有指定值, Jenkins 则Jenkins会分配一个全局唯一ID(GUID)值。 diff --git "a/doc/\346\233\264\346\226\260\351\227\250\347\246\201\347\216\257\345\242\203\350\212\202\347\202\271\351\225\234\345\203\217.md" "b/doc/\346\233\264\346\226\260\351\227\250\347\246\201\347\216\257\345\242\203\350\212\202\347\202\271\351\225\234\345\203\217.md" index 2b605b137161a11d3b9cd19d5dbeb304278e543b..bb23fd15e74f948d6e8bc3ccf7ae4aad9063b00f 100644 --- "a/doc/\346\233\264\346\226\260\351\227\250\347\246\201\347\216\257\345\242\203\350\212\202\347\202\271\351\225\234\345\203\217.md" +++ "b/doc/\346\233\264\346\226\260\351\227\250\347\246\201\347\216\257\345\242\203\350\212\202\347\202\271\351\225\234\345\203\217.md" @@ -43,7 +43,7 @@ jenkins_ci_soe包含4个任务: ### 1.1 调用方法 -工程链接https://openeulerjenkins.osinfra.cn/job/multiarch/job/build-docker-image/job/jenkins-ci-soe/job/_trigger/,点击构建时需要选择要打成镜像的tag版本号,此处绑定的是openeuler-jenkins代码的tag。 +工程链接https://openeulerjenkins.osinfra.cn/job/multiarch/job/build-docker-image/job/jenkins-ci-soe/job/_trigger/ ,点击构建时需要选择要打成镜像的tag版本号,此处绑定的是openeuler-jenkins代码的tag。 这个任务会调用build-image-aarch64和build-image-x86-64的执行。 @@ -51,7 +51,7 @@ jenkins_ci_soe包含4个任务: 参数化构建:添加下拉框选择源码中的tag号。 -源码管理:连接的是jenkins门禁代码:https://gitee.com/openeuler/openeuler-jenkins,添加代码账号凭证获取代码。 +源码管理:连接的是jenkins门禁代码:https://gitee.com/openeuler/openeuler-jenkins ,添加代码账号凭证获取代码。 build:build中没有什么实际操作 diff --git "a/doc/\351\227\250\347\246\201\351\227\256\351\242\230\346\216\222\346\237\245\346\211\213\345\206\214.md" "b/doc/\351\227\250\347\246\201\351\227\256\351\242\230\346\216\222\346\237\245\346\211\213\345\206\214.md" index 35b02ba74d4aaa4ca0fc794fe627cf8f6f07aa80..42cb44f57214c83c77f60886ccf8781df1131fd4 100644 --- "a/doc/\351\227\250\347\246\201\351\227\256\351\242\230\346\216\222\346\237\245\346\211\213\345\206\214.md" +++ "b/doc/\351\227\250\347\246\201\351\227\256\351\242\230\346\216\222\346\237\245\346\211\213\345\206\214.md" @@ -22,7 +22,9 @@ **报错信息:** -Error: Failed to retrieve plexus-archiver-3.6.0-3.oe1.noarch.rpm from the following locations (in order):http://117.78.1.88/build/openEuler:selfbuild:BaseOS/mainline_standard_x86_64/x86_64/_repository/plexus-archiver +Error: Failed to retrieve plexus-archiver-3.6.0-3.oe1.noarch.rpm from the following locations (in order): + +http://117.78.1.88/build/openEuler:selfbuild:BaseOS/mainline_standard_x86_64/x86_64/_repository/plexus-archiver **定位解决:** @@ -70,7 +72,7 @@ Provides和Requires信息 **注意:pr合入后,obs会自动启动编译,但是归档到二进制仓库中可能有延迟。** - **obs的repo源:http://119.3.219.20:82/,这个repo源在工程稳定的时候会自动更新。** + obs的repo源:http://119.3.219.20:82/,这个repo源在工程稳定的时候会自动更新。 #### 3.1.3 check_install过程中缺少依赖包 @@ -84,7 +86,23 @@ nothing provides libperl.so.5.34()(64bit) needed by perl-version-8:0.99.29-1.oe1 **定位解决:** -从上图可以看出来,安装过程中有依赖perl相关的包,但是在repo源:http://119.3.219.20:82/openEuler:/对应的分支目录下没有对应的包,查找是否存在缺少的依赖包,如果该repo确实不存在,请联系obs接口 +从上图可以看出来,安装过程中有依赖perl相关的包,但是在repo源:http://119.3.219.20:82/openEuler:/ 对应的分支目录下没有对应的包,查找是否存在缺少的依赖包,如果该repo确实不存在,请联系obs接口 + +#### 3.1.4 编译依赖包有问题 + +![](images/obs_broken_package.png) + +**报错信息:** + +buildinfo is broken... it says: + +unresolvable: have choice for libcom_err.so.2()(64bit) needed by libtirpc: e2fsprogs libcom_err + +have choice for libcom_err.so.2()(64bit) needed by krb5-libs: e2fsprogs libcom_err + +**定位解决:** + +安装依赖包有问题,请联系obs接口 ### 3.2 pr触发没显示结果 @@ -108,19 +126,19 @@ PR中打了ci_processing标签,但是长时间没有门禁结果的回显信 如果pr中已经打了ci_processing标签,说明门禁工程正在运行中,可以根据**附件2:门禁入口链接**分别进入trigger、x86-64、aarch64、comment工程中查看工程是否正在运行: -a. 如果进度条在不停刷新,但是进度条为蓝色,如下图,表示门禁正在运行中,耐心等待即可; +a. 进度条在不停刷新,但是进度条为蓝色,如下图,表示门禁正在运行中,耐心等待即可; ![1648707133573](images/ci_processing_blue.png) -b. 如果进度条在执行,但是进度条变红,说明执行时间太长,可能出现卡死情况; +b. 进度条在执行,但是进度条变红,如下图,说明执行时间太长,可能出现卡死情况,请联系门禁接口人处理; ![1648716532044](images/ci_processing_red.png) -c. 如果没有分配到资源,如下图提示,请耐心等待,长时间还没有分配到资源的话,请联系基础设施接口人处理; +c. 没有分配到资源,如下图提示,请耐心等待,长时间还没有分配到资源的话,请联系基础设施接口人处理; ![1648707620036](images/no_excuter.png) -d. 如果出现如下图提示,表示当前仓库已经有pr正在构建,请等待执行;(同一仓库的门禁是串行的,非同一仓库的门禁任务可以并行) +d. 出现如下图提示,表示当前仓库已经有pr正在构建,请等待执行(同一仓库的门禁是串行的,非同一仓库的门禁任务可以并行); ![1648707269226](images/in_processing.png) -e. 如果出现如下图提示,表示当前节点可能在重启,如果长时间保持这种状态,请联系基础设施接口人处理: +e. 出现如下图提示,表示当前节点可能在重启,如果长时间保持这种状态,请联系基础设施接口人处理; ![1648707517272](images/excuter_offline.png) #### 3.3.3 门禁任务执行完成,但结果不回显 diff --git a/openeuler-ci/BiShengCLanguage.yaml b/openeuler-ci/BiShengCLanguage.yaml new file mode 100644 index 0000000000000000000000000000000000000000..651763de297d3435ee8eb91bb30e7fdd1ef081ad --- /dev/null +++ b/openeuler-ci/BiShengCLanguage.yaml @@ -0,0 +1,8 @@ +repo_name: BiShengCLanguage +container_level: l2 +init_shell: "echo Hello BiShengC\necho $?" +users: + - login_name: EdwardWang + name: EdwardWang + email: wangyantao4@huawei.com + gitee_id: plt42 diff --git a/src/ac/acl/source_consistency/check_consistency.py b/src/ac/acl/source_consistency/check_consistency.py index 0e5cc927643d7f4890e42c4332cbd571c5099e67..16b604eabebab531a962ffb153c1b27ede333a2d 100644 --- a/src/ac/acl/source_consistency/check_consistency.py +++ b/src/ac/acl/source_consistency/check_consistency.py @@ -5,9 +5,9 @@ import re import stat import shutil import sqlite3 +import subprocess from sqlite3 import Error -from src.ac.common.gitee_repo import GiteeRepo from src.ac.framework.ac_base import BaseCheck from src.ac.framework.ac_result import FAILED, SUCCESS, WARNING @@ -48,18 +48,12 @@ class CheckSourceConsistency(BaseCheck): self.con.close() self.clear_temp() - @staticmethod - def get_package_from_source(url): - """ - 从url中获取包名 - """ - package_name = url.split("/")[-1].strip() - return package_name - @staticmethod def get_sha256sum(package): """ 计算文件的sha256sum值 + :param package:包路径 + :return: """ logger.info("getting sha256sum of native source package...") native_sha256sum = "" @@ -77,32 +71,51 @@ class CheckSourceConsistency(BaseCheck): logger.warning(e) return native_sha256sum.strip() + def get_package_name(self, url): + """ + 从文件列表或者url中获取包名 + """ + package_name = os.popen("ls -S {0} |grep -v .spec |grep -v .yaml |grep -v .patch |grep -v .md |head -n " + "1".format(self._work_dir)).read().split()[0] + if package_name == "": + package_name = os.path.basename(url) + return package_name + def check_source_consistency(self): """ 检查源码包是否一致 + :return: """ - os.makedirs(os.path.join(self.rpmbuild_dir, "SOURCES"), exist_ok=True) + if not os.path.exists(os.path.join(self.rpmbuild_dir, "SOURCES")): + os.makedirs(os.path.join(self.rpmbuild_dir, "SOURCES")) source_url = self.get_source_url() if source_url == "": logger.warning("no valid source url") + logger.info("Check source consistency warning: If you have some questions, you can ask WX1154966!") return WARNING - package_name = self.get_package_from_source(source_url) + package_name = self.get_package_name(source_url) if package_name not in os.listdir(self._work_dir): - logger.warning("no source package file") + logger.warning("no source package file in the repo, the package name is " + package_name) + logger.info("Check source consistency warning: If you have some questions, you can ask WX1154966!") return WARNING native_sha256sum = self.get_sha256sum(os.path.join(self._work_dir, package_name)) if native_sha256sum == "": logger.warning("get sha256sum of native source package failed") + logger.info("Check source consistency warning: If you have some questions, you can ask WX1154966!") return WARNING remote_sha256sum = self.get_sha256sum_from_url(source_url) if remote_sha256sum == "": - logger.warning("no url in source_clean.db") + logger.warning("no url in source_clean.db, please add it into source_clean.db in the web: " + "https://majun.osinfra.cn/sourceClean/index") + logger.info("Check source consistency warning: If you have some questions, you can ask WX1154966!") return WARNING if native_sha256sum != remote_sha256sum: - logger.error("repo is inconsistency") + logger.error("repo is inconsistency, please check the sha256sum in the web: " + "https://majun.osinfra.cn/sourceClean/index") + logger.info("Check source consistency warning: If you have some questions, you can ask WX1154966!") return FAILED return SUCCESS @@ -110,6 +123,7 @@ class CheckSourceConsistency(BaseCheck): def get_source_url(self): """ 获取spec文件中的Source URL + :return: """ spec_name = "" files_list = os.listdir(self._work_dir) @@ -125,12 +139,17 @@ class CheckSourceConsistency(BaseCheck): if spec_name == "": logger.error("no spec file, please check!") return "" - source_url = self.get_source_from_rpmbuild(spec_name) + source_url = self.get_source_from_spec(spec_name) + # If program can't get source url from spec, try to get source url by rpmbuild + if source_url == "": + source_url = self.get_source_from_rpmbuild(spec_name) return source_url def get_source_from_rpmbuild(self, spec_name=""): """ rpmbuild解析出可查询的Source URL + :param spec_name:spec文件名 + :return: """ if spec_name == "": spec_name = self._repo + ".spec" @@ -139,9 +158,45 @@ class CheckSourceConsistency(BaseCheck): source_url = self.do_rpmbuild() return source_url + def get_source_from_spec(self, spec_name=""): + """ + spec文件中得到可查询的Source URL + :param spec_name:spec文件名 + :return: + """ + if spec_name == "": + spec_name = self._repo + ".spec" + spec_file = os.path.join(self._work_dir, spec_name) + if not os.path.exists(spec_file): + temp_file_list = os.listdir(self._work_dir) + spec_file_list = [] + for temp_file in temp_file_list: + if temp_file.endswith(".spec"): + spec_file_list.append(temp_file) + if len(spec_file_list) == 1: + spec_file = os.getcwd() + os.path.sep + "gitee_code" + os.path.sep + self._repo + os.path.sep + \ + spec_file_list[0] + elif len(spec_file_list) > 1: + for s_file in spec_file_list: + if self._repo in s_file or s_file in self._repo: + spec_file = os.getcwd() + os.path.sep + "gitee_code" + os.path.sep + self._repo + os.path.sep +\ + s_file + else: + return "" + ret = subprocess.check_output(["/usr/bin/spectool", "-S", spec_file], shell=False) + content = ret.decode('utf-8').strip() + source_url = content.split(os.linesep)[0].strip() if os.linesep in content else content.strip() + if ":" in source_url: + source_url = ":".join(source_url.split(":")[1:]).strip() + elif "No such file or directory" in source_url: + return "" + return source_url + def generate_new_spec(self, spec_file): """ 读取spec文件并生成新的spec文件 + :param spec_file:spec文件名 + :return: """ logger.info("reading spec file : %s ...", os.path.basename(spec_file)) @@ -169,6 +224,8 @@ class CheckSourceConsistency(BaseCheck): def get_prep_function(self, url): """ 生成spec文件%prep部分的内容 + :param url:source0的值 + :return: """ logger.info("generating %prep function") function_content = "%prep" + os.linesep @@ -180,6 +237,7 @@ class CheckSourceConsistency(BaseCheck): def do_rpmbuild(self): """ 对新生成的spec文件执行rpmbuild + :return: """ logger.info("start to do rpmbuild") new_spec_file = os.path.join(self.rpmbuild_sources_path, "get_source.spec") @@ -195,6 +253,7 @@ class CheckSourceConsistency(BaseCheck): def create_connection(self): """ 与数据库建立连接 + :return: """ logger.info("getting connection with source_clean.db ...") try: @@ -208,6 +267,8 @@ class CheckSourceConsistency(BaseCheck): def get_sha256sum_from_url(self, url): """ 查询数据库,获取url的sha256sum值 + :param url:source0的值 + :return: """ logger.info("getting sha256sum of remote source package from source_clean.db ...") if self.con is None: @@ -223,6 +284,7 @@ class CheckSourceConsistency(BaseCheck): def clear_temp(self): """ 清理生成的中间文件 + :return: """ if os.path.exists(self._work_dir): shutil.rmtree(self._work_dir) diff --git a/src/ac/framework/ac.yaml b/src/ac/framework/ac.yaml index 991cb07cd6ee14d451df780027f2397faff02e43..6a7c18fc45c8a1e6342b7e4cb56d10740d527160 100644 --- a/src/ac/framework/ac.yaml +++ b/src/ac/framework/ac.yaml @@ -30,7 +30,9 @@ src-openeuler: commit_msg: exclude: True source_consistency: - exclude: True + hint: check_consistency + module: source_consistency.check_consistency + entry: CheckSourceConsistency openeuler: spec: exclude: True @@ -62,7 +64,7 @@ openeuler: "yocto-poky", "bishengjdk-17", "bishengjdk-8", "bishengjdk-11", "bishengjdk-riscv", "powerapi", "eagle", "dcs", "astream", "QARobot", "oec-application", "gala-gopher", "gala-anteater", "gala-spider", "gala-ragdoll", "aops-zeus", "aops-ceres", "aops-apollo", "aops-diana", "aops-hermes", - "aops-vulcanus", "Kmesh"] + "aops-vulcanus", "Kmesh", "BiShengCLanguage"] commit_msg: hint: commit_msg module: commit_msg.check_commit_msg diff --git a/src/conf/project_host_mapping.yaml b/src/conf/project_host_mapping.yaml index 4b1ae94f61354cb6d6269b9e4c3bb2a1706af9a7..8e997dd1df3fa6ec76e067df70909b64669e2f85 100644 --- a/src/conf/project_host_mapping.yaml +++ b/src/conf/project_host_mapping.yaml @@ -6,9 +6,6 @@ main: - openEuler:22.03:LTS:SP1:Epol - openEuler:22.03:LTS:LoongArch - openEuler:22.03:LTS:LoongArch:selfbuild:BaseOS - - openEuler:22.09 - - openEuler:22.09:Epol - - openEuler:22.09:Epol:Multi-Version:obs-server:2.10.11 - openEuler:Epol - openEuler:Extras - openEuler:Factory @@ -45,6 +42,9 @@ backend_002: - openEuler:22.03:LTS:Next:Epol:Multi-Version:OpenStack:Wallaby - openEuler:22.03:LTS:Next:Extras - openEuler:22.03:LTS:Next:selfbuild:BaseOS + - openEuler:22.09 + - openEuler:22.09:Epol + - openEuler:22.09:Epol:Multi-Version:obs-server:2.10.11 backend_003: host: "http://121.36.94.113:82" project_list: