From 1c7091dcd0969cc78ebe94f7d9f42312948c5e97 Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Wed, 22 Jul 2015 12:01:29 +0000 Subject: [PATCH] Removed unused hautoproxy code Change-Id: Idcfc97567fc34a700259c13c54035a401d76e1e9 Closes-Bug: #1474679 --- docker/centos/binary/hautoproxy/Dockerfile | 9 --- docker/centos/binary/hautoproxy/build | 1 - .../centos/binary/hautoproxy/haproxy.cfg.tmpl | 1 - docker/centos/binary/hautoproxy/start.py | 1 - docker/common/hautoproxy/haproxy.cfg.tmpl | 26 ------ docker/common/hautoproxy/start.py | 79 ------------------- docker/fedora/binary/hautoproxy | 1 - docker/rhel/binary/hautoproxy | 1 - docs/minimal-environment-vars.md | 4 - 9 files changed, 123 deletions(-) delete mode 100644 docker/centos/binary/hautoproxy/Dockerfile delete mode 120000 docker/centos/binary/hautoproxy/build delete mode 120000 docker/centos/binary/hautoproxy/haproxy.cfg.tmpl delete mode 120000 docker/centos/binary/hautoproxy/start.py delete mode 100644 docker/common/hautoproxy/haproxy.cfg.tmpl delete mode 100755 docker/common/hautoproxy/start.py delete mode 120000 docker/fedora/binary/hautoproxy delete mode 120000 docker/rhel/binary/hautoproxy diff --git a/docker/centos/binary/hautoproxy/Dockerfile b/docker/centos/binary/hautoproxy/Dockerfile deleted file mode 100644 index 34299c843b..0000000000 --- a/docker/centos/binary/hautoproxy/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM fedora:21 -MAINTAINER Kolla Project (https://launchpad.net/kolla) - -RUN yum -y install haproxy python-jinja2 && yum clean all -RUN mkdir -p /etc/haproxy/templates -COPY haproxy.cfg.tmpl /etc/haproxy/templates/haproxy.cfg.tmpl -COPY start.py /start.py -CMD ["/start.py"] - diff --git a/docker/centos/binary/hautoproxy/build b/docker/centos/binary/hautoproxy/build deleted file mode 120000 index 8d652f7ee2..0000000000 --- a/docker/centos/binary/hautoproxy/build +++ /dev/null @@ -1 +0,0 @@ -../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/hautoproxy/haproxy.cfg.tmpl b/docker/centos/binary/hautoproxy/haproxy.cfg.tmpl deleted file mode 120000 index dc3f45c31a..0000000000 --- a/docker/centos/binary/hautoproxy/haproxy.cfg.tmpl +++ /dev/null @@ -1 +0,0 @@ -../../../common/hautoproxy/haproxy.cfg.tmpl \ No newline at end of file diff --git a/docker/centos/binary/hautoproxy/start.py b/docker/centos/binary/hautoproxy/start.py deleted file mode 120000 index f89efa2f89..0000000000 --- a/docker/centos/binary/hautoproxy/start.py +++ /dev/null @@ -1 +0,0 @@ -../../../common/hautoproxy/start.py \ No newline at end of file diff --git a/docker/common/hautoproxy/haproxy.cfg.tmpl b/docker/common/hautoproxy/haproxy.cfg.tmpl deleted file mode 100644 index cd1174b219..0000000000 --- a/docker/common/hautoproxy/haproxy.cfg.tmpl +++ /dev/null @@ -1,26 +0,0 @@ -global - daemon - maxconn 4096 - pidfile /var/run/haproxy.pid - -defaults - mode tcp - timeout connect 5s - timeout client 1m - timeout server 1m - option redispatch - balance roundrobin - -listen stats :1936 - mode http - stats enable - stats hide-version - #stats realm Haproxy\ Statistics - stats uri / - #stats auth Username:Password - -{% for service in services %} -listen {{ service.service_name }} - bind 127.0.0.1:{{service.local_port}} - server {{ service.remote_name }} {{ service.remote_addr }}:{{ service.remote_port}} check inter 2s rise 3 fall 2 -{% endfor %} diff --git a/docker/common/hautoproxy/start.py b/docker/common/hautoproxy/start.py deleted file mode 100755 index 914a2ffac9..0000000000 --- a/docker/common/hautoproxy/start.py +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/python - -# 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 script configures and starts a local haproxy instances, bound to -127.0.0.1, that forwards connections all of the discovered -docker/kubernetes environment variables.''' - -import argparse -from jinja2 import Environment -from jinja2 import FileSystemLoader -import os -import re -import urlparse - -re_url = re.compile( - '^(?P.*)_PORT_(?P\d+)_(?P(UDP|TCP))$') - - -def parse_args(): - p = argparse.ArgumentParser() - p.add_argument('--output', '-o', - default='/etc/haproxy/haproxy.cfg') - p.add_argument('--no-start', '-n', - action='store_true') - p.add_argument('--template-dir', '-t', - default='/etc/haproxy/templates') - return p.parse_args() - - -def discover_services(): - services = [] - for k in os.environ: - mo = re_url.match(k) - - if mo: - parts = urlparse.urlparse(os.environ[k]) - remote_host, remote_port = parts.netloc.split(':') - service_name = '%(name)s-%(port)s' % mo.groupdict() - - services.append({ - 'remote_name': mo.group('name'), - 'remote_addr': remote_host, - 'remote_port': remote_port, - 'remote_proto': parts.scheme, - 'local_port': mo.group('port'), - 'service_name': service_name, - }) - - return services - - -def main(): - args = parse_args() - services = discover_services() - - env = Environment(loader=FileSystemLoader(['.', - args.template_dir])) - template = env.get_template('haproxy.cfg.tmpl') - with open(args.output, 'w') as fd: - fd.write(template.render(services=services)) - - if args.no_start: - return - - os.execlp('haproxy', 'haproxy', '-f', args.output, '-db') - -if __name__ == '__main__': - main() diff --git a/docker/fedora/binary/hautoproxy b/docker/fedora/binary/hautoproxy deleted file mode 120000 index 916cfd1974..0000000000 --- a/docker/fedora/binary/hautoproxy +++ /dev/null @@ -1 +0,0 @@ -../../centos/binary/hautoproxy \ No newline at end of file diff --git a/docker/rhel/binary/hautoproxy b/docker/rhel/binary/hautoproxy deleted file mode 120000 index 916cfd1974..0000000000 --- a/docker/rhel/binary/hautoproxy +++ /dev/null @@ -1 +0,0 @@ -../../centos/binary/hautoproxy \ No newline at end of file diff --git a/docs/minimal-environment-vars.md b/docs/minimal-environment-vars.md index 0bf21ecc63..31f1d72130 100644 --- a/docs/minimal-environment-vars.md +++ b/docs/minimal-environment-vars.md @@ -233,10 +233,6 @@ In order for each service to function, there is a minimum set of required variab None -# Hautoproxy - - None - # Heat-api-cfn ADMIN_TENANT_NAME