[docker-config-engine]: introduce docker sonic config engine (#274)

* [docker-config-engine]: introduce docker sonic config engine

sonic config engine provide the sonic configure engine for all sonic
dockers that rely on the engine to generate runtime configuration.
This commit is contained in:
lguohan 2017-02-07 18:11:19 -08:00 committed by GitHub
parent a412fe16c4
commit b6753e7960
20 changed files with 71 additions and 92 deletions

3
.gitignore vendored
View File

@ -29,7 +29,6 @@ dockers/docker-lldp-sv2/Dockerfile
dockers/docker-orchagent/Dockerfile
dockers/docker-snmp-sv2/Dockerfile
dockers/docker-team/Dockerfile
dockers/docker-platform-monitor/Dockerfile
dockers/docker-dhcp-relay/Dockerfile
dockers/docker-teamd/Dockerfile
dockers/docker-config-engine/Dockerfile
platform/broadcom/docker-syncd-brcm/Dockerfile

View File

@ -0,0 +1,21 @@
FROM docker-base
RUN apt-get update
# Dependencies for sonic-cfggen
RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml
COPY \
{% for deb in docker_config_engine_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
RUN dpkg -i \
{% for deb in docker_config_engine_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}
## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs

View File

@ -1,4 +1,4 @@
FROM docker-base
FROM docker-config-engine
## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive
@ -6,21 +6,6 @@ ENV DEBIAN_FRONTEND=noninteractive
## Update APT package lists
RUN apt-get update
## Dependencies for sonic-cfggen
RUN apt-get -y install python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml
COPY \
{% for deb in docker_dhcp_relay_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
RUN dpkg -i \
{% for deb in docker_dhcp_relay_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}
## Install isc-dhcp-relay Debian package
RUN apt-get -y install isc-dhcp-relay

View File

@ -1,12 +1,9 @@
FROM docker-base
FROM docker-config-engine
RUN apt-get update
RUN apt-get install -y libdbus-1-3 libdaemon0 libjansson4
# Dependencies for sonic-cfggen
RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml
COPY \
{% for deb in docker_fpm_debs.split(' ') -%}
debs/{{ deb }}{{' '}}

View File

@ -1,4 +1,4 @@
FROM docker-base
FROM docker-config-engine
COPY \
{% for deb in docker_lldp_sv2_debs.split(' ') -%}
@ -10,9 +10,6 @@ COPY python-wheels /python-wheels
RUN apt-get update && apt-get install -y python-pip supervisor libbsd0 libevent-2.0-5 libjansson4 libwrap0 libxml2 libpci3 libperl5.20
# Dependencies for sonic-cfggen
RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml
## Pre-install the fundamental packages
## Install Python SSWSDK
## Install LLDP Sync Daemon

View File

@ -1,4 +1,4 @@
FROM docker-base
FROM docker-config-engine
RUN apt-get update
@ -8,9 +8,6 @@ RUN apt-get install -f -y ifupdown bridge-utils libdbus-1-3 libdaemon0 libjansso
## TODO: implicitly install dependencies
RUN apt-get -y install libjemalloc1
# Dependencies for sonic-cfggen
RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml
COPY \
{% for deb in docker_orchagent_debs.split(' ') -%}
debs/{{ deb }}{{' '}}

View File

@ -0,0 +1,18 @@
FROM docker-config-engine
RUN apt-get update
RUN apt-get install -y smartmontools sensord
## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs
COPY ["config.sh", "/usr/bin/"]
ENTRYPOINT /usr/bin/config.sh \
&& service rsyslog start \
&& service lm-sensors start \
&& service smartmontools start \
&& service sensord start \
&& /bin/bash

View File

@ -1,33 +0,0 @@
FROM docker-base
RUN apt-get update
RUN apt-get install -y smartmontools sensord
# Dependencies for sonic-cfggen
RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml
COPY \
{% for deb in docker_platform_monitor_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
RUN dpkg -i \
{% for deb in docker_platform_monitor_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}
## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs
COPY ["config.sh", "/usr/bin/"]
ENTRYPOINT /usr/bin/config.sh \
&& service rsyslog start \
&& service lm-sensors start \
&& service smartmontools start \
&& service sensord start \
&& /bin/bash

View File

@ -1,4 +1,4 @@
FROM docker-base
FROM docker-config-engine
COPY \
{% for deb in docker_snmp_sv2_debs.split(' ') -%}
@ -17,9 +17,6 @@ ENV PYTHONOPTIMIZE 1
## Clean up
RUN apt-get update && apt-get install -y libmysqlclient-dev libmysqld-dev libperl-dev libpci-dev libpci3 libsensors4 libsensors4-dev libwrap0-dev
# Dependencies for sonic-cfggen
RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml
RUN dpkg -i \
{% for deb in docker_snmp_sv2_debs.split(' ') -%}
debs/{{ deb }}{{' '}}

View File

@ -1,11 +1,7 @@
FROM docker-base
FROM docker-config-engine
RUN apt-get update && apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4
# Dependencies for sonic-cfggen
RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml
COPY \
{% for deb in docker_teamd_debs.split(' ') -%}
debs/{{ deb }}{{' '}}

View File

@ -2,8 +2,8 @@
DOCKER_ORCHAGENT_BRCM = docker-orchagent-brcm.gz
$(DOCKER_ORCHAGENT_BRCM)_PATH = $(DOCKERS_PATH)/docker-orchagent
$(DOCKER_ORCHAGENT_BRCM)_DEPENDS += $(SWSS) $(REDIS_TOOLS) $(SONIC_CONFIG_ENGINE)
$(DOCKER_ORCHAGENT_BRCM)_LOAD_DOCKERS += $(DOCKER_BASE)
$(DOCKER_ORCHAGENT_BRCM)_DEPENDS += $(SWSS) $(REDIS_TOOLS)
$(DOCKER_ORCHAGENT_BRCM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BRCM)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_BRCM)

View File

@ -2,8 +2,8 @@
DOCKER_ORCHAGENT_CAVM = docker-orchagent-cavm.gz
$(DOCKER_ORCHAGENT_CAVM)_PATH = $(DOCKERS_PATH)/docker-orchagent
$(DOCKER_ORCHAGENT_CAVM)_DEPENDS += $(SWSS) $(REDIS_TOOLS) $(SONIC_CONFIG_ENGINE)
$(DOCKER_ORCHAGENT_CAVM)_LOAD_DOCKERS += $(DOCKER_BASE)
$(DOCKER_ORCHAGENT_CAVM)_DEPENDS += $(SWSS) $(REDIS_TOOLS)
$(DOCKER_ORCHAGENT_CAVM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_CAVM)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_CAVM)

View File

@ -2,8 +2,8 @@
DOCKER_ORCHAGENT_MLNX = docker-orchagent-mlnx.gz
$(DOCKER_ORCHAGENT_MLNX)_PATH = $(DOCKERS_PATH)/docker-orchagent
$(DOCKER_ORCHAGENT_MLNX)_DEPENDS += $(SWSS) $(REDIS_TOOLS) $(SONIC_CONFIG_ENGINE)
$(DOCKER_ORCHAGENT_MLNX)_LOAD_DOCKERS += $(DOCKER_BASE)
$(DOCKER_ORCHAGENT_MLNX)_DEPENDS += $(SWSS) $(REDIS_TOOLS)
$(DOCKER_ORCHAGENT_MLNX)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_MLNX)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_ORCHAGENT_MLNX)

View File

@ -0,0 +1,7 @@
# docker image for sonic config engine
DOCKER_CONFIG_ENGINE = docker-config-engine.gz
$(DOCKER_CONFIG_ENGINE)_PATH = $(DOCKERS_PATH)/docker-config-engine
$(DOCKER_CONFIG_ENGINE)_DEPENDS += $(SONIC_CONFIG_ENGINE)
$(DOCKER_CONFIG_ENGINE)_LOAD_DOCKERS += $(DOCKER_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_CONFIG_ENGINE)

View File

@ -2,9 +2,8 @@
DOCKER_DHCP_RELAY = docker-dhcp-relay.gz
$(DOCKER_DHCP_RELAY)_PATH = $(DOCKERS_PATH)/docker-dhcp-relay
$(DOCKER_DHCP_RELAY)_DEPENDS += $(SONIC_CONFIG_ENGINE)
$(DOCKER_DHCP_RELAY)_LOAD_DOCKERS = $(DOCKER_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_DHCP_RELAY)
$(DOCKER_DHCP_RELAY)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE)
SONIC_SIMPLE_DOCKER_IMAGES += $(DOCKER_DHCP_RELAY)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_DHCP_RELAY)

View File

@ -2,8 +2,8 @@
DOCKER_FPM = docker-fpm.gz
$(DOCKER_FPM)_PATH = $(DOCKERS_PATH)/docker-fpm
$(DOCKER_FPM)_DEPENDS += $(QUAGGA) $(SWSS) $(SONIC_CONFIG_ENGINE)
$(DOCKER_FPM)_LOAD_DOCKERS += $(DOCKER_BASE)
$(DOCKER_FPM)_DEPENDS += $(QUAGGA) $(SWSS)
$(DOCKER_FPM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_FPM)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_FPM)

View File

@ -2,9 +2,9 @@
DOCKER_LLDP_SV2 = docker-lldp-sv2.gz
$(DOCKER_LLDP_SV2)_PATH = $(DOCKERS_PATH)/docker-lldp-sv2
$(DOCKER_LLDP_SV2)_DEPENDS += $(LLDPD) $(SONIC_CONFIG_ENGINE)
$(DOCKER_LLDP_SV2)_DEPENDS += $(LLDPD)
$(DOCKER_LLDP_SV2)_PYTHON_WHEELS += $(DBSYNCD_PY2)
$(DOCKER_LLDP_SV2)_LOAD_DOCKERS += $(DOCKER_BASE)
$(DOCKER_LLDP_SV2)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_LLDP_SV2)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_LLDP_SV2)

View File

@ -2,10 +2,9 @@
DOCKER_PLATFORM_MONITOR = docker-platform-monitor.gz
$(DOCKER_PLATFORM_MONITOR)_PATH = $(DOCKERS_PATH)/docker-platform-monitor
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(SONIC_CONFIG_ENGINE)
$(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_BASE)
$(DOCKER_PLATFORM_MONITOR)_LOAD_DOCKERS = $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR)
SONIC_SIMPLE_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_PLATFORM_MONITOR)
$(DOCKER_PLATFORM_MONITOR)_CONTAINER_NAME = pmon

View File

@ -2,9 +2,9 @@
DOCKER_SNMP_SV2 = docker-snmp-sv2.gz
$(DOCKER_SNMP_SV2)_PATH = $(DOCKERS_PATH)/docker-snmp-sv2
$(DOCKER_SNMP_SV2)_DEPENDS += $(SNMP) $(SNMPD) $(SONIC_CONFIG_ENGINE)
$(DOCKER_SNMP_SV2)_DEPENDS += $(SNMP) $(SNMPD)
$(DOCKER_SNMP_SV2)_PYTHON_WHEELS += $(ASYNCSNMP_PY3)
$(DOCKER_SNMP_SV2)_LOAD_DOCKERS += $(DOCKER_BASE)
$(DOCKER_SNMP_SV2)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_SNMP_SV2)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SNMP_SV2)

View File

@ -2,8 +2,8 @@
DOCKER_TEAMD = docker-teamd.gz
$(DOCKER_TEAMD)_PATH = $(DOCKERS_PATH)/docker-teamd
$(DOCKER_TEAMD)_DEPENDS += $(SWSS) $(LIBTEAMDCT) $(LIBTEAM_UTILS) $(SONIC_CONFIG_ENGINE)
$(DOCKER_TEAMD)_LOAD_DOCKERS += $(DOCKER_BASE)
$(DOCKER_TEAMD)_DEPENDS += $(SWSS) $(LIBTEAMDCT) $(LIBTEAM_UTILS)
$(DOCKER_TEAMD)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_TEAMD)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_TEAMD)