Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from project-arlo/brcm_poc
Browse files Browse the repository at this point in the history
Brcm poc changes to include sonic-mgmt-framework docker to sonic-broadcom.bin
  • Loading branch information
jghalam authored Jun 19, 2019
2 parents 4ce3cc8 + 3a8ef73 commit 3b3ded5
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 34 additions & 0 deletions dockers/docker-sonic-mgmt-framework/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM {{ docker_sonic_mgmt_framework_load_image }}

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 changes: 7 additions & 0 deletions dockers/docker-sonic-mgmt-framework/rest-server.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 0 deletions dockers/docker-sonic-mgmt-framework/start.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 28 additions & 0 deletions dockers/docker-sonic-mgmt-framework/supervisord.conf
Original file line number Diff line number Diff line change
@@ -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 changes: 14 additions & 0 deletions files/build_templates/mgmt-framework.service.j2
Original file line number Diff line number Diff line change
@@ -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 changes: 22 additions & 0 deletions rules/docker-sonic-mgmt-framework.mk
Original file line number Diff line number Diff line change
@@ -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 changes: 5 additions & 0 deletions rules/sonic-mgmt-framework.mk
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions src/sonic-mgmt-framework
Submodule sonic-mgmt-framework added at 6dd912

0 comments on commit 3b3ded5

Please sign in to comment.