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

Commit 3b3ded5

Browse files
authored
Merge pull request #1 from project-arlo/brcm_poc
Brcm poc changes to include sonic-mgmt-framework docker to sonic-broadcom.bin
2 parents 4ce3cc8 + 3a8ef73 commit 3b3ded5

9 files changed

Lines changed: 124 additions & 0 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,6 @@
6666
[submodule "platform/mellanox/mlnx-sai/SAI-Implementation"]
6767
path = platform/mellanox/mlnx-sai/SAI-Implementation
6868
url = https://github.com/Mellanox/SAI-Implementation
69+
[submodule "src/sonic-mgmt-framework"]
70+
path = src/sonic-mgmt-framework
71+
url = https://github.com/project-arlo/sonic-mgmt-framework.git
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM {{ docker_sonic_mgmt_framework_load_image }}
2+
3+
ARG docker_container_name
4+
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf
5+
6+
## Make apt-get non-interactive
7+
ENV DEBIAN_FRONTEND=noninteractive
8+
9+
RUN apt-get update
10+
11+
#RUN apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4
12+
13+
## Install redis-tools dependencies
14+
## TODO: implicitly install dependencies
15+
RUN apt-get -y install libjemalloc1
16+
17+
COPY \
18+
{% for deb in docker_sonic_mgmt_framework_debs.split(' ') -%}
19+
debs/{{ deb }}{{' '}}
20+
{%- endfor -%}
21+
debs/
22+
23+
RUN dpkg -i \
24+
{% for deb in docker_sonic_mgmt_framework_debs.split(' ') -%}
25+
debs/{{ deb }}{{' '}}
26+
{%- endfor %}
27+
28+
COPY ["start.sh", "rest-server.sh", "/usr/bin/"]
29+
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
30+
31+
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
32+
RUN rm -rf /debs
33+
34+
ENTRYPOINT ["/usr/bin/supervisord"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
REST_SERVER_ARGS=" -ui /rest_ui -port=80 -logtostderr"
4+
5+
exec /usr/sbin/rest_server ${REST_SERVER_ARGS}
6+
7+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
mkdir -p /var/sonic
4+
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status
5+
6+
rm -f /var/run/rsyslogd.pid
7+
8+
supervisorctl start rsyslogd
9+
10+
supervisorctl start rest-server
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[supervisord]
2+
logfile_maxbytes=1MB
3+
logfile_backups=2
4+
nodaemon=true
5+
6+
[program:start.sh]
7+
command=/usr/bin/start.sh
8+
priority=1
9+
autostart=true
10+
autorestart=false
11+
stdout_logfile=syslog
12+
stderr_logfile=syslog
13+
14+
[program:rsyslogd]
15+
command=/usr/sbin/rsyslogd -n
16+
priority=2
17+
autostart=false
18+
autorestart=false
19+
stdout_logfile=syslog
20+
stderr_logfile=syslog
21+
22+
[program:rest-server]
23+
command=/usr/bin/rest-server.sh
24+
priority=3
25+
autostart=false
26+
autorestart=true
27+
stdout_logfile=syslog
28+
stderr_logfile=syslog
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=Management Framework container
3+
Requires=swss.service
4+
After=swss.service
5+
Before=ntp-config.service
6+
7+
[Service]
8+
User={{ sonicadmin_user }}
9+
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
10+
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
11+
ExecStop=/usr/bin/{{docker_container_name}}.sh stop
12+
13+
[Install]
14+
WantedBy=multi-user.target
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# docker image for mgmt-framework
2+
3+
DOCKER_MGMT-FRAMEWORK_STEM = docker-sonic-mgmt-framework
4+
DOCKER_MGMT-FRAMEWORK = $(DOCKER_MGMT-FRAMEWORK_STEM).gz
5+
DOCKER_MGMT-FRAMEWORK_DBG = $(DOCKER_MGMT-FRAMEWORK_STEM)-$(DBG_IMAGE_MARK).gz
6+
7+
$(DOCKER_MGMT-FRAMEWORK)_PATH = $(DOCKERS_PATH)/$(DOCKER_MGMT-FRAMEWORK_STEM)
8+
9+
$(DOCKER_MGMT-FRAMEWORK)_DEPENDS += $(REDIS_TOOLS) $(SONIC_MGMT-FRAMEWORK)
10+
#$(DOCKER_MGMT-FRAMEWORK)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)
11+
12+
SONIC_DOCKER_IMAGES += $(DOCKER_MGMT-FRAMEWORK)
13+
$(DOCKER_MGMT-FRAMEWORK)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)
14+
#$(DOCKER_MGMT-FRAMEWORK)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES)
15+
16+
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_MGMT-FRAMEWORK)
17+
SONIC_STRETCH_DOCKERS += $(DOCKER_MGMT-FRAMEWORK)
18+
19+
$(DOCKER_MGMT-FRAMEWORK)_CONTAINER_NAME = mgmt-framework
20+
$(DOCKER_MGMT-FRAMEWORK)_RUN_OPT += --net=host --privileged -t
21+
$(DOCKER_MGMT-FRAMEWORK)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
22+

rules/sonic-mgmt-framework.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SONiC mgmt-framework package
2+
3+
SONIC_MGMT-FRAMEWORK = sonic-mgmt-framework_1.0-01_amd64.deb
4+
$(SONIC_MGMT-FRAMEWORK)_SRC_PATH = $(SRC_PATH)/sonic-mgmt-framework
5+
SONIC_DPKG_DEBS += $(SONIC_MGMT-FRAMEWORK)

src/sonic-mgmt-framework

Submodule sonic-mgmt-framework added at 6dd9125

0 commit comments

Comments
 (0)