Skip to content

Docker library (fix 20.04 EOL) + RHEL10 base #803

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

Merged
merged 2 commits into from
Jul 16, 2025

Conversation

grooverdan
Copy link
Member

Adjust the triggers for Docker Library:

  • 10.11 /10.6 are being triggered incorrectly.
  • Add RHEL10 as base for MariaDB-12+

Supported by MariaDB/mariadb-docker#653

c4ca50e had a regression where additional
] ended up in the fnmatch resulting in the 10.6 no being triggered
for Ubuntu based images, and 10.11 being triggered with a 24.04 base instead
of 22.04.
With the release of RHEL10, and Docker Official Images supporting it,
MariaDB 12+ release will be based on RHEL10.
Copy link
Collaborator

@RazvanLiviuVarzaru RazvanLiviuVarzaru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, looks ok to me,
made some short tests and they pass.

import unittest
from test import hasDockerLibrary

class TestHasDockerLibrary(unittest.TestCase):
    def test_ubuntu_2204_branch(self):
        self.assertTrue(hasDockerLibrary("ubuntu-2204-deb-autobake", "10.11"))
        self.assertTrue(hasDockerLibrary("ubuntu-2204-deb-autobake", "10.6"))
        self.assertFalse(hasDockerLibrary("ubuntu-2204-deb-autobake", "11.4"))
        self.assertFalse(hasDockerLibrary("ubuntu-2204-deb-autobake", "12.1"))

    def test_ubuntu_2404_branch(self):
        self.assertTrue(hasDockerLibrary("ubuntu-2404-deb-autobake", "11.4"))
        self.assertFalse(hasDockerLibrary("ubuntu-2404-deb-autobake", "10.11"))

    def test_rhel9_with_10_or_11(self):
        self.assertTrue(hasDockerLibrary("amd64-rhel-9-rpm-autobake", "10.6"))
        self.assertTrue(hasDockerLibrary("amd64-rhel-9-rpm-autobake", "11.4"))
        self.assertFalse(hasDockerLibrary("amd64-rhel-9-rpm-autobake", "12.1"))

    def test_rhel10_with_not_10_or_11(self):
        self.assertFalse(hasDockerLibrary("amd64-rhel-10-rpm-autobake", "10.11"))
        self.assertFalse(hasDockerLibrary("amd64-rhel-10-rpm-autobake", "11.4"))
        self.assertTrue(hasDockerLibrary("amd64-rhel-10-rpm-autobake", "12.1"))

    def test_non_matching_builder(self):
        self.assertFalse(hasDockerLibrary("some-random-builder", "10.11"))
        self.assertFalse(hasDockerLibrary("some-other-builder", "12.0"))

if __name__ == "__main__":
    unittest.main()

where

import fnmatch

def hasDockerLibrary(builder_name, branch) -> bool:
    branch = branch
    builder_name = builder_name

    # from https://github.com/MariaDB/mariadb-docker/blob/next/update.sh#L7-L15
    if fnmatch.fnmatch(branch, "10.11") or fnmatch.fnmatch(branch, "10.6"):
        dockerbase = "ubuntu-2204-deb-autobake"
    else:
        dockerbase = "ubuntu-2404-deb-autobake"

    # UBI images
    if builder_name.endswith("amd64-rhel-9-rpm-autobake"):
        return fnmatch.fnmatch(branch, "10.*") or fnmatch.fnmatch(branch, "11.*")

    if builder_name.endswith("amd64-rhel-10-rpm-autobake"):
        return not (fnmatch.fnmatch(branch, "10.*") or fnmatch.fnmatch(branch, "11.*"))

    # We only build on the above autobakes for all architectures
    return builder_name.endswith(dockerbase)

@RazvanLiviuVarzaru RazvanLiviuVarzaru enabled auto-merge (rebase) July 16, 2025 10:38
@RazvanLiviuVarzaru RazvanLiviuVarzaru merged commit 5a9e51d into MariaDB:dev Jul 16, 2025
2 of 3 checks passed
@grooverdan grooverdan deleted the docker_library branch July 17, 2025 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants