diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-06-24 15:28:59 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-06-24 15:28:59 +0000 |
| commit | 6766632b9ca2aa081464aebec4855c1a6c8d4163 (patch) | |
| tree | 329f03d816e34fcdbdb53697b6b7e865fef33653 /docker/centos | |
| parent | 214ac7e6084583f703041fdfd19d67dda9417274 (diff) | |
| parent | 98460af04d626907f44ea1b13289769979ed4f7b (diff) | |
| download | kolla-6766632b9ca2aa081464aebec4855c1a6c8d4163.tar.gz kolla-6766632b9ca2aa081464aebec4855c1a6c8d4163.zip | |
Merge "Change fat neutron container into thin containers"
Diffstat (limited to 'docker/centos')
33 files changed, 132 insertions, 59 deletions
diff --git a/docker/centos/binary/neutron/neutron-agents/Dockerfile b/docker/centos/binary/neutron/neutron-agents/Dockerfile deleted file mode 100644 index 89ce874bb..000000000 --- a/docker/centos/binary/neutron/neutron-agents/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base:%%KOLLA_TAG%% -MAINTAINER Kolla Project (https://launchpad.net/kolla) - -# Install supervisor -RUN easy_install supervisor - -# Install supervisor-stdout -RUN pip install supervisor-stdout - -# Install required packages -RUN yum install -y openstack-neutron openstack-neutron-linuxbridge \ - net-tools \ - && yum clean all - -# Add config scripts -ADD config-scripts/config-linuxbridge-agent.sh /opt/kolla/neutron/ -ADD config-scripts/config-dhcp-agent.sh /opt/kolla/neutron/ -ADD config-scripts/config-l3-agent.sh /opt/kolla/neutron/ -ADD config-scripts/config-metadata-agent.sh /opt/kolla/neutron/ -ADD config-scripts/config-sudoers.sh /opt/kolla/ - -# Add check scripts -ADD check-scripts/check-linuxbridge-agent.sh /opt/kolla/neutron/ -ADD check-scripts/check-dhcp-agent.sh /opt/kolla/neutron/ -ADD check-scripts/check-l3-agent.sh /opt/kolla/neutron/ -ADD check-scripts/check-metadata-agent.sh /opt/kolla/neutron/ - -# This is needed to workaround a problem with the agents exiting if the -# file is not present. This file really shouldn't need to be present and -# implies a configuration problem somewhere else in the code base, but -# we are out of time. -COPY fwaas_driver.ini /etc/neutron/ - -# Configure supervisord -RUN mkdir -p /var/log/supervisor/ -ADD supervisord.conf /etc/ - -# Start supervisor -CMD ["/usr/bin/supervisord"] diff --git a/docker/centos/binary/neutron/neutron-agents/check-scripts/check-dhcp-agent.sh b/docker/centos/binary/neutron/neutron-agents/check-scripts/check-dhcp-agent.sh deleted file mode 120000 index fcce4f251..000000000 --- a/docker/centos/binary/neutron/neutron-agents/check-scripts/check-dhcp-agent.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../../common/neutron/neutron-agents/check-scripts/check-dhcp-agent.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-agents/check-scripts/check-l3-agent.sh b/docker/centos/binary/neutron/neutron-agents/check-scripts/check-l3-agent.sh deleted file mode 120000 index 3975d06b6..000000000 --- a/docker/centos/binary/neutron/neutron-agents/check-scripts/check-l3-agent.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../../common/neutron/neutron-agents/check-scripts/check-l3-agent.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-agents/check-scripts/check-linuxbridge-agent.sh b/docker/centos/binary/neutron/neutron-agents/check-scripts/check-linuxbridge-agent.sh deleted file mode 120000 index 8f26a18fe..000000000 --- a/docker/centos/binary/neutron/neutron-agents/check-scripts/check-linuxbridge-agent.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../../common/neutron/neutron-agents/check-scripts/check-linuxbridge-agent.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-agents/check-scripts/check-metadata-agent.sh b/docker/centos/binary/neutron/neutron-agents/check-scripts/check-metadata-agent.sh deleted file mode 120000 index aabb2a9ee..000000000 --- a/docker/centos/binary/neutron/neutron-agents/check-scripts/check-metadata-agent.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../../common/neutron/neutron-agents/check-scripts/check-metadata-agent.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-agents/config-scripts/config-dhcp-agent.sh b/docker/centos/binary/neutron/neutron-agents/config-scripts/config-dhcp-agent.sh deleted file mode 120000 index 8ef8dec06..000000000 --- a/docker/centos/binary/neutron/neutron-agents/config-scripts/config-dhcp-agent.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../../common/neutron/neutron-agents/config-scripts/config-dhcp-agent.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-agents/config-scripts/config-l3-agent.sh b/docker/centos/binary/neutron/neutron-agents/config-scripts/config-l3-agent.sh deleted file mode 120000 index d92fe01ec..000000000 --- a/docker/centos/binary/neutron/neutron-agents/config-scripts/config-l3-agent.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../../common/neutron/neutron-agents/config-scripts/config-l3-agent.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-agents/config-scripts/config-linuxbridge-agent.sh b/docker/centos/binary/neutron/neutron-agents/config-scripts/config-linuxbridge-agent.sh deleted file mode 120000 index 0736ca3ca..000000000 --- a/docker/centos/binary/neutron/neutron-agents/config-scripts/config-linuxbridge-agent.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../../common/neutron/neutron-agents/config-scripts/config-linuxbridge-agent.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-agents/config-scripts/config-metadata-agent.sh b/docker/centos/binary/neutron/neutron-agents/config-scripts/config-metadata-agent.sh deleted file mode 120000 index 7e9c1b299..000000000 --- a/docker/centos/binary/neutron/neutron-agents/config-scripts/config-metadata-agent.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../../common/neutron/neutron-agents/config-scripts/config-metadata-agent.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-agents/config-scripts/config-sudoers.sh b/docker/centos/binary/neutron/neutron-agents/config-scripts/config-sudoers.sh deleted file mode 120000 index 3ecc0c823..000000000 --- a/docker/centos/binary/neutron/neutron-agents/config-scripts/config-sudoers.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../../common/neutron/neutron-agents/config-scripts/config-sudoers.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-agents/fwaas_driver.ini b/docker/centos/binary/neutron/neutron-agents/fwaas_driver.ini deleted file mode 120000 index 84e47b1c2..000000000 --- a/docker/centos/binary/neutron/neutron-agents/fwaas_driver.ini +++ /dev/null @@ -1 +0,0 @@ -../../../../common/neutron/neutron-agents/fwaas_driver.ini
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-agents/supervisord.conf b/docker/centos/binary/neutron/neutron-agents/supervisord.conf deleted file mode 120000 index a7f24cb77..000000000 --- a/docker/centos/binary/neutron/neutron-agents/supervisord.conf +++ /dev/null @@ -1 +0,0 @@ -../../../../common/neutron/neutron-agents/supervisord.conf
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-base/Dockerfile b/docker/centos/binary/neutron/neutron-base/Dockerfile index c8a5ef2d9..5d87dbb77 100644 --- a/docker/centos/binary/neutron/neutron-base/Dockerfile +++ b/docker/centos/binary/neutron/neutron-base/Dockerfile @@ -1,7 +1,16 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%% MAINTAINER Kolla Project (https://launchpad.net/kolla) -RUN yum -y install openstack-neutron-ml2 && yum clean all +RUN yum -y install openstack-neutron \ + openstack-neutron-ml2 \ + python-neutron-client \ + && yum clean all -RUN mkdir -p /opt/kolla -COPY config-neutron.sh /opt/kolla/config-neutron.sh +RUN pip install nsenter \ + && ln -s 1 /opt/kolla/host_proc/self + +RUN mkdir -p /opt/kolla/host_proc +COPY config-neutron.sh config-sudoers.sh /opt/kolla/ + +RUN mv /sbin/ip /opt/kolla/ip +COPY ip_wrapper.py /sbin/ip diff --git a/docker/centos/binary/neutron/neutron-base/config-sudoers.sh b/docker/centos/binary/neutron/neutron-base/config-sudoers.sh new file mode 100644 index 000000000..0e02226db --- /dev/null +++ b/docker/centos/binary/neutron/neutron-base/config-sudoers.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Neutron uses rootwrap which requires a tty for sudo. +# Since the container is running in daemon mode, a tty +# is not present and requiretty must be commented out. +if [ ! -f /var/run/sudo-modified ]; then + chmod 0640 /etc/sudoers + sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers + chmod 0440 /etc/sudoers +fi + +touch /var/run/sudo-modified diff --git a/docker/centos/binary/neutron/neutron-base/ip_wrapper.py b/docker/centos/binary/neutron/neutron-base/ip_wrapper.py new file mode 100755 index 000000000..99d70340e --- /dev/null +++ b/docker/centos/binary/neutron/neutron-base/ip_wrapper.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +# Copyright 2015 Sam Yaple +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file exists because we want to create and delete any network namespaces from the +# host mount namespace. This allows the host to access all of the neutron network +# namespaces as well as all containers that bind mount /run/netns from the host. + +# This is required for "thin" neutron containers to function properly + +import sys +import subprocess +import nsenter + +def host_mnt_exec(cmd): + try: + with nsenter.ExitStack() as stack: + stack.enter_context(nsenter.Namespace('1', 'mnt', proc='/opt/kolla/host_proc/')) + process_ = subprocess.Popen(cmd) + + except Exception as e: + print("An error has occured with a component that Kolla manages. Please file a bug") + print("Error: ", e) + + return process_ + + +if len(sys.argv) > 2: + # We catch all commands that ip will accept that refer to creating or deleteing a + # Network namespace + if str(sys.argv[1]).startswith("net") and \ + (str(sys.argv[2]).startswith("a") or str(sys.argv[2]).startswith("d")): + # This cmd is executed in the host mount namespace + cmd = ["/usr/bin/env", "ip"] + sys.argv[1:] + sys.exit(host_mnt_exec(cmd).returncode) + else: + cmd = ["/opt/kolla/ip"] + sys.argv[1:] +else: + cmd = ["/opt/kolla/ip"] + + if len(sys.argv) == 2: + cmd = cmd + sys.argv[1:] + +process_ = subprocess.Popen(cmd) +sys.exit(process_.returncode) diff --git a/docker/centos/binary/neutron/neutron-dhcp-agent/Dockerfile b/docker/centos/binary/neutron/neutron-dhcp-agent/Dockerfile new file mode 100644 index 000000000..bbc9354f3 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-dhcp-agent/Dockerfile @@ -0,0 +1,6 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +COPY check.sh start.sh / + +CMD ["/start.sh"] diff --git a/docker/centos/binary/neutron/neutron-agents/build b/docker/centos/binary/neutron/neutron-dhcp-agent/build index ec1913803..ec1913803 120000 --- a/docker/centos/binary/neutron/neutron-agents/build +++ b/docker/centos/binary/neutron/neutron-dhcp-agent/build diff --git a/docker/centos/binary/neutron/neutron-dhcp-agent/check.sh b/docker/centos/binary/neutron/neutron-dhcp-agent/check.sh new file mode 120000 index 000000000..c8efc14c6 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-dhcp-agent/check.sh @@ -0,0 +1 @@ +../../../../common/neutron/neutron-dhcp-agent/check.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-dhcp-agent/start.sh b/docker/centos/binary/neutron/neutron-dhcp-agent/start.sh new file mode 120000 index 000000000..98a2563e9 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-dhcp-agent/start.sh @@ -0,0 +1 @@ +../../../../common/neutron/neutron-dhcp-agent/start.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-l3-agent/Dockerfile b/docker/centos/binary/neutron/neutron-l3-agent/Dockerfile new file mode 100644 index 000000000..96a05c9c3 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-l3-agent/Dockerfile @@ -0,0 +1,14 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +# 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 check.sh start.sh / + +CMD ["/start.sh"] diff --git a/docker/centos/binary/neutron/neutron-l3-agent/build b/docker/centos/binary/neutron/neutron-l3-agent/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-l3-agent/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-l3-agent/check.sh b/docker/centos/binary/neutron/neutron-l3-agent/check.sh new file mode 120000 index 000000000..7f8ed45ce --- /dev/null +++ b/docker/centos/binary/neutron/neutron-l3-agent/check.sh @@ -0,0 +1 @@ +../../../../common/neutron/neutron-l3-agent/check.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-l3-agent/fwaas_driver.ini b/docker/centos/binary/neutron/neutron-l3-agent/fwaas_driver.ini new file mode 120000 index 000000000..0e016223c --- /dev/null +++ b/docker/centos/binary/neutron/neutron-l3-agent/fwaas_driver.ini @@ -0,0 +1 @@ +../../../../common/neutron/neutron-l3-agent/fwaas_driver.ini
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-l3-agent/start.sh b/docker/centos/binary/neutron/neutron-l3-agent/start.sh new file mode 120000 index 000000000..8d9104a33 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-l3-agent/start.sh @@ -0,0 +1 @@ +../../../../common/neutron/neutron-l3-agent/start.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-linuxbridge-agent/Dockerfile b/docker/centos/binary/neutron/neutron-linuxbridge-agent/Dockerfile new file mode 100644 index 000000000..702e16b42 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-linuxbridge-agent/Dockerfile @@ -0,0 +1,10 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +# Install required packages +RUN yum install -y openstack-neutron-linuxbridge && \ + yum clean all + +COPY check.sh start.sh / + +CMD ["/start.sh"] diff --git a/docker/centos/binary/neutron/neutron-linuxbridge-agent/build b/docker/centos/binary/neutron/neutron-linuxbridge-agent/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-linuxbridge-agent/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-linuxbridge-agent/check.sh b/docker/centos/binary/neutron/neutron-linuxbridge-agent/check.sh new file mode 120000 index 000000000..469fd5d7f --- /dev/null +++ b/docker/centos/binary/neutron/neutron-linuxbridge-agent/check.sh @@ -0,0 +1 @@ +../../../../common/neutron/neutron-linuxbridge-agent/check.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-linuxbridge-agent/start.sh b/docker/centos/binary/neutron/neutron-linuxbridge-agent/start.sh new file mode 120000 index 000000000..9d51d3d6a --- /dev/null +++ b/docker/centos/binary/neutron/neutron-linuxbridge-agent/start.sh @@ -0,0 +1 @@ +../../../../common/neutron/neutron-linuxbridge-agent/start.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-metadata-agent/Dockerfile b/docker/centos/binary/neutron/neutron-metadata-agent/Dockerfile new file mode 100644 index 000000000..bbc9354f3 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-metadata-agent/Dockerfile @@ -0,0 +1,6 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +COPY check.sh start.sh / + +CMD ["/start.sh"] diff --git a/docker/centos/binary/neutron/neutron-metadata-agent/build b/docker/centos/binary/neutron/neutron-metadata-agent/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-metadata-agent/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-metadata-agent/check.sh b/docker/centos/binary/neutron/neutron-metadata-agent/check.sh new file mode 120000 index 000000000..2ac733b83 --- /dev/null +++ b/docker/centos/binary/neutron/neutron-metadata-agent/check.sh @@ -0,0 +1 @@ +../../../../common/neutron/neutron-metadata-agent/check.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-metadata-agent/start.sh b/docker/centos/binary/neutron/neutron-metadata-agent/start.sh new file mode 120000 index 000000000..b555e715d --- /dev/null +++ b/docker/centos/binary/neutron/neutron-metadata-agent/start.sh @@ -0,0 +1 @@ +../../../../common/neutron/neutron-metadata-agent/start.sh
\ No newline at end of file diff --git a/docker/centos/binary/neutron/neutron-server/Dockerfile b/docker/centos/binary/neutron/neutron-server/Dockerfile index 8d59dd04a..0bfd3cf4b 100644 --- a/docker/centos/binary/neutron/neutron-server/Dockerfile +++ b/docker/centos/binary/neutron/neutron-server/Dockerfile @@ -2,12 +2,9 @@ FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%neutron-base:%%KOLLA_TAG%% MAINTAINER Kolla Project (https://launchpad.net/kolla) #Install required packages -RUN yum install -y openstack-neutron \ - python-neutronclient \ - which \ - && yum clean all +RUN yum install -y which && \ + yum clean all -ADD ./start.sh /start.sh -ADD ./check.sh /check.sh +COPY check.sh start.sh / CMD ["/start.sh"] |
