Merge "Customizations for Cinder"

This commit is contained in:
Jenkins 2016-08-18 11:23:21 +00:00 committed by Gerrit Code Review
commit b7a8b38d4f
6 changed files with 103 additions and 54 deletions

View File

@ -1,25 +1,33 @@
FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \ {% set cinder_api_packages = [
python-keystone \ 'python-keystone'
&& yum clean all ] %}
{% elif base_distro in ['ubuntu'] %} {% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \ {% set cinder_api_packages = [
cinder-api \ 'cinder-api'
&& apt-get clean ] %}
{% endif %} {% endif %}
RUN {{ macros.install_packages(cinder_api_packages | customizable("packages")) }}
{% endif %} {% endif %}
COPY extend_start.sh /usr/local/bin/kolla_cinder_extend_start COPY extend_start.sh /usr/local/bin/kolla_cinder_extend_start
RUN chmod 755 /usr/local/bin/kolla_cinder_extend_start RUN chmod 755 /usr/local/bin/kolla_cinder_extend_start
{% block cinder_api_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }} {{ include_footer }}
USER cinder USER cinder

View File

@ -1,16 +1,22 @@
FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% if base_distro in ['ubuntu'] %} {% if base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \ {% set cinder_backup_packages = [
cinder-backup \ 'cinder-backup'
&& apt-get clean ] %}
RUN {{ macros.install_packages(cinder_backup_packages | customizable("packages")) }}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% block cinder_backup_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }} {{ include_footer }}
USER cinder USER cinder

View File

@ -1,47 +1,51 @@
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \ {% set cinder_base_packages = [
openstack-cinder \ 'openstack-cinder',
python-automaton \ 'python-automaton',
lvm2 \ 'lvm2',
ceph-common \ 'ceph-common'
&& yum clean all \ ] %}
&& mkdir -p /etc/ceph
{% elif base_distro in ['ubuntu'] %} {% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \ {% set cinder_base_packages = [
cinder-common \ 'cinder-common',
ceph-common \ 'ceph-common',
lvm2 \ 'lvm2'
&& apt-get clean \ ] %}
&& mkdir -p /etc/ceph
{% endif %} {% endif %}
RUN {{ macros.install_packages(cinder_base_packages | customizable("packages")) }}
{% elif install_type == 'source' %} {% elif install_type == 'source' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \ {% set cinder_base_packages = [
lvm2 \ 'lvm2',
qemu-img \ 'qemu-img',
ceph-common \ 'ceph-common'
&& yum clean all ] %}
{% elif base_distro in ['ubuntu', 'debian'] %} {% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get -y install --no-install-recommends \ {% set cinder_base_packages = [
lvm2 \ 'lvm2',
qemu-utils \ 'qemu-utils',
ceph-common \ 'ceph-common'
&& apt-get clean \ ] %}
&& mkdir -p /etc/ceph
{% endif %} {% endif %}
RUN {{ macros.install_packages(cinder_base_packages | customizable("packages")) }}
ADD cinder-base-archive /cinder-base-source ADD cinder-base-archive /cinder-base-source
RUN ln -s cinder-base-source/* cinder \ RUN ln -s cinder-base-source/* cinder \
&& useradd --user-group cinder \ && useradd --user-group cinder \
@ -57,7 +61,11 @@ COPY cinder_sudoers /etc/sudoers.d/kolla_cinder_sudoers
COPY extend_start.sh /usr/local/bin/kolla_extend_start COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN usermod -a -G kolla cinder \ RUN usermod -a -G kolla cinder \
&& mkdir -p /etc/ceph \
&& chmod 750 /etc/sudoers.d \ && chmod 750 /etc/sudoers.d \
&& chmod 440 /etc/sudoers.d/kolla_cinder_sudoers \ && chmod 440 /etc/sudoers.d/kolla_cinder_sudoers \
&& touch /usr/local/bin/kolla_cinder_extend_start \ && touch /usr/local/bin/kolla_cinder_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_cinder_extend_start && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_cinder_extend_start
{% block cinder_base_footer %}{% endblock %}
{% block footer %}{% endblock %}

View File

@ -1,21 +1,27 @@
FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \ {% set cinder_rpcbind_packages = [
nfs-utils \ 'nfs-utils',
nfs-utils-lib \ 'nfs-utils-lib'
&& yum clean all ] %}
{% elif base_distro in ['ubuntu', 'debian'] %} {% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get -y install --no-install-recommends \ {% set cinder_rpcbind_packages = [
rpcbind \ 'rpcbind'
&& apt-get clean ] %}
{% endif %} {% endif %}
RUN {{ macros.install_packages(cinder_rpcbind_packages | customizable("packages")) }}
{% block cinder_rpcbind_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }} {{ include_footer }}
USER cinder USER cinder

View File

@ -1,16 +1,22 @@
FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% if base_distro in ['ubuntu'] %} {% if base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \ {% set cinder_scheduler_packages = [
cinder-scheduler \ 'cinder-scheduler'
&& apt-get clean ] %}
RUN {{ macros.install_packages(cinder_scheduler_packages | customizable("packages")) }}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% block cinder_scheduler_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }} {{ include_footer }}
USER cinder USER cinder

View File

@ -1,31 +1,44 @@
FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }} FROM {{ namespace }}/{{ image_prefix }}cinder-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \ {% set cinder_volume_packages = [
scsi-target-utils \ 'scsi-target-utils'
&& yum clean all ] %}
RUN {{ macros.install_packages(cinder_volume_packages | customizable("packages")) }}
{% block cinder_volume_redhat_setup %}
RUN sed -i '1 i include /var/lib/cinder/volumes/*' /etc/tgt/tgtd.conf RUN sed -i '1 i include /var/lib/cinder/volumes/*' /etc/tgt/tgtd.conf
{% endblock %}
{% elif base_distro in ['ubuntu', 'debian'] %} {% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get -y install --no-install-recommends \ {% set cinder_volume_packages = [
tgt \ 'tgt'
&& apt-get clean ] %}
RUN {{ macros.install_packages(cinder_volume_packages | customizable("packages")) }}
{% block cinder_volume_ubuntu_setup %}
RUN sed -i '1 i include /var/lib/cinder/volumes/*' /etc/tgt/targets.conf RUN sed -i '1 i include /var/lib/cinder/volumes/*' /etc/tgt/targets.conf
{% endblock %}
{% endif %} {% endif %}
{% if install_type == 'binary' %} {% if install_type == 'binary' %}
{% if base_distro in ['ubuntu', 'debian'] %} {% if base_distro in ['ubuntu', 'debian'] %}
RUN apt-get -y install --no-install-recommends \ {% set cinder_volume_packages = [
cinder-volume \ 'cinder-volume'
&& apt-get clean ] %}
{% endif %} RUN {{ macros.install_packages(cinder_volume_packages | customizable("packages")) }}
{% endif %}
{% endif %} {% endif %}
COPY cinder_sudoers /etc/sudoers.d/cinder_sudoers COPY cinder_sudoers /etc/sudoers.d/cinder_sudoers
@ -35,6 +48,8 @@ RUN chmod 750 /etc/sudoers.d \
&& chmod 440 /etc/sudoers.d/cinder_sudoers \ && chmod 440 /etc/sudoers.d/cinder_sudoers \
&& chmod 755 /usr/local/bin/kolla_extend_start && chmod 755 /usr/local/bin/kolla_extend_start
{% block cinder_volume_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }} {{ include_footer }}
USER cinder USER cinder