Merge "Add support for PostgreSQL 16 & 17"

This commit is contained in:
Zuul
2025-07-11 02:26:24 +00:00
committed by Gerrit Code Review
7 changed files with 162 additions and 125 deletions

View File

@@ -527,7 +527,7 @@ function create_registry_container {
container=$(sudo docker ps -a --format "{{.Names}}" --filter name=registry)
if [ -z $container ]; then
sudo docker run -d --net=host -e REGISTRY_HTTP_ADDR=0.0.0.0:4000 --restart=always -v /opt/trove_registry/:/var/lib/registry --name registry quay.io/openstack.trove/registry:2
for img in {"mysql:8.0","mariadb:11.4","postgres:12"};
for img in {"mysql:8.0","mariadb:11.4","postgres:17"};
do
sudo docker pull quay.io/openstack.trove/${img} && sudo docker tag quay.io/openstack.trove/${img} 127.0.0.1:4000/trove-datastores/${img} && sudo docker push 127.0.0.1:4000/trove-datastores/${img}
done
@@ -535,10 +535,10 @@ function create_registry_container {
# build backup images
sudo docker build --network host -t 127.0.0.1:4000/trove-datastores/db-backup-mysql:8.0 --build-arg DATASTORE=mysql --build-arg DATASTORE_VERSION=8.0 .
sudo docker build --network host -t 127.0.0.1:4000/trove-datastores/db-backup-mariadb:11.4 --build-arg DATASTORE=mariadb --build-arg DATASTORE_VERSION=11.4 .
sudo docker build --network host -t 127.0.0.1:4000/trove-datastores/db-backup-postgresql:12 --build-arg DATASTORE=postgresql --build-arg BASE_OS_VERSION=20.04 --build-arg DATASTORE_VERSION=12 .
sudo docker build --network host -t 127.0.0.1:4000/trove-datastores/db-backup-postgresql:17 --build-arg DATASTORE=postgresql --build-arg DATASTORE_VERSION=17 .
popd
# push backup images
for backupimg in {"db-backup-mysql:8.0","db-backup-mariadb:11.4","db-backup-postgresql:12"};
for backupimg in {"db-backup-mysql:8.0","db-backup-mariadb:11.4","db-backup-postgresql:17"};
do
sudo docker push 127.0.0.1:4000/trove-datastores/${backupimg}
done

View File

@@ -0,0 +1,5 @@
---
features:
- Add the support of PostgreSQL 16 & 17
deprecations:
- Remove the support of PostgreSQL 12

View File

@@ -48,7 +48,7 @@ class PgSqlAppStatus(service.BaseDbStatus):
def __init__(self, docker_client):
super(PgSqlAppStatus, self).__init__(docker_client)
def get_actual_db_status(self):
def _get_container_status(self):
"""Check database service status."""
status = docker_util.get_container_status(self.docker_client)
if status == "running":
@@ -74,10 +74,38 @@ class PgSqlAppStatus(service.BaseDbStatus):
else:
return service_status.ServiceStatuses.UNKNOWN
def get_actual_db_status(self):
health = docker_util.get_container_health(self.docker_client)
LOG.debug('container health status: %s', health)
if health == "healthy":
return service_status.ServiceStatuses.HEALTHY
elif health == "starting":
return service_status.ServiceStatuses.RUNNING
elif health == "unhealthy":
# In case the container was stopped
status = docker_util.get_container_status(self.docker_client)
if status == "exited":
return service_status.ServiceStatuses.SHUTDOWN
else:
return service_status.ServiceStatuses.CRASHED
# if the health status is one of unkown or None, let's check
# container status. this is for the compatibility with the
# old datastores.
return self._get_container_status()
class PgSqlApp(service.BaseDbApp):
_configuration_manager = None
HEALTHCHECK = {
"test": ["CMD", "pg_isready", "-U", "postgres"],
"start_period": 10 * 1000000000, # 10 seconds in nanoseconds
"interval": 10 * 1000000000,
"timeout": 5 * 1000000000,
"retries": 3
}
@property
def configuration_manager(self):
if self._configuration_manager:
@@ -221,6 +249,7 @@ class PgSqlApp(service.BaseDbApp):
"POSTGRES_PASSWORD": postgres_pass,
"PGDATA": self.datadir,
},
healthcheck=self.HEALTHCHECK,
command=command
)

View File

@@ -153,6 +153,7 @@ def start_container(client, image, name="database",
f"Creating docker container, image: {image}, "
f"volumes: {volumes}, ports: {ports}, user: {user}, "
f"network_mode: {network_mode}, environment: {environment}, "
f"health_check: {healthcheck}, "
f"command: {command}")
kwargs = dict(name=name,
restart_policy={"Name": restart_policy},

View File

@@ -330,122 +330,6 @@
backup_wait_timeout: 1200
default_datastore_versions: mysql:8.0
- job:
name: trove-tempest-ubuntu-base-postgresql12
parent: trove-tempest-ubuntu-base
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^etc/.*$
- ^releasenotes/.*$
- ^test-requirements.txt$
- ^tox.ini$
- ^LICENSE$
- ^contrib/
- ^zuul\.d/
- ^backup/
- ^\..+
- ^trove/guestagent/strategies/replication/
- ^trove/guestagent/datastore/(mysql.*|mariadb)/.*$
vars:
devstack_localrc:
TROVE_DATASTORE_TYPE: postgresql
TROVE_DATASTORE_VERSION: 12
devstack_local_conf:
test-config:
$TEMPEST_CONFIG:
database:
enabled_datastores: "postgresql"
default_datastore_versions: postgresql:12
- job:
name: trove-tempest-ubuntu-backup-postgresql12
parent: trove-tempest-ubuntu-backup
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^etc/.*$
- ^releasenotes/.*$
- ^test-requirements.txt$
- ^tox.ini$
- ^LICENSE$
- ^contrib/
- ^zuul\.d/
- ^\..+
- ^trove/guestagent/strategies/replication/
- ^trove/guestagent/datastore/(mysql.*|mariadb)/.*$
vars:
devstack_localrc:
TROVE_DATASTORE_TYPE: postgresql
TROVE_DATASTORE_VERSION: 12
devstack_local_conf:
test-config:
$TEMPEST_CONFIG:
database:
enabled_datastores: "postgresql"
default_datastore_versions: postgresql:12
- job:
name: trove-tempest-ubuntu-replication-postgresql12
parent: trove-tempest-ubuntu-replication
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^etc/.*$
- ^releasenotes/.*$
- ^test-requirements.txt$
- ^tox.ini$
- ^LICENSE$
- ^contrib/
- ^zuul\.d/
- ^backup/
- ^\..+
- ^trove/guestagent/datastore/(mysql.*|mariadb)/.*$
- ^trove/guestagent/strategies/replication/(mariadb.*|mysql.*)\.py$
vars:
devstack_localrc:
TROVE_DATASTORE_TYPE: postgresql
TROVE_DATASTORE_VERSION: 12
devstack_local_conf:
test-config:
$TEMPEST_CONFIG:
database:
enabled_datastores: "postgresql"
default_datastore_versions: postgresql:12
- job:
name: trove-tempest-cinder-storage-driver-postgresql12
parent: trove-tempest-snapshot
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^etc/.*$
- ^releasenotes/.*$
- ^test-requirements.txt$
- ^tox.ini$
- ^LICENSE$
- ^contrib/
- ^zuul\.d/
- ^backup/
- ^\..+
- ^trove/guestagent/datastore/(mysql|mariadb)/.*$
- ^trove/guestagent/strategies/replication/(mysql.*|mariadb.*)\.py$
vars:
devstack_localrc:
TROVE_DATASTORE_TYPE: postgresql
TROVE_DATASTORE_VERSION: 12
devstack_local_conf:
test-config:
$TEMPEST_CONFIG:
database:
backup_wait_timeout: 1200
enabled_datastores: "postgresql"
default_datastore_versions: postgresql:12
- job:
name: publish-trove-guest-image
parent: publish-openstack-artifacts

117
zuul.d/postgresql_jobs.yaml Normal file
View File

@@ -0,0 +1,117 @@
# PostgreSQL jobs
- job:
name: trove-tempest-ubuntu-base-postgresql17
parent: trove-tempest-ubuntu-base
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^etc/.*$
- ^releasenotes/.*$
- ^test-requirements.txt$
- ^tox.ini$
- ^LICENSE$
- ^contrib/
- ^zuul\.d/
- ^backup/
- ^\..+
- ^trove/guestagent/strategies/replication/
- ^trove/guestagent/datastore/(mysql.*|mariadb)/.*$
vars:
devstack_localrc:
TROVE_DATASTORE_TYPE: postgresql
TROVE_DATASTORE_VERSION: 17
devstack_local_conf:
test-config:
$TEMPEST_CONFIG:
database:
enabled_datastores: "postgresql"
default_datastore_versions: postgresql:17
- job:
name: trove-tempest-ubuntu-backup-postgresql17
parent: trove-tempest-ubuntu-backup
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^etc/.*$
- ^releasenotes/.*$
- ^test-requirements.txt$
- ^tox.ini$
- ^LICENSE$
- ^contrib/
- ^zuul\.d/
- ^\..+
- ^trove/guestagent/strategies/replication/
- ^trove/guestagent/datastore/(mysql.*|mariadb)/.*$
vars:
devstack_localrc:
TROVE_DATASTORE_TYPE: postgresql
TROVE_DATASTORE_VERSION: 17
devstack_local_conf:
test-config:
$TEMPEST_CONFIG:
database:
enabled_datastores: "postgresql"
default_datastore_versions: postgresql:17
- job:
name: trove-tempest-ubuntu-replication-postgresql17
parent: trove-tempest-ubuntu-replication
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^etc/.*$
- ^releasenotes/.*$
- ^test-requirements.txt$
- ^tox.ini$
- ^LICENSE$
- ^contrib/
- ^zuul\.d/
- ^backup/
- ^\..+
- ^trove/guestagent/datastore/(mysql.*|mariadb)/.*$
- ^trove/guestagent/strategies/replication/(mariadb.*|mysql.*)\.py$
vars:
devstack_localrc:
TROVE_DATASTORE_TYPE: postgresql
TROVE_DATASTORE_VERSION: 17
devstack_local_conf:
test-config:
$TEMPEST_CONFIG:
database:
enabled_datastores: "postgresql"
default_datastore_versions: postgresql:17
- job:
name: trove-tempest-cinder-storage-driver-postgresql17
parent: trove-tempest-snapshot
irrelevant-files:
- ^.*\.rst$
- ^api-ref/.*$
- ^doc/.*$
- ^etc/.*$
- ^releasenotes/.*$
- ^test-requirements.txt$
- ^tox.ini$
- ^LICENSE$
- ^contrib/
- ^zuul\.d/
- ^backup/
- ^\..+
- ^trove/guestagent/datastore/(mysql|mariadb)/.*$
- ^trove/guestagent/strategies/replication/(mysql.*|mariadb.*)\.py$
vars:
devstack_localrc:
TROVE_DATASTORE_TYPE: postgresql
TROVE_DATASTORE_VERSION: 17
devstack_local_conf:
test-config:
$TEMPEST_CONFIG:
database:
backup_wait_timeout: 1200
enabled_datastores: "postgresql"
default_datastore_versions: postgresql:17

View File

@@ -26,12 +26,13 @@
voting: false
- trove-tempest-cinder-storage-driver-mariadb11.4:
voting: false
- trove-tempest-ubuntu-base-postgresql12
- trove-tempest-ubuntu-backup-postgresql12:
- trove-tempest-ubuntu-base-postgresql17:
voting: false
- trove-tempest-ubuntu-replication-postgresql12:
- trove-tempest-ubuntu-backup-postgresql17:
voting: false
- trove-tempest-cinder-storage-driver-postgresql12:
- trove-tempest-ubuntu-replication-postgresql17:
voting: false
- trove-tempest-cinder-storage-driver-postgresql17:
voting: false
- openstack-tox-cover:
voting: true
@@ -43,7 +44,7 @@
jobs:
- trove-tempest-ubuntu-base-mysql8.0
- trove-tempest-ubuntu-base-mariadb11.4
- trove-tempest-ubuntu-base-postgresql12
- trove-tempest-ubuntu-base-postgresql17
experimental:
jobs:
- trove-tempest-ipv6-only