diff --git a/.github/workflows/call-offline-build.yaml b/.github/workflows/call-offline-build.yaml index ddbbe336d..ddd1b4131 100644 --- a/.github/workflows/call-offline-build.yaml +++ b/.github/workflows/call-offline-build.yaml @@ -37,10 +37,12 @@ jobs: ./artifacts/gen_airgap_crs.py Manifest ./artifacts/gen_airgap_crs.py LocalArtifactSet cp artifacts/import_iso.sh ${KUBEAN_TAG}/ + cp build/os-packages/others/other_os_pkgs.sh ${KUBEAN_TAG}/ pushd ${KUBEAN_TAG} sha256sum localartifactset.cr.yaml >> ../${{ env.SHA256SUM_TXT }} sha256sum import_iso.sh >> ../${{ env.SHA256SUM_TXT }} + sha256sum other_os_pkgs.sh >> ../${{ env.SHA256SUM_TXT }} popd echo "localartifactset cr output:" diff --git a/build/os-packages/others/README.md b/build/os-packages/others/README.md index 609020441..4d0ff7ac5 100644 --- a/build/os-packages/others/README.md +++ b/build/os-packages/others/README.md @@ -9,7 +9,6 @@ Please make sure these tools are installed in your OS environment: ``` bash $ cd /home -$ curl -Lo ./pkgs.yml https://raw.githubusercontent.com/kubean-io/kubean/main/build/os-packages/others/pkgs.yml $ curl -Lo ./other_os_pkgs.sh https://raw.githubusercontent.com/kubean-io/kubean/main/build/os-packages/others/other_os_pkgs.sh && chmod +x other_os_pkgs.sh ``` @@ -19,7 +18,6 @@ Since the build process will download packages, you need to make sure that the n ``` bash $ cd /home -$ export PKGS_YML_PATH=/home/pkgs.yml $ ./other_os_pkgs.sh build ``` @@ -28,7 +26,6 @@ $ ./other_os_pkgs.sh build Prepare the OS package tarball file in advance. ``` bash -$ export PKGS_YML_PATH=/home/pkgs.yml $ export PKGS_TAR_PATH=/home/os-pkgs.tar.gz $ export HOST_IPS='192.168.10.11 192.168.10.12' diff --git a/build/os-packages/others/other_os_pkgs.sh b/build/os-packages/others/other_os_pkgs.sh index 2148f5122..9d548286c 100644 --- a/build/os-packages/others/other_os_pkgs.sh +++ b/build/os-packages/others/other_os_pkgs.sh @@ -8,7 +8,6 @@ DISTRO=${DISTRO:-''} VERSION=${VERSION:-''} ARCH=${ARCH:-''} -PKGS_YML_PATH=${PKGS_YML_PATH:-"pkgs.yml"} PKGS_TAR_PATH=${PKGS_TAR_PATH:-"os-pkgs-${DISTRO}-${VERSION}.tar.gz"} SSH_MODE=${SSH_MODE:-'PWD'} # PWD or KEY @@ -18,6 +17,60 @@ HOST_IPS=${HOST_IPS:-''} REMOTE_REPO_PATH='/home/other_repo' +#===========================# +###### Packages config ###### +#===========================# + +PKGS_YML_CONF=' +yum: + build_tools: + - createrepo + - yum-utils + required_pkgs: + - libselinux-python + - python3-libselinux + - device-mapper-libs + - nss-tools + - conntrack + - container-selinux + - libseccomp + - chrony + - iputils + required_mods: + - container-tools + +apt: + build_tools: + - dpkg-dev + required_pkgs: + - python-apt + - python3-apt + - aufs-tools + - apt-transport-https + - software-properties-common + - conntrack + - apparmor + - libseccomp2 + - ntp + - iputils-ping + +commons: +- openssl +- curl +- rsync +- socat +- unzip +- e2fsprogs +- xfsprogs +- ebtables +- bash-completion +- tar +- ipvsadm +- ipset +- sshpass +' + + #============================# ###### Common Functions ###### #============================# @@ -118,8 +171,8 @@ function get_local_os_release() { function yum_build() { local build_path="/${DISTRO}/${VERSION}/os" - local build_tools=$(cat ${PKGS_YML_PATH} | yq eval '.yum.build_tools[]' | tr '\n' ' ') - local packages=$(cat ${PKGS_YML_PATH} | yq eval '.yum.required_pkgs[],.commons[]' | tr '\n' ' ') + local build_tools=$(echo "${PKGS_YML_CONF}" | yq eval '.yum.build_tools[]' | tr '\n' ' ') + local packages=$(echo "${PKGS_YML_CONF}" | yq eval '.yum.required_pkgs[],.commons[]' | tr '\n' ' ') mkdir -p ${build_path} pushd ${build_path} @@ -146,9 +199,9 @@ function yum_build() { function dnf_build() { local build_path="/${DISTRO}/${VERSION}/os" - local build_tools=$(cat ${PKGS_YML_PATH} | yq eval '.yum.build_tools[]' | tr '\n' ' ') - local packages=$(cat ${PKGS_YML_PATH} | yq eval '.yum.required_pkgs[],.commons[]' | tr '\n' ' ') - local modules=$(cat ${PKGS_YML_PATH} | yq eval '.yum.required_mods[]' | tr '\n' ' ') + local build_tools=$(echo "${PKGS_YML_CONF}" | yq eval '.yum.build_tools[]' | tr '\n' ' ') + local packages=$(echo "${PKGS_YML_CONF}" | yq eval '.yum.required_pkgs[],.commons[]' | tr '\n' ' ') + local modules=$(echo "${PKGS_YML_CONF}" | yq eval '.yum.required_mods[]' | tr '\n' ' ') mkdir -p ${build_path} pushd ${build_path} @@ -183,8 +236,8 @@ function dnf_build() { function apt_build() { local build_path="/${DISTRO}/$(require_arch)/${VERSION}" - local build_tools=$(cat ${PKGS_YML_PATH} | yq eval '.apt.build_tools[]' | tr '\n' ' ') - local packages=$(cat ${PKGS_YML_PATH} | yq eval '.apt.required_pkgs[],.commons[]' | tr '\n' ' ') + local build_tools=$(echo "${PKGS_YML_CONF}" | yq eval '.apt.build_tools[]' | tr '\n' ' ') + local packages=$(echo "${PKGS_YML_CONF}" | yq eval '.apt.required_pkgs[],.commons[]' | tr '\n' ' ') mkdir -p ${build_path} pushd ${build_path} @@ -229,10 +282,6 @@ function Build() { log_erro "Please install the tar command line tool." fi - if [ -z "${PKGS_YML_PATH}" ] || [ ! -f ${PKGS_YML_PATH} ]; then - log_erro "package config: \${PKGS_YML_PATH} should exist." - fi - if [ -z "${DISTRO}" ]; then DISTRO=$(get_local_os_release 'ID') fi @@ -318,7 +367,7 @@ function dnf_install() { local ip=$1 local yum_repos_path='/etc/yum.repos.d' local yum_repo_config='other-extra.repo' - local packages=$(cat ${PKGS_YML_PATH} | yq eval '.yum.required_pkgs[],.commons[]' | tr '\n' ' ') + local packages=$(echo "${PKGS_YML_CONF}" | yq eval '.yum.required_pkgs[],.commons[]' | tr '\n' ' ') remote_exec "${ip}" "mv /etc/yum.repos.d/ /etc/yum.repos.d.bak/ && mkdir -p /etc/yum.repos.d/" # Distribute yum repo configuration @@ -356,7 +405,7 @@ function yum_install() { local ip=$1 local yum_repos_path='/etc/yum.repos.d' local yum_repo_config='other-extra.repo' - local packages=$(cat ${PKGS_YML_PATH} | yq eval '.yum.required_pkgs[],.commons[]' | tr '\n' ' ') + local packages=$(echo "${PKGS_YML_CONF}" | yq eval '.yum.required_pkgs[],.commons[]' | tr '\n' ' ') remote_exec "${ip}" "mv /etc/yum.repos.d/ /etc/yum.repos.d.bak/ && mkdir -p /etc/yum.repos.d/" # Distribute yum repo configuration @@ -385,7 +434,7 @@ EOF function apt_install() { local ip=$1 local apt_repo_path='/etc/apt/sources.list' - local packages=$(cat ${PKGS_YML_PATH} | yq eval '.apt.required_pkgs[],.commons[]' | tr '\n' ' ') + local packages=$(echo "${PKGS_YML_CONF}" | yq eval '.apt.required_pkgs[],.commons[]' | tr '\n' ' ') local extra_repo="deb [trusted=yes] file://${REMOTE_REPO_PATH}/os-pkgs/resources/${DISTRO}/$(require_arch)/${VERSION} ./" local install_failed_list=() @@ -441,10 +490,6 @@ function Install() { if [ -z "${PKGS_TAR_PATH}" ] || [ ! -f ${PKGS_TAR_PATH} ]; then log_erro "Package tar path: \${PKGS_TAR_PATH} should exist." fi - # Check if PKGS_YML_PATH exists - if [ -z "${PKGS_YML_PATH}" ] || [ ! -f ${PKGS_YML_PATH} ]; then - log_erro "Package yml path: \${PKGS_YML_PATH} should exist." - fi # Check if HOST_IPS is empty if [ -z "${HOST_IPS}" ]; then log_erro "Host IPs: \${HOST_IPS} should not be empty." @@ -520,11 +565,9 @@ Commands Examples # Build OS Package - export PKGS_YML_PATH=/home/pkgs.yml ./$cmd build # Install OS Package - export PKGS_YML_PATH=/home/pkgs.yml export PKGS_TAR_PATH=/home/os-pkgs.tar.gz export SSH_USER=root export SSH_CRED=dangerous diff --git a/build/os-packages/others/pkgs.yml b/build/os-packages/others/pkgs.yml deleted file mode 100644 index 3a5c60cdf..000000000 --- a/build/os-packages/others/pkgs.yml +++ /dev/null @@ -1,46 +0,0 @@ -yum: - build_tools: - - createrepo - - yum-utils - required_pkgs: - - libselinux-python - - python3-libselinux - - device-mapper-libs - - nss-tools - - conntrack - - container-selinux - - libseccomp - - chrony - - iputils - required_mods: - - container-tools - -apt: - build_tools: - - dpkg-dev - required_pkgs: - - python-apt - - python3-apt - - aufs-tools - - apt-transport-https - - software-properties-common - - conntrack - - apparmor - - libseccomp2 - - ntp - - iputils-ping - -commons: -- openssl -- curl -- rsync -- socat -- unzip -- e2fsprogs -- xfsprogs -- ebtables -- bash-completion -- tar -- ipvsadm -- ipset -- sshpass diff --git a/version.yml b/version.yml index 3181cf841..f5700a8e5 100644 --- a/version.yml +++ b/version.yml @@ -1,2 +1,2 @@ kubespray_version: 5988ba0890b06fb937070fbeb5059861d301e641 -kubernetes_version: v1.30.4 +kubernetes_version: v1.30.5