diff --git a/doc/source/support_matrix.rst b/doc/source/support_matrix.rst index c5638fbcbe..70d5a84052 100644 --- a/doc/source/support_matrix.rst +++ b/doc/source/support_matrix.rst @@ -18,7 +18,7 @@ The following base container images are supported: Distribution Default base Default base tag ================== =============================== ================ Rocky Linux quay.io/rockylinux/rockylinux 9 -Debian Bullseye debian bullseye +Debian Bookworm debian bookworm Ubuntu Jammy ubuntu 22.04 Ubuntu Noble ubuntu 24.04 ================== =============================== ================ diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index 57ee7be1d6..2b4fc97a43 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -240,19 +240,23 @@ RUN cat /tmp/kolla_bashrc >> /etc/bash.bashrc \ {% if base_distro == 'debian' %} RUN rm -f /etc/apt/sources.list.d/debian.sources COPY sources.list.{{ base_distro }} /etc/apt/sources.list -{% elif ( base_distro == 'ubuntu' and base_arch == 'x86_64' ) %} +{% elif base_distro == 'ubuntu' %} {% if base_distro_tag.startswith('22.04') or base_distro_tag.startswith('jammy') %} +RUN rm -f /etc/apt/sources.list +{% if base_arch == 'x86_64' %} COPY sources.list.{{ base_distro }}.jammy /etc/apt/sources.list +{% else %} +COPY sources.list.{{ base_distro }}.jammy.{{ base_arch }} /etc/apt/sources.list +{% endif %} {% elif base_distro_tag.startswith('24.04') or base_distro_tag.startswith('noble') %} +RUN rm -f /etc/apt/sources.list.d/{{ base_distro }}.sources +{% if base_arch == 'x86_64' %} COPY sources.list.{{ base_distro }}.noble /etc/apt/sources.list -{% endif %} {% else %} -{% if base_distro_tag.startswith('22.04') or base_distro_tag.startswith('jammy')%} -COPY sources.list.{{ base_distro }}.jammy.{{ base_arch }} /etc/apt/sources.list -{% elif base_distro_tag.startswith('24.04') or base_distro_tag.startswith('noble')%} COPY sources.list.{{ base_distro }}.noble.{{ base_arch }} /etc/apt/sources.list {% endif %} {% endif %} +{% endif %} COPY sources.list /etc/apt/sources.list.d/kolla-custom.list {% endblock %} diff --git a/kolla/common/sources.py b/kolla/common/sources.py index 7d7d4fb431..a780e7e4cf 100644 --- a/kolla/common/sources.py +++ b/kolla/common/sources.py @@ -322,11 +322,11 @@ 'elasticsearch_exporter' '-${version}.linux-${debian_arch}.tar.gz')}, 'prometheus-libvirt-exporter': { - 'version': '1.6.0', + 'version': '2.2.0', 'type': 'url', 'sha256': { - 'amd64': '57f1e71ac5bd87f18a40b9089e9fb513dec44ced58328b3065879b279f967596', # noqa: E501 - 'arm64': '8f474fbb515caf19fda92c839eece761738138c7c676d12d10aa0b8c29b3ef9d'}, # noqa: E501 + 'amd64': '37e26779be1ebaef2e76d7304a3d3ecfbdc232a5c57645ee0f97b13f014bd842', # noqa: E501 + 'arm64': '94ac011349d60d70c14985df2942d02ecac87c0b7c7a468133394eb1800a22b0'}, # noqa: E501 'location': ('https://github.com/' 'inovex/prometheus-libvirt-exporter/' 'releases/download/v${version}/' diff --git a/kolla/image/tasks.py b/kolla/image/tasks.py index 1242ecd8de..16533a637d 100644 --- a/kolla/image/tasks.py +++ b/kolla/image/tasks.py @@ -119,6 +119,16 @@ def run(self): def push_image(self, image): kwargs = dict(stream=True, decode=True) + # NOTE(bbezak): Docker ≥ 28.3.3 rejects a push with no + # X-Registry-Auth header (moby/moby#50371, docker-py#3348). + # If the SDK cannot find creds for this registry, we inject + # an empty {} so the daemon still accepts the request. + # TODO(bbezak): Remove fallback once docker-py handles empty auth + if self.conf.engine == engine.Engine.DOCKER.value: + from docker.auth import resolve_authconfig + if not resolve_authconfig(self.engine_client.api._auth_configs, + registry=self.conf.registry): + kwargs.setdefault("auth_config", {}) for response in self.engine_client.images.push(image.canonical_name, **kwargs): diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py index 08fcee13c2..78462d1317 100644 --- a/kolla/tests/test_build.py +++ b/kolla/tests/test_build.py @@ -81,10 +81,12 @@ def setUp(self): @mock.patch(engine_client) def test_push_image(self, mock_client): self.engine_client = mock_client + mock_client().api._auth_configs = {} pusher = tasks.PushTask(self.conf, self.image) pusher.run() mock_client().images.push.assert_called_once_with( - self.image.canonical_name, decode=True, stream=True) + self.image.canonical_name, + decode=True, stream=True, auth_config={}) self.assertTrue(pusher.success) @mock.patch.dict(os.environ, clear=True) @@ -92,11 +94,13 @@ def test_push_image(self, mock_client): def test_push_image_failure(self, mock_client): """failure on connecting Docker API""" self.engine_client = mock_client + mock_client().api._auth_configs = {} mock_client().images.push.side_effect = Exception pusher = tasks.PushTask(self.conf, self.image) pusher.run() mock_client().images.push.assert_called_once_with( - self.image.canonical_name, decode=True, stream=True) + self.image.canonical_name, + decode=True, stream=True, auth_config={}) self.assertFalse(pusher.success) self.assertEqual(utils.Status.PUSH_ERROR, self.image.status) @@ -105,11 +109,13 @@ def test_push_image_failure(self, mock_client): def test_push_image_failure_retry(self, mock_client): """failure on connecting Docker API, success on retry""" self.engine_client = mock_client + mock_client().api._auth_configs = {} mock_client().images.push.side_effect = [Exception, []] pusher = tasks.PushTask(self.conf, self.image) pusher.run() mock_client().images.push.assert_called_once_with( - self.image.canonical_name, decode=True, stream=True) + self.image.canonical_name, + decode=True, stream=True, auth_config={}) self.assertFalse(pusher.success) self.assertEqual(utils.Status.PUSH_ERROR, self.image.status) @@ -125,12 +131,14 @@ def test_push_image_failure_retry(self, mock_client): def test_push_image_failure_error(self, mock_client): """Docker connected, failure to push""" self.engine_client = mock_client + mock_client().api._auth_configs = {} mock_client().images.push.return_value = [{'errorDetail': {'message': 'mock push fail'}}] pusher = tasks.PushTask(self.conf, self.image) pusher.run() mock_client().images.push.assert_called_once_with( - self.image.canonical_name, decode=True, stream=True) + self.image.canonical_name, + decode=True, stream=True, auth_config={}) self.assertFalse(pusher.success) self.assertEqual(utils.Status.PUSH_ERROR, self.image.status) @@ -139,12 +147,14 @@ def test_push_image_failure_error(self, mock_client): def test_push_image_failure_error_retry(self, mock_client): """Docker connected, failure to push, success on retry""" self.engine_client = mock_client + mock_client().api._auth_configs = {} mock_client().images.push.return_value = [{'errorDetail': {'message': 'mock push fail'}}] pusher = tasks.PushTask(self.conf, self.image) pusher.run() mock_client().images.push.assert_called_once_with( - self.image.canonical_name, decode=True, stream=True) + self.image.canonical_name, + decode=True, stream=True, auth_config={}) self.assertFalse(pusher.success) self.assertEqual(utils.Status.PUSH_ERROR, self.image.status) diff --git a/releasenotes/notes/bug-2120639-74c180bd812ddcf7.yaml b/releasenotes/notes/bug-2120639-74c180bd812ddcf7.yaml new file mode 100644 index 0000000000..0b77a1bf8c --- /dev/null +++ b/releasenotes/notes/bug-2120639-74c180bd812ddcf7.yaml @@ -0,0 +1,10 @@ +--- +fixes: + - | + Fixed missing metrics in Prometheus libvirt exporter. + + The Prometheus libvirt exporter has been bumped from ``v1.6.0`` to + ``v2.2.0``. This restores some metrics that were lost when the exporter + source was changed in a previous release. + + `LP#2120639 `__. diff --git a/tests/playbooks/run.yml b/tests/playbooks/run.yml index 4c430535ee..d7ac8d552c 100644 --- a/tests/playbooks/run.yml +++ b/tests/playbooks/run.yml @@ -37,7 +37,7 @@ vars: kolla_mirror_config: DEFAULT: - base_image: "quay.io/openstack.kolla/{{ base_distro }}" + base_image: "quay.io/opendevmirror/{{ base_distro }}" set_fact: kolla_build_config: "{{ kolla_build_config | combine(kolla_mirror_config, recursive=True) }}" when: base_distro in ['debian', 'ubuntu']