Skip to content

Commit

Permalink
remove RHEL7, CentOS7, and Oracle Linux 7 packages and support (#5271)
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya authored Jul 26, 2024
1 parent fb17e02 commit aa084d4
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 288 deletions.
56 changes: 0 additions & 56 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ dist/docker-%.tar.gz:
${MAKE} build/packages/docker/$*/ubuntu-18.04
${MAKE} build/packages/docker/$*/ubuntu-20.04
${MAKE} build/packages/docker/$*/ubuntu-22.04
${MAKE} build/packages/docker/$*/rhel-7
${MAKE} build/packages/docker/$*/amzn-force
${MAKE} build/packages/docker/$*/rhel-8
mkdir -p dist
curl -L https://github.com/opencontainers/runc/releases/download/v1.0.0-rc95/runc.amd64 > build/packages/docker/$*/runc
Expand Down Expand Up @@ -243,8 +241,6 @@ dist/kubernetes-%.tar.gz:
${MAKE} build/packages/kubernetes/$*/ubuntu-18.04
${MAKE} build/packages/kubernetes/$*/ubuntu-20.04
${MAKE} build/packages/kubernetes/$*/ubuntu-22.04
${MAKE} build/packages/kubernetes/$*/rhel-7
${MAKE} build/packages/kubernetes/$*/rhel-7-force
${MAKE} build/packages/kubernetes/$*/rhel-8
${MAKE} build/packages/kubernetes/$*/rhel-9
cp packages/kubernetes/$*/Manifest build/packages/kubernetes/$*/
Expand Down Expand Up @@ -462,18 +458,6 @@ build/packages/docker/%/ubuntu-20.04:
build/packages/docker/%/ubuntu-22.04:
./bundles/docker-ubuntu2204/build.sh $* `pwd`/build/packages/docker/$*/ubuntu-22.04

build/packages/docker/%/rhel-7:
docker build \
--build-arg DOCKER_VERSION=$* \
-t kurl/rhel-7-docker:$* \
-f bundles/docker-rhel7/Dockerfile \
bundles/docker-rhel7
-docker rm -f docker-rhel7 2>/dev/null
docker create --name docker-rhel7-$* kurl/rhel-7-docker:$*
mkdir -p build/packages/docker/$*/rhel-7
docker cp docker-rhel7-$*:/packages/archives/. build/packages/docker/$*/rhel-7
docker rm docker-rhel7-$*

build/packages/docker/18.09.8/rhel-8:
${MAKE} build/packages/docker/18.09.8/amzn-force

Expand All @@ -483,18 +467,6 @@ build/packages/docker/19.03.4/rhel-8:
build/packages/docker/19.03.10/rhel-8:
${MAKE} build/packages/docker/19.03.10/amzn-force

build/packages/docker/%/amzn-force:
docker build \
--build-arg DOCKER_VERSION=$* \
-t kurl/rhel-7-force-docker:$* \
-f bundles/docker-rhel7-force/Dockerfile \
bundles/docker-rhel7-force
-docker rm -f docker-rhel7-force 2>/dev/null
docker create --name docker-rhel7-force-$* kurl/rhel-7-force-docker:$*
mkdir -p build/packages/docker/$*/rhel-7-force
docker cp docker-rhel7-force-$*:/packages/archives/. build/packages/docker/$*/rhel-7-force
docker rm docker-rhel7-force-$*

build/packages/docker/%/rhel-8:
docker build \
--build-arg DOCKER_VERSION=$* \
Expand Down Expand Up @@ -546,32 +518,6 @@ build/packages/kubernetes/%/ubuntu-22.04:
docker cp k8s-ubuntu2204-$*:/packages/archives/. build/packages/kubernetes/$*/ubuntu-22.04/
docker rm k8s-ubuntu2204-$*

build/packages/kubernetes/%/rhel-7:
docker build \
--build-arg KUBERNETES_VERSION=$* \
--build-arg KUBERNETES_MINOR_VERSION=$(shell echo $* | sed 's/\.[0-9]*$$//') \
-t kurl/rhel-7-k8s:$* \
-f bundles/k8s-rhel7/Dockerfile \
bundles/k8s-rhel7
-docker rm -f k8s-rhel7-$* 2>/dev/null
docker create --name k8s-rhel7-$* kurl/rhel-7-k8s:$*
mkdir -p build/packages/kubernetes/$*/rhel-7
docker cp k8s-rhel7-$*:/packages/archives/. build/packages/kubernetes/$*/rhel-7/
docker rm k8s-rhel7-$*

build/packages/kubernetes/%/rhel-7-force:
docker build \
--build-arg KUBERNETES_VERSION=$* \
--build-arg KUBERNETES_MINOR_VERSION=$(shell echo $* | sed 's/\.[0-9]*$$//') \
-t kurl/rhel-7-force-k8s:$* \
-f bundles/k8s-rhel7-force/Dockerfile \
bundles/k8s-rhel7-force
-docker rm -f k8s-rhel7-force-$* 2>/dev/null
docker create --name k8s-rhel7-force-$* kurl/rhel-7-force-k8s:$*
mkdir -p build/packages/kubernetes/$*/rhel-7-force
docker cp k8s-rhel7-force-$*:/packages/archives/. build/packages/kubernetes/$*/rhel-7-force/
docker rm k8s-rhel7-force-$*

build/packages/kubernetes/%/rhel-8:
docker build \
--build-arg KUBERNETES_VERSION=$* \
Expand Down Expand Up @@ -682,12 +628,10 @@ test: lint vet ## Check the code with linters and vet

.PHONY: docker-test-shell
docker-test-shell: ## Run tests for code in shell but containerized. (Used in build-test github action)
docker build -t kurl-test-shell-rhel-7 -f hack/test-shell/Dockerfile.rhel-7 hack/test-shell
docker build -t kurl-test-shell-rhel-8 -f hack/test-shell/Dockerfile.rhel-8 hack/test-shell
docker build -t kurl-test-shell-rhel-9 -f hack/test-shell/Dockerfile.rhel-9 hack/test-shell
docker build -t kurl-test-shell-ubuntu-20.04 -f hack/test-shell/Dockerfile.ubuntu-20.04 hack/test-shell
docker build -t kurl-test-shell-ubuntu-22.04 -f hack/test-shell/Dockerfile.ubuntu-22.04 hack/test-shell
docker run -i --rm -v `pwd`:/src kurl-test-shell-rhel-7 make /usr/local/bin/shunit2 test-shell
docker run -i --rm -v `pwd`:/src kurl-test-shell-rhel-8 make /usr/local/bin/shunit2 test-shell
docker run -i --rm -v `pwd`:/src kurl-test-shell-rhel-9 make /usr/local/bin/shunit2 test-shell
docker run -i --rm -v `pwd`:/src kurl-test-shell-ubuntu-20.04 make /usr/local/bin/shunit2 test-shell
Expand Down
13 changes: 0 additions & 13 deletions addons/containerd/template/Dockerfile.centos7

This file was deleted.

11 changes: 0 additions & 11 deletions addons/containerd/template/Dockerfile.centos7-force

This file was deleted.

19 changes: 1 addition & 18 deletions addons/containerd/template/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,13 @@ UNSUPPORTED_CONTAINERD_MINORS="01234"

VERSIONS=()
function find_common_versions() {
docker build --no-cache --pull -t centos7 -f Dockerfile.centos7 .
docker build --no-cache --pull -t centos8 -f Dockerfile.centos8 .
docker build --no-cache --pull -t rhel9 -f Dockerfile.rhel9 .
docker build --no-cache --pull -t ubuntu16 -f Dockerfile.ubuntu16 .
docker build --no-cache --pull -t ubuntu18 -f Dockerfile.ubuntu18 .
docker build --no-cache --pull -t ubuntu20 -f Dockerfile.ubuntu20 .
docker build --no-cache --pull -t ubuntu22 -f Dockerfile.ubuntu22 .

CENTOS7_VERSIONS=($(docker run --rm -i centos7 yum list --showduplicates containerd.io | grep -Eo '1\.[[:digit:]]+\.[[:digit:]]+' | grep -vE '1\.['"$UNSUPPORTED_CONTAINERD_MINORS"']\.' | sort -rV | uniq))
echo "Found ${#CENTOS7_VERSIONS[*]} containerd versions for CentOS 7: ${CENTOS7_VERSIONS[*]}"

CENTOS8_VERSIONS=($(docker run --rm -i centos8 yum list --showduplicates containerd.io | grep -Eo '1\.[[:digit:]]+\.[[:digit:]]+' | grep -vE '1\.['"$UNSUPPORTED_CONTAINERD_MINORS"']\.' | sort -rV | uniq))
echo "Found ${#CENTOS8_VERSIONS[*]} containerd versions for CentOS 8: ${CENTOS8_VERSIONS[*]}"

Expand All @@ -183,26 +179,13 @@ function find_common_versions() {
echo "Found ${#UBUNTU22_VERSIONS[*]} containerd versions for Ubuntu 22: ${UBUNTU22_VERSIONS[*]}"

# Get the union of versions available for all operating systems
local ALL_VERSIONS=("${CENTOS7_VERSIONS[@]}" "${CENTOS8_VERSIONS[@]}" "${RHEL9_VERSIONS[@]}" "${UBUNTU16_VERSIONS[@]}" "${UBUNTU18_VERSIONS[@]}" "${UBUNTU20_VERSIONS[@]}" "${UBUNTU22_VERSIONS[@]}")
local ALL_VERSIONS=("${CENTOS8_VERSIONS[@]}" "${RHEL9_VERSIONS[@]}" "${UBUNTU16_VERSIONS[@]}" "${UBUNTU18_VERSIONS[@]}" "${UBUNTU20_VERSIONS[@]}" "${UBUNTU22_VERSIONS[@]}")
ALL_VERSIONS=($(echo "${ALL_VERSIONS[@]}" | tr ' ' '\n' | sort -rV | uniq -d | tr '\n' ' ')) # remove duplicates

for version in ${ALL_VERSIONS[@]}; do
init_preflight_file $version
init_manifest_file $version

if ! contains "$version" ${CENTOS7_VERSIONS[*]}; then
echo "CentOS 7 lacks version $version"
add_unsupported_os_to_preflight_file "$version" "centos" "7"
add_unsupported_os_to_preflight_file "$version" "rhel" "7"
add_unsupported_os_to_preflight_file "$version" "ol" "7"
else
add_supported_os_to_preflight_file "$version" "centos" "7"
add_supported_os_to_preflight_file "$version" "rhel" "7"
add_supported_os_to_preflight_file "$version" "ol" "7"
add_supported_os_to_manifest_file "$version" "rhel-7" "Dockerfile.centos7"
add_supported_os_to_manifest_file "$version" "rhel-7-force" "Dockerfile.centos7-force"
fi

if ! contains "$version" ${CENTOS8_VERSIONS[*]}; then
echo "CentOS 8 lacks version $version"
add_unsupported_os_to_preflight_file "$version" "centos" "8"
Expand Down
117 changes: 0 additions & 117 deletions bin/save-manifest-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,67 +13,6 @@ fi

mkdir -p "$OUT_DIR"

function build_rhel_7() {
local packages=("$@")
local outdir="$OUT_DIR/rhel-7"

mkdir -p "$outdir"

docker rm -f "rhel-7-$PACKAGE_NAME" 2>/dev/null || true
# Use the oldest OS minor version supported to ensure that updates required for outdated
# packages are included.
docker run \
--name "rhel-7-$PACKAGE_NAME" \
centos:7.4.1708 \
/bin/bash -c "\
set -x
yum update -y ca-certificates && \
yum install -y epel-release && \
mkdir -p /packages/archives && \
yumdownloader --installroot=/tmp/empty-directory --releasever=/ --resolve --destdir=/packages/archives -y ${packages[*]}"
sudo docker cp "rhel-7-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}

function build_rhel_7_force() {
local packages=("$@")
local outdir="$OUT_DIR/rhel-7-force"

mkdir -p "$outdir"

docker rm -f "rhel-7-force-$PACKAGE_NAME" 2>/dev/null || true
# Use the oldest OS minor version supported to ensure that updates required for outdated
# packages are included.
docker run \
--name "rhel-7-force-$PACKAGE_NAME" \
centos:7.4.1708 \
/bin/bash -c "\
set -x
yum update -y ca-certificates && \
yum install -y epel-release && \
mkdir -p /packages/archives && \
yumdownloader --resolve --destdir=/packages/archives -y ${packages[*]}"
sudo docker cp "rhel-7-force-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}

function createrepo_rhel_7() {
local outdir=
outdir="$(realpath "$OUT_DIR")/rhel-7"

docker rm -f "rhel-7-createrepo-$PACKAGE_NAME" 2>/dev/null || true
docker run \
--name "rhel-7-createrepo-$PACKAGE_NAME" \
-v "$outdir/archives":/packages/archives \
centos:7.4.1708 \
/bin/bash -c "\
set -x
yum install -y createrepo && \
createrepo /packages/archives"
sudo docker cp "rhel-7-createrepo-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}

function build_rhel_8() {
local packages=("$@")
local outdir="$OUT_DIR/rhel-8"
Expand Down Expand Up @@ -210,44 +149,6 @@ function build_deps_rhel_9() {
mv "$OUT_DIR/rhel-9/Deps.tmp" "$OUT_DIR/rhel-9/Deps"
}

function build_ol_7() {
local packages=("$@")
local outdir="$OUT_DIR/ol-7"

mkdir -p "$outdir"

docker rm -f "ol-7-$PACKAGE_NAME" 2>/dev/null || true
# Use the oldest OS minor version supported to ensure that updates required for outdated
# packages are included.
docker run \
--name "ol-7-$PACKAGE_NAME" \
centos:7.4.1708 \
/bin/bash -c "\
set -x && \
yum-config-manager --add-repo=http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/ && \
mkdir -p /packages/archives && \
yumdownloader --disablerepo=* --enablerepo=public-yum.oracle.com_repo_OracleLinux_OL7_latest_x86_64_ --installroot=/tmp/empty-directory --releasever=/ --resolve --destdir=/packages/archives -y ${packages[*]}"
sudo docker cp "ol-7-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}

function createrepo_ol_7() {
local outdir=
outdir="$(realpath "$OUT_DIR")/ol-7"

docker rm -f "ol-7-createrepo-$PACKAGE_NAME" 2>/dev/null || true
docker run \
--name "ol-7-createrepo-$PACKAGE_NAME" \
-v "$outdir/archives":/packages/archives \
centos:7.4.1708 \
/bin/bash -c "\
set -x
yum install -y createrepo && \
createrepo /packages/archives"
sudo docker cp "ol-7-createrepo-$PACKAGE_NAME":/packages/archives "$outdir"
sudo chown -R $UID "$outdir"
}

function try_5_times() {
local fn="$1"
local args=("${@:2}")
Expand Down Expand Up @@ -409,31 +310,13 @@ while read -r line || [ -n "$line" ]; do
esac
done < "$MANIFEST_PATH"

if [ "${#pkgs_rhel7[@]}" -gt "0" ]; then
build_rhel_7 "${pkgs_rhel7[@]}"
fi
if [ "$(find "$OUT_DIR"/rhel-7/archives/*rpm 2>/dev/null | wc -l)" -gt 0 ]; then
createrepo_rhel_7
fi

if [ "${#pkgs_rhel7[@]}" -gt "0" ]; then
build_rhel_7_force "${pkgs_rhel7[@]}"
fi

if [ "${#pkgs_rhel8[@]}" -gt "0" ]; then
build_rhel_8 "${pkgs_rhel8[@]}"
fi
if [ "$(find "$OUT_DIR"/rhel-8/archives/*rpm 2>/dev/null | wc -l)" -gt 0 ]; then
createrepo_rhel_8
fi

if [ "${#pkgs_ol7[@]}" -gt "0" ]; then
build_ol_7 "${pkgs_ol7[@]}"
fi
if [ "$(find "$OUT_DIR"/ol-7/archives/*rpm 2>/dev/null | wc -l)" -gt 0 ]; then
createrepo_ol_7
fi

build_image_rhel_9 "${pkgs_rhel9[@]}"
if [ "${#pkgs_rhel9[@]}" -gt "0" ]; then
build_rhel_9 "${pkgs_rhel9[@]}"
Expand Down
12 changes: 0 additions & 12 deletions bundles/docker-rhel7-force/Dockerfile

This file was deleted.

14 changes: 0 additions & 14 deletions bundles/docker-rhel7/Dockerfile

This file was deleted.

15 changes: 0 additions & 15 deletions bundles/k8s-rhel7-force/Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions bundles/k8s-rhel7-force/kubernetes.repo

This file was deleted.

15 changes: 0 additions & 15 deletions bundles/k8s-rhel7/Dockerfile

This file was deleted.

7 changes: 0 additions & 7 deletions bundles/k8s-rhel7/kubernetes.repo

This file was deleted.

Loading

0 comments on commit aa084d4

Please sign in to comment.