Repository navigation
rhel8,9: move partitioning into YAML (HMS-6021) - #1390
Conversation
6cf56ce to
8add153
Compare
d154da6 to
10a0273
Compare
When we go over conditions that require versions we need to make
sure we sort them first so that if there are multiple version
conditions the way they are applied is predictable. As they
are just map keys in YAML the order is not preditable otherwise.
So with
```
condition
version_greater_or_equal:
"1":
- foo
"2":
- bar
```
we need stable ordering to ensure that when e.g. a partition
table is overriden they are executed in order so that the last
change can potentially override the previous one.
Note that this version requires go1.23 which we currently cannot
use. So there is an extra commit to provide a go1.22 version that
we can just revert once we can use go1.23.
This commit should be reverted once we can move to go1.23. It just ports the (rather nice) `versionLessThanSortedKeys()` helper to the versions of slices/maps available in go1.22.
This is an alternative implementation of a partition table override implementation that is *very* simple (thanks Achilleas). With the right YAML anchor/alias support this will allow overrides for our current cases. We can look into more complicated schemes (c.f. Also use the new `partiton_tables_override` syntax for the existing fedora partitions.
This commit adds
```
partition_tables_override:
condition:
version_less_than:
```
sort as this is needed for rhel-8,99
This commit adds:
```yaml
partition_tables_override:
condition:
distro_name:
```
support.
This commit moves the existing rhel8 partition tables into YAML.
This commit moves the existing rhel9 partition tables into YAML.
This test takes a long time already (~30s on my machine) because it creates manifest for all our 900 image types. With the YAML based loading it takes about 5x longer (150s on my machine) because now each manifest creation takes a bit more work (loading/parsing yaml etc). In CI this meant that we hit the 5min test limit (sometimes). By making this test run in parallel we gain a substancial speedup (from 150s to 11s on my machine) that should fix the CI timeouts.
The TestPipelineRepositories now takes more than the default 10m test timeout. The reason is that the YAML adds a bit of extra time for each test-run. But because we run a total of >6_000 subtests it adds up. And even with "t.Parallel()" with just the default 4 hit runner CPUs we do not win enough speedup.
10a0273 to
7bdc88a
Compare
thozza
left a comment
There was a problem hiding this comment.
Nice work. I like it a lot, although I need to get used to all these advanced YAML syntax 😇
| size: 111_111_111 | ||
| ` | ||
| // XXX: we cannot use distro.Name() as it will give us a name+ver | ||
| baseDir := makeFakePkgsSet(t, test_distro.TestDistroNameBase, fakeDistroYaml) |
There was a problem hiding this comment.
Nitpick: it would probably make sense to rename makeFakePkgsSet() to something like makeFakeDefs(), since it seem to be doing more than just package sets.
There was a problem hiding this comment.
Thanks, I will do a small followup with this (and the other suggestions)
| - &ec2_partition_table_part_boot512 | ||
| <<: *ec2_partition_table_part_boot | ||
| size: 536_870_912 # 512MiB |
| distro_name: | ||
| # we need this override to ensure that centos always gets | ||
| # the latest partition-tables, othersie "centos-8" is | ||
| # less then "8 <= 8.9" |
| func ec2PartitionTables(t *rhel.ImageType) (disk.PartitionTable, bool) { | ||
| return partitionTables(t) | ||
| } |
There was a problem hiding this comment.
I suppose you plan to eventually use partitionTables(t) everywhere and remove image-type-specific partition table generator functions?
There was a problem hiding this comment.
Yeah, mostly to keep the diff small but a bit misguided I guess. This will also be part of a small followup.
tag v0.140.0 Tagger: imagebuilder-bot <[email protected]> Changes with 0.140.0 ---------------- * Loader part override followups (osbuild/image-builder#1466) * Author: Michael Vogt, Reviewers: Tomáš Hozza * RHEL-10/gce: install cloud-utils-growpart by default (osbuild/image-builder#1463) * Author: Tomáš Hozza, Reviewers: Michael Vogt, Simon de Vlieger * base-host-check: expand to cover more (COMPOSER-2498) (osbuild/image-builder#1432) * Author: Simon de Vlieger, Reviewers: Tomáš Hozza * rhel8,9: move partitioning into YAML (osbuild/image-builder#1390) * Author: Michael Vogt, Reviewers: Tomáš Hozza — Somewhere on the Internet, 2025-04-28 --- tag v0.141.0 Tagger: imagebuilder-bot <[email protected]> Changes with 0.141.0 ---------------- * Shrink the current installer images a bit (osbuild/image-builder#1423) * Author: Brian C. Lane, Reviewers: Achilleas Koutsou, Simon de Vlieger, Tomáš Hozza * Update EL10 Azure images with changes made in RHEL 9.6 (osbuild/image-builder#1472) * Author: Achilleas Koutsou, Reviewers: Michael Vogt, Tomáš Hozza * distro: add DNFSetReleaseVerVar to ImageConfig (osbuild/image-builder#1465) * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Tomáš Hozza * test/base-host-check.sh: fix disabled firewall services check (osbuild/image-builder#1471) * Author: Sanne Raymaekers, Reviewers: Achilleas Koutsou, Tomáš Hozza — Somewhere on the Internet, 2025-04-29 ---
tag v0.140.0 Tagger: imagebuilder-bot <[email protected]> Changes with 0.140.0 ---------------- * Loader part override followups (osbuild/image-builder#1466) * Author: Michael Vogt, Reviewers: Tomáš Hozza * RHEL-10/gce: install cloud-utils-growpart by default (osbuild/image-builder#1463) * Author: Tomáš Hozza, Reviewers: Michael Vogt, Simon de Vlieger * base-host-check: expand to cover more (COMPOSER-2498) (osbuild/image-builder#1432) * Author: Simon de Vlieger, Reviewers: Tomáš Hozza * rhel8,9: move partitioning into YAML (osbuild/image-builder#1390) * Author: Michael Vogt, Reviewers: Tomáš Hozza — Somewhere on the Internet, 2025-04-28 --- tag v0.141.0 Tagger: imagebuilder-bot <[email protected]> Changes with 0.141.0 ---------------- * Shrink the current installer images a bit (osbuild/image-builder#1423) * Author: Brian C. Lane, Reviewers: Achilleas Koutsou, Simon de Vlieger, Tomáš Hozza * Update EL10 Azure images with changes made in RHEL 9.6 (osbuild/image-builder#1472) * Author: Achilleas Koutsou, Reviewers: Michael Vogt, Tomáš Hozza * distro: add DNFSetReleaseVerVar to ImageConfig (osbuild/image-builder#1465) * Author: Michael Vogt, Reviewers: Achilleas Koutsou, Tomáš Hozza * test/base-host-check.sh: fix disabled firewall services check (osbuild/image-builder#1471) * Author: Sanne Raymaekers, Reviewers: Achilleas Koutsou, Tomáš Hozza — Somewhere on the Internet, 2025-04-29 ---
This PR moves the rhel8,9 partition tables into YAML. Its a cleaned up version of
#1388
and uses a simplified approach to partition overrides (thanks to Achilleas) compared to
#1372
which is using a reflect/patch-individual fields approach that is more complicated.
Here the idea of this PR is that we only have the ability to fully replace partition tables, e.g.
This of course means that only a single override wins and it must be a full partition table. This is not too bad because YAML anchors help a lot, but it gets a bit verbose (rhel-9 has the most complex example).
Another slightly weird thing is that distro name matching always "wins" so that we can have defaults for centos. Here the version match does not work because centos is e.g. version 9 so all overrides for version_less_than 9.X will be applied. We could solve also solve this by making centos an artifical 9.999 version and then all centos distro_name conditions would go away.
Note that we can always move to the "patch individual fields approach in #1372 later.
/jira-epic HMS-5284
JIRA: HMS-6021