MDBF-1104 Auto-determine version name of distro upgrade tests - #786
Conversation
|
@grooverdan I'd prefer this format, below is just an example how I imagine it (all the other builders are honoring it):
A very good example already honoring this format is rhel as in: This way we don't need many hardcoded code paths in buildbot. |
|
The symlinks always looked like a hack to me. The use of non-RPM arch names (amd64) and inconsistent version naming makes the repos that end users use requiring manual editing on distro upgrade. The interfaces that I'd like used by users are ones that can be installed ones across distro versions (including upgrades) and arches like:
As its a mature form that I'd like this to continues for end users, I'd like to see our CI environment testing the upgrades like an end users would in their repofiles.
hmm, if Rocky Linux/AlmaLinux where fixed we could just use the |
I understand your concern and I agree with you that we should install / upgrade in the same way a user would do it. This is why I advocate for a two step approach:
|
|
sure, can split tomorrow. |
If they are done like that, the only change needed in this patch is that |
6a2c7f5 to
e23539d
Compare
fbcec67 to
ca9253a
Compare
95dbe59 to
dfaf33c
Compare
|
Lots of bash lib changes so adding @fauust also as co-reviewer. |
| url_path="$ID/$VERSION_ID/$(rpm --eval '%_arch')" | ||
| mirror_url="https://rpm.mariadb.org/$branch/$url_path" | ||
| archive_url="https://archive.mariadb.org/mariadb-$branch/yum/$url_path" |
There was a problem hiding this comment.
Kindly request to evaluate the resulted url_path for all supported distros and compare with our mirrors.
VERSION_ID evaluates to major.minor, at least on rhel.
at mirror/archive only major is present. Example https://mirror.mariadb.org/yum/11.8/rhel/9/x86_64/
e.g.
:~$ docker run -it --platform amd64 --rm quay.io/mariadb-foundation/bb-worker:rhel9-srpm bash -c 'source /etc/os-release && echo "$ID/$VERSION_ID/$(rpm --eval '%_arch')"'
rhel/9.6/x86_64
~$ docker run -it --platform amd64 --rm quay.io/mariadb-foundation/bb-worker:rhel10-srpm bash -c 'source /etc/os-release && echo "$ID/$VERSION_ID/$(rpm --eval '%_arch')"'
rhel/10.0/x86_64
OpenSUSE is a whole different story.
$ docker run -it --platform amd64 --rm quay.io/mariadb-foundation/bb-worker:opensuse1506-srpm bash -c 'source /etc/os-release && echo "$ID/$VERSION_ID/$(rpm --eval '%_arch')"'
opensuse-leap/15.6/x86_64
and on mirror https://mirror.mariadb.org/yum/11.8/opensuse/15.6/x86_64/
| bb_log_warn "Columnstore was not found in packages, the test will not be run" | ||
| exit | ||
| elif [[ $version_name == "sid" ]]; then | ||
| elif [[ $VERSION_CODENAME == "sid" ]]; then |
There was a problem hiding this comment.
I have no idea why
$ docker run -it --platform amd64 --rm debian:sid bash -c 'source /etc/os-release && echo "/$ID/dists/$VERSION_CODENAME"'
/debian/dists/trixieprints trixie so the elif won't work.
dist_name, version_name and arch can now be determined by install/upgrade scripts. By using the /etc/os-version defines consistent across RPM based distros we can obtain the path of install/upgrade tests based on $ID, being the distro and $VERSION_ID, as the release version. For RHEL and derivities/clones the VERSION_ID is of the form X.Y that needs be reduced to just X because of ABI consistency. A single number X is the way its named on our mirrors. For SLES/OpenSUSE without an ABI consistentcy the VERSION_ID of X.Y version is used. Centos and Fedora use a single number version. Debian/Ubuntu no-longer need version_name as /etc/os-release provides VERSION_CODENAME and $(arch), the command rather than env variable, is the architecture.
Without disto/distro_name being passed we'll use the pkg_cmd as the check to see if this is a sles/suse distro.
|
|
||
| source /etc/os-release | ||
|
|
||
| if [ "${PRETTY_NAME##*/}" == "sid" ]; then |
There was a problem hiding this comment.
Are you sure?
$ docker run --rm debian:sid bash -c 'source /etc/os-release && echo $PRETTY_NAME'
Debian GNU/Linux 13 (trixie)There was a problem hiding this comment.
Ah ok, updated image and sid was unlocked. Right.
$ docker run --rm debian:sid bash -c 'cat /etc/os-release'
PRETTY_NAME="Debian GNU/Linux forky/sid"
NAME="Debian GNU/Linux"
VERSION_CODENAME=forky
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"There was a problem hiding this comment.
corrected with explicit sid handling as the VERSION_CODENAME rapidly changes after the release of a stable version.
if [ "${PRETTY_NAME##*/}" == "sid" ]; then
# Sid has the VERSION_CODENAME of the next
# release which isn't useful to us.
VERSION_CODENAME=sid
fi
There was a problem hiding this comment.
That's only the autobake container.
Should discuss with @fauust for a VM update strategy. It involves Ansible but I am not sure it is possible since most of the VM updates require a master-libvirt restart.
There was a problem hiding this comment.
The libvirt restart occurs only in the case of a new VM deployment, see: https://gitlab.com/mariadb/sysadmin/-/blob/main/ansible/roles/bb_worker_vm/tasks/libvirt.yml?ref_type=heads#L29, so updating a VM is an easy task that can be done anytime (unless the queue on BB is going to trigger a VM start).
fauust
left a comment
There was a problem hiding this comment.
Very nice job @grooverdan! Some small comments, see below.
Otherwise previous test would have detected it as missing.
…mirror And this removes a double processing of /etc/os-release
RazvanLiviuVarzaru
left a comment
There was a problem hiding this comment.
Approved from me, thank's a lot @grooverdan for simplifying this.
I can merge it after @fauust approves.

to correct the minor/major upgrade tests from failing with corrected handing of SLES/RPM repos.