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

[MDBF-800][Postfix] - fix minor upgrade all #596

Merged
merged 10 commits into from
Oct 18, 2024
Merged
1 change: 1 addition & 0 deletions ci_build_images/debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ RUN . /etc/os-release \
libeigen3-dev \
libffi-dev \
libio-socket-ssl-perl \
libmecab-dev \
libnet-ssleay-perl \
libssl-dev \
lsof \
Expand Down
9 changes: 8 additions & 1 deletion master-libvirt/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,14 @@ for builder_name in builders_install:
elif builder_type == "rpm":
factory_install = f_rpm_install
factory_upgrade = f_rpm_upgrade
build_arch = os_name + os_version + "-" + platform
build_arch = os_name + str(os_info[os_info_name]["version_name"]) + "-" + platform

# FIXME - all RPM's should follow the same conventions!
if os_name == "centos" and os_info[os_info_name]["version_name"] >= 9:
if platform == "amd64":
platform = "x86_64"
build_arch = f"centos/{os_info[os_info_name]['version_name']}/{platform}"


c["builders"].append(
util.BuilderConfig(
Expand Down
4 changes: 2 additions & 2 deletions os_info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ openeuler-2403:
- aarch64
type: rpm
opensuse-1505:
version_name: 15.5
version_name: 155
arch:
- amd64
type: rpm
opensuse-1506:
version_name: 15.6
version_name: 156
arch:
- amd64
type: rpm
Expand Down
22 changes: 19 additions & 3 deletions scripts/bash_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,13 @@ rpm_pkg_makecache() {
# Try several times, to avoid sporadic "The requested URL returned error: 404"
made_cache=0
for i in {1..5}; do
sudo rm -rf "/var/cache/$pkg_cmd/*"
sudo "$pkg_cmd" clean all
if [[ $ID_LIKE =~ ^suse* ]]; then
sudo rm -rf "/var/cache/zypp/*"
sudo "$pkg_cmd" clean --all
else
sudo rm -rf "/var/cache/$pkg_cmd/*"
sudo "$pkg_cmd" clean all
fi
source /etc/os-release
if [[ $ID == "rhel" ]]; then
sudo subscription-manager refresh
Expand Down Expand Up @@ -210,7 +215,8 @@ rpm_repoquery() {
set +u
# return full package list from repository
if [[ $ID_LIKE =~ ^suse* ]]; then
zypper packages -r "${repo_name}" | grep "MariaDB" | awk '{print $8}'
sudo zypper --gpg-auto-import-keys packages -r "${repo_name}">/dev/null
fauust marked this conversation as resolved.
Show resolved Hide resolved
zypper packages -r "${repo_name}" | grep "MariaDB" | awk '{print $4}' #After cache is made, no need for sudo
else
repoquery --disablerepo=* --enablerepo="${repo_name}" -a -q |
cut -d ":" -f1 | sort -u | sed 's/-0//'
Expand Down Expand Up @@ -571,6 +577,16 @@ check_upgraded_versions() {
# when legitimate changes in dependencies happen between minor versions.
# The adjustments should be done to .cmp files, and removed after the release
#

# Remove after Q4 2024 release
sed -i '/libaio.so/d;liburing.so/d' ./reqs-*.cmp
sed -i '/libaio.so/d;liburing.so/d' ./ldd-*.cmp
sed -i '/lsof/d' ./reqs-*.cmp

#Account for mariadb-plugin-mroonga diffs in Debian-11
sed -i '/liblz4-1/d' ./reqs-*.cmp
sed -i '/liblz4.so.1/d' ./ldd-*.cmp

# End of temporary adjustments

set -o pipefail
Expand Down
10 changes: 5 additions & 5 deletions scripts/deb-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ get_packages_file_mirror() {
set -u
if ! wget "$baseurl/$dist_name/dists/$version_name/main/binary-$(deb_arch)/Packages"
then
bb_log_err "Could not find the 'Packages' file for a previous version."
bb_log_err "Could not find the 'Packages' file for $dist_name $version_name on deb|archive.mariadb.org."
exit 1
fi
set +u
Expand All @@ -50,10 +50,10 @@ case $test_mode in
if grep -qi columnstore Packages; then
bb_log_warn "due to MCOL-4120 (Columnstore leaves the server shut down) and other bugs Columnstore upgrade is tested separately"
fi
package_list=$(grep "^Package:" Packages | grep -vE 'galera|spider|columnstore' | awk '{print $2}' | sort | uniq | xargs)
package_list=$(grep "^Package:" Packages | grep -vE 'galera|spider|columnstore' | awk '{print $2}' | sort -u | xargs)
if grep -qi spider Packages; then
bb_log_warn "due to MDEV-14622 Spider will be installed separately after the server"
spider_package_list=$(grep "^Package:" Packages | grep 'spider' | awk '{print $2}' | sort | uniq | xargs)
spider_package_list=$(grep "^Package:" Packages | grep 'spider' | awk '{print $2}' | sort -u | xargs)
fi
if grep -si tokudb Packages; then
# For the sake of installing TokuDB, disable hugepages
Expand All @@ -75,7 +75,7 @@ case $test_mode in
bb_log_warn "Columnstore isn't necessarily built on Sid, the test will be skipped"
exit
fi
package_list="mariadb-server "$(grep "^Package:" Packages | grep 'columnstore' | awk '{print $2}' | sort | uniq | xargs)
package_list="mariadb-server "$(grep "^Package:" Packages | grep 'columnstore' | awk '{print $2}' | sort -u | xargs)
;;
*)
bb_log_err "unknown test mode: $test_mode"
Expand Down Expand Up @@ -233,7 +233,7 @@ store_mariadb_server_info new
# //TEMP what needs to be done here?
# # Dependency information for new binaries/libraries
# set +x
# for i in $(sudo which mysqld | sed -e 's/mysqld$/mysql\*/') $(which mysql | sed -e 's/mysql$/mysql\*/') $(dpkg-query -L $(dpkg -l | grep mariadb | awk '{print $2}' | xargs) | grep -v 'mysql-test' | grep -v '/debug/' | grep '/plugin/' | sed -e 's/[^\/]*$/\*/' | sort | uniq | xargs); do
# for i in $(sudo which mysqld | sed -e 's/mysqld$/mysql\*/') $(which mysql | sed -e 's/mysql$/mysql\*/') $(dpkg-query -L $(dpkg -l | grep mariadb | awk '{print $2}' | xargs) | grep -v 'mysql-test' | grep -v '/debug/' | grep '/plugin/' | sed -e 's/[^\/]*$/\*/' | sort -u | xargs); do
# echo "=== $i"
# ldd $i | sort | sed 's/(.*)//'
# done >/home/buildbot/ldd.new
Expand Down
16 changes: 11 additions & 5 deletions scripts/rpm-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,16 @@ bb_log_info "Package_list: $package_list"
# sudo rm -rf
# /etc/zypp/repos.d/SUSE_Linux_Enterprise_Server_12_SP3_x86_64:SLES12-SP3-Updates.repo
# /etc/zypp/repos.d/SUSE_Linux_Enterprise_Server_12_SP3_x86_64:SLES12-SP3-Pool.repo
sudo "$pkg_cmd" clean all
if [[ $ID_LIKE =~ ^suse* ]]; then
sudo "$pkg_cmd" clean --all
pkg_cmd_nonint="-n"
else
sudo "$pkg_cmd" clean all
pkg_cmd_nonint="-y"
RazvanLiviuVarzaru marked this conversation as resolved.
Show resolved Hide resolved
fi

# Install previous release
echo "$package_list" | xargs sudo "$pkg_cmd" -y install ||
echo "$package_list" | xargs sudo "$pkg_cmd" "$pkg_cmd_nonint" install ||
bb_log_err "installation of a previous release failed, see the output above"
#fi

Expand Down Expand Up @@ -246,18 +252,18 @@ fi
if [[ $test_type == "major" ]]; then
bb_log_info "remove old packages for major upgrade"
packages_to_remove=$(rpm -qa | grep 'MariaDB-' | awk -F'-' '{print $1"-"$2}')
echo "$packages_to_remove" | xargs sudo "$pkg_cmd" -y remove
echo "$packages_to_remove" | xargs sudo "$pkg_cmd" "$pkg_cmd_nonint" remove
rpm -qa | grep -iE 'maria|mysql' || true
fi

rpm_setup_bb_galera_artifacts_mirror
rpm_setup_bb_artifacts_mirror
if [[ $test_type == "major" ]]; then
# major upgrade (remove then install)
echo "$package_list" | xargs sudo "$pkg_cmd" -y install
echo "$package_list" | xargs sudo "$pkg_cmd" "$pkg_cmd_nonint" install
else
# minor upgrade (upgrade works)
echo "$package_list" | xargs sudo "$pkg_cmd" -y upgrade
echo "$package_list" | xargs sudo "$pkg_cmd" "$pkg_cmd_nonint" upgrade
fi
# set +e

Expand Down
10 changes: 9 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,15 @@ def hasCompat(step):
# For s390x and the listed distros there are no compat files
if any(
builderName.find(sub) != -1
for sub in {"s390x", "fedora", "alma", "rocky", "openeuler", "suse15", "sles15"}
for sub in {
"s390x",
"fedora",
"alma",
"rocky",
"openeuler",
"suse-15",
"sles-15",
}
):
return False
if "rhel" in builderName or "centos" in builderName:
Expand Down