Skip to content

Commit

Permalink
Add os pkg for kylin v10 sp3
Browse files Browse the repository at this point in the history
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
  • Loading branch information
ErikJiang committed Jul 10, 2024
1 parent c7d61e3 commit 5b1ea40
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/call-speedup-offline-packags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
file: [ files-amd64, images-amd64, files-arm64, images-arm64, os-pkgs-centos7, os-pkgs-kylinv10, os-pkgs-redhat8, os-pkgs-redhat7 ]
file: [ files-amd64, images-amd64, files-arm64, images-arm64, os-pkgs-centos7, os-pkgs-kylin-v10sp2, os-pkgs-kylin-v10sp3, os-pkgs-redhat8, os-pkgs-redhat7 ]
permissions:
packages: write
contents: read
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/os-pkgs-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
{ "name": "redhat8", "dockerfile":"build/os-packages/Dockerfile.redhat8"},
{ "name": "redhat9", "dockerfile":"build/os-packages/Dockerfile.redhat9"},
{ "name": "rocky9", "dockerfile":"build/os-packages/Dockerfile.rocky9"},
{ "name": "kylinv10", "dockerfile":"build/os-packages/Dockerfile.kylinv10"},
{ "name": "kylin-v10sp2", "dockerfile":"build/os-packages/Dockerfile.kylin-v10sp2"},
{ "name": "kylin-v10sp3", "dockerfile":"build/os-packages/Dockerfile.kylin-v10sp3"},
{ "name": "openeuler22.03", "dockerfile":"build/os-packages/Dockerfile.openeuler22.03"},
{ "name": "oracle8", "dockerfile":"build/os-packages/Dockerfile.oracle8"},
{ "name": "oracle9", "dockerfile":"build/os-packages/Dockerfile.oracle9"},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM openeuler/openeuler:22.03-lts as os-kylinv10
FROM openeuler/openeuler:22.03-lts as os-kylin-v10sp2
ARG OS_VERSION=10
ARG BUILD_TOOLS="dnf-utils dnf-plugins-core createrepo wget"
ARG BUILD_TOOLS="dnf-utils dnf-plugins-core createrepo"

WORKDIR /kylin/${OS_VERSION}/os
COPY build/os-packages/repos/kylin.repo /etc/yum.repos.d/
WORKDIR /kylin/${OS_VERSION}/sp2/os
COPY build/os-packages/repos/kylin.sp2.repo /etc/yum.repos.d/
COPY build/os-packages/packages.yml .
COPY --from=mikefarah/yq:4.30.8 /usr/bin/yq /usr/bin/yq
RUN yq eval '.common[],.yum[],.kylinv10[]' packages.yml > packages.list
RUN yq eval '.common[],.yum[],.kylin[]' packages.yml > packages.list

RUN ARCH=$(uname -m) \
&& dnf install -y ${BUILD_TOOLS} \
Expand All @@ -17,7 +17,7 @@ RUN ARCH=$(uname -m) \
&& createrepo -d ${ARCH}

FROM scratch
COPY --from=os-kylinv10 /kylin /resources/kylin
COPY --from=os-kylin-v10sp2 /kylin /resources/kylin

# One way to make a kylin docker image:
# https://github.com/moby/moby/blob/master/contrib/mkimage-yum.sh
22 changes: 22 additions & 0 deletions build/os-packages/Dockerfile.kylin-v10sp3
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM rockylinux:8 as os-kylin-v10sp3
ARG OS_VERSION=10
ARG BUILD_TOOLS="dnf-utils dnf-plugins-core createrepo"

WORKDIR /kylin/${OS_VERSION}/sp3/os
COPY build/os-packages/repos/kylin.sp3.repo /etc/yum.repos.d/
COPY build/os-packages/packages.yml .
COPY --from=mikefarah/yq:4.30.8 /usr/bin/yq /usr/bin/yq
RUN yq eval '.common[],.yum[],.kylin[]' packages.yml > packages.list

RUN ARCH=$(uname -m) \
&& dnf install -y ${BUILD_TOOLS} \
&& dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo \
&& rm -rf /etc/yum.repos.d/Rocky* && dnf clean all && dnf makecache \
&& while read -r line; do \
dnf install -y --downloadonly --downloaddir=${ARCH} ${line} \
--nobest --allowerasing --setopt=install_weak_deps=False; \
done <<<"$(sort -u packages.list)" \
&& createrepo -d ${ARCH}

FROM scratch
COPY --from=os-kylin-v10sp3 /kylin /resources/kylin
17 changes: 11 additions & 6 deletions build/os-packages/check_rebuild_pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,21 @@ prev_packages_yml=$(git show "${prev_tag}":build/os-packages/packages.yml)

git diff --quiet "${prev_tag}" "${late_tag}" artifacts/import_ospkgs.sh || { echo "true"; exit; }

if [ "${OS_NAME}" == "kylinv10" ]; then
git diff --quiet "${prev_tag}" "${late_tag}" build/os-packages/repos/kylin.repo || { echo "true"; exit; }
if [[ "${OS_NAME}" == "kylin-v10sp2" ]]; then
git diff --quiet "${prev_tag}" "${late_tag}" build/os-packages/repos/kylin.sp2.repo || { echo "true"; exit; }
fi

if [[ "${OS_NAME}" == "kylin-v10sp3" ]]; then
git diff --quiet "${prev_tag}" "${late_tag}" build/os-packages/repos/kylin.sp3.repo || { echo "true"; exit; }
fi

git diff --quiet "${prev_tag}" "${late_tag}" "build/os-packages/Dockerfile.${OS_NAME}" || { echo "true"; exit; }

# centos7 / kylinv10 / redhat7 / redhat8
if [ "${OS_NAME}" == "centos7" ] || [ "${OS_NAME}" == "kylinv10" ] || [ "${OS_NAME}" == "redhat7" ] || [ "${OS_NAME}" == "redhat8" ] || [ "${OS_NAME}" == "oracle8" ] || [ "${OS_NAME}" == "oracle9" ] || [ "${OS_NAME}" == "tencent31" ]; then
late_digest=$(echo "${late_packages_yml}" | yq eval ".common[],.yum[],.${OS_NAME}[]" | sort | sha1sum | awk '{print $1}')
prev_digest=$(echo "${prev_packages_yml}" | yq eval ".common[],.yum[],.${OS_NAME}[]" | sort | sha1sum | awk '{print $1}')
if [[ "${OS_NAME}" == "centos"* ]] || [[ "${OS_NAME}" == "kylin"* ]] || [[ "${OS_NAME}" == "redhat"* ]] || [[ "${OS_NAME}" == "oracle"* ]] || [[ "${OS_NAME}" == "tencent"* ]]; then
os_key="${OS_NAME/-v10sp*/}"
late_digest=$(echo "${late_packages_yml}" | yq eval ".common[],.yum[],.${os_key}[]" | sort | sha1sum | awk '{print $1}')
prev_digest=$(echo "${prev_packages_yml}" | yq eval ".common[],.yum[],.${os_key}[]" | sort | sha1sum | awk '{print $1}')
if [ "${late_digest}" == "${prev_digest}" ]; then
ret=0
wget -c https://github.com/${ORG_NAME}/kubean/releases/download/${prev_tag}/os-pkgs-${OS_NAME}-${prev_tag}.tar.gz -O os-pkgs-${OS_NAME}-${late_tag}.tar.gz || ret=$?
Expand All @@ -41,7 +46,7 @@ if [ "${OS_NAME}" == "centos7" ] || [ "${OS_NAME}" == "kylinv10" ] || [ "${OS_NA
fi

# ubuntu2004 / ubuntu2204
if [ "${OS_NAME}" == "ubuntu2004" ] || [ "${OS_NAME}" == "ubuntu2204" ]; then
if [[ "${OS_NAME}" == "ubuntu"* ]]; then
late_digest=$(echo "${late_packages_yml}" | yq eval ".common[],.apt[],.${OS_NAME}[]" | sort | sha1sum | awk '{print $1}')
prev_digest=$(echo "${prev_packages_yml}" | yq eval ".common[],.apt[],.${OS_NAME}[]" | sort | sha1sum | awk '{print $1}')
if [ "${late_digest}" == "${prev_digest}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion build/os-packages/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rocky9:
- container-selinux
- socat

kylinv10:
kylin:
- container-selinux
- socat
- libselinux-devel
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions build/os-packages/repos/kylin.sp3.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
###Kylin Linux Advanced Server 10 - os repo###

[ks10-adv-os]
name = Kylin Linux Advanced Server 10 - Os
baseurl = https://update.cs2c.com.cn/NS/V10/V10SP3-2403/os/adv/lic/base/$basearch/
enabled = 1
sslverify=0
gpgcheck = 0

[ks10-adv-updates]
name = Kylin Linux Advanced Server 10 - Updates
baseurl = https://update.cs2c.com.cn/NS/V10/V10SP3-2403/os/adv/lic/updates/$basearch/
enabled = 1
sslverify=0
gpgcheck = 0

[ks10-adv-addons]
name = Kylin Linux Advanced Server 10 - Addons
baseurl = https://update.cs2c.com.cn/NS/V10/V10SP3-2403/os/adv/lic/addons/$basearch/
enabled = 0
sslverify=0
gpgcheck = 0
2 changes: 1 addition & 1 deletion hack/download-offline-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ f_files_arm64__tgz=${base_url}/files-arm64-${TAG}.tar.gz
f_images_arm64_tgz=${base_url}/images-arm64-${TAG}.tar.gz
# os pkgs
f_os_centos7=${base_url}/os-pkgs-centos7-${TAG}.tar.gz
f_os_kylin10=${base_url}/os-pkgs-kylinv10-${TAG}.tar.gz
f_os_kylin10=${base_url}/os-pkgs-kylin-v10sp2-${TAG}.tar.gz
f_os_redhat8=${base_url}/os-pkgs-redhat8-${TAG}.tar.gz
f_os_redhat7=${base_url}/os-pkgs-redhat7-${TAG}.tar.gz
# shellcheck disable=SC2206
Expand Down
4 changes: 2 additions & 2 deletions hack/resouce_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -o pipefail
#####################################
source "${REPO_ROOT}"/hack/util.sh

RELEASE_FILE_LIST_PARTNAME=( "files-amd64" "images-amd64" "files-arm64" "images-arm64" "os-pkgs-centos7" "os-pkgs-kylinv10" "os-pkgs-redhat8" "os-pkgs-redhat7" )
RELEASE_FILE_LIST_PARTNAME=( "files-amd64" "images-amd64" "files-arm64" "images-arm64" "os-pkgs-centos7" "os-pkgs-kylin-v10sp2" "os-pkgs-kylin-v10sp3" "os-pkgs-redhat8" "os-pkgs-redhat7" )
KUBEAN_ARTIFACTS_USED_FILE_LIST_PARANAME=("files-amd64" "images-amd64" "os-pkgs-centos7")
BASE_URL="https://files.m.daocloud.io/github.com/kubean-io/kubean/releases/download"

Expand Down Expand Up @@ -403,7 +403,7 @@ function resource::import_os_package_minio(){
if [[ ${test_type} =~ "artifact" ]];then
os_list=("os-pkgs-centos7" )
else
os_list=( "os-pkgs-centos7" "os-pkgs-kylinv10" "os-pkgs-redhat8" "os-pkgs-redhat7" )
os_list=( "os-pkgs-centos7" "os-pkgs-kylin-v10sp2" "os-pkgs-redhat8" "os-pkgs-redhat7" )
fi
for os_name in "${os_list[@]}";do
echo "Import os pkgs to minio: ${os_name}..."
Expand Down

0 comments on commit 5b1ea40

Please sign in to comment.