Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: d2iq-archive/marathon-lb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.1
Choose a base ref
...
head repository: d2iq-archive/marathon-lb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 13,622 additions and 1,911 deletions.
  1. +3 −0 .coveragerc
  2. +8 −0 .dockerignore
  3. +11 −0 .gitignore
  4. +0 −8 .travis.yml
  5. +102 −11 Dockerfile
  6. +37 −0 Dockerfile.devkit
  7. +1,526 −0 Longhelp.md
  8. +366 −0 Makefile
  9. +318 −248 README.md
  10. +0 −456 bluegreen_deploy.py
  11. +1 −0 bluegreen_deploy.py
  12. +0 −36 build-haproxy.sh
  13. +18 −0 build.bash
  14. +34 −0 ci/backends/docker_bridge.json
  15. +33 −0 ci/backends/docker_host.json
  16. +33 −0 ci/backends/docker_ippc.json
  17. +35 −0 ci/backends/ucr_bridge.json
  18. +39 −0 ci/backends/ucr_host.json
  19. +34 −0 ci/backends/ucr_ippc.json
  20. +43 −0 ci/backends_1.9/docker_bridge.json
  21. +42 −0 ci/backends_1.9/docker_host.json
  22. +47 −0 ci/backends_1.9/docker_ippc.json
  23. +41 −0 ci/backends_1.9/ucr_host.json
  24. +432 −0 ci/ci-integration.sh
  25. +94 −0 ci/test_marathon_lb.py
  26. +515 −0 ci/test_marathon_lb_dcos_e2e.py
  27. +96 −20 common.py
  28. +1,699 −0 config.py
  29. +39 −0 getconfig.lua
  30. +59 −0 getmaps.lua
  31. +2 −3 getpids.lua
  32. +13 −0 hooks/pre-commit
  33. +29 −0 lrucache.py
  34. +1,762 −832 marathon_lb.py
  35. +5 −0 reload_haproxy.sh
  36. +12 −0 requirements-dev.txt
  37. +5 −3 requirements.txt
  38. +113 −48 run
  39. +10 −0 scripts/build-docs.sh
  40. +17 −0 scripts/install-git-hooks.sh
  41. +2 −43 service/haproxy/run
  42. +40 −0 signalmlb.lua
  43. +9 −0 syslogd/run
  44. +1 −0 syslogd/syslog.conf
  45. +34 −0 tests/1-nginx-marathon1.5.json
  46. +14 −5 tests/Dockerfile
  47. 0 tests/__init__.py
  48. +33 −0 tests/haproxy_stats.csv
  49. +87 −0 tests/marathon15_apps.json
  50. +0 −92 tests/test_bluegreen_deploy.py
  51. +0 −20 tests/test_code_style.py
  52. +23 −0 tests/test_common.py
  53. +3,062 −72 tests/test_marathon_lb.py
  54. +103 −0 tests/test_marathon_lb_haproxy_options.py
  55. +477 −0 tests/test_utils.py
  56. +502 −0 tests/test_zdd.py
  57. +1 −8 tests/{bluegreen_app_blue.json → zdd_app_blue.json}
  58. +178 −0 tests/zdd_app_blue_marathon1.5.json
  59. +4 −6 tests/{bluegreen_apps.json → zdd_apps.json}
  60. +443 −0 utils.py
  61. +855 −0 zdd.py
  62. +81 −0 zdd_exceptions.py
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
source = .
omit = tests/*
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.git
build.bash
tests
hooks
scripts
.*
Dockerfile
Makefile
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
.idea
templates/
__pycache__
.pytest_cache
*.pyc
.env
.cache

.coverage
.coverage.*
*,cover
coverage.xml
htmlcov/
*.iml
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

113 changes: 102 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,107 @@
FROM debian:jessie
FROM debian:buster

ENTRYPOINT [ "/marathon-lb/run" ]
CMD [ "sse", "-m", "http://master.mesos:8080", "--health-check", "--group", "external" ]
EXPOSE 80 81 443 9090
LABEL LAST_MODIFIED=20191004

COPY . /marathon-lb
# runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
inetutils-syslogd \
libcurl4 \
liblua5.3-0 \
libssl1.1 \
openssl \
procps \
python3 \
runit \
gnupg-agent \
socat \
make \
&& rm -rf /var/lib/apt/lists/*

ENV TINI_VERSION=v0.18.0 \
TINI_GPG_KEY=595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7

RUN set -x \
&& apt-get update && apt-get install -y --no-install-recommends dirmngr gpg wget \
&& rm -rf /var/lib/apt/lists/* \
&& wget -O tini "https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini-amd64" \
&& wget -O tini.asc "https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini-amd64.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$TINI_GPG_KEY" \
|| gpg --keyserver pool.sks-keyservers.net --recv-keys "$TINI_GPG_KEY" \
|| gpg --keyserver keyserver.pgp.com --recv-keys "$TINI_GPG_KEY" \
|| gpg --keyserver pgp.mit.edu --recv-keys "$TINI_GPG_KEY" \
&& gpg --batch --verify tini.asc tini \
&& rm -rf "$GNUPGHOME" tini.asc \
&& mv tini /usr/bin/tini \
&& chmod +x /usr/bin/tini \
&& tini -- true \
&& apt-get purge -y --auto-remove dirmngr gpg wget


ENV HAPROXY_MAJOR=2.0 \
HAPROXY_VERSION=2.0.17 \
HAPROXY_MD5=786a967c73cc1455c938d42fbe333bfe

RUN apt-get update && apt-get install -y python3 python3-pip openssl libssl-dev runit \
wget build-essential libpcre3 libpcre3-dev python3-dateutil socat iptables libreadline-dev \
&& pip3 install -r /marathon-lb/requirements.txt \
&& /marathon-lb/build-haproxy.sh \
&& apt-get remove -yf --auto-remove wget libssl-dev build-essential libpcre3-dev libreadline-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
COPY requirements.txt /marathon-lb/

RUN set -x \
&& buildDeps=' \
build-essential \
gcc \
libcurl4-openssl-dev \
libffi-dev \
liblua5.3-dev \
libpcre3-dev \
libssl-dev \
python3-dev \
python3-pip \
python3-setuptools \
wget \
zlib1g-dev \
' \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& rm -rf /var/lib/apt/lists/* \
\
# Build HAProxy
&& wget -O haproxy.tar.gz "https://www.haproxy.org/download/$HAPROXY_MAJOR/src/haproxy-$HAPROXY_VERSION.tar.gz" \
&& echo "$HAPROXY_MD5 haproxy.tar.gz" | md5sum -c \
&& mkdir -p /usr/src/haproxy \
&& tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1 \
&& rm haproxy.tar.gz \
&& make -C /usr/src/haproxy \
TARGET=linux-glibc \
ARCH=x86_64 \
USE_LUA=1 \
LUA_INC=/usr/include/lua5.3/ \
USE_OPENSSL=1 \
USE_PCRE_JIT=1 \
USE_PCRE=1 \
USE_REGPARM=1 \
USE_STATIC_PCRE=1 \
USE_ZLIB=1 \
EXTRA_OBJS="contrib/prometheus-exporter/service-prometheus.o" \
all \
install-bin \
&& rm -rf /usr/src/haproxy \
\
# Install Python dependencies
# Install Python packages with --upgrade so we get new packages even if a system
# package is already installed. Combine with --force-reinstall to ensure we get
# a local package even if the system package is up-to-date as the system package
# will probably be uninstalled with the build dependencies.
&& pip3 install --no-cache --upgrade --force-reinstall -r /marathon-lb/requirements.txt \
\
&& apt-get purge -y --auto-remove $buildDeps \
# Purge of python3-dev will delete python3 also
&& apt-get update && apt-get install -y --no-install-recommends python3

COPY . /marathon-lb

WORKDIR /marathon-lb

ENTRYPOINT [ "tini", "-g", "--", "/marathon-lb/run" ]
CMD [ "sse", "--health-check", "--group", "external" ]

EXPOSE 80 443 9090 9091
37 changes: 37 additions & 0 deletions Dockerfile.devkit
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM debian:buster

ENV LANG=C.UTF-8

RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
docker.io \
gcc \
git \
jq \
libcurl4-openssl-dev \
libssl-dev \
python3-dev \
python3-pip \
python3-setuptools

COPY requirements-dev.txt /marathon-lb/requirements-dev.txt
COPY requirements.txt /marathon-lb/requirements.txt

# NOTE(jkoelker) dcos-e2e has a large list of strict requrements (== vs >=)
# that creates conflicts preventing the command line from
# running. By installing it in its own pip transaction, then
# allowing subsequent pip to use the existing requirements
# (no --upgrade or --force-reinstall) the command line is
# available
RUN set -x \
&& pip3 install \
--no-cache \
--upgrade \
https://github.com/dcos/dcos-e2e/archive/2018.12.10.0.zip \
&& pip3 install \
--no-cache \
-r /marathon-lb/requirements-dev.txt

CMD ["/bin/bash"]
Loading