Skip to content

Commit

Permalink
Switch to Antelope images (#1227)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaser authored May 24, 2024
1 parent 6858f4a commit 5d4d441
Show file tree
Hide file tree
Showing 28 changed files with 552 additions and 72 deletions.
2 changes: 1 addition & 1 deletion images/barbican/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ARG RELEASE

FROM registry.atmosphere.dev/library/openstack-venv-builder:${RELEASE} AS build
ARG BARBICAN_GIT_REF=ca57ef5436e20e90cf6cd6853efe3c89a9afd986
ARG BARBICAN_GIT_REF=9c8fb8c3a9a47276868d38a86f098e54e5f05ea6
ADD --keep-git-dir=true https://opendev.org/openstack/barbican.git#${BARBICAN_GIT_REF} /src/barbican
RUN git -C /src/barbican fetch --unshallow
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private <<EOF bash -xe
Expand Down
6 changes: 3 additions & 3 deletions images/cinder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ARG RELEASE

FROM registry.atmosphere.dev/library/openstack-venv-builder:${RELEASE} AS build
ARG CINDER_GIT_REF=b0f0b9015b9dfa228dff98eeee5116d8eca1c3cc
ARG CINDER_GIT_REF=0cca8c2aaf20cea530278bc481e94d647de1793f
ADD --keep-git-dir=true https://opendev.org/openstack/cinder.git#${CINDER_GIT_REF} /src/cinder
RUN git -C /src/cinder fetch --unshallow
COPY patches/cinder /patches/cinder
Expand All @@ -29,10 +29,10 @@ pip3 install \
storpool.spopenstack
EOF
ADD --chmod=644 \
https://github.com/storpool/storpool-openstack-integration/raw/master/drivers/cinder/openstack/bobcat/storpool.py \
https://github.com/storpool/storpool-openstack-integration/raw/master/drivers/cinder/openstack/antelope/storpool.py \
/var/lib/openstack/lib/python3.10/site-packages/cinder/volume/drivers/storpool.py
ADD --chmod=644 \
https://github.com/storpool/storpool-openstack-integration/raw/master/drivers/os_brick/openstack/bobcat/storpool.py \
https://github.com/storpool/storpool-openstack-integration/raw/master/drivers/os_brick/openstack/antelope/storpool.py \
/var/lib/openstack/lib/python3.10/site-packages/os_brick/initiator/connectors/storpool.py

FROM registry.atmosphere.dev/library/openstack-python-runtime:${RELEASE}
Expand Down
4 changes: 1 addition & 3 deletions images/designate/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
ARG RELEASE

FROM registry.atmosphere.dev/library/openstack-venv-builder:${RELEASE} AS build
ARG DESIGNATE_GIT_REF=097ffc6df181290eba1bcd7c492b1b505bc15434
ARG DESIGNATE_GIT_REF=ff1986cbb755f0d74a7db98623d6d17816d933a6
ADD --keep-git-dir=true https://opendev.org/openstack/designate.git#${DESIGNATE_GIT_REF} /src/designate
RUN git -C /src/designate fetch --unshallow
COPY patches/designate /patches/designate
RUN git -C /src/designate apply --verbose /patches/designate/*
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private <<EOF bash -xe
pip3 install \
--constraint /upper-constraints.txt \
Expand Down

This file was deleted.

8 changes: 5 additions & 3 deletions images/glance/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
ARG RELEASE

FROM registry.atmosphere.dev/library/openstack-venv-builder:${RELEASE} AS build
ARG GLANCE_GIT_REF=0bcd6cd71c09917c6734421374fd598d73e8d0cc
ARG GLANCE_GIT_REF=70170d2a99f9d30bddcc55a9183133a16ed14c06
ADD --keep-git-dir=true https://opendev.org/openstack/glance.git#${GLANCE_GIT_REF} /src/glance
RUN git -C /src/glance fetch --unshallow
ADD --keep-git-dir=true https://opendev.org/openstack/glance_store.git#master /src/glance_store
ADD --keep-git-dir=true https://opendev.org/openstack/glance_store.git#stable/2023.1 /src/glance_store
RUN git -C /src/glance_store fetch --unshallow
COPY patches/glance_store /patches/glance_store
RUN git -C /src/glance_store apply --verbose /patches/glance_store/*
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private <<EOF bash -xe
pip3 install \
--constraint /upper-constraints.txt \
Expand All @@ -29,7 +31,7 @@ pip3 install \
storpool.spopenstack
EOF
ADD --chmod=644 \
https://github.com/storpool/storpool-openstack-integration/raw/master/drivers/os_brick/openstack/bobcat/storpool.py \
https://github.com/storpool/storpool-openstack-integration/raw/master/drivers/os_brick/openstack/antelope/storpool.py \
/var/lib/openstack/lib/python3.10/site-packages/os_brick/initiator/connectors/storpool.py

FROM registry.atmosphere.dev/library/openstack-python-runtime:${RELEASE}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
From fa43561078bbee531ccc8acf2e185b3fc6d98b2a Mon Sep 17 00:00:00 2001
From: Andrew Bogott <[email protected]>
Date: Thu, 8 Jun 2023 07:54:16 -0500
Subject: [PATCH] rbd: compute appropriate resize amount before resizing image

Resolves a bug introduced in

https://opendev.org/openstack/glance_store/commit/c43f19e8456b9e20f03709773fb2ffdb94807a0a

This issue is only in evidence when glance is behind a proxy where the
client buffer size can be lower (for haproxy: bufsize = 16384) which
can cause unaligned reads

(https://github.com/openstack/glance/blob/master/glance/common/wsgi.py#L1028).

The response length can be bigger than the store_chunk_size for the
first time, so at the end the RBD write will fail because it wants
to write more data than the actual RBD image size after the first
resize.

Thanks to Robert Varjasi for investigating this issue!

Fixes-Bug: 1916482
Change-Id: Ie03693c2cb8b096978fb156231c3b1cab695470f
---
glance_store/_drivers/rbd.py | 6 ++--
glance_store/tests/unit/test_rbd_store.py | 38 ++++++++++++++---------
2 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/glance_store/_drivers/rbd.py b/glance_store/_drivers/rbd.py
index ba2defa..e53baef 100644
--- a/glance_store/_drivers/rbd.py
+++ b/glance_store/_drivers/rbd.py
@@ -535,12 +535,12 @@ class Store(driver.Store):
"""Handle the rbd resize when needed."""
if image_size != 0 or self.size >= bytes_written + chunk_length:
return self.size
- new_size = self.size + self.resize_amount
- LOG.debug("resizing image to %s KiB" % (new_size / units.Ki))
- image.resize(new_size)
# Note(jokke): We double how much we grow the image each time
# up to 8gigs to avoid resizing for each write on bigger images
self.resize_amount = min(self.resize_amount * 2, 8 * units.Gi)
+ new_size = self.size + self.resize_amount
+ LOG.debug("resizing image to %s KiB" % (new_size / units.Ki))
+ image.resize(new_size)
return new_size

@driver.back_compat_add
diff --git a/glance_store/tests/unit/test_rbd_store.py b/glance_store/tests/unit/test_rbd_store.py
index 4f24c26..fb6522a 100644
--- a/glance_store/tests/unit/test_rbd_store.py
+++ b/glance_store/tests/unit/test_rbd_store.py
@@ -213,10 +213,10 @@ class TestReSize(base.StoreBaseTest,
data_len_temp = data_len
resize_amount = self.store.WRITE_CHUNKSIZE
while data_len_temp > 0:
+ resize_amount *= 2
expected_calls.append(resize_amount + (data_len -
data_len_temp))
data_len_temp -= resize_amount
- resize_amount *= 2
expected += 1
self.assertEqual(expected, resize.call_count)
resize.assert_has_calls([mock.call(call) for call in
@@ -244,7 +244,7 @@ class TestReSize(base.StoreBaseTest,
# Current size is smaller than we need
self.store.size = 8
ret = self.store._resize_on_write(image, 0, 16, 16)
- self.assertEqual(8 + self.store.WRITE_CHUNKSIZE, ret)
+ self.assertEqual(8 + self.store.WRITE_CHUNKSIZE * 2, ret)
self.assertEqual(self.store.WRITE_CHUNKSIZE * 2,
self.store.resize_amount)
image.resize.assert_called_once_with(ret)
@@ -253,47 +253,55 @@ class TestReSize(base.StoreBaseTest,
image.resize.reset_mock()
self.store.size = ret
ret = self.store._resize_on_write(image, 0, 64, 16)
- self.assertEqual(8 + self.store.WRITE_CHUNKSIZE, ret)
+ self.assertEqual(8 + self.store.WRITE_CHUNKSIZE * 2, ret)
image.resize.assert_not_called()

# Read past the limit triggers another resize
ret = self.store._resize_on_write(image, 0, ret + 1, 16)
- self.assertEqual(8 + self.store.WRITE_CHUNKSIZE * 3, ret)
+ self.assertEqual(8 + self.store.WRITE_CHUNKSIZE * 6, ret)
image.resize.assert_called_once_with(ret)
self.assertEqual(self.store.WRITE_CHUNKSIZE * 4,
self.store.resize_amount)

# Check that we do not resize past the 8G ceiling.

- # Start with resize_amount at 4G, 1G read so far
+ # Start with resize_amount at 2G, 1G read so far
image.resize.reset_mock()
- self.store.resize_amount = 4 * units.Gi
+ self.store.resize_amount = 2 * units.Gi
self.store.size = 1 * units.Gi

- # First resize happens and we get the 4G,
- # resize_amount goes to limit of 8G
+ # First resize happens and we get to 5G,
+ # resize_amount goes to limit of 4G
ret = self.store._resize_on_write(image, 0, 4097 * units.Mi, 16)
- self.assertEqual(5 * units.Gi, ret)
- self.assertEqual(8 * units.Gi, self.store.resize_amount)
+ self.assertEqual(4 * units.Gi, self.store.resize_amount)
+ self.assertEqual((1 + 4) * units.Gi, ret)
self.store.size = ret

- # Second resize happens and we get to 13G,
+ # Second resize happens and we stay at 13, no resize
# resize amount stays at limit of 8G
ret = self.store._resize_on_write(image, 0, 6144 * units.Mi, 16)
- self.assertEqual((5 + 8) * units.Gi, ret)
self.assertEqual(8 * units.Gi, self.store.resize_amount)
+ self.assertEqual((1 + 4 + 8) * units.Gi, ret)
self.store.size = ret

- # Third resize happens and we get to 21G,
+ # Third resize happens and we get to 21,
# resize amount stays at limit of 8G
ret = self.store._resize_on_write(image, 0, 14336 * units.Mi, 16)
- self.assertEqual((5 + 8 + 8) * units.Gi, ret)
self.assertEqual(8 * units.Gi, self.store.resize_amount)
+ self.assertEqual((1 + 4 + 8 + 8) * units.Gi, ret)
+ self.store.size = ret
+
+ # Fourth resize happens and we get to 29,
+ # resize amount stays at limit of 8G
+ ret = self.store._resize_on_write(image, 0, 22528 * units.Mi, 16)
+ self.assertEqual(8 * units.Gi, self.store.resize_amount)
+ self.assertEqual((1 + 4 + 8 + 8 + 8) * units.Gi, ret)

image.resize.assert_has_calls([
mock.call(5 * units.Gi),
mock.call(13 * units.Gi),
- mock.call(21 * units.Gi)])
+ mock.call(21 * units.Gi),
+ mock.call(29 * units.Gi)])


class TestStore(base.StoreBaseTest,
--
2.34.1
2 changes: 1 addition & 1 deletion images/heat/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ARG RELEASE

FROM registry.atmosphere.dev/library/openstack-venv-builder:${RELEASE} AS build
ARG HEAT_GIT_REF=80eea85194825773d1b60ecc4386b2d5ba52a066
ARG HEAT_GIT_REF=362bd38d902e006b50caf86f46581dfd16f7adab
ADD --keep-git-dir=true https://opendev.org/openstack/heat.git#${HEAT_GIT_REF} /src/heat
RUN git -C /src/heat fetch --unshallow
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip,sharing=private <<EOF bash -xe
Expand Down
18 changes: 9 additions & 9 deletions images/horizon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@
ARG RELEASE

FROM registry.atmosphere.dev/library/openstack-venv-builder:${RELEASE} AS build
ARG HORIZON_GIT_REF=3f1f1d46e6e47a3dbe46fb023fe69ff25d6a601b
ARG HORIZON_GIT_REF=b467683b1ed2aab4e38fe2cb2ac7ae5500e5d5c0
ADD --keep-git-dir=true https://opendev.org/openstack/horizon.git#${HORIZON_GIT_REF} /src/horizon
RUN git -C /src/horizon fetch --unshallow
ADD --keep-git-dir=true https://opendev.org/openstack/designate-dashboard.git#master /src/designate-dashboard
ADD --keep-git-dir=true https://opendev.org/openstack/designate-dashboard.git#stable/2023.1 /src/designate-dashboard
RUN git -C /src/designate-dashboard fetch --unshallow
ADD --keep-git-dir=true https://opendev.org/openstack/heat-dashboard.git#master /src/heat-dashboard
ADD --keep-git-dir=true https://opendev.org/openstack/heat-dashboard.git#stable/2023.1 /src/heat-dashboard
RUN git -C /src/heat-dashboard fetch --unshallow
ADD --keep-git-dir=true https://opendev.org/openstack/ironic-ui.git#master /src/ironic-ui
ADD --keep-git-dir=true https://opendev.org/openstack/ironic-ui.git#stable/2023.1 /src/ironic-ui
RUN git -C /src/ironic-ui fetch --unshallow
ADD --keep-git-dir=true https://opendev.org/openstack/magnum-ui.git#master /src/magnum-ui
ADD --keep-git-dir=true https://opendev.org/openstack/magnum-ui.git#stable/2023.1 /src/magnum-ui
RUN git -C /src/magnum-ui fetch --unshallow
ADD --keep-git-dir=true https://opendev.org/openstack/manila-ui.git#master /src/manila-ui
ADD --keep-git-dir=true https://opendev.org/openstack/manila-ui.git#stable/2023.1 /src/manila-ui
RUN git -C /src/manila-ui fetch --unshallow
ADD --keep-git-dir=true https://opendev.org/openstack/neutron-vpnaas-dashboard.git#master /src/neutron-vpnaas-dashboard
ADD --keep-git-dir=true https://opendev.org/openstack/neutron-vpnaas-dashboard.git#stable/2023.1 /src/neutron-vpnaas-dashboard
RUN git -C /src/neutron-vpnaas-dashboard fetch --unshallow
ADD --keep-git-dir=true https://opendev.org/openstack/octavia-dashboard.git#master /src/octavia-dashboard
ADD --keep-git-dir=true https://opendev.org/openstack/octavia-dashboard.git#stable/2023.1 /src/octavia-dashboard
RUN git -C /src/octavia-dashboard fetch --unshallow
ADD --keep-git-dir=true https://opendev.org/openstack/senlin-dashboard.git#master /src/senlin-dashboard
ADD --keep-git-dir=true https://opendev.org/openstack/senlin-dashboard.git#stable/2023.1 /src/senlin-dashboard
RUN git -C /src/senlin-dashboard fetch --unshallow
COPY patches/magnum-ui /patches/magnum-ui
RUN git -C /src/magnum-ui apply --verbose /patches/magnum-ui/*
Expand Down
Loading

0 comments on commit 5d4d441

Please sign in to comment.