From f03a450583018b9e129892bb0808be8b4f8fd26e Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 11:31:39 +0800 Subject: [PATCH 01/25] =?UTF-8?q?=E6=B7=BB=E5=8A=A0BoostKit=E7=A6=BB?= =?UTF-8?q?=E7=BA=BF=E6=8F=92=E4=BB=B6=E7=9A=84=E5=9F=BA=E7=A1=80=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=92=8C=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要变更包括: 1. 新增source.cfg配置文件,定义KSL、HMPP等组件版本 2. 新增build.sh构建脚本用于下载依赖 --- plugins/boostkit-offline/config.yaml | 34 ++ plugins/boostkit-offline/main.yaml | 15 + .../workspace/AccLib-install.yml | 6 + .../workspace/AccLib-show.yml | 6 + plugins/boostkit-offline/workspace/build.sh | 42 ++ .../AccLib/install/tasks/execute_install.yml | 24 ++ .../roles/AccLib/install/tasks/main.yml | 3 + .../files/BoostKit-AccLib/scripts/install.py | 397 ++++++++++++++++++ .../BoostKit-AccLib/scripts/requirements.txt | 1 + .../files/BoostKit-AccLib/scripts/version.xml | 22 + .../roles/AccLib/prepare/tasks/main.yml | 23 + .../AccLib/prepare/templates/version.xml.j2 | 22 + .../roles/AccLib/show/tasks/main.yml | 13 + .../workspace/roles/check/tasks/main.yml | 84 ++++ plugins/boostkit-offline/workspace/source.cfg | 4 + 15 files changed, 696 insertions(+) create mode 100644 plugins/boostkit-offline/config.yaml create mode 100644 plugins/boostkit-offline/main.yaml create mode 100644 plugins/boostkit-offline/workspace/AccLib-install.yml create mode 100644 plugins/boostkit-offline/workspace/AccLib-show.yml create mode 100644 plugins/boostkit-offline/workspace/build.sh create mode 100644 plugins/boostkit-offline/workspace/roles/AccLib/install/tasks/execute_install.yml create mode 100644 plugins/boostkit-offline/workspace/roles/AccLib/install/tasks/main.yml create mode 100644 plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py create mode 100644 plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/requirements.txt create mode 100644 plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml create mode 100644 plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml create mode 100644 plugins/boostkit-offline/workspace/roles/AccLib/prepare/templates/version.xml.j2 create mode 100644 plugins/boostkit-offline/workspace/roles/AccLib/show/tasks/main.yml create mode 100644 plugins/boostkit-offline/workspace/roles/check/tasks/main.yml create mode 100644 plugins/boostkit-offline/workspace/source.cfg diff --git a/plugins/boostkit-offline/config.yaml b/plugins/boostkit-offline/config.yaml new file mode 100644 index 0000000..c0f940e --- /dev/null +++ b/plugins/boostkit-offline/config.yaml @@ -0,0 +1,34 @@ +all: + hosts: + host1: + ansible_host: HOST_IP # e.g. 192.168.1.101 + ansible_port: 22 + ansible_user: root + ansible_password: "" + # 按实际代理需要添加,添加时删除以下第一行和所需行的井号;如需全局使用代理请移动至 all:vars + #proxy_env: + # http_proxy: + # https_proxy: + # ftp_proxy: + # no_proxy: + # 可在此添加更多主机 + children: + AccLib: + hosts: + host1: + # 可在此包含更多主机 + vars: + install_list: 'ALL' # 支持使用列表,或者使用逗号分隔的字符串 + KSL_version: 2.5.0 + HMPP_version: 2.5.0 + hyperscan_branch: v5.4.2.aarch64 + KAE_tag: kae2 + vars: + # 跳过所有基本检查项 + skip_check: false + # pip 源地址,如不涉及 pip 安装可删除此项 + pip_index_url: "https://mirrors.huaweicloud.com/repository/pypi/simple" + # 临时文件存放目录 + temp_path: /tmp + # 跳过 ssh 校验,如需禁用此功能,请删除以下配置项 + ansible_ssh_common_args: '-o StrictHostKeyChecking=no' diff --git a/plugins/boostkit-offline/main.yaml b/plugins/boostkit-offline/main.yaml new file mode 100644 index 0000000..5c77268 --- /dev/null +++ b/plugins/boostkit-offline/main.yaml @@ -0,0 +1,15 @@ +name: boostkit +description: BoostKit +action: + AccLib-show: + description: show available components in AccLib + tasks: + - name: show available components in AccLib + playbook: AccLib-show.yml + scope: AccLib + AccLib-install: + description: install components in AccLib + tasks: + - name: install components in AccLib + playbook: AccLib-install.yml + scope: AccLib diff --git a/plugins/boostkit-offline/workspace/AccLib-install.yml b/plugins/boostkit-offline/workspace/AccLib-install.yml new file mode 100644 index 0000000..274e427 --- /dev/null +++ b/plugins/boostkit-offline/workspace/AccLib-install.yml @@ -0,0 +1,6 @@ +- hosts: all + environment: "{{ proxy_env | default({}) }}" + roles: + - check + - AccLib/prepare + - AccLib/install diff --git a/plugins/boostkit-offline/workspace/AccLib-show.yml b/plugins/boostkit-offline/workspace/AccLib-show.yml new file mode 100644 index 0000000..ffa7beb --- /dev/null +++ b/plugins/boostkit-offline/workspace/AccLib-show.yml @@ -0,0 +1,6 @@ +- hosts: all + environment: "{{ proxy_env | default({}) }}" + roles: + - check + - AccLib/prepare + - AccLib/show diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh new file mode 100644 index 0000000..a4acb63 --- /dev/null +++ b/plugins/boostkit-offline/workspace/build.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +DIR=$(cd `dirname $0/`;pwd) + +get_source() { + source "$DIR/source.cfg" + + KSL_version=${KSL_version:-"2.5.0"} + HMPP_version=${HMPP_version:-"2.5.0"} + Hyperscan_branch=${Hyperscan_branch:-"v5.4.2.aarch64"} + KAE_tag=${KAE_tag:-"kae2"} + + KSL_url=${KSL_url:-"https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-ksl-${KSL_version}-1.aarch64.rpm"} + HMPP_url=${HMPP_url:-"https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-hmpp-${HMPP_version}-1.aarch64.rpm"} + ragel_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/ragel-6.10.tar.gz" + boost_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boost_1_87_0.tar.gz" + pcre_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/pcre-8.43.tar.gz" + + Hyperscan_git="https://gitee.com/kunpengcompute/hyperscan.git" + KAE_git="https://gitee.com/kunpengcompute/KAE.git" +} + +download() { + download_dir=$DIR/download + mkdir $download_dir + pushd $download_dir + + wget --no-check-certificate KSL_url + wget --no-check-certificate HMPP_url + wget --no-check-certificate ragel_url + wget --no-check-certificate boost_url + wget --no-check-certificate pcre_url + + popd +} + +pushd $DIR + +get_source() +download() + +popd diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/install/tasks/execute_install.yml b/plugins/boostkit-offline/workspace/roles/AccLib/install/tasks/execute_install.yml new file mode 100644 index 0000000..d2a4a00 --- /dev/null +++ b/plugins/boostkit-offline/workspace/roles/AccLib/install/tasks/execute_install.yml @@ -0,0 +1,24 @@ +- name: Get timestamp + command: date +%Y%m%d%H%M%S + register: timestamp + changed_when: false + +- name: Execute install script for {{ item }} + shell: | + python3 install.py --component {{ item }} > {{ temp_path }}/BoostKit-AccLib/scripts/{{ timestamp.stdout }}.log 2>&1 + args: + chdir: "{{ temp_path }}/BoostKit-AccLib/scripts" + register: install_result + changed_when: false + ignore_errors: true + tags: install + +- name: Show execution result + debug: + msg: "Installation completed for {{ item }}. Log file: {{ temp_path }}/BoostKit-AccLib/scripts/{{ timestamp.stdout }}.log" + when: install_result is succeeded + +- name: Fail if installation failed + fail: + msg: "Installation failed for {{ item }}. Check log file: {{ temp_path }}/BoostKit-AccLib/scripts/{{ timestamp.stdout }}.log" + when: install_result is failed diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/install/tasks/main.yml b/plugins/boostkit-offline/workspace/roles/AccLib/install/tasks/main.yml new file mode 100644 index 0000000..525a999 --- /dev/null +++ b/plugins/boostkit-offline/workspace/roles/AccLib/install/tasks/main.yml @@ -0,0 +1,3 @@ +- name: "[Script] Execute install script" + include_tasks: execute_install.yml + loop: "{{ (install_list if install_list is defined and (install_list is iterable and not install_list is string) else [install_list]) if install_list is defined and install_list | length > 0 else ['ALL'] }}" diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py new file mode 100644 index 0000000..fe29138 --- /dev/null +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py @@ -0,0 +1,397 @@ +import argparse +import os.path +import re +import xml.etree.ElementTree as ET +import subprocess +from contextlib import contextmanager + +quiet = True + + +def check_version(src, tar, op=">="): + src_list = src.split('.') + tar_list = tar.split('.') + + for index, str in enumerate(tar_list): + if '*' in str or index >= len(src_list): + break + + if op == ">=": + if int(src_list[index]) > int(str): + return True + elif int(src_list[index]) == int(str): + continue + else: + return False + elif op == "<": + if int(src_list[index]) < int(str): + return True + elif int(src_list[index]) == int(str): + continue + else: + return False + elif op == "=": + if int(src_list[index]) != int(str): + return False + else: + return False + return True + + +class Runcmd(object): + @staticmethod + def sendcmd(cmd, workspace=None, check=True, extra_env: dict = None): + env = os.environ.copy() + if extra_env: + for key in extra_env: + env[key] = extra_env.get(key) + + if not quiet: + print(f"cmd: {cmd}") + result = subprocess.run(cmd, cwd=workspace, shell=True, check=check, capture_output=True, encoding='utf-8', + env=env) + if not quiet: + print(f"done\nstdout:\n{result.stdout}\nstderr:\n{result.stderr}\nreturn code: {result.returncode}") + return '\n'.join(result.stdout.split('\n')).strip("\n") + + +class Installer(object): + __root = None + __function_dict = dict() + + def __init__(self, xml_path): + self.__root = ET.parse(xml_path).getroot() + self.__ROOT_PATH = os.path.abspath(os.path.dirname(os.getcwd())) + self.__SOURCE_PATH = os.path.join(self.__ROOT_PATH, "source/") + self.__init_func_dict() + self.__platform = self.__check_platform() + + def __check_platform(self): + kunpeng_platform = {"0xd01": "Kunpeng 920", "0xd02": "Kunpeng 920 V200"} + implementer = Runcmd.sendcmd("cat /proc/cpuinfo | grep 'CPU implementer' | head -n 1 | awk '{print $NF}'") + part = Runcmd.sendcmd("cat /proc/cpuinfo | grep 'CPU part' | head -n 1 | awk '{print $NF}'") + + if implementer == "0x48": + return kunpeng_platform.get(part) + else: + return Runcmd.sendcmd("lscpu | grep 'BIOS Model name:' | awk '{print $NF}'") + + def __check_env(self): + with self.__process("检查代理"): + Runcmd.sendcmd("curl www.baidu.com") + + with self.__process("检查yum源, 并安装必要工具"): + Runcmd.sendcmd("yum makecache") + Runcmd.sendcmd("yum install -y git tar gcc gcc-c++ patch") + Runcmd.sendcmd("git config --global https.sslverify false") + Runcmd.sendcmd("git config --global http.sslverify false") + + def __chech_env_in_profile(self, key, value): + libpath = os.getenv(key) + if libpath and value in libpath: + return True + + env_list = Runcmd.sendcmd(f"cat /etc/profile | grep {key}", check=False).split("\n") + for env in env_list: + if value in env and not re.search("#.+export", env): + return True + + return False + + def __get_element_text(self, tag: str): + tags = [child.tag for child in self.__root.find(tag)] + texts = [child.text for child in self.__root.find(tag)] + info = dict() + + for index, tag in enumerate(tags): + info[tag] = texts[index] + + return info + + @contextmanager + def __process(self, topic): + try: + print(topic) + yield + print(f"{topic}成功") + except subprocess.CalledProcessError as e: + print(f"{topic}存在执行命令失败, 报错信息如下:\n{e.stderr}") + raise e + except Exception as e: + print(f"{topic}失败") + raise e + + def __install_ksl(self): + Runcmd.sendcmd("rm -rf ./KSL", workspace=f"{self.__ROOT_PATH}") + Runcmd.sendcmd(f"mkdir -p KSL/rpm", workspace=f"{self.__ROOT_PATH}") + + ksl_info = self.__get_element_text("KSL") + with self.__process("安装KSL"): + res = Runcmd.sendcmd("cat /etc/os-release") + name = re.search("NAME=\"(.+)\"", res).group(1) + assert name == "openEuler", "仅支持在openEuler上安装" + pkg_version = ksl_info.get("version") + url = ksl_info.get('url').format(pkg_version) + + Runcmd.sendcmd(f"wget {url} --no-check-certificate", workspace=f"{self.__ROOT_PATH}/KSL/rpm") + Runcmd.sendcmd("rpm -e boostkit-ksl", check=False) + Runcmd.sendcmd("rpm -ivh rpm/*.rpm", workspace=f"{self.__ROOT_PATH}/KSL") + + def __install_hyperscan_dep(self): + self.__install_ksl() + + Runcmd.sendcmd("rm -rf ./Hyperscan", workspace=f"{self.__ROOT_PATH}") + Runcmd.sendcmd(f"mkdir -p Hyperscan/resource", workspace=f"{self.__ROOT_PATH}") + + info = self.__get_element_text("Hyperscan") + + with self.__process("安装ragel"): + download = info.get("ragel") + bag = info.get("ragel").split('/')[-1] + + Runcmd.sendcmd(f"wget {download} --no-check-certificate", workspace=f"{self.__ROOT_PATH}/Hyperscan") + Runcmd.sendcmd(f"tar -zxf {bag}", workspace=f"{self.__ROOT_PATH}/Hyperscan") + + dir = Runcmd.sendcmd(f"ls | grep ragel | grep -v tar", workspace=f"{self.__ROOT_PATH}/Hyperscan") + Runcmd.sendcmd(f"./configure", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") + Runcmd.sendcmd(f"make -j && make install", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") + Runcmd.sendcmd(f"ragel -v") + + with self.__process("安装boost"): + download = info.get("boost") + bag = info.get("boost").split('/')[-1] + + Runcmd.sendcmd(f"wget {download} --no-check-certificate", workspace=f"{self.__ROOT_PATH}/Hyperscan") + Runcmd.sendcmd(f"tar -zxf {bag}", workspace=f"{self.__ROOT_PATH}/Hyperscan") + + with self.__process("安装pcre"): + download = info.get("pcre") + bag = info.get("pcre").split('/')[-1] + + Runcmd.sendcmd(f"wget {download} --no-check-certificate", workspace=f"{self.__ROOT_PATH}/Hyperscan") + Runcmd.sendcmd(f"tar -zxf {bag}", workspace=f"{self.__ROOT_PATH}/Hyperscan") + + with self.__process("安装yum依赖包"): + Runcmd.sendcmd("yum install -y sqlite sqlite-devel") + stdout = Runcmd.sendcmd("pkg-config --libs sqlite3") + assert "-lsqlite3" in stdout, "安装sqlite失败" + Runcmd.sendcmd("yum install -y cmake make gcc gcc-c++") + + def __install_hyperscan(self): + self.__install_hyperscan_dep() + + info = self.__get_element_text("Hyperscan") + + with self.__process("安装Hyperscan"): + stdout = Runcmd.sendcmd("lscpu | grep Architecture") + platform = "x86" if "x86" in stdout else "arm" + download = info.get(f"code_{platform}") + branch = info.get(f"branch_{platform}") + dir = download.split('/')[-1].split('.')[0] + + res = Runcmd.sendcmd("rpm -qa | grep boostkit-ksl") + ksl_version = re.search("boostkit-ksl-(\d+.\d+.\d+)", res).group(1) + if platform == "arm" and check_version(ksl_version, "2.4.0"): + Runcmd.sendcmd(f"git clone {download} -b khsel", workspace=f"{self.__ROOT_PATH}/Hyperscan") + Runcmd.sendcmd("cp hyperscan/khsel.patch ./", workspace=f"{self.__ROOT_PATH}/Hyperscan") + Runcmd.sendcmd(f"git checkout {branch}", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") + Runcmd.sendcmd(f"mv ../khsel.patch ./", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") + Runcmd.sendcmd(f"git apply khsel.patch", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") + else: + Runcmd.sendcmd(f"git clone {download} -b {branch}", workspace=f"{self.__ROOT_PATH}/Hyperscan") + + boost_path = Runcmd.sendcmd("ls | grep boost | grep -v tar", workspace=f"{self.__ROOT_PATH}/Hyperscan") + boost_path = f"{self.__ROOT_PATH}/Hyperscan/{boost_path}" + Runcmd.sendcmd(f"ln -s {boost_path}/boost include/boost", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") + + pcre_path = Runcmd.sendcmd("ls | grep pcre | grep -v tar", workspace=f"{self.__ROOT_PATH}/Hyperscan") + Runcmd.sendcmd(f"cp -rf ../{pcre_path} ./pcre", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") + + stdout = Runcmd.sendcmd("cmake --version | grep version", workspace=f"{self.__ROOT_PATH}/Hyperscan") + version = stdout.split()[-1] + if check_version(version, "2.8.0", op='<'): + Runcmd.sendcmd( + "sed -i 's/CMAKE_POLICY(SET CMP0026 OLD)/#CMAKE_POLICY(SET CMP0026 OLD)/g' CMakeLists.txt", + workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}/pcre") + + Runcmd.sendcmd("mkdir -p build", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") + Runcmd.sendcmd("cmake .. && make -j", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}/build") + + def __install_compress_decompress_tools(self): + Runcmd.sendcmd("rm -rf ZIP", workspace=f"{self.__ROOT_PATH}") + Runcmd.sendcmd("mkdir ZIP", workspace=f"{self.__ROOT_PATH}") + + with self.__process("安装软算测试工具lzbench"): + Runcmd.sendcmd("git clone https://gitee.com/kunpeng_compute/lzbench.git --depth=1", + workspace=f"{self.__ROOT_PATH}/ZIP") + Runcmd.sendcmd("make -j", workspace=f"{self.__ROOT_PATH}/ZIP/lzbench") + + if "KAE" in str(self.__function_dict.keys()) or "QAT" in str(self.__function_dict.keys()): + with self.__process("安装带宽测试工具"): + Runcmd.sendcmd(f"make platform='{self.__platform}'", + workspace=f"{self.__ROOT_PATH}/resources/bandwidth") + Runcmd.sendcmd(f"cp ./bin/bandwidth {self.__ROOT_PATH}/ZIP", + workspace=f"{self.__ROOT_PATH}/resources/bandwidth") + Runcmd.sendcmd("make clean", workspace=f"{self.__ROOT_PATH}/resources/bandwidth") + + def __install_kae_dep(self): + with self.__process("安装KAE相关依赖"): + Runcmd.sendcmd( + "yum install -y make kernel-devel libtool numactl-devel openssl-devel chrpath lz4-devel zstd-devel zlib-devel") + + def __install_kae(self): + version = Runcmd.sendcmd("openssl version | awk '{print $2}'") + if check_version(version, "1.*", "="): + engine_path = "/usr/local/lib/engines-1.1/" + component = "engine" + elif check_version(version, "3.*", "="): + engine_path = "/usr/local/lib/engines-3.0/" + component = "engine3" + else: + assert False, f"unsupport openssl version: {version}" + + self.__install_kae_dep() + + info = self.__get_element_text("KAE") + Runcmd.sendcmd("rm -rf ./KAE", workspace=f"{self.__ROOT_PATH}") + Runcmd.sendcmd("mkdir KAE", workspace=f"{self.__ROOT_PATH}") + + with self.__process("下载编译KAE源码"): + download = info.get("kae_code") + branch = info.get("kae_code_tag") + dir = download.split('/')[-1].split('.')[0] + + Runcmd.sendcmd(f"git clone {download} -b {branch} --depth=1", workspace=f"{self.__ROOT_PATH}/KAE") + Runcmd.sendcmd("bash build.sh cleanup", workspace=f"{self.__ROOT_PATH}/KAE/{dir}") + Runcmd.sendcmd("bash build.sh driver", workspace=f"{self.__ROOT_PATH}/KAE/{dir}") + Runcmd.sendcmd("bash build.sh uadk", workspace=f"{self.__ROOT_PATH}/KAE/{dir}") + Runcmd.sendcmd(f"bash build.sh {component}", workspace=f"{self.__ROOT_PATH}/KAE/{dir}") + Runcmd.sendcmd("bash build.sh zlib", workspace=f"{self.__ROOT_PATH}/KAE/{dir}") + + if "Kunpeng 920 V200" == self.__platform: + Runcmd.sendcmd("bash build.sh lz4", workspace=f"{self.__ROOT_PATH}/KAE/{dir}") + Runcmd.sendcmd("bash build.sh zstd", workspace=f"{self.__ROOT_PATH}/KAE/{dir}") + + with self.__process("确认KAE模块使能"): + res = Runcmd.sendcmd("ls /sys/class/uacce", check=False) + if not res: + Runcmd.sendcmd("rmmod hisi_zip && rmmod hisi_sec2 && rmmod hisi_hpre") + Runcmd.sendcmd("inmod hisi_hpre && inmod hisi_sec2 && inmod hisi_zip") + Runcmd.sendcmd("ls /sys/class/uacce") + Runcmd.sendcmd("ls /usr/local/lib/libwd*") + + res = Runcmd.sendcmd("ls /usr/local/kaezip/lib", check=False) + assert "kaezip" in res, "没有找到kaezip相关动态库" + if "Kunpeng 920 V200" == self.__platform: + res = Runcmd.sendcmd("ls /usr/local/kaelz4/lib", check=False) + assert "kaelz4" in res, "没有找到kaelz4相关动态库" + res = Runcmd.sendcmd("ls /usr/local/kaezstd/lib", check=False) + assert "kaezstd" in res, "没有找到kaezstd相关动态库" + + res = Runcmd.sendcmd(f"ls {engine_path}", check=False) + assert "kae.so" in res, "没有找到engine相关动态库" + + if not self.__chech_env_in_profile("OPENSSL_ENGINES", engine_path): + Runcmd.sendcmd(f"echo 'export OPENSSL_ENGINES={engine_path}:$OPENSSL_ENGINES' >> /etc/profile") + + print("成功安装KAE, 已经添加必要环境变量, 执行source /etc/profile使能") + + def __install_libgcrypt_dep(self): + with self.__process("安装libgcrypt相关依赖"): + Runcmd.sendcmd("yum install -y texinfo transfig hwloc hwloc-devel autoconf automake") + + def __install_libgcrypt(self): + self.__install_libgcrypt_dep() + + gpg_info = Runcmd.sendcmd("find /usr/local/lib -name '*libgpg-error.so*'") + if "libgpg-error.so" in gpg_info: + print("已经安装了libgpg-error,不用再安装了") + return + + Runcmd.sendcmd("rm -rf libgpg", workspace=f"{self.__ROOT_PATH}") + with self.__process("安装libgcrypt"): + Runcmd.sendcmd(f"unzip libgpg-error-1.51.zip -d {self.__ROOT_PATH}/libgpg", + workspace=f"{self.__ROOT_PATH}/resources/libgcrypt") + Runcmd.sendcmd("chmod 777 autogen.sh; ./autogen.sh", + workspace=f"{self.__ROOT_PATH}/libgpg/libgpg-error-1.51") + Runcmd.sendcmd("chmod 777 configure; ./configure --enable-maintainer-mode", + workspace=f"{self.__ROOT_PATH}/libgpg/libgpg-error-1.51") + Runcmd.sendcmd("make -j; make install", workspace=f"{self.__ROOT_PATH}/libgpg/libgpg-error-1.51") + + if not self.__chech_env_in_profile("LD_LIBRARY_PATH", "/usr/local/lib"): + Runcmd.sendcmd("echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> /etc/profile") + + def __install_kqmalloc_dep(self): + with self.__process("安装kqmalloc编译依赖"): + Runcmd.sendcmd("yum install -y autoconf gcc gcc-c++") + + def __install_kqmalloc(self): + self.__install_kqmalloc_dep() + + Runcmd.sendcmd(f"rm -rf ./KQMalloc", workspace=f"{self.__ROOT_PATH}") + Runcmd.sendcmd(f"mkdir -p KQMalloc/resource", workspace=f"{self.__ROOT_PATH}") + + with self.__process("安装kqmalloc"): + self.__install_ksl() + res = Runcmd.sendcmd("rpm -qa | grep boostkit-ksl") + ksl_version = re.search("boostkit-ksl-(\d+.\d+.\d+)", res).group(1) + assert check_version(ksl_version, "2.4.0"), "ksl版本过低,请指定2.4.0以上版本" + + def __init_func_dict(self): + self.__function_dict["Hyperscan"] = self.__install_hyperscan + self.__function_dict["Libgcrypt"] = self.__install_libgcrypt + res = Runcmd.sendcmd("lscpu | grep 'BIOS Model name:'") + if "Kunpeng" in res: + self.__function_dict["KAE"] = self.__install_kae + self.__function_dict["KQMalloc"] = self.__install_kqmalloc + else: + self.__function_dict["SOFT_COMPRESS"] = self.__install_compress_decompress_tools + + def get_support(self): + return ' '.join(self.__function_dict.keys()) + + def install(self, components): + self.__check_env() + + if "ALL" == components: + for func in self.__function_dict.values(): + try: + func() + except Exception as e: + print(e) + if not args.ignore: + raise e + else: + for component in components.split(): + func = self.__function_dict.get(component) + if func: + try: + func() + except Exception as e: + print(e) + if not args.ignore: + raise e + else: + raise f"没有找到安装方法, {component}" + + +if __name__ == '__main__': + installer = Installer('version.xml') + supports = installer.get_support() + + parser = argparse.ArgumentParser() + parser.add_argument("--component", type=str, + help=f"support component eg. ALL | component | 'component1 component2...', default ALL", + default='ALL') + parser.add_argument("-q", '--quiet', action='store_true', help="print quiet") + parser.add_argument('--ignore', action='store_true', + help="ignore error for each installing component while component is ALL") + parser.add_argument("-i", '--info', action='store_true', help="check supported components") + args = parser.parse_args() + quiet = args.quiet + info_t = args.info + if info_t: + print(supports) + exit(0) + + installer.install(args.component) diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/requirements.txt b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/requirements.txt new file mode 100644 index 0000000..9a2a89e --- /dev/null +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/requirements.txt @@ -0,0 +1 @@ +argparse>=1.4.0 diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml new file mode 100644 index 0000000..c9f6095 --- /dev/null +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml @@ -0,0 +1,22 @@ + + + + 2.5.0 + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-ksl-{}-1.aarch64.rpm + + + 2.5.0 + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-hmpp-{}-1.aarch64.rpm + + + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/ragel-6.10.tar.gz + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boost_1_87_0.tar.gz + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/pcre-8.43.tar.gz + https://gitee.com/kunpengcompute/hyperscan.git + v5.4.2.aarch64 + + + https://gitee.com/kunpengcompute/KAE.git + kae2 + + \ No newline at end of file diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml new file mode 100644 index 0000000..0bb0152 --- /dev/null +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml @@ -0,0 +1,23 @@ +- name: "[Dependency] Install python3-libselinux" + yum: + name: python3-libselinux + state: present + tags: dependency + +- name: "[File] Ensure destination directory exists" + file: + path: "{{ temp_path }}" + state: directory + tags: file_transfer + +- name: "[File] Transfer local file to remote host" + copy: + src: "BoostKit-AccLib" + dest: "{{ temp_path }}" + tags: file_transfer + +- name: "[File] Copy version.xml to remote host" + template: + src: "version.xml.j2" + dest: "{{ temp_path }}/BoostKit-AccLib/scripts/version.xml" + tags: file_transfer diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/templates/version.xml.j2 b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/templates/version.xml.j2 new file mode 100644 index 0000000..eaa3e79 --- /dev/null +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/templates/version.xml.j2 @@ -0,0 +1,22 @@ + + + + {{ KSL_version }} + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-ksl-{}-1.aarch64.rpm + + + {{ HMPP_version }} + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-hmpp-{}-1.aarch64.rpm + + + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/ragel-6.10.tar.gz + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boost_1_87_0.tar.gz + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/pcre-8.43.tar.gz + https://gitee.com/kunpengcompute/hyperscan.git + {{ hyperscan_branch }} + + + https://gitee.com/kunpengcompute/KAE.git + {{ KAE_tag }} + + \ No newline at end of file diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/show/tasks/main.yml b/plugins/boostkit-offline/workspace/roles/AccLib/show/tasks/main.yml new file mode 100644 index 0000000..5652f83 --- /dev/null +++ b/plugins/boostkit-offline/workspace/roles/AccLib/show/tasks/main.yml @@ -0,0 +1,13 @@ +- name: "[Script] Get info and display" + shell: | + python3 install.py -i + args: + chdir: "{{ temp_path }}/BoostKit-AccLib/scripts" + register: info_output + changed_when: false + tags: get_info + +- name: "[Script] Display execution output" + debug: + msg: "{{ info_output.stdout_lines }}" + tags: get_info diff --git a/plugins/boostkit-offline/workspace/roles/check/tasks/main.yml b/plugins/boostkit-offline/workspace/roles/check/tasks/main.yml new file mode 100644 index 0000000..c058d64 --- /dev/null +++ b/plugins/boostkit-offline/workspace/roles/check/tasks/main.yml @@ -0,0 +1,84 @@ +- name: "[Check] Skip all checks if skip_check is true" + debug: + msg: "Skipping all checks" + when: > + skip_check is defined and + (skip_check == true or skip_check | string == "true") + tags: never + +- block: + - name: "[Check] Initialize check results" + set_fact: + check_results: [ ] + check_failed: "false" + + - name: "[CPU] Verify Kunpeng-920 processor" + shell: | + grep -m1 "CPU implementer" /proc/cpuinfo | awk '{print $4}' + register: cpu_implementer + changed_when: false + tags: hardware_check + + - name: "[CPU] Record CPU check result" + set_fact: + check_results: "{{ check_results + ['CPU implementer: ' + cpu_implementer.stdout] }}" + check_failed: "{{ check_failed or (cpu_implementer.stdout != '0x48') }}" + tags: hardware_check + + - name: "[Network] Test connectivity to Baidu using curl" + command: >- + curl -sSf --connect-timeout 5 + -w "HTTP %{http_code}" -o /dev/null + https://www.baidu.com + register: network_test + ignore_errors: yes + changed_when: false + tags: network_check + + - name: "[Network] Record network check result" + set_fact: + check_results: >- + {{ check_results + ['Network test: ' + + (network_test is failed | ternary('Failed', 'Success (' + network_test.stdout + ')'))] }} + check_failed: "{{ check_failed or (network_test is failed) }}" + tags: network_check + + - name: "[Python] Validate pip repository accessibility" + pip: + name: pip + extra_args: >- + -i "{{ pip_index_url | default('https://pypi.org/simple', true) }}" + --disable-pip-version-check + --timeout 30 + --retries 2 + state: present + when: pip_index_url is defined + register: pip_validation + ignore_errors: yes + changed_when: false + tags: python_check + + - name: "[Python] Record pip check result" + set_fact: + check_results: "{{ check_results + ['Pip repository: ' + (pip_validation is failed | ternary('Unavailable', 'Available'))] }}" + check_failed: "{{ check_failed or (pip_validation is failed) }}" + when: pip_index_url is defined + tags: python_check + + - name: "[Check] Display all check results" + debug: + msg: "{{ item }}" + loop: "{{ check_results }}" + + - name: "[Check] Abort if any check failed" + fail: + msg: >- + Pre-deployment checks failed: + {% for result in check_results %} + - {{ result }} + {% endfor %} + Please fix the issues and try again. + when: check_failed + when: > + skip_check is not defined or + (skip_check != true and skip_check | string != "true") diff --git a/plugins/boostkit-offline/workspace/source.cfg b/plugins/boostkit-offline/workspace/source.cfg new file mode 100644 index 0000000..ced5950 --- /dev/null +++ b/plugins/boostkit-offline/workspace/source.cfg @@ -0,0 +1,4 @@ +KSL_version = 2.5.0 +HMPP_version = 2.5.0 +Hyperscan_branch = v5.4.2.aarch64 +KAE_tag = kae2 \ No newline at end of file -- Gitee From 5129c939e791f8d49021dcc1c9e945befd8eb360 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 14:45:25 +0800 Subject: [PATCH 02/25] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E8=84=9A=E6=9C=AC=E4=B8=AD=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?URL=E5=8F=98=E9=87=8F=E5=BC=95=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/boostkit-offline/workspace/build.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh index a4acb63..01b245a 100644 --- a/plugins/boostkit-offline/workspace/build.sh +++ b/plugins/boostkit-offline/workspace/build.sh @@ -25,11 +25,11 @@ download() { mkdir $download_dir pushd $download_dir - wget --no-check-certificate KSL_url - wget --no-check-certificate HMPP_url - wget --no-check-certificate ragel_url - wget --no-check-certificate boost_url - wget --no-check-certificate pcre_url + wget --no-check-certificate $KSL_url + wget --no-check-certificate $HMPP_url + wget --no-check-certificate $ragel_url + wget --no-check-certificate $boost_url + wget --no-check-certificate $pcre_url popd } -- Gitee From eb4e8f07f0ce69446073ce3bb29267d5167a40c4 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 15:59:10 +0800 Subject: [PATCH 03/25] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要变更: 1. 移除HMPP相关版本配置和下载逻辑 2. 删除version.xml和version.xml.j2模板文件 3. 更新build.sh和source.cfg移除HMPP相关变量 4. 调整install.py组件安装逻辑,支持逗号分隔的组件列表 5. 优化libgcrypt安装流程,改为从网络下载源码包 --- plugins/boostkit-offline/config.yaml | 1 - plugins/boostkit-offline/workspace/build.sh | 6 ++--- .../files/BoostKit-AccLib/scripts/install.py | 18 +++++++++++++-- .../files/BoostKit-AccLib/scripts/version.xml | 22 ------------------- .../roles/AccLib/prepare/tasks/main.yml | 6 ----- .../AccLib/prepare/templates/version.xml.j2 | 22 ------------------- plugins/boostkit-offline/workspace/source.cfg | 4 ++-- plugins/boostkit/config.yaml | 3 --- 8 files changed, 21 insertions(+), 61 deletions(-) delete mode 100644 plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml delete mode 100644 plugins/boostkit-offline/workspace/roles/AccLib/prepare/templates/version.xml.j2 diff --git a/plugins/boostkit-offline/config.yaml b/plugins/boostkit-offline/config.yaml index c0f940e..f3cc05c 100644 --- a/plugins/boostkit-offline/config.yaml +++ b/plugins/boostkit-offline/config.yaml @@ -20,7 +20,6 @@ all: vars: install_list: 'ALL' # 支持使用列表,或者使用逗号分隔的字符串 KSL_version: 2.5.0 - HMPP_version: 2.5.0 hyperscan_branch: v5.4.2.aarch64 KAE_tag: kae2 vars: diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh index 01b245a..a0279d1 100644 --- a/plugins/boostkit-offline/workspace/build.sh +++ b/plugins/boostkit-offline/workspace/build.sh @@ -6,15 +6,15 @@ get_source() { source "$DIR/source.cfg" KSL_version=${KSL_version:-"2.5.0"} - HMPP_version=${HMPP_version:-"2.5.0"} Hyperscan_branch=${Hyperscan_branch:-"v5.4.2.aarch64"} KAE_tag=${KAE_tag:-"kae2"} + Libgcrypt_version=${Libgcrypt_version:-"1.51"} KSL_url=${KSL_url:-"https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-ksl-${KSL_version}-1.aarch64.rpm"} - HMPP_url=${HMPP_url:-"https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-hmpp-${HMPP_version}-1.aarch64.rpm"} ragel_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/ragel-6.10.tar.gz" boost_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boost_1_87_0.tar.gz" pcre_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/pcre-8.43.tar.gz" + Libgcrypt_url="https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-${Libgcrypt_version}.tar.gz" Hyperscan_git="https://gitee.com/kunpengcompute/hyperscan.git" KAE_git="https://gitee.com/kunpengcompute/KAE.git" @@ -26,10 +26,10 @@ download() { pushd $download_dir wget --no-check-certificate $KSL_url - wget --no-check-certificate $HMPP_url wget --no-check-certificate $ragel_url wget --no-check-certificate $boost_url wget --no-check-certificate $pcre_url + wget --no-check-certificate $Libgcrypt_url popd } diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py index fe29138..3acf72a 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py @@ -308,9 +308,23 @@ class Installer(object): print("已经安装了libgpg-error,不用再安装了") return + info = self.__get_element_text("libgcrypt") + version = info.get("version") + download = info.get('url').format(version) + name = download.split('/')[-1] + + Runcmd.sendcmd("rm -rf ./resources", workspace=f"{self.__ROOT_PATH}") + Runcmd.sendcmd("mkdir resources", workspace=f"{self.__ROOT_PATH}") + Runcmd.sendcmd("cd resources", workspace=f"{self.__ROOT_PATH}") + Runcmd.sendcmd("mkdir libgcrypt", workspace=f"{self.__ROOT_PATH}/resources") + Runcmd.sendcmd("rm -rf libgpg", workspace=f"{self.__ROOT_PATH}") + Runcmd.sendcmd("mkdir libgpg", workspace=f"{self.__ROOT_PATH}") + with self.__process("安装libgcrypt"): - Runcmd.sendcmd(f"unzip libgpg-error-1.51.zip -d {self.__ROOT_PATH}/libgpg", + Runcmd.sendcmd(f"wget {download} --no-check-certificate", + workspace=f"{self.__ROOT_PATH}/resources/libgcrypt") + Runcmd.sendcmd(f"tar -xvf {name} -C {self.__ROOT_PATH}/libgpg", workspace=f"{self.__ROOT_PATH}/resources/libgcrypt") Runcmd.sendcmd("chmod 777 autogen.sh; ./autogen.sh", workspace=f"{self.__ROOT_PATH}/libgpg/libgpg-error-1.51") @@ -362,7 +376,7 @@ class Installer(object): if not args.ignore: raise e else: - for component in components.split(): + for component in components.split(','): func = self.__function_dict.get(component) if func: try: diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml deleted file mode 100644 index c9f6095..0000000 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - 2.5.0 - https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-ksl-{}-1.aarch64.rpm - - - 2.5.0 - https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-hmpp-{}-1.aarch64.rpm - - - https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/ragel-6.10.tar.gz - https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boost_1_87_0.tar.gz - https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/pcre-8.43.tar.gz - https://gitee.com/kunpengcompute/hyperscan.git - v5.4.2.aarch64 - - - https://gitee.com/kunpengcompute/KAE.git - kae2 - - \ No newline at end of file diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml index 0bb0152..9597ff1 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml @@ -15,9 +15,3 @@ src: "BoostKit-AccLib" dest: "{{ temp_path }}" tags: file_transfer - -- name: "[File] Copy version.xml to remote host" - template: - src: "version.xml.j2" - dest: "{{ temp_path }}/BoostKit-AccLib/scripts/version.xml" - tags: file_transfer diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/templates/version.xml.j2 b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/templates/version.xml.j2 deleted file mode 100644 index eaa3e79..0000000 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/templates/version.xml.j2 +++ /dev/null @@ -1,22 +0,0 @@ - - - - {{ KSL_version }} - https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-ksl-{}-1.aarch64.rpm - - - {{ HMPP_version }} - https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-hmpp-{}-1.aarch64.rpm - - - https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/ragel-6.10.tar.gz - https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boost_1_87_0.tar.gz - https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/pcre-8.43.tar.gz - https://gitee.com/kunpengcompute/hyperscan.git - {{ hyperscan_branch }} - - - https://gitee.com/kunpengcompute/KAE.git - {{ KAE_tag }} - - \ No newline at end of file diff --git a/plugins/boostkit-offline/workspace/source.cfg b/plugins/boostkit-offline/workspace/source.cfg index ced5950..8f319e0 100644 --- a/plugins/boostkit-offline/workspace/source.cfg +++ b/plugins/boostkit-offline/workspace/source.cfg @@ -1,4 +1,4 @@ KSL_version = 2.5.0 -HMPP_version = 2.5.0 Hyperscan_branch = v5.4.2.aarch64 -KAE_tag = kae2 \ No newline at end of file +KAE_tag = kae2 +Libgcrypt_version = 1.51 diff --git a/plugins/boostkit/config.yaml b/plugins/boostkit/config.yaml index f3cc05c..42565b0 100644 --- a/plugins/boostkit/config.yaml +++ b/plugins/boostkit/config.yaml @@ -19,9 +19,6 @@ all: # 可在此包含更多主机 vars: install_list: 'ALL' # 支持使用列表,或者使用逗号分隔的字符串 - KSL_version: 2.5.0 - hyperscan_branch: v5.4.2.aarch64 - KAE_tag: kae2 vars: # 跳过所有基本检查项 skip_check: false -- Gitee From 1e42ad27101527a675f9d6d2121128ec38c4f4e3 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 16:04:08 +0800 Subject: [PATCH 04/25] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=AF=E5=88=A0?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E7=89=88=E6=9C=AC=E9=85=8D=E7=BD=AE=E9=A1=B9?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/boostkit-offline/config.yaml | 3 --- plugins/boostkit/config.yaml | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/boostkit-offline/config.yaml b/plugins/boostkit-offline/config.yaml index f3cc05c..42565b0 100644 --- a/plugins/boostkit-offline/config.yaml +++ b/plugins/boostkit-offline/config.yaml @@ -19,9 +19,6 @@ all: # 可在此包含更多主机 vars: install_list: 'ALL' # 支持使用列表,或者使用逗号分隔的字符串 - KSL_version: 2.5.0 - hyperscan_branch: v5.4.2.aarch64 - KAE_tag: kae2 vars: # 跳过所有基本检查项 skip_check: false diff --git a/plugins/boostkit/config.yaml b/plugins/boostkit/config.yaml index 42565b0..f3cc05c 100644 --- a/plugins/boostkit/config.yaml +++ b/plugins/boostkit/config.yaml @@ -19,6 +19,9 @@ all: # 可在此包含更多主机 vars: install_list: 'ALL' # 支持使用列表,或者使用逗号分隔的字符串 + KSL_version: 2.5.0 + hyperscan_branch: v5.4.2.aarch64 + KAE_tag: kae2 vars: # 跳过所有基本检查项 skip_check: false -- Gitee From c96d7486cb63e946feefb49410308a9aace37edd Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 16:32:02 +0800 Subject: [PATCH 05/25] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E8=84=9A=E6=9C=AC=E5=92=8C=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84=E5=8F=98=E9=87=8F=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要变更: 1. 更改build.sh中的变量名,将$KAE_tag改为$KAE_branch 2. 支持Hyperscan_git和KAE_git配置,并添加默认值定义 3. 在build.sh中增加git克隆Hyperscan和KAE仓库的逻辑 4. 重构source.cfg文件格式,使用引号包裹字符串值,并调整变量顺序 --- plugins/boostkit-offline/workspace/build.sh | 12 +++++++++--- plugins/boostkit-offline/workspace/source.cfg | 10 ++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh index a0279d1..d639a24 100644 --- a/plugins/boostkit-offline/workspace/build.sh +++ b/plugins/boostkit-offline/workspace/build.sh @@ -7,7 +7,7 @@ get_source() { KSL_version=${KSL_version:-"2.5.0"} Hyperscan_branch=${Hyperscan_branch:-"v5.4.2.aarch64"} - KAE_tag=${KAE_tag:-"kae2"} + $KAE_branch=${$KAE_branch:-"kae2"} Libgcrypt_version=${Libgcrypt_version:-"1.51"} KSL_url=${KSL_url:-"https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-ksl-${KSL_version}-1.aarch64.rpm"} @@ -16,8 +16,8 @@ get_source() { pcre_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/pcre-8.43.tar.gz" Libgcrypt_url="https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-${Libgcrypt_version}.tar.gz" - Hyperscan_git="https://gitee.com/kunpengcompute/hyperscan.git" - KAE_git="https://gitee.com/kunpengcompute/KAE.git" + Hyperscan_git=${Hyperscan_git:-"https://gitee.com/kunpengcompute/hyperscan.git"} + KAE_git=${KAE_git:-"https://gitee.com/kunpengcompute/KAE.git"} } download() { @@ -31,6 +31,12 @@ download() { wget --no-check-certificate $pcre_url wget --no-check-certificate $Libgcrypt_url + git clone $Hyperscan_git -b khsel + cp hyperscan/khsel.patch ./ + git checkout $Hyperscan_branch + + git clone $KAE_git -b $KAE_branch --depth=1 + popd } diff --git a/plugins/boostkit-offline/workspace/source.cfg b/plugins/boostkit-offline/workspace/source.cfg index 8f319e0..94215e5 100644 --- a/plugins/boostkit-offline/workspace/source.cfg +++ b/plugins/boostkit-offline/workspace/source.cfg @@ -1,4 +1,6 @@ -KSL_version = 2.5.0 -Hyperscan_branch = v5.4.2.aarch64 -KAE_tag = kae2 -Libgcrypt_version = 1.51 +KSL_version = "2.5.0" +Libgcrypt_version = "1.51" +Hyperscan_git = "https://gitee.com/kunpengcompute/hyperscan.git" +Hyperscan_branch = "v5.4.2.aarch64" +KAE_git = "https://gitee.com/kunpengcompute/KAE.git" +KAE_branch = "kae2" -- Gitee From 046f842dffd11aafa7614e17abc315ad6d336d27 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 16:36:13 +0800 Subject: [PATCH 06/25] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=98=E6=9B=B4=EF=BC=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E6=95=88=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../files/BoostKit-AccLib/scripts/install.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py index 3acf72a..535f608 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py @@ -217,23 +217,6 @@ class Installer(object): Runcmd.sendcmd("mkdir -p build", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") Runcmd.sendcmd("cmake .. && make -j", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}/build") - def __install_compress_decompress_tools(self): - Runcmd.sendcmd("rm -rf ZIP", workspace=f"{self.__ROOT_PATH}") - Runcmd.sendcmd("mkdir ZIP", workspace=f"{self.__ROOT_PATH}") - - with self.__process("安装软算测试工具lzbench"): - Runcmd.sendcmd("git clone https://gitee.com/kunpeng_compute/lzbench.git --depth=1", - workspace=f"{self.__ROOT_PATH}/ZIP") - Runcmd.sendcmd("make -j", workspace=f"{self.__ROOT_PATH}/ZIP/lzbench") - - if "KAE" in str(self.__function_dict.keys()) or "QAT" in str(self.__function_dict.keys()): - with self.__process("安装带宽测试工具"): - Runcmd.sendcmd(f"make platform='{self.__platform}'", - workspace=f"{self.__ROOT_PATH}/resources/bandwidth") - Runcmd.sendcmd(f"cp ./bin/bandwidth {self.__ROOT_PATH}/ZIP", - workspace=f"{self.__ROOT_PATH}/resources/bandwidth") - Runcmd.sendcmd("make clean", workspace=f"{self.__ROOT_PATH}/resources/bandwidth") - def __install_kae_dep(self): with self.__process("安装KAE相关依赖"): Runcmd.sendcmd( @@ -358,8 +341,6 @@ class Installer(object): if "Kunpeng" in res: self.__function_dict["KAE"] = self.__install_kae self.__function_dict["KQMalloc"] = self.__install_kqmalloc - else: - self.__function_dict["SOFT_COMPRESS"] = self.__install_compress_decompress_tools def get_support(self): return ' '.join(self.__function_dict.keys()) -- Gitee From f2d84d936fdd61383e19009acb508f2503f2b668 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 16:57:49 +0800 Subject: [PATCH 07/25] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=95=B4=E7=90=86?= =?UTF-8?q?BoostKit-AccLib=E7=9A=84=E7=BB=84=E4=BB=B6=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在build.sh脚本中新增build_dir函数,用于将下载的组件文件按类别整理到BoostKit-AccLib目录下: 1. 创建Hyperscan目录并复制相关文件 2. 创建KAE目录并复制KAE组件 3. 创建KSL目录并添加rpm包 4. 创建resources目录存放libgcrypt相关资源 --- plugins/boostkit-offline/workspace/build.sh | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh index d639a24..c532f03 100644 --- a/plugins/boostkit-offline/workspace/build.sh +++ b/plugins/boostkit-offline/workspace/build.sh @@ -40,9 +40,34 @@ download() { popd } +build_dir() { + download_dir=$DIR/download + target_dir=$DIR/roles/AccLib/prepare/files/BoostKit-AccLib + + Hyperscan_dir=$target_dir/Hyperscan + mkdir -p $Hyperscan_dir + cp -af $download_dir/boost_*.tar.gz $Hyperscan_dir + cp -af $download_dir/pcre-*.tar.gz $Hyperscan_dir + cp -af $download_dir/ragel-*.tar.gz $Hyperscan_dir + cp -arf $download_dir/hyperscan $Hyperscan_dir + + KAE_dir=$target_dir/KAE + mkdir -p $KAE_dir + cp -arf $download_dir/KAE $KAE_dir + + KSL_dir=$target_dir/KSL + mkdir -p $KSL_dir/rpm + cp -af $download_dir/boostkit-ksl-*.rpm $KSL_dir/rpm + + resources_dir=$target_dir/resources + mkdir -p $resources_dir/libgcrypt + cp -af $download_dir/libgpg-error-*.tar.gz $resources_dir/libgcrypt +} + pushd $DIR get_source() download() +build_dir() popd -- Gitee From eaad6da0714db4c280e65c95f9074c9c6f296f89 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 17:26:08 +0800 Subject: [PATCH 08/25] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=B5=81=E7=A8=8B=E5=B9=B6=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要变更: 1. 移除install.py中所有在线下载和代理检查逻辑 2. 添加patch目录用于存放补丁文件 3. 新增version.xml文件记录离线资源路径 4. 修改libgcrypt安装流程使用本地资源 这些改动使安装过程完全离线化,提高部署可靠性。 --- plugins/boostkit-offline/workspace/build.sh | 4 +++ .../files/BoostKit-AccLib/scripts/install.py | 33 ++----------------- .../files/BoostKit-AccLib/scripts/version.xml | 15 +++++++++ 3 files changed, 22 insertions(+), 30 deletions(-) create mode 100644 plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh index c532f03..b92482a 100644 --- a/plugins/boostkit-offline/workspace/build.sh +++ b/plugins/boostkit-offline/workspace/build.sh @@ -62,6 +62,10 @@ build_dir() { resources_dir=$target_dir/resources mkdir -p $resources_dir/libgcrypt cp -af $download_dir/libgpg-error-*.tar.gz $resources_dir/libgcrypt + + patch_dir=$target_dir/patch + mkdir -p $patch_dir + cp -af $download_dir/*.patch $patch_dir } pushd $DIR diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py index 535f608..aa14afe 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py @@ -77,14 +77,9 @@ class Installer(object): return Runcmd.sendcmd("lscpu | grep 'BIOS Model name:' | awk '{print $NF}'") def __check_env(self): - with self.__process("检查代理"): - Runcmd.sendcmd("curl www.baidu.com") - with self.__process("检查yum源, 并安装必要工具"): Runcmd.sendcmd("yum makecache") - Runcmd.sendcmd("yum install -y git tar gcc gcc-c++ patch") - Runcmd.sendcmd("git config --global https.sslverify false") - Runcmd.sendcmd("git config --global http.sslverify false") + Runcmd.sendcmd("yum install -y tar gcc gcc-c++ patch") def __chech_env_in_profile(self, key, value): libpath = os.getenv(key) @@ -125,15 +120,11 @@ class Installer(object): Runcmd.sendcmd("rm -rf ./KSL", workspace=f"{self.__ROOT_PATH}") Runcmd.sendcmd(f"mkdir -p KSL/rpm", workspace=f"{self.__ROOT_PATH}") - ksl_info = self.__get_element_text("KSL") with self.__process("安装KSL"): res = Runcmd.sendcmd("cat /etc/os-release") name = re.search("NAME=\"(.+)\"", res).group(1) assert name == "openEuler", "仅支持在openEuler上安装" - pkg_version = ksl_info.get("version") - url = ksl_info.get('url').format(pkg_version) - Runcmd.sendcmd(f"wget {url} --no-check-certificate", workspace=f"{self.__ROOT_PATH}/KSL/rpm") Runcmd.sendcmd("rpm -e boostkit-ksl", check=False) Runcmd.sendcmd("rpm -ivh rpm/*.rpm", workspace=f"{self.__ROOT_PATH}/KSL") @@ -146,10 +137,8 @@ class Installer(object): info = self.__get_element_text("Hyperscan") with self.__process("安装ragel"): - download = info.get("ragel") bag = info.get("ragel").split('/')[-1] - Runcmd.sendcmd(f"wget {download} --no-check-certificate", workspace=f"{self.__ROOT_PATH}/Hyperscan") Runcmd.sendcmd(f"tar -zxf {bag}", workspace=f"{self.__ROOT_PATH}/Hyperscan") dir = Runcmd.sendcmd(f"ls | grep ragel | grep -v tar", workspace=f"{self.__ROOT_PATH}/Hyperscan") @@ -158,17 +147,13 @@ class Installer(object): Runcmd.sendcmd(f"ragel -v") with self.__process("安装boost"): - download = info.get("boost") bag = info.get("boost").split('/')[-1] - Runcmd.sendcmd(f"wget {download} --no-check-certificate", workspace=f"{self.__ROOT_PATH}/Hyperscan") Runcmd.sendcmd(f"tar -zxf {bag}", workspace=f"{self.__ROOT_PATH}/Hyperscan") with self.__process("安装pcre"): - download = info.get("pcre") bag = info.get("pcre").split('/')[-1] - Runcmd.sendcmd(f"wget {download} --no-check-certificate", workspace=f"{self.__ROOT_PATH}/Hyperscan") Runcmd.sendcmd(f"tar -zxf {bag}", workspace=f"{self.__ROOT_PATH}/Hyperscan") with self.__process("安装yum依赖包"): @@ -186,19 +171,12 @@ class Installer(object): stdout = Runcmd.sendcmd("lscpu | grep Architecture") platform = "x86" if "x86" in stdout else "arm" download = info.get(f"code_{platform}") - branch = info.get(f"branch_{platform}") dir = download.split('/')[-1].split('.')[0] res = Runcmd.sendcmd("rpm -qa | grep boostkit-ksl") ksl_version = re.search("boostkit-ksl-(\d+.\d+.\d+)", res).group(1) if platform == "arm" and check_version(ksl_version, "2.4.0"): - Runcmd.sendcmd(f"git clone {download} -b khsel", workspace=f"{self.__ROOT_PATH}/Hyperscan") - Runcmd.sendcmd("cp hyperscan/khsel.patch ./", workspace=f"{self.__ROOT_PATH}/Hyperscan") - Runcmd.sendcmd(f"git checkout {branch}", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") - Runcmd.sendcmd(f"mv ../khsel.patch ./", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") - Runcmd.sendcmd(f"git apply khsel.patch", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") - else: - Runcmd.sendcmd(f"git clone {download} -b {branch}", workspace=f"{self.__ROOT_PATH}/Hyperscan") + Runcmd.sendcmd(f"patch -p1 < ../../patch/khsel.patch", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") boost_path = Runcmd.sendcmd("ls | grep boost | grep -v tar", workspace=f"{self.__ROOT_PATH}/Hyperscan") boost_path = f"{self.__ROOT_PATH}/Hyperscan/{boost_path}" @@ -241,10 +219,8 @@ class Installer(object): with self.__process("下载编译KAE源码"): download = info.get("kae_code") - branch = info.get("kae_code_tag") dir = download.split('/')[-1].split('.')[0] - Runcmd.sendcmd(f"git clone {download} -b {branch} --depth=1", workspace=f"{self.__ROOT_PATH}/KAE") Runcmd.sendcmd("bash build.sh cleanup", workspace=f"{self.__ROOT_PATH}/KAE/{dir}") Runcmd.sendcmd("bash build.sh driver", workspace=f"{self.__ROOT_PATH}/KAE/{dir}") Runcmd.sendcmd("bash build.sh uadk", workspace=f"{self.__ROOT_PATH}/KAE/{dir}") @@ -292,8 +268,7 @@ class Installer(object): return info = self.__get_element_text("libgcrypt") - version = info.get("version") - download = info.get('url').format(version) + download = info.get('libgcrypt_url') name = download.split('/')[-1] Runcmd.sendcmd("rm -rf ./resources", workspace=f"{self.__ROOT_PATH}") @@ -305,8 +280,6 @@ class Installer(object): Runcmd.sendcmd("mkdir libgpg", workspace=f"{self.__ROOT_PATH}") with self.__process("安装libgcrypt"): - Runcmd.sendcmd(f"wget {download} --no-check-certificate", - workspace=f"{self.__ROOT_PATH}/resources/libgcrypt") Runcmd.sendcmd(f"tar -xvf {name} -C {self.__ROOT_PATH}/libgpg", workspace=f"{self.__ROOT_PATH}/resources/libgcrypt") Runcmd.sendcmd("chmod 777 autogen.sh; ./autogen.sh", diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml new file mode 100644 index 0000000..004f1d5 --- /dev/null +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml @@ -0,0 +1,15 @@ + + + + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/ragel-6.10.tar.gz + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boost_1_87_0.tar.gz + https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/pcre-8.43.tar.gz + https://gitee.com/kunpengcompute/hyperscan.git + + + https://gitee.com/kunpengcompute/KAE.git + + + https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.51.tar.gz + + \ No newline at end of file -- Gitee From a06a50d3ec26791c2da25d873257c4a323f52e77 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 17:31:24 +0800 Subject: [PATCH 09/25] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbuild.sh=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=B8=AD=E7=9A=84=E5=8F=98=E9=87=8F=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=92=8C=E5=87=BD=E6=95=B0=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要变更: 1. 修正KAE_branch变量引用错误,移除多余的$符号 2. 修复函数调用语法,移除错误的括号 3. 保持代码风格一致 --- plugins/boostkit-offline/workspace/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh index b92482a..717faff 100644 --- a/plugins/boostkit-offline/workspace/build.sh +++ b/plugins/boostkit-offline/workspace/build.sh @@ -7,7 +7,7 @@ get_source() { KSL_version=${KSL_version:-"2.5.0"} Hyperscan_branch=${Hyperscan_branch:-"v5.4.2.aarch64"} - $KAE_branch=${$KAE_branch:-"kae2"} + KAE_branch=${$KAE_branch:-"kae2"} Libgcrypt_version=${Libgcrypt_version:-"1.51"} KSL_url=${KSL_url:-"https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-ksl-${KSL_version}-1.aarch64.rpm"} @@ -70,8 +70,8 @@ build_dir() { pushd $DIR -get_source() -download() -build_dir() +get_source +download +build_dir popd -- Gitee From 74ef96f1d7603d6a51436b4242b66698a452c507 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 17:32:25 +0800 Subject: [PATCH 10/25] =?UTF-8?q?=E4=BF=AE=E5=A4=8DKAE=5Fbranch=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=BC=95=E7=94=A8=E4=B8=AD=E7=9A=84=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在build.sh脚本中修正了KAE_branch变量的引用方式,从错误的${$KAE_branch}改为正确的${KAE_branch} --- plugins/boostkit-offline/workspace/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh index 717faff..974ce64 100644 --- a/plugins/boostkit-offline/workspace/build.sh +++ b/plugins/boostkit-offline/workspace/build.sh @@ -7,7 +7,7 @@ get_source() { KSL_version=${KSL_version:-"2.5.0"} Hyperscan_branch=${Hyperscan_branch:-"v5.4.2.aarch64"} - KAE_branch=${$KAE_branch:-"kae2"} + KAE_branch=${KAE_branch:-"kae2"} Libgcrypt_version=${Libgcrypt_version:-"1.51"} KSL_url=${KSL_url:-"https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-ksl-${KSL_version}-1.aarch64.rpm"} -- Gitee From 666ba71e107319e9806008d9c20f19a73a2aa637 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 18:17:04 +0800 Subject: [PATCH 11/25] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=B5=81=E7=A8=8B=E5=B9=B6=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E7=BD=91=E7=BB=9C=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 在build.sh中添加build_tar函数,将BoostKit-AccLib目录打包为tar.gz格式 2. 修改prepare任务,改为先传输压缩包再解压的方式 3. 移除check任务中对百度网络连通性的检查,因离线环境无需网络检查 --- plugins/boostkit-offline/workspace/build.sh | 7 +++++++ .../roles/AccLib/prepare/tasks/main.yml | 8 +++++++- .../workspace/roles/check/tasks/main.yml | 18 ------------------ 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh index 974ce64..5554678 100644 --- a/plugins/boostkit-offline/workspace/build.sh +++ b/plugins/boostkit-offline/workspace/build.sh @@ -68,10 +68,17 @@ build_dir() { cp -af $download_dir/*.patch $patch_dir } +build_tar() { + pushd $DIR/roles/AccLib/prepare/files + tar -zcvf BoostKit-AccLib.tar.gz BoostKit-AccLib/ + popd +} + pushd $DIR get_source download build_dir +build_tar popd diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml index 9597ff1..3915f5c 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml @@ -12,6 +12,12 @@ - name: "[File] Transfer local file to remote host" copy: - src: "BoostKit-AccLib" + src: "BoostKit-AccLib.tar.gz" + dest: "{{ temp_path }}" + tags: file_transfer + +- name: "[File] Unpack BoostKit-AccLib.tar.gz" + unarchive: + src: "{{ temp_path }}/BoostKit-AccLib.tar.gz" dest: "{{ temp_path }}" tags: file_transfer diff --git a/plugins/boostkit-offline/workspace/roles/check/tasks/main.yml b/plugins/boostkit-offline/workspace/roles/check/tasks/main.yml index c058d64..f378e78 100644 --- a/plugins/boostkit-offline/workspace/roles/check/tasks/main.yml +++ b/plugins/boostkit-offline/workspace/roles/check/tasks/main.yml @@ -25,24 +25,6 @@ check_failed: "{{ check_failed or (cpu_implementer.stdout != '0x48') }}" tags: hardware_check - - name: "[Network] Test connectivity to Baidu using curl" - command: >- - curl -sSf --connect-timeout 5 - -w "HTTP %{http_code}" -o /dev/null - https://www.baidu.com - register: network_test - ignore_errors: yes - changed_when: false - tags: network_check - - - name: "[Network] Record network check result" - set_fact: - check_results: >- - {{ check_results + ['Network test: ' + - (network_test is failed | ternary('Failed', 'Success (' + network_test.stdout + ')'))] }} - check_failed: "{{ check_failed or (network_test is failed) }}" - tags: network_check - - name: "[Python] Validate pip repository accessibility" pip: name: pip -- Gitee From fce3ca78468b33e46a73e55472304b366bc49c82 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 18:28:53 +0800 Subject: [PATCH 12/25] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=B8=AD=E5=86=97=E4=BD=99=E7=9A=84=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E6=B8=85=E7=90=86=E5=92=8C=E5=88=9B=E5=BB=BA=E5=91=BD?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../files/BoostKit-AccLib/scripts/install.py | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py index aa14afe..433c205 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py @@ -117,9 +117,6 @@ class Installer(object): raise e def __install_ksl(self): - Runcmd.sendcmd("rm -rf ./KSL", workspace=f"{self.__ROOT_PATH}") - Runcmd.sendcmd(f"mkdir -p KSL/rpm", workspace=f"{self.__ROOT_PATH}") - with self.__process("安装KSL"): res = Runcmd.sendcmd("cat /etc/os-release") name = re.search("NAME=\"(.+)\"", res).group(1) @@ -131,9 +128,6 @@ class Installer(object): def __install_hyperscan_dep(self): self.__install_ksl() - Runcmd.sendcmd("rm -rf ./Hyperscan", workspace=f"{self.__ROOT_PATH}") - Runcmd.sendcmd(f"mkdir -p Hyperscan/resource", workspace=f"{self.__ROOT_PATH}") - info = self.__get_element_text("Hyperscan") with self.__process("安装ragel"): @@ -214,10 +208,8 @@ class Installer(object): self.__install_kae_dep() info = self.__get_element_text("KAE") - Runcmd.sendcmd("rm -rf ./KAE", workspace=f"{self.__ROOT_PATH}") - Runcmd.sendcmd("mkdir KAE", workspace=f"{self.__ROOT_PATH}") - with self.__process("下载编译KAE源码"): + with self.__process("编译KAE源码"): download = info.get("kae_code") dir = download.split('/')[-1].split('.')[0] @@ -271,14 +263,6 @@ class Installer(object): download = info.get('libgcrypt_url') name = download.split('/')[-1] - Runcmd.sendcmd("rm -rf ./resources", workspace=f"{self.__ROOT_PATH}") - Runcmd.sendcmd("mkdir resources", workspace=f"{self.__ROOT_PATH}") - Runcmd.sendcmd("cd resources", workspace=f"{self.__ROOT_PATH}") - Runcmd.sendcmd("mkdir libgcrypt", workspace=f"{self.__ROOT_PATH}/resources") - - Runcmd.sendcmd("rm -rf libgpg", workspace=f"{self.__ROOT_PATH}") - Runcmd.sendcmd("mkdir libgpg", workspace=f"{self.__ROOT_PATH}") - with self.__process("安装libgcrypt"): Runcmd.sendcmd(f"tar -xvf {name} -C {self.__ROOT_PATH}/libgpg", workspace=f"{self.__ROOT_PATH}/resources/libgcrypt") @@ -298,9 +282,6 @@ class Installer(object): def __install_kqmalloc(self): self.__install_kqmalloc_dep() - Runcmd.sendcmd(f"rm -rf ./KQMalloc", workspace=f"{self.__ROOT_PATH}") - Runcmd.sendcmd(f"mkdir -p KQMalloc/resource", workspace=f"{self.__ROOT_PATH}") - with self.__process("安装kqmalloc"): self.__install_ksl() res = Runcmd.sendcmd("rpm -qa | grep boostkit-ksl") -- Gitee From 8cfd2a75cf74a1e74d2b5d20d1551c84d3554bda Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 18:36:01 +0800 Subject: [PATCH 13/25] =?UTF-8?q?=E4=B8=BAwget=E5=91=BD=E4=BB=A4=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0-N=E5=8F=82=E6=95=B0=E4=BB=A5=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E4=B8=8B=E8=BD=BD=E5=B7=B2=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/boostkit-offline/workspace/build.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh index 5554678..a382acd 100644 --- a/plugins/boostkit-offline/workspace/build.sh +++ b/plugins/boostkit-offline/workspace/build.sh @@ -25,11 +25,11 @@ download() { mkdir $download_dir pushd $download_dir - wget --no-check-certificate $KSL_url - wget --no-check-certificate $ragel_url - wget --no-check-certificate $boost_url - wget --no-check-certificate $pcre_url - wget --no-check-certificate $Libgcrypt_url + wget -N --no-check-certificate $KSL_url + wget -N --no-check-certificate $ragel_url + wget -N --no-check-certificate $boost_url + wget -N --no-check-certificate $pcre_url + wget -N --no-check-certificate $Libgcrypt_url git clone $Hyperscan_git -b khsel cp hyperscan/khsel.patch ./ -- Gitee From 3f40426a0dbe16836355f054271ee50146aa2588 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 18:44:30 +0800 Subject: [PATCH 14/25] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=B8=AD=E7=9A=84hyperscan=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改build.sh脚本,在切换hyperscan分支前先进入对应目录,确保操作在正确路径下执行。同时保持目录堆栈平衡,使用pushd/popd命令对。 --- plugins/boostkit-offline/workspace/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh index a382acd..5c53f4c 100644 --- a/plugins/boostkit-offline/workspace/build.sh +++ b/plugins/boostkit-offline/workspace/build.sh @@ -33,7 +33,9 @@ download() { git clone $Hyperscan_git -b khsel cp hyperscan/khsel.patch ./ + pushd hyperscan git checkout $Hyperscan_branch + popd git clone $KAE_git -b $KAE_branch --depth=1 -- Gitee From 97493c6b5ac132c853893ea2ebd73b1a1b17b236 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 18:58:13 +0800 Subject: [PATCH 15/25] =?UTF-8?q?=E5=9C=A8AccLib=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B8=AD=E6=B7=BB=E5=8A=A0=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=B7=AF=E5=BE=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在execute_install.yml中添加调试信息,在执行安装脚本前显示日志文件路径,方便用户通过tail命令实时查看安装进度。 --- .../workspace/roles/AccLib/install/tasks/execute_install.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/install/tasks/execute_install.yml b/plugins/boostkit-offline/workspace/roles/AccLib/install/tasks/execute_install.yml index d2a4a00..48bff61 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/install/tasks/execute_install.yml +++ b/plugins/boostkit-offline/workspace/roles/AccLib/install/tasks/execute_install.yml @@ -3,6 +3,11 @@ register: timestamp changed_when: false +- name: Show log file path + debug: + msg: "Start executing install script. Use 'tail -f {{ temp_path }}/BoostKit-AccLib/scripts/{{ timestamp.stdout }}.log' to watch process." + tags: install + - name: Execute install script for {{ item }} shell: | python3 install.py --component {{ item }} > {{ temp_path }}/BoostKit-AccLib/scripts/{{ timestamp.stdout }}.log 2>&1 -- Gitee From b4d5d4a8f7a813fafa54a0fbbc960cee779c0239 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 19:13:08 +0800 Subject: [PATCH 16/25] =?UTF-8?q?=E7=A7=BB=E9=99=A4source.cfg=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E4=B8=AD=E9=94=AE=E5=80=BC=E5=AF=B9?= =?UTF-8?q?=E4=B9=8B=E9=97=B4=E7=9A=84=E5=A4=9A=E4=BD=99=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/boostkit-offline/workspace/source.cfg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/boostkit-offline/workspace/source.cfg b/plugins/boostkit-offline/workspace/source.cfg index 94215e5..e913919 100644 --- a/plugins/boostkit-offline/workspace/source.cfg +++ b/plugins/boostkit-offline/workspace/source.cfg @@ -1,6 +1,6 @@ -KSL_version = "2.5.0" -Libgcrypt_version = "1.51" -Hyperscan_git = "https://gitee.com/kunpengcompute/hyperscan.git" -Hyperscan_branch = "v5.4.2.aarch64" -KAE_git = "https://gitee.com/kunpengcompute/KAE.git" -KAE_branch = "kae2" +KSL_version="2.5.0" +Libgcrypt_version="1.51" +Hyperscan_git="https://gitee.com/kunpengcompute/hyperscan.git" +Hyperscan_branch="v5.4.2.aarch64" +KAE_git="https://gitee.com/kunpengcompute/KAE.git" +KAE_branch="kae2" -- Gitee From 885325f809df203c1ff0bf0dbc827ce515dce78d Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 19:23:03 +0800 Subject: [PATCH 17/25] =?UTF-8?q?=E4=B8=BApatch=E5=91=BD=E4=BB=A4=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0-N=E9=80=89=E9=A1=B9=E4=BB=A5=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=E5=B7=B2=E5=BA=94=E7=94=A8=E7=9A=84=E8=A1=A5=E4=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AccLib/prepare/files/BoostKit-AccLib/scripts/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py index 433c205..9de6fd2 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py @@ -170,7 +170,7 @@ class Installer(object): res = Runcmd.sendcmd("rpm -qa | grep boostkit-ksl") ksl_version = re.search("boostkit-ksl-(\d+.\d+.\d+)", res).group(1) if platform == "arm" and check_version(ksl_version, "2.4.0"): - Runcmd.sendcmd(f"patch -p1 < ../../patch/khsel.patch", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") + Runcmd.sendcmd(f"patch -p1 -N < ../../patch/khsel.patch", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") boost_path = Runcmd.sendcmd("ls | grep boost | grep -v tar", workspace=f"{self.__ROOT_PATH}/Hyperscan") boost_path = f"{self.__ROOT_PATH}/Hyperscan/{boost_path}" -- Gitee From a4927066234911d2d91dc9b5701c6098b40cd3ff Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Thu, 8 May 2025 19:36:51 +0800 Subject: [PATCH 18/25] =?UTF-8?q?=E5=BF=BD=E7=95=A5=E5=BA=94=E7=94=A8khsel?= =?UTF-8?q?=E8=A1=A5=E4=B8=81=E6=97=B6=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AccLib/prepare/files/BoostKit-AccLib/scripts/install.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py index 9de6fd2..0b2f68d 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py @@ -170,7 +170,8 @@ class Installer(object): res = Runcmd.sendcmd("rpm -qa | grep boostkit-ksl") ksl_version = re.search("boostkit-ksl-(\d+.\d+.\d+)", res).group(1) if platform == "arm" and check_version(ksl_version, "2.4.0"): - Runcmd.sendcmd(f"patch -p1 -N < ../../patch/khsel.patch", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}") + Runcmd.sendcmd(f"patch -p1 -N < ../../patch/khsel.patch", + workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}", check=False) boost_path = Runcmd.sendcmd("ls | grep boost | grep -v tar", workspace=f"{self.__ROOT_PATH}/Hyperscan") boost_path = f"{self.__ROOT_PATH}/Hyperscan/{boost_path}" -- Gitee From 1dd0f0017adc524747dcde8a3a5481ba58a2e653 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Fri, 9 May 2025 12:09:52 +0800 Subject: [PATCH 19/25] =?UTF-8?q?=E9=87=8D=E6=9E=84AccLib=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E6=B5=81=E7=A8=8B=E5=B9=B6=E4=BC=98=E5=8C=96=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除requirements.txt文件,改为通过pip直接安装依赖 - 重构build.sh脚本,拆分到build/AccLib目录下 - 优化版本XML配置,统一使用libgpg命名 - 修改install.py脚本,适配新的依赖安装方式 - 更新check任务,移除pip源检查 - 调整config.yaml配置,移除pip相关配置项 - 新增BoostKit-AccLib-wheels目录用于存放wheel包 - 优化构建流程,自动下载并安装Python依赖包 --- plugins/boostkit-offline/config.yaml | 8 -- plugins/boostkit-offline/workspace/build.sh | 85 +-------------- .../workspace/build/AccLib/build.sh | 102 ++++++++++++++++++ .../workspace/{ => build/AccLib}/source.cfg | 1 - .../files/BoostKit-AccLib/scripts/install.py | 11 +- .../BoostKit-AccLib/scripts/requirements.txt | 1 - .../files/BoostKit-AccLib/scripts/version.xml | 8 +- .../roles/AccLib/prepare/tasks/main.yml | 10 +- .../workspace/roles/check/tasks/main.yml | 24 +---- 9 files changed, 123 insertions(+), 127 deletions(-) create mode 100644 plugins/boostkit-offline/workspace/build/AccLib/build.sh rename plugins/boostkit-offline/workspace/{ => build/AccLib}/source.cfg (88%) delete mode 100644 plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/requirements.txt diff --git a/plugins/boostkit-offline/config.yaml b/plugins/boostkit-offline/config.yaml index 42565b0..71d23f5 100644 --- a/plugins/boostkit-offline/config.yaml +++ b/plugins/boostkit-offline/config.yaml @@ -5,12 +5,6 @@ all: ansible_port: 22 ansible_user: root ansible_password: "" - # 按实际代理需要添加,添加时删除以下第一行和所需行的井号;如需全局使用代理请移动至 all:vars - #proxy_env: - # http_proxy: - # https_proxy: - # ftp_proxy: - # no_proxy: # 可在此添加更多主机 children: AccLib: @@ -22,8 +16,6 @@ all: vars: # 跳过所有基本检查项 skip_check: false - # pip 源地址,如不涉及 pip 安装可删除此项 - pip_index_url: "https://mirrors.huaweicloud.com/repository/pypi/simple" # 临时文件存放目录 temp_path: /tmp # 跳过 ssh 校验,如需禁用此功能,请删除以下配置项 diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh index 5c53f4c..677ecc9 100644 --- a/plugins/boostkit-offline/workspace/build.sh +++ b/plugins/boostkit-offline/workspace/build.sh @@ -1,86 +1,5 @@ #!/bin/bash -DIR=$(cd `dirname $0/`;pwd) +export DIR=$(cd `dirname $0/`;pwd) -get_source() { - source "$DIR/source.cfg" - - KSL_version=${KSL_version:-"2.5.0"} - Hyperscan_branch=${Hyperscan_branch:-"v5.4.2.aarch64"} - KAE_branch=${KAE_branch:-"kae2"} - Libgcrypt_version=${Libgcrypt_version:-"1.51"} - - KSL_url=${KSL_url:-"https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-ksl-${KSL_version}-1.aarch64.rpm"} - ragel_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/ragel-6.10.tar.gz" - boost_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boost_1_87_0.tar.gz" - pcre_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/pcre-8.43.tar.gz" - Libgcrypt_url="https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-${Libgcrypt_version}.tar.gz" - - Hyperscan_git=${Hyperscan_git:-"https://gitee.com/kunpengcompute/hyperscan.git"} - KAE_git=${KAE_git:-"https://gitee.com/kunpengcompute/KAE.git"} -} - -download() { - download_dir=$DIR/download - mkdir $download_dir - pushd $download_dir - - wget -N --no-check-certificate $KSL_url - wget -N --no-check-certificate $ragel_url - wget -N --no-check-certificate $boost_url - wget -N --no-check-certificate $pcre_url - wget -N --no-check-certificate $Libgcrypt_url - - git clone $Hyperscan_git -b khsel - cp hyperscan/khsel.patch ./ - pushd hyperscan - git checkout $Hyperscan_branch - popd - - git clone $KAE_git -b $KAE_branch --depth=1 - - popd -} - -build_dir() { - download_dir=$DIR/download - target_dir=$DIR/roles/AccLib/prepare/files/BoostKit-AccLib - - Hyperscan_dir=$target_dir/Hyperscan - mkdir -p $Hyperscan_dir - cp -af $download_dir/boost_*.tar.gz $Hyperscan_dir - cp -af $download_dir/pcre-*.tar.gz $Hyperscan_dir - cp -af $download_dir/ragel-*.tar.gz $Hyperscan_dir - cp -arf $download_dir/hyperscan $Hyperscan_dir - - KAE_dir=$target_dir/KAE - mkdir -p $KAE_dir - cp -arf $download_dir/KAE $KAE_dir - - KSL_dir=$target_dir/KSL - mkdir -p $KSL_dir/rpm - cp -af $download_dir/boostkit-ksl-*.rpm $KSL_dir/rpm - - resources_dir=$target_dir/resources - mkdir -p $resources_dir/libgcrypt - cp -af $download_dir/libgpg-error-*.tar.gz $resources_dir/libgcrypt - - patch_dir=$target_dir/patch - mkdir -p $patch_dir - cp -af $download_dir/*.patch $patch_dir -} - -build_tar() { - pushd $DIR/roles/AccLib/prepare/files - tar -zcvf BoostKit-AccLib.tar.gz BoostKit-AccLib/ - popd -} - -pushd $DIR - -get_source -download -build_dir -build_tar - -popd +sh $DIR/build/AccLib/build.sh \ No newline at end of file diff --git a/plugins/boostkit-offline/workspace/build/AccLib/build.sh b/plugins/boostkit-offline/workspace/build/AccLib/build.sh new file mode 100644 index 0000000..02d7130 --- /dev/null +++ b/plugins/boostkit-offline/workspace/build/AccLib/build.sh @@ -0,0 +1,102 @@ +#!/bin/bash + +get_source() { + source "$DIR/source.cfg" + + KSL_version=${KSL_version:-"2.5.0"} + Hyperscan_branch=${Hyperscan_branch:-"v5.4.2.aarch64"} + KAE_branch=${KAE_branch:-"kae2"} + + KSL_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boostkit-ksl-${KSL_version}-1.aarch64.rpm" + ragel_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/ragel-6.10.tar.gz" + boost_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boost_1_87_0.tar.gz" + pcre_url="https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/pcre-8.43.tar.gz" + libgpg_url="https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.51.tar.gz" + + Hyperscan_git=${Hyperscan_git:-"https://gitee.com/kunpengcompute/hyperscan.git"} + KAE_git=${KAE_git:-"https://gitee.com/kunpengcompute/KAE.git"} +} + +download() { + download_dir=$DIR/build/AccLib/download + mkdir $download_dir + pushd $download_dir + + wget -N --no-check-certificate $KSL_url + wget -N --no-check-certificate $ragel_url + wget -N --no-check-certificate $boost_url + wget -N --no-check-certificate $pcre_url + wget -N --no-check-certificate $libgpg_url + + git clone $Hyperscan_git -b khsel + cp hyperscan/khsel.patch ./ + pushd hyperscan + git checkout $Hyperscan_branch + popd + + git clone $KAE_git -b $KAE_branch --depth=1 + + pip download "argparse>=1.4.0" + + popd +} + +build_dir() { + download_dir=$DIR/build/AccLib/download + target_dir=$DIR/roles/AccLib/prepare/files/BoostKit-AccLib + wheel_dir=$DIR/roles/AccLib/prepare/files/BoostKit-AccLib-wheels + + Hyperscan_dir=$target_dir/Hyperscan + mkdir -p $Hyperscan_dir + cp -af $download_dir/boost_*.tar.gz $Hyperscan_dir + cp -af $download_dir/pcre-*.tar.gz $Hyperscan_dir + cp -af $download_dir/ragel-*.tar.gz $Hyperscan_dir + cp -arf $download_dir/hyperscan $Hyperscan_dir + + KAE_dir=$target_dir/KAE + mkdir -p $KAE_dir + cp -arf $download_dir/KAE $KAE_dir + + KSL_dir=$target_dir/KSL + mkdir -p $KSL_dir/rpm + cp -af $download_dir/boostkit-ksl-*.rpm $KSL_dir/rpm + + resources_dir=$target_dir/resources + mkdir -p $resources_dir/libgcrypt + cp -af $download_dir/libgpg-error-*.tar.gz $resources_dir/libgcrypt + + patch_dir=$target_dir/patch + mkdir -p $patch_dir + cp -af $download_dir/*.patch $patch_dir + + mkdir -p $wheel_dir + cp -af $download/*.whl $wheel_dir +} + +edit_xml() { + xml_file=$DIR/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml + + sed -i "s|.*|${ragel_url}|g" $xml_file + sed -i "s|.*|${boost_url}|g" $xml_file + sed -i "s|.*|${pcre_url}|g" $xml_file + sed -i "s|.*|${Hyperscan_git}|g" $xml_file + sed -i "s|.*|${KAE_git}|g" $xml_file + sed -i "s|.*|${libgpg_url}|g" $xml_file +} + + +build_tar() { + pushd $DIR/roles/AccLib/prepare/files + tar -zcvf BoostKit-AccLib.tar.gz BoostKit-AccLib/ + popd +} + +pushd $DIR + +get_source +download +build_dir +edit_xml +build_tar + +popd diff --git a/plugins/boostkit-offline/workspace/source.cfg b/plugins/boostkit-offline/workspace/build/AccLib/source.cfg similarity index 88% rename from plugins/boostkit-offline/workspace/source.cfg rename to plugins/boostkit-offline/workspace/build/AccLib/source.cfg index e913919..de93de1 100644 --- a/plugins/boostkit-offline/workspace/source.cfg +++ b/plugins/boostkit-offline/workspace/build/AccLib/source.cfg @@ -1,5 +1,4 @@ KSL_version="2.5.0" -Libgcrypt_version="1.51" Hyperscan_git="https://gitee.com/kunpengcompute/hyperscan.git" Hyperscan_branch="v5.4.2.aarch64" KAE_git="https://gitee.com/kunpengcompute/KAE.git" diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py index 0b2f68d..80db5b8 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/install.py @@ -162,14 +162,12 @@ class Installer(object): info = self.__get_element_text("Hyperscan") with self.__process("安装Hyperscan"): - stdout = Runcmd.sendcmd("lscpu | grep Architecture") - platform = "x86" if "x86" in stdout else "arm" - download = info.get(f"code_{platform}") + download = info.get("hyperscan_code") dir = download.split('/')[-1].split('.')[0] res = Runcmd.sendcmd("rpm -qa | grep boostkit-ksl") ksl_version = re.search("boostkit-ksl-(\d+.\d+.\d+)", res).group(1) - if platform == "arm" and check_version(ksl_version, "2.4.0"): + if check_version(ksl_version, "2.4.0"): Runcmd.sendcmd(f"patch -p1 -N < ../../patch/khsel.patch", workspace=f"{self.__ROOT_PATH}/Hyperscan/{dir}", check=False) @@ -260,10 +258,11 @@ class Installer(object): print("已经安装了libgpg-error,不用再安装了") return - info = self.__get_element_text("libgcrypt") - download = info.get('libgcrypt_url') + info = self.__get_element_text("Libgcrypt") + download = info.get('libgpg') name = download.split('/')[-1] + Runcmd.sendcmd("mkdir libgpg", workspace=f"{self.__ROOT_PATH}") with self.__process("安装libgcrypt"): Runcmd.sendcmd(f"tar -xvf {name} -C {self.__ROOT_PATH}/libgpg", workspace=f"{self.__ROOT_PATH}/resources/libgcrypt") diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/requirements.txt b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/requirements.txt deleted file mode 100644 index 9a2a89e..0000000 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -argparse>=1.4.0 diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml index 004f1d5..46b3897 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/files/BoostKit-AccLib/scripts/version.xml @@ -4,12 +4,12 @@ https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/ragel-6.10.tar.gz https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/boost_1_87_0.tar.gz https://repo.oepkgs.net/openEuler/rpm/openEuler-24.03-LTS/contrib/oedp/files/pcre-8.43.tar.gz - https://gitee.com/kunpengcompute/hyperscan.git + https://gitee.com/kunpengcompute/hyperscan.git https://gitee.com/kunpengcompute/KAE.git - - https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.51.tar.gz - + + https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.51.tar.gz + \ No newline at end of file diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml index 3915f5c..1d1d487 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml @@ -12,7 +12,9 @@ - name: "[File] Transfer local file to remote host" copy: - src: "BoostKit-AccLib.tar.gz" + src: + - "BoostKit-AccLib.tar.gz" + - "BoostKit-AccLib-wheels" dest: "{{ temp_path }}" tags: file_transfer @@ -21,3 +23,9 @@ src: "{{ temp_path }}/BoostKit-AccLib.tar.gz" dest: "{{ temp_path }}" tags: file_transfer + +- name: "[Dependency] Install all wheel files from BoostKit-AccLib-wheels" + pip: + name: "{{ temp_path }}/BoostKit-AccLib-wheels/*.whl" + state: present + tags: dependency diff --git a/plugins/boostkit-offline/workspace/roles/check/tasks/main.yml b/plugins/boostkit-offline/workspace/roles/check/tasks/main.yml index f378e78..78ab7fe 100644 --- a/plugins/boostkit-offline/workspace/roles/check/tasks/main.yml +++ b/plugins/boostkit-offline/workspace/roles/check/tasks/main.yml @@ -9,7 +9,7 @@ - block: - name: "[Check] Initialize check results" set_fact: - check_results: [ ] + check_results: [] check_failed: "false" - name: "[CPU] Verify Kunpeng-920 processor" @@ -25,28 +25,6 @@ check_failed: "{{ check_failed or (cpu_implementer.stdout != '0x48') }}" tags: hardware_check - - name: "[Python] Validate pip repository accessibility" - pip: - name: pip - extra_args: >- - -i "{{ pip_index_url | default('https://pypi.org/simple', true) }}" - --disable-pip-version-check - --timeout 30 - --retries 2 - state: present - when: pip_index_url is defined - register: pip_validation - ignore_errors: yes - changed_when: false - tags: python_check - - - name: "[Python] Record pip check result" - set_fact: - check_results: "{{ check_results + ['Pip repository: ' + (pip_validation is failed | ternary('Unavailable', 'Available'))] }}" - check_failed: "{{ check_failed or (pip_validation is failed) }}" - when: pip_index_url is defined - tags: python_check - - name: "[Check] Display all check results" debug: msg: "{{ item }}" -- Gitee From 78050780f37e5c6bcb4192acb4674a979a04facc Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Fri, 9 May 2025 14:12:47 +0800 Subject: [PATCH 20/25] =?UTF-8?q?=E6=9B=B4=E6=96=B0AccLib=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E8=84=9A=E6=9C=AC=E4=B8=AD=E7=9A=84source.cfg?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/boostkit-offline/workspace/build/AccLib/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/boostkit-offline/workspace/build/AccLib/build.sh b/plugins/boostkit-offline/workspace/build/AccLib/build.sh index 02d7130..21f3b9b 100644 --- a/plugins/boostkit-offline/workspace/build/AccLib/build.sh +++ b/plugins/boostkit-offline/workspace/build/AccLib/build.sh @@ -1,7 +1,7 @@ #!/bin/bash get_source() { - source "$DIR/source.cfg" + source "$DIR/build/AccLib/source.cfg" KSL_version=${KSL_version:-"2.5.0"} Hyperscan_branch=${Hyperscan_branch:-"v5.4.2.aarch64"} -- Gitee From d69f20c6bc6b86797bec95ea8100ec3fb1c897c4 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Fri, 9 May 2025 15:59:57 +0800 Subject: [PATCH 21/25] =?UTF-8?q?=E4=BC=98=E5=8C=96AccLib=E7=A6=BB?= =?UTF-8?q?=E7=BA=BF=E9=83=A8=E7=BD=B2=E6=B5=81=E7=A8=8B=EF=BC=8C=E6=8B=86?= =?UTF-8?q?=E5=88=86=E6=96=87=E4=BB=B6=E4=BC=A0=E8=BE=93=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=B9=B6=E6=B7=BB=E5=8A=A0=E6=B8=85=E7=90=86=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增清理临时文件和目录的任务,确保部署环境干净 2. 将文件传输任务拆分为两个独立任务: - 单独传输BoostKit-AccLib.tar.gz - 单独传输BoostKit-AccLib-wheels目录 3. 保持原有解压和依赖安装逻辑不变 --- .../roles/AccLib/prepare/tasks/main.yml | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml index 1d1d487..4f8879b 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml @@ -4,6 +4,16 @@ state: present tags: dependency +- name: "[Cleanup] Remove temporary files and directories" + file: + path: "{{ temp_path }}/{{ item }}" + state: absent + loop: + - "BoostKit-AccLib" + - "BoostKit-AccLib.tar.gz" + - "BoostKit-AccLib-wheels" + tags: cleanup + - name: "[File] Ensure destination directory exists" file: path: "{{ temp_path }}" @@ -12,9 +22,7 @@ - name: "[File] Transfer local file to remote host" copy: - src: - - "BoostKit-AccLib.tar.gz" - - "BoostKit-AccLib-wheels" + src: "BoostKit-AccLib.tar.gz" dest: "{{ temp_path }}" tags: file_transfer @@ -24,6 +32,12 @@ dest: "{{ temp_path }}" tags: file_transfer +- name: "[File] Transfer wheels to remote host" + copy: + src: "BoostKit-AccLib-wheels" + dest: "{{ temp_path }}" + tags: file_transfer + - name: "[Dependency] Install all wheel files from BoostKit-AccLib-wheels" pip: name: "{{ temp_path }}/BoostKit-AccLib-wheels/*.whl" -- Gitee From ad28e496529e4f12ea323d84843e1546aa181d27 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Fri, 9 May 2025 16:04:09 +0800 Subject: [PATCH 22/25] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbuild.sh=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=B8=AD=E5=8F=98=E9=87=8F=E5=90=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=EF=BC=8C=E5=B0=86$download=E6=9B=B4=E6=AD=A3=E4=B8=BA$download?= =?UTF-8?q?=5Fdir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/boostkit-offline/workspace/build/AccLib/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/boostkit-offline/workspace/build/AccLib/build.sh b/plugins/boostkit-offline/workspace/build/AccLib/build.sh index 21f3b9b..55b8c02 100644 --- a/plugins/boostkit-offline/workspace/build/AccLib/build.sh +++ b/plugins/boostkit-offline/workspace/build/AccLib/build.sh @@ -70,7 +70,7 @@ build_dir() { cp -af $download_dir/*.patch $patch_dir mkdir -p $wheel_dir - cp -af $download/*.whl $wheel_dir + cp -af $download_dir/*.whl $wheel_dir } edit_xml() { -- Gitee From 1cc869f25a3d63a9188f6f807cab8ed789124abc Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Fri, 9 May 2025 16:13:14 +0800 Subject: [PATCH 23/25] =?UTF-8?q?=E4=BC=98=E5=8C=96AccLib=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=AE=89=E8=A3=85=E4=BB=BB=E5=8A=A1=EF=BC=8C=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E4=BD=BF=E7=94=A8with=5Ffileglob=E5=BE=AA=E7=8E=AF?= =?UTF-8?q?=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workspace/roles/AccLib/prepare/tasks/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml index 4f8879b..70fafff 100644 --- a/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml +++ b/plugins/boostkit-offline/workspace/roles/AccLib/prepare/tasks/main.yml @@ -40,6 +40,8 @@ - name: "[Dependency] Install all wheel files from BoostKit-AccLib-wheels" pip: - name: "{{ temp_path }}/BoostKit-AccLib-wheels/*.whl" + name: "{{ item }}" state: present + with_fileglob: + - "{{ temp_path }}/BoostKit-AccLib-wheels/*.whl" tags: dependency -- Gitee From c2797dd1a10b1f867ae81f5324344a26228b16b1 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Fri, 9 May 2025 16:31:10 +0800 Subject: [PATCH 24/25] =?UTF-8?q?=E4=B8=BAbuild.sh=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=8F=AF=E6=89=A7=E8=A1=8C=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/boostkit-offline/workspace/build.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 plugins/boostkit-offline/workspace/build.sh diff --git a/plugins/boostkit-offline/workspace/build.sh b/plugins/boostkit-offline/workspace/build.sh old mode 100644 new mode 100755 -- Gitee From bd50e465e250c3696148a55b91ae247145b23757 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Fri, 9 May 2025 16:59:44 +0800 Subject: [PATCH 25/25] =?UTF-8?q?=E4=BC=98=E5=8C=96AccLib=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E8=84=9A=E6=9C=AC=EF=BC=8C=E6=B8=85=E7=90=86=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=B9=B6=E7=B2=BE=E7=A1=AE=E6=8B=B7=E8=B4=9Dwheel?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在克隆hyperscan和KAE仓库前添加清理操作,确保目录干净 - 精确指定拷贝argparse相关的wheel文件,避免误拷贝其他whl文件 - 保持构建环境整洁,提高构建可靠性 --- plugins/boostkit-offline/workspace/build/AccLib/build.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/boostkit-offline/workspace/build/AccLib/build.sh b/plugins/boostkit-offline/workspace/build/AccLib/build.sh index 55b8c02..957d3fb 100644 --- a/plugins/boostkit-offline/workspace/build/AccLib/build.sh +++ b/plugins/boostkit-offline/workspace/build/AccLib/build.sh @@ -28,12 +28,14 @@ download() { wget -N --no-check-certificate $pcre_url wget -N --no-check-certificate $libgpg_url + rm -rf hyperscan git clone $Hyperscan_git -b khsel cp hyperscan/khsel.patch ./ pushd hyperscan git checkout $Hyperscan_branch popd + rm -rf KAE git clone $KAE_git -b $KAE_branch --depth=1 pip download "argparse>=1.4.0" @@ -70,7 +72,7 @@ build_dir() { cp -af $download_dir/*.patch $patch_dir mkdir -p $wheel_dir - cp -af $download_dir/*.whl $wheel_dir + cp -af $download_dir/argparse-*.whl $wheel_dir } edit_xml() { -- Gitee