Skip to content

Commit dfaf33c

Browse files
committed
MDBF-1104 Auto-determine version name of distro upgrade tests
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, the distro and $VERSION_ID, the release version 8, 9, 10 for RHEL and derivities/clones, and 44 for Fedora. 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.
1 parent 5abcd82 commit dfaf33c

7 files changed

Lines changed: 23 additions & 78 deletions

File tree

master-libvirt/master.cfg

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ def getRpmUpgradeStep():
4343
env=envFromProperties(
4444
[
4545
"BB_CI",
46-
"arch",
4746
"artifactsURL",
4847
"branch",
49-
"dist_name",
5048
"is_main_tree",
5149
"major_version",
5250
"mariadb_version",
@@ -56,7 +54,6 @@ def getRpmUpgradeStep():
5654
"systemdCapability",
5755
"test_mode",
5856
"test_type",
59-
"version_name",
6057
]
6158
),
6259
command=["./rpm-upgrade.sh"],
@@ -72,10 +69,8 @@ def getRpmInstallStep():
7269
env=envFromProperties(
7370
[
7471
"BB_CI",
75-
"arch",
7672
"artifactsURL",
7773
"branch",
78-
"dist_name",
7974
"major_version",
8075
"mariadb_version",
8176
"master_branch",
@@ -84,7 +79,6 @@ def getRpmInstallStep():
8479
"systemdCapability",
8580
"test_mode",
8681
"test_type",
87-
"version_name",
8882
]
8983
),
9084
command=["./rpm-install.sh"],
@@ -100,10 +94,8 @@ def getDebUpgradeStep():
10094
env=envFromProperties(
10195
[
10296
"BB_CI",
103-
"arch",
10497
"artifactsURL",
10598
"branch",
106-
"dist_name",
10799
"major_version",
108100
"mariadb_version",
109101
"master_branch",
@@ -112,7 +104,6 @@ def getDebUpgradeStep():
112104
"systemdCapability",
113105
"test_mode",
114106
"test_type",
115-
"version_name",
116107
]
117108
),
118109
command=["./deb-upgrade.sh"],
@@ -128,10 +119,8 @@ def getDebInstallStep():
128119
env=envFromProperties(
129120
[
130121
"BB_CI",
131-
"arch",
132122
"artifactsURL",
133123
"branch",
134-
"dist_name",
135124
"major_version",
136125
"mariadb_version",
137126
"master_branch",
@@ -140,7 +129,6 @@ def getDebInstallStep():
140129
"systemdCapability",
141130
"test_mode",
142131
"test_type",
143-
"version_name",
144132
]
145133
),
146134
command=["./deb-install.sh"],
@@ -243,19 +231,9 @@ for builder_name in BUILDERS_INSTALL:
243231
if builder_type == "deb":
244232
factory_install = f_deb_install
245233
factory_upgrade = f_deb_upgrade
246-
build_arch = platform
247234
elif builder_type == "rpm":
248235
factory_install = f_rpm_install
249236
factory_upgrade = f_rpm_upgrade
250-
build_arch = (
251-
os_name + str(OS_INFO[os_info_name]["version_name"]) + "-" + platform
252-
)
253-
254-
# FIXME - all RPM's should follow the same conventions!
255-
if os_name == "centos" and OS_INFO[os_info_name]["version_name"] >= 9:
256-
if platform == "amd64":
257-
platform = "x86_64"
258-
build_arch = f"centos/{OS_INFO[os_info_name]['version_name']}/{platform}"
259237

260238
c["builders"].append(
261239
util.BuilderConfig(
@@ -268,9 +246,6 @@ for builder_name in BUILDERS_INSTALL:
268246
properties={
269247
"systemdCapability": "yes",
270248
"needsGalera": "yes",
271-
"dist_name": os_name,
272-
"version_name": OS_INFO[os_info_name]["version_name"],
273-
"arch": build_arch,
274249
"BB_CI": True,
275250
"artifactsURL": artifactsURL,
276251
},
@@ -292,9 +267,6 @@ for builder_name in BUILDERS_INSTALL:
292267
properties={
293268
"systemdCapability": "yes",
294269
"needsGalera": "yes",
295-
"dist_name": os_name,
296-
"version_name": OS_INFO[os_info_name]["version_name"],
297-
"arch": build_arch,
298270
"test_mode": "server",
299271
"test_type": "major",
300272
"BB_CI": True,
@@ -318,9 +290,6 @@ for builder_name in BUILDERS_INSTALL:
318290
properties={
319291
"systemdCapability": "yes",
320292
"needsGalera": "yes",
321-
"dist_name": os_name,
322-
"version_name": OS_INFO[os_info_name]["version_name"],
323-
"arch": build_arch,
324293
"test_mode": "all",
325294
"test_type": "minor",
326295
"BB_CI": True,
@@ -342,9 +311,6 @@ for builder_name in BUILDERS_INSTALL:
342311
properties={
343312
"systemdCapability": "yes",
344313
"needsGalera": "no",
345-
"dist_name": os_name,
346-
"version_name": OS_INFO[os_info_name]["version_name"],
347-
"arch": build_arch,
348314
"test_mode": "columnstore",
349315
"test_type": "minor",
350316
"BB_CI": True,

os_info.yaml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
almalinux-8:
33
image_tag: almalinux8
4-
version_name: 8
54
tags:
65
- release_packages
76
arch:
@@ -12,7 +11,6 @@ almalinux-8:
1211
install_only: True
1312
almalinux-9:
1413
image_tag: almalinux9
15-
version_name: 9
1614
tags:
1715
- release_packages
1816
arch:
@@ -23,7 +21,6 @@ almalinux-9:
2321
install_only: True
2422
almalinux-10:
2523
image_tag: almalinux10
26-
version_name: 10
2724
tags:
2825
- release_packages
2926
arch:
@@ -34,7 +31,6 @@ almalinux-10:
3431
install_only: True
3532
centos-stream9:
3633
image_tag: centosstream9
37-
version_name: 9
3834
tags:
3935
- release_packages
4036
arch:
@@ -44,7 +40,6 @@ centos-stream9:
4440
type: rpm
4541
centos-stream10:
4642
image_tag: centosstream10
47-
version_name: 10
4843
tags:
4944
- release_packages
5045
- bleeding-edge
@@ -55,7 +50,6 @@ centos-stream10:
5550
type: rpm
5651
debian-11:
5752
image_tag: debian11
58-
version_name: bullseye
5953
tags:
6054
- release_packages
6155
arch:
@@ -64,7 +58,6 @@ debian-11:
6458
type: deb
6559
debian-12:
6660
image_tag: debian12
67-
version_name: bookworm
6861
tags:
6962
- release_packages
7063
arch:
@@ -75,7 +68,6 @@ debian-12:
7568
type: deb
7669
debian-13:
7770
image_tag: debian13
78-
version_name: trixie
7971
tags:
8072
- release_packages
8173
arch:
@@ -86,7 +78,6 @@ debian-13:
8678
type: deb
8779
debian-sid:
8880
image_tag: debiansid
89-
version_name: sid
9081
tags:
9182
- release_packages
9283
- bleeding-edge
@@ -100,7 +91,6 @@ fedora-41:
10091
image_tag: fedora41
10192
tags:
10293
- release_packages
103-
version_name: 41
10494
arch:
10595
- amd64
10696
- aarch64
@@ -118,7 +108,6 @@ openeuler-2403:
118108
image_tag: openeuler2403
119109
tags:
120110
- release_packages
121-
version_name: 24.03
122111
arch:
123112
- amd64
124113
- aarch64
@@ -127,23 +116,20 @@ opensuse-1506:
127116
image_tag: opensuse1506
128117
tags:
129118
- release_packages
130-
version_name: 156
131119
arch:
132120
- amd64
133121
type: rpm
134122
rhel-7:
135123
image_tag: rhel7
136124
tags:
137125
- release_packages
138-
version_name: 7
139126
arch:
140127
- amd64
141128
type: rpm
142129
rhel-8:
143130
image_tag: rhel8
144131
tags:
145132
- release_packages
146-
version_name: 8
147133
arch:
148134
- amd64
149135
- aarch64
@@ -154,7 +140,6 @@ rhel-9:
154140
image_tag: rhel9
155141
tags:
156142
- release_packages
157-
version_name: 9
158143
arch:
159144
- amd64
160145
- aarch64
@@ -165,7 +150,6 @@ rhel-10:
165150
image_tag: rhel10
166151
tags:
167152
- release_packages
168-
version_name: 10
169153
arch:
170154
- amd64
171155
- aarch64
@@ -175,7 +159,6 @@ rhel-10:
175159
rockylinux-8:
176160
image_tag: rockylinux8
177161
tags: []
178-
version_name: 8
179162
arch:
180163
- amd64
181164
- aarch64
@@ -184,7 +167,6 @@ rockylinux-8:
184167
rockylinux-9:
185168
image_tag: rockylinux9
186169
tags: []
187-
version_name: 9
188170
arch:
189171
- amd64
190172
- aarch64
@@ -194,7 +176,6 @@ rockylinux-9:
194176
rockylinux-10:
195177
image_tag: rockylinux10
196178
tags: []
197-
version_name: 10
198179
arch:
199180
- amd64
200181
- aarch64
@@ -205,7 +186,6 @@ sles-1506:
205186
image_tag: sles1506
206187
tags:
207188
- release_packages
208-
version_name: 15
209189
arch:
210190
- amd64
211191
- s390x
@@ -214,7 +194,6 @@ sles-1507:
214194
image_tag: sles1507
215195
tags:
216196
- release_packages
217-
version_name: 157
218197
arch:
219198
- amd64
220199
- s390x
@@ -223,7 +202,6 @@ ubuntu-2204:
223202
image_tag: ubuntu22.04
224203
tags:
225204
- release_packages
226-
version_name: jammy
227205
arch:
228206
- amd64
229207
- aarch64
@@ -234,7 +212,6 @@ ubuntu-2404:
234212
image_tag: ubuntu24.04
235213
tags:
236214
- release_packages
237-
version_name: noble
238215
arch:
239216
- amd64
240217
- aarch64
@@ -245,7 +222,6 @@ ubuntu-2410:
245222
image_tag: ubuntu24.10
246223
tags:
247224
- release_packages
248-
version_name: oracular
249225
arch:
250226
- amd64
251227
- aarch64
@@ -254,7 +230,6 @@ ubuntu-2504:
254230
image_tag: ubuntu25.04
255231
tags:
256232
- release_packages
257-
version_name: plucky
258233
arch:
259234
- amd64
260235
- aarch64

scripts/bash_lib.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ bb_print_env() {
8585
# Environment
8686
source /etc/os-release
8787
echo -e "\nDistribution: $PRETTY_NAME"
88-
echo "Architecture: $arch"
88+
echo "Architecture: $(uname -m)"
8989
echo -e "Systemd capability: $systemdCapability"
9090
echo "MariaDB version: ${mariadb_version/mariadb-/}"
9191
if [[ $test_type == "major" ]]; then
@@ -250,21 +250,23 @@ deb_setup_mariadb_mirror() {
250250
exit 1
251251
}
252252
#//TEMP it's probably better to install the last stable release here...?
253+
source /etc/os-release
254+
253255
mirror_url="https://deb.mariadb.org/$branch"
254256
archive_url="https://archive.mariadb.org/mariadb-$branch/repo"
255-
if wget -q --method=HEAD "$mirror_url/$dist_name/dists/$version_name"; then
257+
if wget -q --method=HEAD "$mirror_url/$ID/dists/$VERSION_CODENAME"; then
256258
baseurl="$mirror_url"
257-
elif wget -q --method=HEAD "$archive_url/$dist_name/dists/$version_name"; then
259+
elif wget -q --method=HEAD "$archive_url/$ID/dists/$VERSION_CODENAME"; then
258260
baseurl="$archive_url"
259261
else
260262
# the correct way of handling this would be to not even start the check
261263
# since we know it will always fail. But apparently, it's not going to
262264
# happen soon in BB. Once done though, replace the warning with an error
263265
# and use a non-zero exit code.
264-
bb_log_warn "deb_setup_mariadb_mirror: $branch packages for $dist_name $version_name does not exist on deb|archive.mariadb.org"
266+
bb_log_warn "deb_setup_mariadb_mirror: $branch packages for $ID $VERSION_CODENAME does not exist on deb|archive.mariadb.org"
265267
exit 0
266268
fi
267-
sudo sh -c "echo 'deb $baseurl/$dist_name $version_name main' >/etc/apt/sources.list.d/mariadb.list"
269+
sudo sh -c "echo 'deb $baseurl/$ID $VERSION_CODENAME main' >/etc/apt/sources.list.d/mariadb.list"
268270
sudo wget https://mariadb.org/mariadb_release_signing_key.asc -O /etc/apt/trusted.gpg.d/mariadb_release_signing_key.asc || {
269271
bb_log_err "mariadb repository key installation failed"
270272
exit 1
@@ -285,9 +287,11 @@ rpm_setup_mariadb_mirror() {
285287
bb_log_err "wget command not found"
286288
exit 1
287289
}
290+
source /etc/os-release
288291
#//TEMP it's probably better to install the last stable release here...?
289-
mirror_url="https://rpm.mariadb.org/$branch/$arch"
290-
archive_url="https://archive.mariadb.org/mariadb-$branch/yum/$arch"
292+
url_path="$ID/$VERSION_ID/$(rpm --eval '%_arch')"
293+
mirror_url="https://rpm.mariadb.org/$branch/$url_path"
294+
archive_url="https://archive.mariadb.org/mariadb-$branch/yum/$url_path"
291295
if wget -q --method=HEAD "$mirror_url"; then
292296
baseurl="$mirror_url"
293297
elif wget -q --method=HEAD "$archive_url"; then
@@ -297,7 +301,7 @@ rpm_setup_mariadb_mirror() {
297301
# since we know it will always fail. But apparently, it's not going to
298302
# happen soon in BB. Once done though, replace the warning with an error
299303
# and use a non-zero exit code.
300-
bb_log_warn "rpm_setup_mariadb_mirror: $branch packages for $dist_name $version_name does not exist on https://rpm.mariadb.org/"
304+
bb_log_warn "rpm_setup_mariadb_mirror: $branch packages for $ID $VERSION_ID does not exist on https://rpm.mariadb.org/"
301305
exit 0
302306
fi
303307
cat <<EOF | sudo tee "$(rpm_repo_dir)/MariaDB.repo"

0 commit comments

Comments
 (0)