Merge "Using local registry in devstack."

This commit is contained in:
Zuul 2023-02-27 16:11:02 +00:00 committed by Gerrit Code Review
commit 60a202d065
5 changed files with 47 additions and 6 deletions

View File

@ -1 +1,2 @@
libxslt1-dev # testonly libxslt1-dev # testonly
docker.io

View File

@ -1 +1,2 @@
libxslt-devel # testonly libxslt-devel # testonly
docker

View File

@ -274,6 +274,8 @@ function configure_trove {
iniset $TROVE_GUESTAGENT_CONF mysql docker_image ${TROVE_DATABASE_IMAGE_MYSQL} iniset $TROVE_GUESTAGENT_CONF mysql docker_image ${TROVE_DATABASE_IMAGE_MYSQL}
iniset $TROVE_GUESTAGENT_CONF mysql backup_docker_image ${TROVE_DATABASE_BACKUP_IMAGE_MYSQL} iniset $TROVE_GUESTAGENT_CONF mysql backup_docker_image ${TROVE_DATABASE_BACKUP_IMAGE_MYSQL}
iniset $TROVE_GUESTAGENT_CONF mariadb docker_image ${TROVE_DATABASE_IMAGE_MARIADB}
iniset $TROVE_GUESTAGENT_CONF mariadb backup_docker_image ${TROVE_DATABASE_BACKUP_IMAGE_MARIADB}
iniset $TROVE_GUESTAGENT_CONF postgresql docker_image ${TROVE_DATABASE_IMAGE_POSTGRES} iniset $TROVE_GUESTAGENT_CONF postgresql docker_image ${TROVE_DATABASE_IMAGE_POSTGRES}
iniset $TROVE_GUESTAGENT_CONF postgresql backup_docker_image ${TROVE_DATABASE_BACKUP_IMAGE_POSTGRES} iniset $TROVE_GUESTAGENT_CONF postgresql backup_docker_image ${TROVE_DATABASE_BACKUP_IMAGE_POSTGRES}
@ -501,6 +503,20 @@ function create_guest_image {
fi fi
} }
function create_registry_container {
# running a docker registry container
echo "Running a docker 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 registry:2
trove_agent_datastore_url=https://tarballs.opendev.org/openstack/trove/images/trove-datastore-registry-master.tar.gz
curl -o trove-datastore-registry-master.tar.gz $trove_agent_datastore_url
sudo tar -zxvf trove-datastore-registry-master.tar.gz -C /opt/trove_registry/
rm -rf trove-datastore-registry-master.tar.gz
fi
iniset $TROVE_CONF DEFAULT docker_insecure_registries "$TROVE_HOST_GATEWAY:4000"
}
# Set up Trove management network and make configuration change. # Set up Trove management network and make configuration change.
function config_trove_network { function config_trove_network {
echo "Finalizing Neutron networking for Trove" echo "Finalizing Neutron networking for Trove"
@ -639,6 +655,9 @@ if is_service_enabled trove; then
config_mgmt_security_group config_mgmt_security_group
config_trove_network config_trove_network
create_guest_image create_guest_image
if [ "$TROVE_ENABLE_LOCAL_REGISTRY" == "True" ] ; then
create_registry_container
fi
echo_summary "Starting Trove" echo_summary "Starting Trove"
start_trove start_trove

View File

@ -5,6 +5,8 @@
TROVE_DIR=${TROVE_DIR:-${DEST}/trove} TROVE_DIR=${TROVE_DIR:-${DEST}/trove}
TROVE_REPO=${TROVE_REPO:-${GIT_BASE}/openstack/trove.git} TROVE_REPO=${TROVE_REPO:-${GIT_BASE}/openstack/trove.git}
TROVE_BRANCH=${TROVE_BRANCH:-master} TROVE_BRANCH=${TROVE_BRANCH:-master}
# Default is set to False
TROVE_ENABLE_LOCAL_REGISTRY=${TROVE_ENABLE_LOCAL_REGISTRY:-False}
TROVE_CLIENT_DIR=${TROVE_CLIENT_DIR:-${TROVECLIENT_DIR:-${DEST}/python-troveclient}} TROVE_CLIENT_DIR=${TROVE_CLIENT_DIR:-${TROVECLIENT_DIR:-${DEST}/python-troveclient}}
TROVE_CLIENT_REPO=${TROVE_CLIENT_REPO:-${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git}} TROVE_CLIENT_REPO=${TROVE_CLIENT_REPO:-${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git}}
@ -87,7 +89,16 @@ TROVE_ENABLE_IMAGE_BUILD=${TROVE_ENABLE_IMAGE_BUILD:-"true"}
TROVE_NON_DEV_IMAGE_URL=${TROVE_NON_DEV_IMAGE_URL:-""} TROVE_NON_DEV_IMAGE_URL=${TROVE_NON_DEV_IMAGE_URL:-""}
# Customized database container images # Customized database container images
if [ "$TROVE_ENABLE_LOCAL_REGISTRY" == "True" ] ; then
TROVE_DATABASE_IMAGE_MYSQL=${TROVE_DATABASE_IMAGE_MYSQL:-"$TROVE_HOST_GATEWAY:4000/trove-datastores/mysql"}
TROVE_DATABASE_IMAGE_MARIADB=${TROVE_DATABASE_IMAGE_MARIAD:-"$TROVE_HOST_GATEWAY:4000/trove-datastores/mariadb"}
TROVE_DATABASE_IMAGE_POSTGRES=${TROVE_DATABASE_IMAGE_POSTGRES:-"$TROVE_HOST_GATEWAY:4000/trove-datastores/postgres"}
TROVE_DATABASE_BACKUP_IMAGE_MYSQL=${TROVE_DATABASE_BACKUP_IMAGE_MYSQL:-"$TROVE_HOST_GATEWAY:4000/trove-datastores/db-backup-mysql:1.1.0"}
TROVE_DATABASE_BACKUP_IMAGE_MARIADB=${TROVE_DATABASE_BACKUP_IMAGE_MARIADB:-"$TROVE_HOST_GATEWAY:4000/trove-datastores/db-backup-mariadb:1.1.0"}
TROVE_DATABASE_BACKUP_IMAGE_POSTGRES=${TROVE_DATABASE_BACKUP_IMAGE_POSTGRES:-"$TROVE_HOST_GATEWAY:4000/trove-datastores/db-backup-postgresql:1.1.2"}
else
TROVE_DATABASE_IMAGE_MYSQL=${TROVE_DATABASE_IMAGE_MYSQL:-"catalystcloud/mysql"} TROVE_DATABASE_IMAGE_MYSQL=${TROVE_DATABASE_IMAGE_MYSQL:-"catalystcloud/mysql"}
TROVE_DATABASE_IMAGE_POSTGRES=${TROVE_DATABASE_IMAGE_POSTGRES:-"catalystcloud/postgres"} TROVE_DATABASE_IMAGE_POSTGRES=${TROVE_DATABASE_IMAGE_POSTGRES:-"catalystcloud/postgres"}
TROVE_DATABASE_BACKUP_IMAGE_MYSQL=${TROVE_DATABASE_BACKUP_IMAGE_MYSQL:-"catalystcloud/db-backup-mysql:1.1.0"} TROVE_DATABASE_BACKUP_IMAGE_MYSQL=${TROVE_DATABASE_BACKUP_IMAGE_MYSQL:-"catalystcloud/db-backup-mysql:1.1.0"}
TROVE_DATABASE_BACKUP_IMAGE_POSTGRES=${TROVE_DATABASE_BACKUP_IMAGE_POSTGRES:-"catalystcloud/db-backup-postgresql:1.1.2"} TROVE_DATABASE_BACKUP_IMAGE_POSTGRES=${TROVE_DATABASE_BACKUP_IMAGE_POSTGRES:-"catalystcloud/db-backup-postgresql:1.1.2"}
fi

View File

@ -46,6 +46,8 @@
Q_PLUGIN: ml2 Q_PLUGIN: ml2
Q_ML2_TENANT_NETWORK_TYPE: vxlan Q_ML2_TENANT_NETWORK_TYPE: vxlan
Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch
TROVE_ENABLE_LOCAL_REGISTRY: True
TROVE_DATASTORE_VERSION: 5.7
run: playbooks/trove-devstack-base.yaml run: playbooks/trove-devstack-base.yaml
irrelevant-files: irrelevant-files:
- ^.*\.rst$ - ^.*\.rst$
@ -290,11 +292,17 @@
Q_PLUGIN: ml2 Q_PLUGIN: ml2
Q_ML2_TENANT_NETWORK_TYPE: vxlan Q_ML2_TENANT_NETWORK_TYPE: vxlan
Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch
TROVE_ENABLE_LOCAL_REGISTRY: True
TROVE_DATASTORE_VERSION: 5.7
devstack_local_conf: devstack_local_conf:
post-config: post-config:
$TROVE_CONF: $TROVE_CONF:
DEFAULT: DEFAULT:
usage_timeout: 1800 usage_timeout: 1800
test-config:
$TEMPEST_CONFIG:
database:
default_datastore_versions: mysql:5.7
devstack_plugins: devstack_plugins:
trove: https://opendev.org/openstack/trove.git trove: https://opendev.org/openstack/trove.git
devstack_services: devstack_services:
@ -356,7 +364,8 @@
Q_ML2_TENANT_NETWORK_TYPE: vxlan Q_ML2_TENANT_NETWORK_TYPE: vxlan
Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch
TROVE_DATASTORE_TYPE: postgresql TROVE_DATASTORE_TYPE: postgresql
TROVE_DATASTORE_VERSION: 12.4 TROVE_DATASTORE_VERSION: 12
TROVE_ENABLE_LOCAL_REGISTRY: True
devstack_local_conf: devstack_local_conf:
post-config: post-config:
$TROVE_CONF: $TROVE_CONF:
@ -366,7 +375,7 @@
$TEMPEST_CONFIG: $TEMPEST_CONFIG:
database: database:
enabled_datastores: "postgresql" enabled_datastores: "postgresql"
default_datastore_versions: "postgresql:12.4" default_datastore_versions: "postgresql:12"
devstack_plugins: devstack_plugins:
trove: https://opendev.org/openstack/trove.git trove: https://opendev.org/openstack/trove.git
devstack_services: devstack_services: