CentOS 8: Add rabbitmq-3.7.24 image (CentOS 7 only)

The CentOS 7 rabbitmq image contains 3.7.10, and the CentOS 8 rabbitmq
image contains 3.7.24. These versions are not compatible, which prevents
a rolling migration from CentOS 7 to CentOS 8.

This change adds a rabbitmq-3.7.24 image, available for CentOS 7 images
only. This provides a path for migration, by first upgrading all CentOS
7 rabbitmq containers to use this image.

Depends-On: https://review.opendev.org/720218

Change-Id: Icff279be07c4767dd0b18c697894373f46102bf1
Partially-Implements: blueprint centos-rhel-8
This commit is contained in:
Mark Goddard 2020-03-26 14:23:04 +00:00
parent 052a943365
commit 27d3f39e0e
6 changed files with 98 additions and 0 deletions

View File

@ -0,0 +1,49 @@
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block rabbitmq_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='rabbitmq') }}
{% block rabbitmq_install %}
{% if base_package_type == 'rpm' %}
{% set rabbitmq_packages = [
'hostname',
'rabbitmq-server-3.7.24',
] %}
{% endif %}
COPY rabbitmq_rabbitmq-erlang.repo rabbitmq_rabbitmq-server.repo /etc/yum.repos.d/
RUN rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
{{ macros.install_packages(rabbitmq_packages | customizable("packages")) }}
{% endblock %}
{% block rabbitmq_install_plugins %}
RUN rm -rf /var/lib/rabbitmq/* \
&& mkdir -p /usr/lib/rabbitmq/plugins \
&& /usr/lib/rabbitmq/bin/rabbitmq-plugins enable --offline \
rabbitmq_management
{% set rabbitmq_plugins = [
'accept-0.3.3.ez',
'prometheus-3.5.1.ez',
'prometheus_cowboy-0.1.4.ez',
'prometheus_httpd-2.1.8.ez',
'prometheus_rabbitmq_exporter-3.7.2.4.ez'
] %}
{{ macros.install_rabbitmq_plugins(rabbitmq_plugins | customizable("plugins"), version="v3.7.2.4") }}
{% endblock %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{% block rabbitmq_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER rabbitmq

View File

@ -0,0 +1,26 @@
#!/bin/bash
: ${RABBITMQ_LOG_DIR:=/var/log/kolla/rabbitmq}
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
# NOTE(sbezverk): In kubernetes environment, if this file exists from previous
# bootstrap, the system does not allow to overwrite it (it bootstrap files with
# permission denied error) but it allows to delete it and then recreate it.
if [[ -e "/var/lib/rabbitmq/.erlang.cookie" ]]; then
rm -f /var/lib/rabbitmq/.erlang.cookie
fi
echo "${RABBITMQ_CLUSTER_COOKIE}" > /var/lib/rabbitmq/.erlang.cookie
chmod 400 /var/lib/rabbitmq/.erlang.cookie
exit 0
fi
if [[ ! -d "${RABBITMQ_LOG_DIR}" ]]; then
mkdir -p ${RABBITMQ_LOG_DIR}
fi
if [[ $(stat -c %a ${RABBITMQ_LOG_DIR}) != "755" ]]; then
chmod 755 ${RABBITMQ_LOG_DIR}
fi

View File

@ -0,0 +1,7 @@
[rabbitmq_rabbitmq-erlang]
name=rabbitmq_rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/22/el/$releasever/
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://www.rabbitmq.com/rabbitmq-release-signing-key.asc

View File

@ -0,0 +1,7 @@
[rabbitmq_rabbitmq-server]
name=rabbitmq_rabbitmq-server
baseurl=https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/v3.7.x/el/$releasever/
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://www.rabbitmq.com/rabbitmq-release-signing-key.asc

View File

@ -161,6 +161,7 @@ UNBUILDABLE_IMAGES = {
"nova-spicehtml5proxy", # Missing spicehtml5 package
"opendaylight", # Missing opendaylight repo
"ovsdpdk", # Not supported on CentOS
"rabbitmq-3.7.24", # Required only for CentOS 7 to 8 migration
"sensu-base", # Missing sensu package
"tgtd", # Not supported on CentOS 8
},
@ -179,12 +180,14 @@ UNBUILDABLE_IMAGES = {
"opendaylight", # no binary package
"ovsdpdk",
"qdrouterd",
"rabbitmq-3.7.24", # Required only for CentOS 7 to 8 migration
"sensu-base",
"telegraf", # no binary package
},
'ubuntu': {
"cyborg-base",
"qdrouterd", # There is no qdrouterd package for ubuntu bionic
"rabbitmq-3.7.24", # Required only for CentOS 7 to 8 migration
},
'debian+aarch64': {

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
Adds a new ``rabbitmq-3.7.24`` image for CentOS 7 only. This image is used
to provide compatibility between RabbitMQ versions in CentOS 7 and 8
images. This image will only be available in the Train release.