Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove support for centos #394

Merged
merged 3 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 4 additions & 39 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ jobs:
source .requirements

# build apisix
make package type=rpm app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=centos image_tag=7
make package type=rpm app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=centos image_tag=8
make package type=rpm app=apisix openresty=apisix-runtime runtime_version=${APISIX_RUNTIME} checkout=${APISIX_TAG_VERSION} version=${APISIX_TAG_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6
mv ./output/apisix-${APISIX_TAG_VERSION}-0.{el7,el8,ubi8.6}.${ARCH}.rpm ${VAR_RPM_WORKBENCH_DIR}
echo "TARGET_APP=apisix" >> "$GITHUB_ENV"
Expand All @@ -86,8 +84,6 @@ jobs:
run: |
# build apisix-base
echo ${{ env.TAG_TYPE }} ${{ env.TAG_VERSION }}
make package type=rpm app=apisix-base checkout=${APISIX_BASE_TAG_VERSION} version=${APISIX_BASE_TAG_VERSION} image_base=centos image_tag=7
make package type=rpm app=apisix-base checkout=${APISIX_BASE_TAG_VERSION} version=${APISIX_BASE_TAG_VERSION} image_base=centos image_tag=8
make package type=rpm app=apisix-base checkout=${APISIX_BASE_TAG_VERSION} version=${APISIX_BASE_TAG_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6
mv ./output/apisix-base-${APISIX_BASE_TAG_VERSION}-0.{el7,el8,ubi8.6}.${ARCH}.rpm ${VAR_RPM_WORKBENCH_DIR}
echo "TARGET_APP=apisix-base" >> "$GITHUB_ENV"
Expand All @@ -99,8 +95,6 @@ jobs:
run: |
# build apisix-runtime
echo ${{ env.TAG_TYPE }} ${{ env.TAG_VERSION }}
make package type=rpm app=apisix-runtime checkout=${APISIX_RUNTIME_TAG_VERSION} version=${APISIX_RUNTIME_TAG_VERSION} image_base=centos image_tag=7
make package type=rpm app=apisix-runtime checkout=${APISIX_RUNTIME_TAG_VERSION} version=${APISIX_RUNTIME_TAG_VERSION} image_base=centos image_tag=8
make package type=rpm app=apisix-runtime checkout=${APISIX_RUNTIME_TAG_VERSION} version=${APISIX_RUNTIME_TAG_VERSION} image_base=registry.access.redhat.com/ubi8/ubi image_tag=8.6
mv ./output/apisix-runtime-${APISIX_RUNTIME_TAG_VERSION}-0.{el7,el8,ubi8.6}.${ARCH}.rpm ${VAR_RPM_WORKBENCH_DIR}
echo "TARGET_APP=apisix-runtime" >> "$GITHUB_ENV"
Expand All @@ -111,8 +105,6 @@ jobs:
APISIX_DASHBOARD_TAG_VERSION: ${{ env.TAG_VERSION }}
run: |
# build apisix dashboard
make package type=rpm app=dashboard checkout=${APISIX_DASHBOARD_TAG_VERSION} version=${APISIX_DASHBOARD_TAG_VERSION} image_base=centos image_tag=7
make package type=rpm app=dashboard checkout=${APISIX_DASHBOARD_TAG_VERSION} version=${APISIX_DASHBOARD_TAG_VERSION} image_base=centos image_tag=8
mv ./output/apisix-dashboard-${APISIX_DASHBOARD_TAG_VERSION}-0.el{7,8}.${ARCH}.rpm ${VAR_RPM_WORKBENCH_DIR}
echo "TARGET_APP=apisix-dashboard" >> "$GITHUB_ENV"

Expand All @@ -130,15 +122,6 @@ jobs:
name: "${{ env.PACKAGE_NAME }}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${{ env.PACKAGE_NAME }}"

- name: Upload apisix Artifact for Centos
if: ${{ env.TAG_TYPE == 'apisix' }}
uses: actions/[email protected]
env:
PACKAGE_NAME: apisix-${{ env.TAG_VERSION }}-0.el7.${{ env.ARCH }}.rpm
with:
name: "${{ env.PACKAGE_NAME }}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${{ env.PACKAGE_NAME }}"

- name: Upload apisix-base Artifact for Redhat
if: ${{ env.TAG_TYPE == 'apisix-base' }}
uses: actions/[email protected]
Expand All @@ -148,15 +131,6 @@ jobs:
name: "${{ env.PACKAGE_NAME }}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${{ env.PACKAGE_NAME }}"

- name: Upload apisix-base Artifact for Centos
if: ${{ env.TAG_TYPE == 'apisix-base' }}
uses: actions/[email protected]
env:
PACKAGE_NAME: apisix-base-${{ env.TAG_VERSION }}-0.el7.${{ env.ARCH }}.rpm
with:
name: "${{ env.PACKAGE_NAME }}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${{ env.PACKAGE_NAME }}"

- name: Upload apisix-runtime Artifact for Redhat
if: ${{ env.TAG_TYPE == 'apisix-runtime' }}
uses: actions/[email protected]
Expand All @@ -166,15 +140,6 @@ jobs:
name: "${{ env.PACKAGE_NAME }}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${{ env.PACKAGE_NAME }}"

- name: Upload apisix-runtime Artifact for Centos
if: ${{ env.TAG_TYPE == 'apisix-runtime' }}
uses: actions/[email protected]
env:
PACKAGE_NAME: apisix-runtime-${{ env.TAG_VERSION }}-0.el7.${{ env.ARCH }}.rpm
with:
name: "${{ env.PACKAGE_NAME }}"
path: "${{ env.VAR_RPM_WORKBENCH_DIR }}/${{ env.PACKAGE_NAME }}"

- name: Upload apisix-dashboard Artifact
if: ${{ env.TAG_TYPE == 'dashboard' }}
uses: actions/[email protected]
Expand All @@ -192,7 +157,7 @@ jobs:
sudo pip install coscmd
sudo -E ./utils/publish-rpm.sh init_cos_utils

- name: RPM repo init for centos and redhat
- name: RPM repo init for redhat
run: |
sudo -E ./utils/publish-rpm.sh repo_init
sudo -E ./utils/publish-rpm.sh repo_clone
Expand All @@ -208,15 +173,15 @@ jobs:
sudo -E ./utils/publish-rpm.sh rpm_gpg_sign
sudo -E ./utils/publish-rpm.sh repo_package_sync

- name: RPM repo backup for centos and redhat
- name: RPM repo backup for redhat
run: |
sudo -E ./utils/publish-rpm.sh repo_backup

- name: RPM repo refresh for centos and redhat
- name: RPM repo refresh for redhat
run: |
sudo -E ./utils/publish-rpm.sh repo_repodata_rebuild
sudo -E ./utils/publish-rpm.sh repo_upload

- name: RPM repo publish for centos and redhat
- name: RPM repo publish for redhat
run: |
sudo -E ./utils/publish-rpm.sh repo_publish
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ version=0
checkout=0
app=0
type=0
image_base="centos"
image_tag="7"
image_base="registry.access.redhat.com/ubi8/ubi"
image_tag="8.6"
iteration=0
local_code_path=0
openresty="apisix-runtime"
Expand Down
19 changes: 0 additions & 19 deletions build-apisix-base-debug-centos7.sh

This file was deleted.

19 changes: 0 additions & 19 deletions build-apisix-runtime-debug-centos7.sh

This file was deleted.

14 changes: 2 additions & 12 deletions dockerfiles/Dockerfile.apisix-base.rpm
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
ARG IMAGE_BASE="centos"
ARG IMAGE_TAG="7"
ARG IMAGE_BASE="registry.access.redhat.com/ubi8/ubi"
ARG IMAGE_TAG="8.6"

FROM ${IMAGE_BASE}:${IMAGE_TAG}

# Note: The duplication around the rpm series dockerfile here
# is used for reuse the container layer cache
RUN if [[ $(rpm --eval '%{centos_ver}') == "8" ]]; then \
sed -re "s/^#?\s*(mirrorlist)/#\1/g" \
-e "s|^#?\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" \
-i /etc/yum.repos.d/CentOS-Linux-*; \
dnf install -y centos-release-stream; \
dnf swap -y centos-{linux,stream}-repos; \
dnf distro-sync -y; \
fi

COPY ./utils/build-common.sh /tmp/build-common.sh
COPY build-apisix-base.sh /tmp/build-apisix-base.sh
Expand Down
16 changes: 2 additions & 14 deletions dockerfiles/Dockerfile.apisix-runtime.rpm
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
ARG IMAGE_BASE="centos"
ARG IMAGE_TAG="7"
ARG IMAGE_BASE="registry.access.redhat.com/ubi8/ubi"
ARG IMAGE_TAG="8.6"

FROM ${IMAGE_BASE}:${IMAGE_TAG}

# Note: The duplication around the rpm series dockerfile here
# is used for reuse the container layer cache
RUN if [[ $(rpm --eval '%{centos_ver}') == "8" ]]; then \
sed -re "s/^#?\s*(mirrorlist)/#\1/g" \
-e "s|^#?\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" \
-i /etc/yum.repos.d/CentOS-Linux-*; \
dnf install -y centos-release-stream; \
dnf swap -y centos-{linux,stream}-repos; \
dnf distro-sync -y; \
fi


WORKDIR /tmp

ARG VERSION
Expand Down
16 changes: 3 additions & 13 deletions dockerfiles/Dockerfile.apisix.rpm
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
ARG IMAGE_BASE="centos"
ARG IMAGE_TAG="7"
ARG IMAGE_BASE="registry.access.redhat.com/ubi8/ubi"
ARG IMAGE_TAG="8.6"

ARG PACKAGE_TYPE
ARG RUNTIME_VERSION

FROM apache/apisix-runtime-${PACKAGE_TYPE}:${RUNTIME_VERSION} AS APISIX-RUNTIME
FROM ${IMAGE_BASE}:${IMAGE_TAG}

# Note: The duplication around the rpm series dockerfile here
# is used for reuse the container layer cache
RUN if [[ $(rpm --eval '%{centos_ver}') == "8" ]]; then \
sed -re "s/^#?\s*(mirrorlist)/#\1/g" \
-e "s|^#?\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" \
-i /etc/yum.repos.d/CentOS-Linux-*; \
dnf install -y centos-release-stream; \
dnf swap -y centos-{linux,stream}-repos; \
dnf distro-sync -y; \
fi

COPY ./utils/install-common.sh /install-common.sh
COPY ./utils/determine-dist.sh /determine-dist.sh
COPY --from=APISIX-RUNTIME /usr/local/openresty /usr/local/openresty
Expand Down
15 changes: 2 additions & 13 deletions dockerfiles/Dockerfile.dashboard.rpm
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
ARG IMAGE_BASE="centos"
ARG IMAGE_TAG="7"
ARG IMAGE_BASE="registry.access.redhat.com/ubi8/ubi"
ARG IMAGE_TAG="8.6"

FROM ${IMAGE_BASE}:${IMAGE_TAG}

# Note: The duplication around the rpm series dockerfile here
# is used for reuse the container layer cache
RUN if [[ $(rpm --eval '%{centos_ver}') == "8" ]]; then \
sed -re "s/^#?\s*(mirrorlist)/#\1/g" \
-e "s|^#?\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" \
-i /etc/yum.repos.d/CentOS-Linux-*; \
dnf install -y centos-release-stream; \
dnf swap -y centos-{linux,stream}-repos; \
dnf distro-sync -y; \
fi

COPY ./utils/install-common.sh /install-common.sh
COPY ./utils/determine-dist.sh /determine-dist.sh

Expand Down
36 changes: 4 additions & 32 deletions utils/build-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,8 @@ ARCH=${ARCH:-`(uname -m | tr '[:upper:]' '[:lower:]')`}
BUILD_PATH=${BUILD_PATH:-`pwd`}

build_apisix_base_rpm() {
if [[ $(rpm --eval '%{centos_ver}') == "7" ]]; then
yum -y install centos-release-scl
yum -y install devtoolset-9 patch wget git make sudo
set +eu
source scl_source enable devtoolset-9
set -eu
elif [[ $(rpm --eval '%{centos_ver}') == "8" ]]; then
dnf install -y gcc-toolset-9-toolchain patch wget git make sudo
dnf install -y yum-utils
set +eu
source /opt/rh/gcc-toolset-9/enable
set -eu
else
dnf install -y yum-utils
yum -y install --disablerepo=* --enablerepo=ubi-8-appstream-rpms --enablerepo=ubi-8-baseos-rpms gcc gcc-c++ patch wget git make sudo xz
fi
dnf install -y yum-utils
yum -y install --disablerepo=* --enablerepo=ubi-8-appstream-rpms --enablerepo=ubi-8-baseos-rpms gcc gcc-c++ patch wget git make sudo xz

command -v gcc
gcc --version
Expand Down Expand Up @@ -69,22 +55,8 @@ build_apisix_base_apk() {
}

build_apisix_runtime_rpm() {
if [[ $(rpm --eval '%{centos_ver}') == "7" ]]; then
yum -y install centos-release-scl
yum -y install devtoolset-9 patch wget git make sudo cpanminus
set +eu
source scl_source enable devtoolset-9
set -eu
elif [[ $(rpm --eval '%{centos_ver}') == "8" ]]; then
dnf install -y gcc-toolset-9-toolchain patch wget git make sudo cpanminus
dnf install -y yum-utils
set +eu
source /opt/rh/gcc-toolset-9/enable
set -eu
else
dnf install -y yum-utils
yum -y install --disablerepo=* --enablerepo=ubi-8-appstream-rpms --enablerepo=ubi-8-baseos-rpms gcc gcc-c++ patch wget git make sudo xz cpanminus
fi
dnf install -y yum-utils
yum -y install --disablerepo=* --enablerepo=ubi-8-appstream-rpms --enablerepo=ubi-8-baseos-rpms gcc gcc-c++ patch wget git make sudo xz cpanminus

command -v gcc
gcc --version
Expand Down
6 changes: 1 addition & 5 deletions utils/determine-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
set -euo pipefail
set -x

dist="el7"
if [ "${IMAGE_BASE}" == "centos" ]
then
dist="el${IMAGE_TAG}"
elif [ "${IMAGE_BASE}" == "ubuntu" ]
if [ "${IMAGE_BASE}" == "ubuntu" ]
then
dist="${IMAGE_BASE}${IMAGE_TAG}"
elif [ "${IMAGE_BASE}" == "debian" ]
Expand Down
14 changes: 0 additions & 14 deletions utils/publish-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ func_cos_utils_credential_init() {
# =======================================
func_repo_init() {
# ${1} - repo workbench path
mkdir -p "${1}"/centos/{7,8}/${ARCH}
mkdir -p "${1}"/redhat/8/${ARCH}
}

Expand Down Expand Up @@ -135,41 +134,28 @@ repo_init)
func_repo_init /tmp
;;
repo_backup)
func_repo_backup "${VAR_COS_BUCKET_REPO}" "centos" "${TAG_DATE}"
func_repo_backup "${VAR_COS_BUCKET_REPO}" "redhat" "${TAG_DATE}"
;;
repo_clone)
func_repo_clone "${VAR_COS_BUCKET_REPO}" "centos" /tmp/centos
func_repo_clone "${VAR_COS_BUCKET_REPO}" "redhat" /tmp/redhat
;;
repo_package_sync)
VAR_REPO_MAJOR_VER=(7 8)
for i in "${VAR_REPO_MAJOR_VER[@]}"; do
find "${VAR_RPM_WORKBENCH_DIR}" -type f -name "*el${i}.${ARCH}.rpm" \
-exec echo "repo sync for: {}" \; \
-exec cp -a {} /tmp/centos/"${i}"/${ARCH} \;
done
find "${VAR_RPM_WORKBENCH_DIR}" -type f -name "*ubi8.6.${ARCH}.rpm" \
-exec echo "repo sync for: {}" \; \
-exec cp -a {} /tmp/redhat/8/${ARCH} \;
;;
repo_repodata_rebuild)
func_repo_repodata_rebuild /tmp/redhat
func_repo_repodata_sign /tmp/redhat
func_repo_repodata_rebuild /tmp/centos
func_repo_repodata_sign /tmp/centos
;;
repo_upload)
func_repo_upload /tmp/redhat "${VAR_COS_BUCKET_CI}" "redhat"
func_repo_upload /tmp/centos "${VAR_COS_BUCKET_CI}" "centos"
;;
repo_publish)
func_repo_publish "${VAR_COS_BUCKET_CI}" "${VAR_COS_BUCKET_REPO}" "redhat"
func_repo_publish "${VAR_COS_BUCKET_CI}" "${VAR_COS_BUCKET_REPO}" "centos"
;;
repo_backup_remove)
func_repo_backup_remove "${VAR_COS_BUCKET_REPO}" "redhat" "${TAG_DATE}"
func_repo_backup_remove "${VAR_COS_BUCKET_REPO}" "centos" "${TAG_DATE}"
;;
rpm_gpg_sign)
func_rpmsign_macros_init
Expand Down
Loading