From e0c78d631007daa263335c012fea1f20ed986e73 Mon Sep 17 00:00:00 2001 From: akwasniewska Date: Thu, 13 Aug 2015 04:24:42 +0200 Subject: [PATCH] Add Dockerfile template for neutron Change-Id: Ica2afc92cae3905765e4031ea921de9b44a153fd Partially-Implements: blueprint dockerfile-template --- .../neutron/neutron-agents/Dockerfile.j2 | 31 +++++++++++++++ .../neutron/neutron-agents/fwaas_driver.ini | 1 + .../neutron-dhcp-agent/config-external.sh | 1 + .../neutron-dhcp-agent/start.sh | 1 + .../neutron-l3-agent/config-external.sh | 1 + .../neutron-l3-agent/fwaas_driver.ini | 1 + .../neutron-agents/neutron-l3-agent/start.sh | 1 + .../neutron-metadata-agent/config-external.sh | 1 + .../neutron-metadata-agent/start.sh | 1 + .../neutron/neutron-agents/supervisord.conf | 1 + .../neutron/neutron-base/Dockerfile.j2 | 39 +++++++++++++++++++ .../neutron/neutron-base/config-sudoers.sh | 1 + .../neutron/neutron-base/ip_wrapper.py | 1 + .../neutron-linuxbridge-agent/Dockerfile.j2 | 23 +++++++++++ .../config-external.sh | 1 + .../neutron-linuxbridge-agent/start.sh | 1 + .../neutron-openvswitch-agent/Dockerfile.j2 | 28 +++++++++++++ .../config-external.sh | 1 + .../neutron-openvswitch-agent/start.sh | 1 + .../neutron/neutron-server/Dockerfile.j2 | 28 +++++++++++++ .../neutron/neutron-server/config-external.sh | 1 + .../neutron/neutron-server/start.sh | 1 + 22 files changed, 166 insertions(+) create mode 100644 docker_templates/neutron/neutron-agents/Dockerfile.j2 create mode 120000 docker_templates/neutron/neutron-agents/fwaas_driver.ini create mode 120000 docker_templates/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh create mode 120000 docker_templates/neutron/neutron-agents/neutron-dhcp-agent/start.sh create mode 120000 docker_templates/neutron/neutron-agents/neutron-l3-agent/config-external.sh create mode 120000 docker_templates/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini create mode 120000 docker_templates/neutron/neutron-agents/neutron-l3-agent/start.sh create mode 120000 docker_templates/neutron/neutron-agents/neutron-metadata-agent/config-external.sh create mode 120000 docker_templates/neutron/neutron-agents/neutron-metadata-agent/start.sh create mode 120000 docker_templates/neutron/neutron-agents/supervisord.conf create mode 100644 docker_templates/neutron/neutron-base/Dockerfile.j2 create mode 120000 docker_templates/neutron/neutron-base/config-sudoers.sh create mode 120000 docker_templates/neutron/neutron-base/ip_wrapper.py create mode 100644 docker_templates/neutron/neutron-linuxbridge-agent/Dockerfile.j2 create mode 120000 docker_templates/neutron/neutron-linuxbridge-agent/config-external.sh create mode 120000 docker_templates/neutron/neutron-linuxbridge-agent/start.sh create mode 100644 docker_templates/neutron/neutron-openvswitch-agent/Dockerfile.j2 create mode 120000 docker_templates/neutron/neutron-openvswitch-agent/config-external.sh create mode 120000 docker_templates/neutron/neutron-openvswitch-agent/start.sh create mode 100644 docker_templates/neutron/neutron-server/Dockerfile.j2 create mode 120000 docker_templates/neutron/neutron-server/config-external.sh create mode 120000 docker_templates/neutron/neutron-server/start.sh diff --git a/docker_templates/neutron/neutron-agents/Dockerfile.j2 b/docker_templates/neutron/neutron-agents/Dockerfile.j2 new file mode 100644 index 0000000000..8c9b54d756 --- /dev/null +++ b/docker_templates/neutron/neutron-agents/Dockerfile.j2 @@ -0,0 +1,31 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-neutron-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net.kolla) + +{% if base_distro in ['centos', 'fedora', 'oraclelinux'] %} + +# Install supervisor +RUN easy_install supervisor + +# Install supervisor-stdout +RUN pip install supervisor-stdout + +# Configure supervisord +RUN mkdir -p /var/log/supervisor/ +COPY supervisord.conf /etc/ + +{% endif %} + +# TODO: SamYaple FWaaS is part of the l3-agent, not a seperate agent that is +# why this file is needed. To support FWaaS we cannot have a seperate container +# I need to figure out the best way to make this work together +# +# This file _does_ _not_ need to exist, you must remove referencing it from the +# exec line in the start script. Also all these config options can exist in the +# main neutron.conf if we wish +COPY fwaas_driver.ini /etc/neutron/ + +COPY neutron-dhcp-agent/ /opt/kolla/neutron-dhcp-agent +COPY neutron-l3-agent/ /opt/kolla/neutron-l3-agent +COPY neutron-metadata-agent/ /opt/kolla/neutron-metadata-agent + +CMD ["/usr/bin/supervisord"] diff --git a/docker_templates/neutron/neutron-agents/fwaas_driver.ini b/docker_templates/neutron/neutron-agents/fwaas_driver.ini new file mode 120000 index 0000000000..1cee84b371 --- /dev/null +++ b/docker_templates/neutron/neutron-agents/fwaas_driver.ini @@ -0,0 +1 @@ +../../../docker/common/neutron/neutron-l3-agent/fwaas_driver.ini \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh b/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh new file mode 120000 index 0000000000..9954a4eb38 --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh @@ -0,0 +1 @@ +../../../../docker/common/neutron/neutron-dhcp-agent/config-external.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/start.sh b/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/start.sh new file mode 120000 index 0000000000..4679ff75c9 --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/start.sh @@ -0,0 +1 @@ +../../../../docker/common/neutron/neutron-dhcp-agent/start.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-l3-agent/config-external.sh b/docker_templates/neutron/neutron-agents/neutron-l3-agent/config-external.sh new file mode 120000 index 0000000000..349f755841 --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-l3-agent/config-external.sh @@ -0,0 +1 @@ +../../../../docker/common/neutron/neutron-l3-agent/config-external.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini b/docker_templates/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini new file mode 120000 index 0000000000..7e00b3b7fc --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini @@ -0,0 +1 @@ +../../../../docker/common/neutron/neutron-l3-agent/fwaas_driver.ini \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-l3-agent/start.sh b/docker_templates/neutron/neutron-agents/neutron-l3-agent/start.sh new file mode 120000 index 0000000000..3b2b832d66 --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-l3-agent/start.sh @@ -0,0 +1 @@ +../../../../docker/common/neutron/neutron-l3-agent/start.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-metadata-agent/config-external.sh b/docker_templates/neutron/neutron-agents/neutron-metadata-agent/config-external.sh new file mode 120000 index 0000000000..eeeb72d51c --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-metadata-agent/config-external.sh @@ -0,0 +1 @@ +../../../../docker/common/neutron/neutron-metadata-agent/config-external.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-metadata-agent/start.sh b/docker_templates/neutron/neutron-agents/neutron-metadata-agent/start.sh new file mode 120000 index 0000000000..a484554622 --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-metadata-agent/start.sh @@ -0,0 +1 @@ +../../../../docker/common/neutron/neutron-metadata-agent/start.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/supervisord.conf b/docker_templates/neutron/neutron-agents/supervisord.conf new file mode 120000 index 0000000000..f4d48915db --- /dev/null +++ b/docker_templates/neutron/neutron-agents/supervisord.conf @@ -0,0 +1 @@ +../../../docker/common/neutron/neutron-agents/supervisord.conf \ No newline at end of file diff --git a/docker_templates/neutron/neutron-base/Dockerfile.j2 b/docker_templates/neutron/neutron-base/Dockerfile.j2 new file mode 100644 index 0000000000..cce1f63ab2 --- /dev/null +++ b/docker_templates/neutron/neutron-base/Dockerfile.j2 @@ -0,0 +1,39 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net.kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %} + +RUN yum -y install openstack-neutron \ + openstack-neutron-ml2 \ + python-neutron-client \ + openvswitch \ + && yum clean all + + {% elif base_distro in ['ubuntu', 'debian'] %} + +RUN echo '{{ install_type}} not yet available for {{ base_distro }}' \ + && /bin/false + + {% endif %} + +{% elif install_type == 'source' %} + +ADD ./neutron.tar / +RUN ln -s /neutron-* /neutron + +RUN cd /neutron \ + && useradd --user-group neutron \ + && pip install -r requirements.txt \ + && pip install /neutron \ + && mkdir /etc/neutron /usr/share/neutron /var/log/neutron \ + && cp -r etc/* /etc/neutron/ \ + && cp -r etc/neutron/* /etc/neutron/ \ + && cp etc/api-paste.ini /usr/share/neutron \ + && mv /etc/neutron/neutron/ /etc/neutron/plugins/ \ + && chown -R neutron: /etc/neutron /var/log/neutron \ + && rm -rf /root/.cache + +{% endif %} + +COPY config-sudoers.sh /opt/kolla/ diff --git a/docker_templates/neutron/neutron-base/config-sudoers.sh b/docker_templates/neutron/neutron-base/config-sudoers.sh new file mode 120000 index 0000000000..02ea80ca77 --- /dev/null +++ b/docker_templates/neutron/neutron-base/config-sudoers.sh @@ -0,0 +1 @@ +../../../docker/common/neutron/neutron-base/config-sudoers.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-base/ip_wrapper.py b/docker_templates/neutron/neutron-base/ip_wrapper.py new file mode 120000 index 0000000000..ef59fec526 --- /dev/null +++ b/docker_templates/neutron/neutron-base/ip_wrapper.py @@ -0,0 +1 @@ +../../../docker/common/neutron/neutron-base/ip_wrapper.py \ No newline at end of file diff --git a/docker_templates/neutron/neutron-linuxbridge-agent/Dockerfile.j2 b/docker_templates/neutron/neutron-linuxbridge-agent/Dockerfile.j2 new file mode 100644 index 0000000000..5a9099848c --- /dev/null +++ b/docker_templates/neutron/neutron-linuxbridge-agent/Dockerfile.j2 @@ -0,0 +1,23 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-neutron-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net.kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %} + +# Install required packages +RUN yum install -y ebtables openstack-neutron-linuxbridge \ + && yum clean all + + {% endif %} + +{% elif install_type == 'source' %} + +# Install required packages +RUN yum install -y ebtables && yum clean all + +{% endif %} + +COPY start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] diff --git a/docker_templates/neutron/neutron-linuxbridge-agent/config-external.sh b/docker_templates/neutron/neutron-linuxbridge-agent/config-external.sh new file mode 120000 index 0000000000..1cf0fcc794 --- /dev/null +++ b/docker_templates/neutron/neutron-linuxbridge-agent/config-external.sh @@ -0,0 +1 @@ +../../../docker/common/neutron/neutron-linuxbridge-agent/config-external.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-linuxbridge-agent/start.sh b/docker_templates/neutron/neutron-linuxbridge-agent/start.sh new file mode 120000 index 0000000000..ed241551eb --- /dev/null +++ b/docker_templates/neutron/neutron-linuxbridge-agent/start.sh @@ -0,0 +1 @@ +../../../docker/common/neutron/neutron-linuxbridge-agent/start.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-openvswitch-agent/Dockerfile.j2 b/docker_templates/neutron/neutron-openvswitch-agent/Dockerfile.j2 new file mode 100644 index 0000000000..af8816690d --- /dev/null +++ b/docker_templates/neutron/neutron-openvswitch-agent/Dockerfile.j2 @@ -0,0 +1,28 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-neutron-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net.kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %} + +# Install required packages +RUN yum install -y openstack-neutron-openvswitch \ + openvswitch \ + && yum clean all + + {% endif %} + +{% elif install_type == 'source' %} + +# Install required packages +RUN yum install -y \ + #TODO: will be addressed later + https://rdoproject.org/repos/openstack-kilo/rdo-release-kilo.rpm \ + openvswitch \ + && yum clean all + +{% endif %} + +COPY start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] diff --git a/docker_templates/neutron/neutron-openvswitch-agent/config-external.sh b/docker_templates/neutron/neutron-openvswitch-agent/config-external.sh new file mode 120000 index 0000000000..5b561db092 --- /dev/null +++ b/docker_templates/neutron/neutron-openvswitch-agent/config-external.sh @@ -0,0 +1 @@ +../../../docker/common/neutron/neutron-openvswitch-agent/config-external.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-openvswitch-agent/start.sh b/docker_templates/neutron/neutron-openvswitch-agent/start.sh new file mode 120000 index 0000000000..5a8cdc1eea --- /dev/null +++ b/docker_templates/neutron/neutron-openvswitch-agent/start.sh @@ -0,0 +1 @@ +../../../docker/common/neutron/neutron-openvswitch-agent/start.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-server/Dockerfile.j2 b/docker_templates/neutron/neutron-server/Dockerfile.j2 new file mode 100644 index 0000000000..a8febf9557 --- /dev/null +++ b/docker_templates/neutron/neutron-server/Dockerfile.j2 @@ -0,0 +1,28 @@ +FROM {{ namespace }}/{{ base_distro }}-{{ install_type }}-neutron-base:{{ tag }} +MAINTAINER Kolla Project (https://launchpad.net.kolla) + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux'] %} + +# Install required packages +RUN yum install -y which \ + && yum clean all + +# See bug: https://bugs.launchpad.net/kolla/+bug/1483667 +# TODO(SamYaple): Check in on this and remove once unneccesary +RUN pip install oslo.messaging==2.2.0 + + {% endif %} + +{% elif install_type == 'source' %} + +#Install required packages +RUN yum install -y which \ + && yum clean all + +{% endif %} + +COPY start.sh / +COPY config-external.sh /opt/kolla/ + +CMD ["/start.sh"] diff --git a/docker_templates/neutron/neutron-server/config-external.sh b/docker_templates/neutron/neutron-server/config-external.sh new file mode 120000 index 0000000000..b10058e78b --- /dev/null +++ b/docker_templates/neutron/neutron-server/config-external.sh @@ -0,0 +1 @@ +../../../docker/common/neutron/neutron-server/config-external.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-server/start.sh b/docker_templates/neutron/neutron-server/start.sh new file mode 120000 index 0000000000..389786a964 --- /dev/null +++ b/docker_templates/neutron/neutron-server/start.sh @@ -0,0 +1 @@ +../../../docker/common/neutron/neutron-server/start.sh \ No newline at end of file