Use one data container for all data volumes
The previous method of using the API image for a data container worked, but resulted in more data being bindmounted and copied into the system. This patch resolves that by essentially using a distro-type as a FROM in a Dockerfile to generate distro-type-data. Further all of the data containers used throughout ansible are modified to use this new data container. Change-Id: I8846573d4f2d4b98d4f46c770bfefc6d4c5cd0b5 Partially-Implements: blueprint one-data-container
This commit is contained in:
parent
ac61653343
commit
bd5e5bbb64
@ -28,6 +28,10 @@ cinder_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ dock
|
||||
cinder_api_tag: "{{ openstack_release }}"
|
||||
cinder_api_image_full: "{{ cinder_api_image }}:{{ cinder_api_tag }}"
|
||||
|
||||
cinder_data_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-data"
|
||||
cinder_data_image_tag: "{{ openstack_release }}"
|
||||
cinder_data_image_full: "{{ cinder_data_image }}:{{ cinder_data_image_tag }}"
|
||||
|
||||
|
||||
####################
|
||||
# Openstack
|
||||
|
@ -40,8 +40,7 @@
|
||||
password: "{{ docker_registry_password }}"
|
||||
insecure_registry: "{{ docker_insecure_registry }}"
|
||||
name: cinder_data
|
||||
image: "{{ cinder_api_image_full }}"
|
||||
command: "/bin/sleep infinity"
|
||||
image: "{{ cinder_data_image_full }}"
|
||||
volumes: "/var/lib/cinder/"
|
||||
|
||||
- name: Starting Cinder bootstrap container
|
||||
|
@ -20,6 +20,10 @@ glance_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ dock
|
||||
glance_api_tag: "{{ openstack_release }}"
|
||||
glance_api_image_full: "{{ glance_api_image }}:{{ glance_api_tag }}"
|
||||
|
||||
glance_data_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-data"
|
||||
glance_data_image_tag: "{{ openstack_release }}"
|
||||
glance_data_image_full: "{{ glance_data_image }}:{{ glance_data_image_tag }}"
|
||||
|
||||
|
||||
####################
|
||||
# Openstack
|
||||
|
@ -40,8 +40,7 @@
|
||||
password: "{{ docker_registry_password }}"
|
||||
insecure_registry: "{{ docker_insecure_registry }}"
|
||||
name: glance_data
|
||||
image: "{{ glance_registry_image_full }}"
|
||||
command: "/bin/sleep infinity"
|
||||
image: "{{ glance_data_image_full }}"
|
||||
volumes: "/var/lib/glance/"
|
||||
|
||||
- name: Starting Glance bootstrap container
|
||||
|
@ -13,3 +13,7 @@ database_cluster_name: "openstack"
|
||||
mariadb_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-galera"
|
||||
mariadb_tag: "{{ openstack_release }}"
|
||||
mariadb_image_full: "{{ mariadb_image }}:{{ mariadb_tag }}"
|
||||
|
||||
mariadb_data_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-data"
|
||||
mariadb_data_tag: "{{ openstack_release }}"
|
||||
mariadb_data_image_full: "{{ mariadb_data_image }}:{{ mariadb_data_tag }}"
|
||||
|
@ -49,8 +49,7 @@
|
||||
password: "{{ docker_registry_password }}"
|
||||
insecure_registry: "{{ docker_insecure_registry }}"
|
||||
name: mariadb_data
|
||||
image: "{{ mariadb_image_full }}"
|
||||
command: "/bin/sleep infinity"
|
||||
image: "{{ mariadb_data_image_full }}"
|
||||
volumes: "/var/lib/mysql/"
|
||||
|
||||
- name: Starting MariaDB bootstrap container
|
||||
|
@ -8,6 +8,10 @@ rabbitmq_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker
|
||||
rabbitmq_tag: "{{ openstack_release }}"
|
||||
rabbitmq_image_full: "{{ rabbitmq_image }}:{{ rabbitmq_tag }}"
|
||||
|
||||
rabbitmq_data_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-data"
|
||||
rabbitmq_data_tag: "{{ openstack_release }}"
|
||||
rabbitmq_data_image_full: "{{ rabbitmq_data_image }}:{{ rabbitmq_data_tag }}"
|
||||
|
||||
|
||||
####################
|
||||
# Message-Broker
|
||||
|
@ -20,8 +20,7 @@
|
||||
password: "{{ docker_registry_password }}"
|
||||
insecure_registry: "{{ docker_insecure_registry }}"
|
||||
name: rabbitmq_data
|
||||
image: "{{ rabbitmq_image_full }}"
|
||||
command: "/bin/sleep infinity"
|
||||
image: "{{ rabbitmq_data_image_full }}"
|
||||
volumes: "/var/lib/rabbitmq/"
|
||||
|
||||
- name: Starting RabbitMQ bootstrap container
|
||||
|
4
docker/centos/binary/data/Dockerfile
Normal file
4
docker/centos/binary/data/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
||||
FROM centos
|
||||
MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
||||
|
||||
CMD /bin/sleep infinity
|
1
docker/centos/binary/data/build
Symbolic link
1
docker/centos/binary/data/build
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../tools/build-docker-image
|
@ -19,7 +19,8 @@ RUN echo "[mariadb]" > /etc/yum.repos.d/MariaDB.repo && \
|
||||
percona-xtrabackup \
|
||||
pv \
|
||||
tar \
|
||||
expect
|
||||
expect \
|
||||
&& rm -rf /var/lib/mysql/*
|
||||
|
||||
COPY config-galera.sh /opt/kolla/config/
|
||||
COPY config-external.sh /opt/kolla/
|
||||
|
@ -5,7 +5,8 @@ RUN yum -y install \
|
||||
hostname \
|
||||
rabbitmq-server && \
|
||||
yum clean all && \
|
||||
/usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management
|
||||
/usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management \
|
||||
&& rm -rf /var/lib/rabbitmq/*
|
||||
|
||||
COPY config-rabbit.sh config-external.sh /opt/kolla/
|
||||
COPY start.sh /
|
||||
|
4
docker/centos/source/data/Dockerfile
Normal file
4
docker/centos/source/data/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
||||
FROM centos
|
||||
MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
||||
|
||||
CMD /bin/sleep infinity
|
1
docker/centos/source/data/build
Symbolic link
1
docker/centos/source/data/build
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../tools/build-docker-image
|
@ -74,13 +74,8 @@ function configure_db {
|
||||
}
|
||||
|
||||
function populate_db {
|
||||
if [[ $(ls /var/lib/mysql) == "" ]]; then
|
||||
echo "POPULATING NEW DB"
|
||||
mysql_install_db
|
||||
chown -R mysql: /var/lib/mysql
|
||||
else
|
||||
echo "DB ALREADY EXISTS"
|
||||
fi
|
||||
mysql_install_db
|
||||
chown -R mysql: /var/lib/mysql
|
||||
}
|
||||
|
||||
function prepare_db {
|
||||
|
@ -2,6 +2,6 @@
|
||||
|
||||
function set_rabbitmq_cookie {
|
||||
echo "${RABBITMQ_CLUSTER_COOKIE}" > /var/lib/rabbitmq/.erlang.cookie
|
||||
chown rabbitmq: /var/lib/rabbitmq/.erlang.cookie
|
||||
chown -R rabbitmq: /var/lib/rabbitmq
|
||||
chmod 400 /var/lib/rabbitmq/.erlang.cookie
|
||||
}
|
||||
|
4
docker_templates/data/Dockerfile.j2
Normal file
4
docker_templates/data/Dockerfile.j2
Normal file
@ -0,0 +1,4 @@
|
||||
FROM {{ base_distro }}:{{ base_distro_tag }}
|
||||
MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
||||
|
||||
CMD /bin/sleep infinity
|
@ -21,12 +21,16 @@ RUN yum install -y http://www.percona.com/redir/downloads/percona-release/redhat
|
||||
percona-xtrabackup \
|
||||
pv \
|
||||
tar \
|
||||
expect
|
||||
expect \
|
||||
&& rm -rf /var/lib/mysql/*
|
||||
|
||||
{% elif base_distro in ['ubuntu', 'debian'] %}
|
||||
|
||||
RUN ["/bin/false"]
|
||||
|
||||
# TODO(sdake) when ubuntu support is implemented we will need a line
|
||||
# && rm -rf /var/lib/mysql/
|
||||
|
||||
{% endif %}
|
||||
|
||||
COPY config-galera.sh /opt/kolla/config/
|
||||
|
@ -6,14 +6,16 @@ MAINTAINER Kolla Project (https://launchpad.net/kolla)
|
||||
RUN yum -y install \
|
||||
hostname \
|
||||
rabbitmq-server \
|
||||
&& yum clean all
|
||||
&& yum clean all \
|
||||
&& rm -rf /var/lib/rabbitmq/*
|
||||
|
||||
{% elif base_distro in ['ubuntu', 'debian'] %}
|
||||
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
hostname \
|
||||
rabbitmq-server \
|
||||
&& apt-get clean
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/rabbitmq/*
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
@ -37,7 +37,7 @@ if ! [ -f "$IMAGE" ]; then
|
||||
curl -L -o ./$IMAGE $IMAGE_URL/$IMAGE
|
||||
fi
|
||||
echo Creating glance image.
|
||||
glance image-create --name cirros --progress --disk-format qcow2 --container-format bare --visibility public --progress --file ./$IMAGE
|
||||
glance image-create --name cirros --progress --disk-format qcow2 --container-format bare --progress --file ./$IMAGE
|
||||
|
||||
if [[ "${NETWORK_MANAGER}" == "nova" ]] ; then
|
||||
echo Configuring nova networking.
|
||||
|
Loading…
Reference in New Issue
Block a user