Skip to content

Commit

Permalink
Move the restore_neighbors.py to sonic-swss submodule
Browse files Browse the repository at this point in the history
Made changes to makefiles accordingly

Make dockerfile.j2 changes and supervisord config changes

Add python monotonic lib for time access

Signed-off-by: Zhenggen Xu <[email protected]>
  • Loading branch information
zhenggen-xu committed Nov 8, 2018
1 parent 0ca4d2a commit e919245
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 277 deletions.
5 changes: 2 additions & 3 deletions dockers/docker-orchagent/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ RUN apt-get -y install libjemalloc1

RUN apt-get install -y libelf1 libmnl0

RUN pip install --upgrade pip
RUN pip install setuptools
RUN pip install pyroute2 netifaces
RUN pip install pyroute2==0.5.3 netifaces==0.10.7
RUN pip install monotonic==1.5

COPY \
{% for deb in docker_orchagent_debs.split(' ') -%}
Expand All @@ -37,7 +37,6 @@ RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs

COPY ["files/arp_update", "/usr/bin"]
COPY ["files/restore_neighbors.py", "/usr/bin"]
COPY ["enable_counters.py", "/usr/bin"]
COPY ["start.sh", "orchagent.sh", "swssconfig.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
Expand Down
2 changes: 2 additions & 0 deletions dockers/docker-orchagent/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ command=/usr/bin/restore_neighbors.py
priority=15
autostart=false
autorestart=false
startsecs=0
startretries=0
stdout_logfile=syslog
stderr_logfile=syslog

257 changes: 0 additions & 257 deletions files/scripts/restore_neighbors.py

This file was deleted.

2 changes: 1 addition & 1 deletion platform/barefoot/docker-orchagent-bfn.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ $(DOCKER_ORCHAGENT_BFN)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_ORCHAGENT_BFN)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw

$(DOCKER_ORCHAGENT_BFN)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel
$(DOCKER_ORCHAGENT_BFN)_FILES += $(ARP_UPDATE_SCRIPT) $(RESTORE_NEIGHS_SCRIPT)
$(DOCKER_ORCHAGENT_BFN)_FILES += $(ARP_UPDATE_SCRIPT)
2 changes: 1 addition & 1 deletion platform/broadcom/docker-orchagent-brcm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ $(DOCKER_ORCHAGENT_BRCM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_ORCHAGENT_BRCM)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw

$(DOCKER_ORCHAGENT_BRCM)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel
$(DOCKER_ORCHAGENT_BRCM)_FILES += $(ARP_UPDATE_SCRIPT) $(RESTORE_NEIGHS_SCRIPT)
$(DOCKER_ORCHAGENT_BRCM)_FILES += $(ARP_UPDATE_SCRIPT)
2 changes: 1 addition & 1 deletion platform/cavium/docker-orchagent-cavm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ $(DOCKER_ORCHAGENT_CAVM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_ORCHAGENT_CAVM)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw

$(DOCKER_ORCHAGENT_CAVM)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel
$(DOCKER_ORCHAGENT_CAVM)_FILES += $(ARP_UPDATE_SCRIPT) $(RESTORE_NEIGHS_SCRIPT)
$(DOCKER_ORCHAGENT_CAVM)_FILES += $(ARP_UPDATE_SCRIPT)
2 changes: 1 addition & 1 deletion platform/centec/docker-orchagent-centec.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ $(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_ORCHAGENT_CENTEC)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw

$(DOCKER_ORCHAGENT_CENTEC)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel
$(DOCKER_ORCHAGENT_CENTEC)_FILES += $(ARP_UPDATE_SCRIPT) $(RESTORE_NEIGHS_SCRIPT)
$(DOCKER_ORCHAGENT_CENTEC)_FILES += $(ARP_UPDATE_SCRIPT)
2 changes: 1 addition & 1 deletion platform/marvell/docker-orchagent-mrvl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ $(DOCKER_ORCHAGENT_MRVL)_RUN_OPT += -v /host/machine.conf:/host/machine.conf
$(DOCKER_ORCHAGENT_MRVL)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro

$(DOCKER_ORCHAGENT_MRVL)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel
$(DOCKER_ORCHAGENT_MRVL)_FILES += $(ARP_UPDATE_SCRIPT) $(RESTORE_NEIGHS_SCRIPT)
$(DOCKER_ORCHAGENT_MRVL)_FILES += $(ARP_UPDATE_SCRIPT)
2 changes: 1 addition & 1 deletion platform/mellanox/docker-orchagent-mlnx.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ $(DOCKER_ORCHAGENT_MLNX)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_ORCHAGENT_MLNX)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw

$(DOCKER_ORCHAGENT_MLNX)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel
$(DOCKER_ORCHAGENT_MLNX)_FILES += $(ARP_UPDATE_SCRIPT) $(RESTORE_NEIGHS_SCRIPT)
$(DOCKER_ORCHAGENT_MLNX)_FILES += $(ARP_UPDATE_SCRIPT)
2 changes: 1 addition & 1 deletion platform/nephos/docker-orchagent-nephos.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ $(DOCKER_ORCHAGENT_NEPHOS)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_ORCHAGENT_NEPHOS)_RUN_OPT += -v /var/log/swss:/var/log/swss:rw

$(DOCKER_ORCHAGENT_NEPHOS)_BASE_IMAGE_FILES += swssloglevel:/usr/bin/swssloglevel
$(DOCKER_ORCHAGENT_NEPHOS)_FILES += $(ARP_UPDATE_SCRIPT) $(RESTORE_NEIGHS_SCRIPT)
$(DOCKER_ORCHAGENT_NEPHOS)_FILES += $(ARP_UPDATE_SCRIPT)
3 changes: 1 addition & 2 deletions platform/vs/docker-sonic-vs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ $(DOCKER_SONIC_VS)_DEPENDS += $(GOBGP)
endif

$(DOCKER_SONIC_VS)_FILES += $(CONFIGDB_LOAD_SCRIPT) \
$(ARP_UPDATE_SCRIPT) \
$(RESTORE_NEIGHS_SCRIPT)
$(ARP_UPDATE_SCRIPT)

$(DOCKER_SONIC_VS)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_SONIC_VS)
5 changes: 2 additions & 3 deletions platform/vs/docker-sonic-vs/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ RUN apt-get install -y net-tools \
RUN pip install setuptools
RUN pip install py2_ipaddress
RUN pip install six
RUN pip install pyroute2
RUN pip install netifaces
RUN pip install pyroute2==0.5.3 netifaces==0.10.7
RUN pip install monotonic==1.5

{% if docker_sonic_vs_debs.strip() -%}
# Copy locally-built Debian package dependencies
Expand Down Expand Up @@ -90,7 +90,6 @@ COPY ["pg_profile_lookup.ini", "/usr/share/sonic/device/vswitch/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["files/configdb-load.sh", "/usr/bin/"]
COPY ["files/arp_update", "/usr/bin"]
COPY ["files/restore_neighbors.py", "/usr/bin"]

# Workaround the tcpdump issue
RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump
Expand Down
2 changes: 2 additions & 0 deletions platform/vs/docker-sonic-vs/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,7 @@ command=/usr/bin/restore_neighbors.py
priority=19
autostart=false
autorestart=false
startsecs=0
startretries=0
stdout_logfile=syslog
stderr_logfile=syslog
6 changes: 1 addition & 5 deletions rules/scripts.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ $(ARP_UPDATE_SCRIPT)_PATH = files/scripts
CONFIGDB_LOAD_SCRIPT = configdb-load.sh
$(CONFIGDB_LOAD_SCRIPT)_PATH = files/scripts

RESTORE_NEIGHS_SCRIPT = restore_neighbors.py
$(RESTORE_NEIGHS_SCRIPT)_PATH = files/scripts

SONIC_COPY_FILES += $(CONFIGDB_LOAD_SCRIPT) \
$(ARP_UPDATE_SCRIPT) \
$(RESTORE_NEIGHS_SCRIPT)
$(ARP_UPDATE_SCRIPT)


0 comments on commit e919245

Please sign in to comment.