Added sonic-mgmt-framework as submodule / docker
This commit is contained in:
parent
4ce3cc864a
commit
159e69f346
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -66,3 +66,6 @@
|
||||
[submodule "platform/mellanox/mlnx-sai/SAI-Implementation"]
|
||||
path = platform/mellanox/mlnx-sai/SAI-Implementation
|
||||
url = https://github.com/Mellanox/SAI-Implementation
|
||||
[submodule "src/sonic-mgmt-framework"]
|
||||
path = src/sonic-mgmt-framework
|
||||
url = https://github.com/project-arlo/sonic-mgmt-framework.git
|
||||
|
34
dockers/docker-sonic-mgmt-framework/Dockerfile.j2
Normal file
34
dockers/docker-sonic-mgmt-framework/Dockerfile.j2
Normal file
@ -0,0 +1,34 @@
|
||||
FROM docker-config-engine-stretch
|
||||
|
||||
ARG docker_container_name
|
||||
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
|
||||
|
||||
## Make apt-get non-interactive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
#RUN apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4
|
||||
|
||||
## Install redis-tools dependencies
|
||||
## TODO: implicitly install dependencies
|
||||
RUN apt-get -y install libjemalloc1
|
||||
|
||||
COPY \
|
||||
{% for deb in docker_sonic_mgmt_framework_debs.split(' ') -%}
|
||||
debs/{{ deb }}{{' '}}
|
||||
{%- endfor -%}
|
||||
debs/
|
||||
|
||||
RUN dpkg -i \
|
||||
{% for deb in docker_sonic_mgmt_framework_debs.split(' ') -%}
|
||||
debs/{{ deb }}{{' '}}
|
||||
{%- endfor %}
|
||||
|
||||
COPY ["start.sh", "rest-server.sh", "/usr/bin/"]
|
||||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
|
||||
|
||||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
|
||||
RUN rm -rf /debs
|
||||
|
||||
ENTRYPOINT ["/usr/bin/supervisord"]
|
7
dockers/docker-sonic-mgmt-framework/rest-server.sh
Executable file
7
dockers/docker-sonic-mgmt-framework/rest-server.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
REST_SERVER_ARGS=" -ui /rest_ui -port=80 -logtostderr"
|
||||
|
||||
exec /usr/sbin/rest_server ${REST_SERVER_ARGS}
|
||||
|
||||
|
10
dockers/docker-sonic-mgmt-framework/start.sh
Executable file
10
dockers/docker-sonic-mgmt-framework/start.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
mkdir -p /var/sonic
|
||||
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
|
||||
|
||||
rm -f /var/run/rsyslogd.pid
|
||||
|
||||
supervisorctl start rsyslogd
|
||||
|
||||
supervisorctl start rest-server
|
28
dockers/docker-sonic-mgmt-framework/supervisord.conf
Normal file
28
dockers/docker-sonic-mgmt-framework/supervisord.conf
Normal file
@ -0,0 +1,28 @@
|
||||
[supervisord]
|
||||
logfile_maxbytes=1MB
|
||||
logfile_backups=2
|
||||
nodaemon=true
|
||||
|
||||
[program:start.sh]
|
||||
command=/usr/bin/start.sh
|
||||
priority=1
|
||||
autostart=true
|
||||
autorestart=false
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
|
||||
[program:rsyslogd]
|
||||
command=/usr/sbin/rsyslogd -n
|
||||
priority=2
|
||||
autostart=false
|
||||
autorestart=false
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
||||
|
||||
[program:rest-server]
|
||||
command=/usr/bin/rest-server.sh
|
||||
priority=3
|
||||
autostart=false
|
||||
autorestart=true
|
||||
stdout_logfile=syslog
|
||||
stderr_logfile=syslog
|
14
files/build_templates/mgmt-framework.service.j2
Normal file
14
files/build_templates/mgmt-framework.service.j2
Normal file
@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Management Framework container
|
||||
Requires=swss.service
|
||||
After=swss.service
|
||||
Before=ntp-config.service
|
||||
|
||||
[Service]
|
||||
User={{ sonicadmin_user }}
|
||||
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
|
||||
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
|
||||
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
22
rules/docker-sonic-mgmt-framework.mk
Normal file
22
rules/docker-sonic-mgmt-framework.mk
Normal file
@ -0,0 +1,22 @@
|
||||
# docker image for mgmt-framework
|
||||
|
||||
DOCKER_MGMT-FRAMEWORK_STEM = docker-sonic-mgmt-framework
|
||||
DOCKER_MGMT-FRAMEWORK = $(DOCKER_MGMT-FRAMEWORK_STEM).gz
|
||||
DOCKER_MGMT-FRAMEWORK_DBG = $(DOCKER_MGMT-FRAMEWORK_STEM)-$(DBG_IMAGE_MARK).gz
|
||||
|
||||
$(DOCKER_MGMT-FRAMEWORK)_PATH = $(DOCKERS_PATH)/$(DOCKER_MGMT-FRAMEWORK_STEM)
|
||||
|
||||
$(DOCKER_MGMT-FRAMEWORK)_DEPENDS += $(REDIS_TOOLS) $(SONIC_MGMT-FRAMEWORK)
|
||||
$(DOCKER_MGMT-FRAMEWORK)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)
|
||||
|
||||
SONIC_DOCKER_IMAGES += $(DOCKER_MGMT-FRAMEWORK)
|
||||
$(DOCKER_MGMT-FRAMEWORK)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)
|
||||
$(DOCKER_MGMT-FRAMEWORK)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES)
|
||||
|
||||
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_MGMT-FRAMEWORK)
|
||||
SONIC_STRETCH_DOCKERS += $(DOCKER_MGMT-FRAMEWORK)
|
||||
|
||||
$(DOCKER_MGMT-FRAMEWORK)_CONTAINER_NAME = mgmt-framework
|
||||
$(DOCKER_MGMT-FRAMEWORK)_RUN_OPT += --net=host --privileged -t
|
||||
$(DOCKER_MGMT-FRAMEWORK)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
|
||||
|
5
rules/sonic-mgmt-framework.mk
Normal file
5
rules/sonic-mgmt-framework.mk
Normal file
@ -0,0 +1,5 @@
|
||||
# SONiC mgmt-framework package
|
||||
|
||||
SONIC_MGMT-FRAMEWORK = sonic-mgmt-framework_1.0-01_amd64.deb
|
||||
$(SONIC_MGMT-FRAMEWORK)_SRC_PATH = $(SRC_PATH)/sonic-mgmt-framework
|
||||
SONIC_DPKG_DEBS += $(SONIC_MGMT-FRAMEWORK)
|
1
src/sonic-mgmt-framework
Submodule
1
src/sonic-mgmt-framework
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 6dd9125f1f0a5dc950857676239497b885b17b3e
|
Loading…
Reference in New Issue
Block a user