Skip to content

Commit

Permalink
Bump Fedora to release 35beta
Browse files Browse the repository at this point in the history
* Drop kube version lookup + CRI-O download, these are no-longer
  necessary.  See containers/conmon#299
* Add mlocate-updatedb.timer service to the naughty-list of services
  to disable (they could randomly interfere with testing)
* Cleanup a few misc. problems found when running shellcheck from
  pre-commit hook.
* Only run systemd_banish when building a VM + run it a second time
  during finalization to take care of any evil services pulled in
  by package dep. solving.

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich committed Sep 29, 2021
1 parent a6f8e38 commit 9cb6f3c
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 37 deletions.
17 changes: 16 additions & 1 deletion base_images/fedora_base-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ REPO_DIRPATH=$(realpath "$SCRIPT_DIRPATH/../")
# shellcheck source=./lib.sh
source "$REPO_DIRPATH/lib.sh"

# TODO: Workaround for broken/missing mirrors during beta
if ((OS_RELEASE_VER==35)); then
for filepath in /etc/yum.repos.d/fedora*.repo; do
echo "Warning: Patching $filepath for F35 beta"
sed -i -r \
-e 's/^#(baseurl=.+)/\1/' \
-e 's/^(metalink=.+)/#\1/' \
-e 's/download.example/dl.fedoraproject.org/' \
-e 's/linux\/releases/linux\/development/' \
$filepath
done
fi

# When installing during a container-build, installing anything
# selinux-related will seriously screw up the rest of your day
# with rpm debugging.
Expand All @@ -24,7 +37,9 @@ declare -a PKGS
PKGS=(rng-tools git coreutils)
XSELINUX=
if ((CONTAINER)); then
XSELINUX="--exclude=selinux*"
if ((OS_RELEASE_VER<35)); then
XSELINUX="--exclude=selinux*"
fi
else
PKGS+=(google-compute-engine-tools google-compute-engine-oslogin)
fi
Expand Down
8 changes: 4 additions & 4 deletions base_images/gce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ variables: # Empty value means it must be passed in on command-line
UBUNTU_BASE_IMAGE: 'ubuntu-2104-hirsute-v20210511a'

# Latest Fedora release download URL
FEDORA_IMAGE_URL: "https://dl.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2"
FEDORA_CSUM_URL: "https://dl.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-34-1.2-x86_64-CHECKSUM"
FEDORA_IMAGE_URL: "https://dl.fedoraproject.org/pub/fedora/linux/development/35/Cloud/x86_64/images/Fedora-Cloud-35-x86_64-20210928.n.0-CHECKSUM" # BETA!
FEDORA_CSUM_URL: "https://dl.fedoraproject.org/pub/fedora/linux/development/35/Cloud/x86_64/images/Fedora-Cloud-Base-35-20210928.n.0.x86_64.qcow2" # BETA!

# Prior Fedora release
PRIOR_FEDORA_IMAGE_URL: "https://dl.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-Base-33-1.2.x86_64.qcow2"
PRIOR_FEDORA_CSUM_URL: "https://dl.fedoraproject.org/pub/fedora/linux/releases/33/Cloud/x86_64/images/Fedora-Cloud-33-1.2-x86_64-CHECKSUM"
PRIOR_FEDORA_IMAGE_URL: "https://dl.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.qcow2"
PRIOR_FEDORA_CSUM_URL: "https://dl.fedoraproject.org/pub/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-34-1.2-x86_64-CHECKSUM"


# Don't leak sensitive values in error messages / output
Expand Down
14 changes: 6 additions & 8 deletions cache_images/fedora_packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ INSTALL_PACKAGES=(\
case "$OS_RELEASE_VER" in
32) INSTALL_PACKAGES+=( python3-pytoml ) ;;
33) ;&
34) INSTALL_PACKAGES+=( perl-FindBin python-toml ) ;;
34) ;&
35) INSTALL_PACKAGES+=( perl-FindBin python-toml ) ;;
*) die "Unknown/Unsupported \$OS_REL_VER '$OS_REL_VER'" ;;
esac

Expand All @@ -167,20 +168,19 @@ if ! ((CONTAINER)); then
policycoreutils
)
else
EXARG="--exclude=selinux*"
if [[ "$OS_RELEASE_VER" -lt 35 ]]; then
EXARG="--exclude=selinux*"
fi
fi


# Download these package files, but don't install them; Any tests
# wishing to, may install them using their native tools at runtime.
DOWNLOAD_PACKAGES=(\
"cri-o-$(get_kubernetes_version)*"
cri-tools
"kubernetes-$(get_kubernetes_version)*"
oci-umount
parallel
podman-docker
python3-pytest4
python3-pytest
python3-virtualenv
)

Expand All @@ -189,8 +189,6 @@ bigto $SUDO dnf install -y $EXARG "${INSTALL_PACKAGES[@]}"

if [[ ${#DOWNLOAD_PACKAGES[@]} -gt 0 ]]; then
echo "Downloading packages for optional installation at runtime, as needed."
# Required for cri-o
ooe.sh $SUDO dnf -y module enable cri-o:$(get_kubernetes_version)
$SUDO mkdir -p "$PACKAGE_DOWNLOAD_DIR"
cd "$PACKAGE_DOWNLOAD_DIR"
lilto ooe.sh $SUDO dnf install -y 'dnf-command(download)'
Expand Down
6 changes: 4 additions & 2 deletions cache_images/fedora_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ SCRIPT_FILEPATH=$(realpath "${BASH_SOURCE[0]}")
SCRIPT_DIRPATH=$(dirname "$SCRIPT_FILEPATH")
REPO_DIRPATH=$(realpath "$SCRIPT_DIRPATH/../")

# Run as quickly as possible after boot
/bin/bash $REPO_DIRPATH/systemd_banish.sh
if ! ((CONTAINER)); then
# Run as quickly as possible after boot
/bin/bash $REPO_DIRPATH/systemd_banish.sh
fi

# shellcheck source=./lib.sh
source "$REPO_DIRPATH/lib.sh"
Expand Down
4 changes: 0 additions & 4 deletions get_ci_vm/bad_repo_test/hack/get_ci_vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ cleanup() {
set +e
wait

# set GCLOUD_DEBUG to leave tmpdir behind for postmortem
test -z "$GCLOUD_DEBUG" && rm -rf $TMPDIR

# Not always called from an exit handler, but should always exit when called
exit $RET
}
Expand Down Expand Up @@ -116,7 +113,6 @@ parse_args(){
show_usage "No image-name specified."
fi

ENVS="$ENVS SPECIALMODE=\"$SPECIALMODE\""
SETUP_CMD="env $ENVS $GOSRC/contrib/cirrus/setup.sh"
VMNAME="${VMNAME:-${USER}-${IMAGE_NAME}}"
CREATE_CMD="$PGCLOUD compute instances create --zone=$ZONE --image-project=libpod-218412 --image=${IMAGE_NAME} --custom-cpu=$CPUS --custom-memory=$MEMORY --boot-disk-size=$DISK --labels=in-use-by=$USER $VMNAME"
Expand Down
18 changes: 4 additions & 14 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,6 @@ set_gac_filepath(){
unset GAC_JSON;
}

get_kubernetes_version() {
local KUBERNETES_VERSION
case "$OS_REL_VER" in
fedora-32)
KUBERNETES_VERSION="1.15" ;;
fedora-33)
KUBERNETES_VERSION="1.18" ;;
fedora-34)
KUBERNETES_VERSION="1.20" ;;
*) die "Unknown/Unsupported \$OS_REL_VER '$OS_REL_VER'"
esac
echo "$KUBERNETES_VERSION"
}

# Warning: DO NOT USE the following functions willy-nilly!
# They are only intended to be called by other setup scripts, as the very
# last step during the build process. They're purpose is to "reset" the
Expand Down Expand Up @@ -166,6 +152,10 @@ common_finalize() {
echo -n "" | $SUDO tee /etc/machine-id
$SUDO sync
if ! ((CONTAINER)); then
# Be sure we got everything - dep. resolving may have pulled in more
/bin/bash $(dirname ${BASH_SOURCE[0]})/systemd_banish.sh

# This helps when google goes to compress the image
$SUDO fstrim -av
fi
}
Expand Down
2 changes: 1 addition & 1 deletion podman/fedora_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
34
35
2 changes: 1 addition & 1 deletion podman/prior-fedora_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
33
34
2 changes: 1 addition & 1 deletion skopeo_cidev/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ cd "$REG_GOSRC"
git clone --depth 1 -b "$OSO_TAG" "$OSO_REPO" "$OSO_GOSRC"
cd "$OSO_GOSRC"

# Edit out a "go < 1.5" check which works incorrectly with go 1.10.
# Edit out a "go < 1.5" check which works incorrectly with go >= 1.10.
sed -i -e 's/\[\[ "\${go_version\[2]}" < "go1.5" ]]/false/' ./hack/common.sh

# Fix a bug in 'options' line processing of resolv.conf when an option is
Expand Down
2 changes: 1 addition & 1 deletion systemd_banish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SUDO=""
[[ "$UID" -eq 0 ]] || \
SUDO="sudo"

EVIL_UNITS="cron crond atd apt-daily-upgrade apt-daily fstrim motd-news systemd-tmpfiles-clean update-notifier-download"
EVIL_UNITS="cron crond atd apt-daily-upgrade apt-daily fstrim motd-news systemd-tmpfiles-clean update-notifier-download mlocate-updatedb"

if [[ "$1" == "--list" ]]
then
Expand Down

0 comments on commit 9cb6f3c

Please sign in to comment.