Customizations for Nova

Change-Id: I7556d6cd473516c7ceb4aba7c1ba1130af2544ee
Partially-implements: blueprint third-party-plugin-support
This commit is contained in:
Paul Bourke 2016-08-05 11:50:16 +00:00
parent d8755e173f
commit d3c60d0035
12 changed files with 272 additions and 173 deletions

View File

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

View File

@ -1,50 +1,57 @@
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
openstack-nova-common \
python-keystoneclient \
python-cinderclient \
bridge-utils \
openvswitch \
&& yum clean all
{% set nova_base_packages = [
'openstack-nova-common',
'python-keystoneclient',
'python-cinderclient',
'bridge-utils',
'openvswitch'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
nova-common \
python-nova \
bridge-utils \
openvswitch-switch \
&& apt-get clean
{% set nova_base_packages = [
'nova-common',
'python-nova',
'bridge-utils',
'openvswitch-switch'
] %}
{% endif %}
{{ macros.install_packages(nova_base_packages | customizable("packages")) }}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
bridge-utils \
openvswitch \
&& yum clean all
{% set nova_base_packages = [
'bridge-utils',
'openvswitch'
] %}
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get -y install --no-install-recommends \
iptables \
iproute2 \
ebtables \
dnsmasq \
bridge-utils \
python-libvirt \
openssh-client \
openvswitch-switch \
&& apt-get clean
{% set nova_base_packages = [
'iptables',
'iproute2',
'ebtables',
'dnsmasq',
'bridge-utils',
'python-libvirt',
'openssh-client',
'openvswitch-switch'
] %}
{% endif %}
{{ macros.install_packages(nova_base_packages | customizable("packages")) }}
ADD nova-base-archive /nova-base-source
RUN ln -s nova-base-source/* nova \
&& useradd --user-group --create-home --home-dir /var/lib/nova nova \
@ -67,3 +74,5 @@ RUN touch /usr/local/bin/kolla_nova_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_nova_extend_start
RUN usermod -a -G kolla nova
{% block nova_base_footer %}{% endblock %}

View File

@ -1,24 +1,32 @@
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
openstack-nova-compute \
&& yum clean all
{% set nova_compute_ironic_packages = [
'openstack-nova-compute'
] %}
{{ macros.install_packages(nova_compute_ironic_packages | customizable("packages")) }}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
nova-compute \
&& apt-get clean
{% set nova_compute_ironic_packages = [
'nova-compute'
] %}
{{ macros.install_packages(nova_compute_ironic_packages | customizable("packages")) }}
RUN rm /etc/nova/nova-compute.conf
{% endif %}
{% endif %}
{% block nova_compute_ironic_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER nova

View File

@ -1,68 +1,78 @@
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
openstack-nova-compute \
openvswitch \
sysfsutils \
ceph-common \
genisoimage \
iscsi-initiator-utils \
targetcli \
python-rtslib \
&& yum clean all
{% set nova_compute_packages = [
'openstack-nova-compute',
'openvswitch',
'sysfsutils',
'ceph-common',
'genisoimage',
'iscsi-initiator-utils',
'targetcli',
'python-rtslib'
] %}
{{ macros.install_packages(nova_compute_packages | customizable("packages")) }}
{% elif base_distro in ['ubuntu'] %}
# ironic as workaround https://bugs.launchpad.net/packstack/+bug/1430388
RUN apt-get -y install --no-install-recommends \
nova-compute \
openvswitch-switch \
sysfsutils \
ceph-common \
ironic-common \
python-ironicclient \
genisoimage \
open-iscsi \
targetcli \
python-rtslib \
&& apt-get clean \
&& rm -f /etc/nova/nova-compute.conf
# ironic as workaround https://bugs.launchpad.net/packstack/+bug/1430388
{% set nova_compute_packages = [
'nova-compute',
'openvswitch-switch',
'sysfsutils',
'ceph-common',
'ironic-common',
'python-ironicclient',
'genisoimage',
'open-iscsi',
'targetcli',
'python-rtslib'
] %}
{{ macros.install_packages(nova_compute_packages | customizable("packages")) }}
RUN rm -f /etc/nova/nova-compute.conf
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
libvirt-devel \
openvswitch \
qemu-img \
sysfsutils \
ceph-common \
genisoimage \
iscsi-initiator-utils \
targetcli \
python-rtslib \
&& yum clean all
{% set nova_compute_packages = [
'libvirt-devel',
'openvswitch',
'qemu-img',
'sysfsutils',
'ceph-common',
'genisoimage',
'iscsi-initiator-utils',
'targetcli',
'python-rtslib'
] %}
{% elif base_distro in ['ubuntu', 'debian'] %}
RUN apt-get -y install --no-install-recommends \
libvirt-dev \
qemu-utils \
ceph-common \
genisoimage \
open-iscsi \
targetcli \
python-rtslib \
&& apt-get clean \
&& mkdir -p /etc/ceph
{% set nova_compute_packages = [
'libvirt-dev',
'qemu-utils',
'ceph-common',
'genisoimage',
'open-iscsi',
'targetcli',
'python-rtslib'
] %}
RUN mkdir -p /etc/ceph
{% endif %}
{{ macros.install_packages(nova_compute_packages | customizable("packages")) }}
RUN /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt libvirt-python
{% endif %}
@ -73,6 +83,8 @@ RUN chmod 755 /usr/local/bin/kolla_nova_extend_start \
ENV PATH $PATH:/lib/udev
{% block nova_compute_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER nova

View File

@ -1,22 +1,29 @@
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
openstack-nova-conductor \
&& yum clean all
{% set nova_conductor_packages = [
'openstack-nova-conductor'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
nova-conductor \
&& apt-get clean
{% set nova_conductor_packages = [
'nova-conductor'
] %}
{% endif %}
{{ macros.install_packages(nova_conductor_packages | customizable("packages")) }}
{% endif %}
{% block nova_conductor_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER nova

View File

@ -1,23 +1,30 @@
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
openstack-nova-console \
&& yum clean all
{% set nova_consoleauth_packages = [
'openstack-nova-console'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
nova-consoleauth \
python-memcache \
&& apt-get clean
{% set nova_consoleauth_packages = [
'nova-consoleauth',
'python-memcache'
] %}
{% endif %}
{{ macros.install_packages(nova_consoleauth_packages | customizable("packages")) }}
{% endif %}
{% block nova_consoleauth_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER nova

View File

@ -1,47 +1,64 @@
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% set libvirt_group = 'libvirtd' %}
{% import "macros.j2" as macros with context %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
libvirt-daemon \
libguestfs \
qemu-system-x86 \
libvirt-daemon-driver-nwfilter \
libvirt-daemon-config-nwfilter \
libvirt-daemon-driver-lxc \
ceph-common \
&& yum clean all \
&& usermod -a -G nova qemu
{% set nova_libvirt_packages = [
'libvirt-daemon',
'libguestfs',
'qemu-system-x86',
'libvirt-daemon-driver-nwfilter',
'libvirt-daemon-config-nwfilter',
'libvirt-daemon-driver-lxc',
'ceph-common'
] %}
{% elif base_distro == 'ubuntu' %}
{% set nova_libvirt_packages = [
'ceph-common',
'libvirt-bin',
'dmidecode',
'pm-utils',
'qemu',
'qemu-block-extra',
'ebtables',
'xen-utils-4.6'
] %}
{% set libvirt_group = 'libvirtd' %}
{% elif base_distro == 'debian' %}
{% set nova_libvirt_packages = [
'ceph-common',
'libvirt-bin',
'dmidecode',
'pm-utils',
'qemu',
'qemu-block-extra',
'ebtables',
'xen-utils-4.4',
'usermode'
] %}
{% set libvirt_group = 'libvirt' %}
{% endif %}
{{ macros.install_packages(nova_libvirt_packages | customizable("packages")) }}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN usermod -a -G nova qemu
{% elif base_distro in ['ubuntu', 'debian'] %}
{% if base_distro == 'ubuntu' %}
{% set packages =
' xen-utils-4.6'
%}
{% elif base_distro == 'debian' %}
{% set packages =
' xen-utils-4.4 usermode'
%}
{% set libvirt_group = 'libvirt' %}
{% endif %}
RUN apt-get -y install --no-install-recommends \
ceph-common \
libvirt-bin \
dmidecode \
pm-utils \
qemu \
qemu-block-extra \
ebtables \
{{ packages }} \
&& apt-get clean \
&& mkdir -p /etc/ceph \
&& rm -f /etc/libvirt/qemu/networks/default.xml /etc/libvirt/qemu/networks/autostart/default.xml \
RUN mkdir -p /etc/ceph \
&& rm -f /etc/libvirt/qemu/networks/default.xml \
/etc/libvirt/qemu/networks/autostart/default.xml \
&& usermod -a -G {{ libvirt_group }} nova
{% endif %}
@ -49,4 +66,6 @@ RUN apt-get -y install --no-install-recommends \
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{% block nova_libvirt_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}

View File

@ -1,32 +1,39 @@
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
openstack-nova-network \
bridge-utils \
initscripts \
&& yum clean all
{% set nova_network_packages = [
'openstack-nova-network',
'bridge-utils',
'initscripts'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
nova-network \
&& apt-get clean
{% set nova_network_packages = [
'nova-network'
] %}
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
initscripts \
&& yum clean all
{% set nova_network_packages = [
'initscripts'
] %}
{% endif %}
{{ macros.install_packages(nova_network_packages | customizable("packages")) }}
{% endif %}
{% block nova_network_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER nova

View File

@ -1,21 +1,26 @@
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
novnc \
openstack-nova-novncproxy \
&& yum clean all
{% set nova_novncproxy_packages = [
'novnc',
'openstack-nova-novncproxy'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
nova-novncproxy \
&& apt-get clean
{% set nova_novncproxy_packages = [
'nova-novncproxy'
] %}
{% endif %}
{{ macros.install_packages(nova_novncproxy_packages | customizable("packages")) }}
{% elif install_type == 'source' %}
ADD nova-novncproxy-archive /usr/share/nova-novncproxy-source
@ -25,6 +30,8 @@ RUN cd /usr/share \
{% endif %}
{% block nova_novncproxy_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER nova

View File

@ -1,22 +1,29 @@
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
openstack-nova-scheduler \
&& yum clean all
{% set nova_scheduler_packages = [
'openstack-nova-scheduler'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
nova-scheduler \
&& apt-get clean
{% set nova_scheduler_packages = [
'nova-scheduler'
] %}
{% endif %}
{{ macros.install_packages(nova_scheduler_packages | customizable("packages")) }}
{% endif %}
{% block nova_scheduler_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER nova

View File

@ -1,28 +1,36 @@
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
RUN yum -y install \
openstack-nova-spicehtml5proxy \
spice-html5 \
&& yum clean all
{% set nova_spicehtml5proxy_packages = [
'openstack-nova-spicehtml5proxy',
'spice-html5'
] %}
{% elif base_distro in ['ubuntu'] %}
RUN apt-get -y install --no-install-recommends \
nova-spiceproxy \
&& apt-get clean
{% set nova_spicehtml5proxy_packages = [
'nova-spiceproxy'
] %}
{% endif %}
{{ macros.install_packages(nova_spicehtml5proxy_packages | customizable("packages")) }}
{% elif install_type == 'source' %}
ADD nova-spicehtml5proxy-archive /usr/share/nova-spicehtml5proxy-source
RUN cd /usr/share && ln -s nova-spicehtml5proxy-source/* spice-html5
RUN cd /usr/share \
&& ln -s nova-spicehtml5proxy-source/* spice-html5
{% endif %}
{% block nova_spicehtml5proxy_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}
USER nova

View File

@ -1,23 +1,24 @@
FROM {{ namespace }}/{{ image_prefix }}nova-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %}
{% import "macros.j2" as macros with context %}
RUN yum -y install \
openssh-server \
&& yum clean all
{% set nova_ssh_packages = [
'openssh-server'
] %}
{% elif base_distro in ['ubuntu', 'debian'] %}
{% if base_distro in ['ubuntu', 'debian'] %}
RUN apt-get -y install --no-install-recommends \
openssh-server \
&& apt-get clean \
&& mkdir -p /var/run/sshd \
RUN mkdir -p /var/run/sshd \
&& chmod 0755 /var/run/sshd
{% endif %}
{{ macros.install_packages(nova_ssh_packages | customizable("packages")) }}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{% block nova_ssh_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}