Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[saiserver]: add saiserver for broadcom, mellanox, cavium #377

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ src/sonic-device-data/src/device/
# Autogenerated Dockerfiles
dockers/docker-database/Dockerfile
dockers/docker-fpm/Dockerfile
dockers/docker-fpm-gobgp/Dockerfile
dockers/docker-lldp-sv2/Dockerfile
dockers/docker-orchagent/Dockerfile
dockers/docker-snmp-sv2/Dockerfile
Expand All @@ -37,3 +38,6 @@ dockers/docker-teamd/Dockerfile
dockers/docker-config-engine/Dockerfile
dockers/docker-base/Dockerfile
platform/broadcom/docker-syncd-brcm/Dockerfile
platform/broadcom/docker-saiserver-brcm/Dockerfile
platform/mellanox/docker-saiserver-mlnx/Dockerfile
platform/mellanox/docker-saiserver-cavm/Dockerfile
4 changes: 2 additions & 2 deletions dockers/docker-config-engine/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ RUN apt-get update
RUN apt-get install -y python-lxml python-jinja2 python-netaddr python-ipaddr python-yaml

COPY \
{% for deb in docker_config_engine_debs.split(' ') -%}
{% for deb in docker_config_engine_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN dpkg -i \
{% for deb in docker_config_engine_debs.split(' ') -%}
{% for deb in docker_config_engine_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}

Expand Down
4 changes: 2 additions & 2 deletions dockers/docker-database/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update

COPY \
{% for deb in docker_database_debs.split(' ') -%}
{% for deb in docker_database_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
Expand All @@ -16,7 +16,7 @@ debs/
RUN apt-get -y install libjemalloc1

RUN dpkg -i \
{% for deb in docker_database_debs.split(' ') -%}
{% for deb in docker_database_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}

Expand Down
4 changes: 2 additions & 2 deletions dockers/docker-fpm-gobgp/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y supervisor

COPY \
{% for deb in docker_fpm_gobgp_debs.split(' ') -%}
{% for deb in docker_fpm_gobgp_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN dpkg -i \
{% for deb in docker_fpm_gobgp_debs.split(' ') -%}
{% for deb in docker_fpm_gobgp_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}

Expand Down
4 changes: 2 additions & 2 deletions dockers/docker-fpm/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ RUN apt-get update
RUN apt-get install -y libdbus-1-3 libdaemon0 libjansson4

COPY \
{% for deb in docker_fpm_debs.split(' ') -%}
{% for deb in docker_fpm_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN dpkg -i \
{% for deb in docker_fpm_debs.split(' ') -%}
{% for deb in docker_fpm_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}

Expand Down
4 changes: 2 additions & 2 deletions dockers/docker-lldp-sv2/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM docker-config-engine

COPY \
{% for deb in docker_lldp_sv2_debs.split(' ') -%}
{% for deb in docker_lldp_sv2_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
Expand All @@ -18,7 +18,7 @@ RUN apt-get update && apt-get install -y python-pip supervisor libbsd0 libevent-
## Install LLDP Sync Daemon

RUN dpkg -i \
{% for deb in docker_lldp_sv2_debs.split(' ') -%}
{% for deb in docker_lldp_sv2_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}

Expand Down
4 changes: 2 additions & 2 deletions dockers/docker-orchagent/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ RUN apt-get install -f -y ifupdown bridge-utils libdbus-1-3 libdaemon0 libjansso
RUN apt-get -y install libjemalloc1

COPY \
{% for deb in docker_orchagent_debs.split(' ') -%}
{% for deb in docker_orchagent_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN dpkg -i \
{% for deb in docker_orchagent_debs.split(' ') -%}
{% for deb in docker_orchagent_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}

Expand Down
4 changes: 2 additions & 2 deletions dockers/docker-ptf/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MAINTAINER Pavel Shirshov

## Copy dependencies
COPY \
{% for deb in docker_ptf_debs.split(' ') -%}
{% for deb in docker_ptf_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/
Expand Down Expand Up @@ -43,7 +43,7 @@ RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' /
libqt5network5

RUN dpkg -i \
{% for deb in docker_ptf_debs.split(' ') -%}
{% for deb in docker_ptf_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}

Expand Down
26 changes: 0 additions & 26 deletions dockers/docker-saiserver-brcm/Dockerfile

This file was deleted.

30 changes: 0 additions & 30 deletions dockers/docker-saiserver-cavm/Dockerfile

This file was deleted.

37 changes: 0 additions & 37 deletions dockers/docker-saiserver-mlnx/Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions dockers/docker-snmp-sv2/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM docker-config-engine

COPY [ \
{% for deb in docker_snmp_sv2_debs.split(' ') -%}
{% for deb in docker_snmp_sv2_debs.strip().split(' ') -%}
"debs/{{ deb }}",
{%- endfor %} \
"/debs/"]
Expand All @@ -27,7 +27,7 @@ RUN apt-get update && apt-get install -y supervisor \
libexpat1-dev \
curl gcc && \
dpkg -i \
{% for deb in docker_snmp_sv2_debs.split(' ') -%}
{% for deb in docker_snmp_sv2_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %} && \
rm -rf /debs && \
Expand Down
4 changes: 2 additions & 2 deletions dockers/docker-teamd/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ RUN apt-get update && apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4
RUN apt-get -y install libjemalloc1

COPY \
{% for deb in docker_teamd_debs.split(' ') -%}
{% for deb in docker_teamd_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN dpkg -i \
{% for deb in docker_teamd_debs.split(' ') -%}
{% for deb in docker_teamd_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}

Expand Down
7 changes: 7 additions & 0 deletions platform/broadcom/docker-saiserver-brcm.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# docker image for brcm saiserver

DOCKER_SAISERVER_BRCM = docker-saiserver-brcm.gz
$(DOCKER_SAISERVER_BRCM)_PATH = $(PLATFORM_PATH)/docker-saiserver-brcm
$(DOCKER_SAISERVER_BRCM)_FILES += $(SAISERVER) $(DSSERVE) $(BCMCMD)
$(DOCKER_SAISERVER_BRCM)_LOAD_DOCKERS += $(DOCKER_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_BRCM)
34 changes: 34 additions & 0 deletions platform/broadcom/docker-saiserver-brcm/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM docker-base

## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update

{% if docker_saiserver_brcm_debs.strip() -%}
COPY \
{% for deb in docker_saiserver_brcm_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN dpkg -i \
{% for deb in docker_saiserver_brcm_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %} || apt-get -y install -f
{% endif %}

## TODO: add kmod into Depends
RUN apt-get install -f kmod

COPY ["debs/saiserver", "debs/dsserve", "debs/bcmcmd", "start.sh", "/usr/bin/"]
RUN chmod +x /usr/bin/dsserve /usr/bin/bcmcmd

COPY ["profile.ini", "portmap.ini", "/etc/sai/"]

## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs

ENTRYPOINT ["/bin/bash"]
CMD ["/usr/bin/start.sh"]
4 changes: 2 additions & 2 deletions platform/broadcom/docker-syncd-brcm/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update

COPY \
{% for deb in docker_syncd_brcm_debs.split(' ') -%}
{% for deb in docker_syncd_brcm_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN dpkg -i \
{% for deb in docker_syncd_brcm_debs.split(' ') -%}
{% for deb in docker_syncd_brcm_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}

Expand Down
8 changes: 6 additions & 2 deletions platform/broadcom/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ include $(PLATFORM_PATH)/platform-modules-arista.mk
include $(PLATFORM_PATH)/platform-modules-ingrasys-s9100.mk
include $(PLATFORM_PATH)/docker-orchagent-brcm.mk
include $(PLATFORM_PATH)/docker-syncd-brcm.mk
include $(PLATFORM_PATH)/docker-saiserver-brcm.mk
include $(PLATFORM_PATH)/one-image.mk
include $(PLATFORM_PATH)/one-aboot.mk

Expand All @@ -18,10 +19,13 @@ $(DSSERVE)_URL = "https://sonicstorage.blob.core.windows.net/packages/dsserve?sv
SONIC_ONLINE_FILES += $(BCMCMD) $(DSSERVE)

SONIC_ALL += $(SONIC_ONE_IMAGE) $(SONIC_ONE_ABOOT_IMAGE) \
$(DOCKER_FPM_GOBGP)
$(DOCKER_FPM_GOBGP) \
$(DOCKER_SAISERVER_BRCM)

# Inject brcm sai into sairedis
$(LIBSAIREDIS)_DEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI) $(BRCM_SAI_DEV)
$(SAISERVER)_DEPENDS += $(BRCM_SAI_DEV)

# Runtime dependency on brcm sai is set only for syncd
$(SYNCD)_RDEPENDS += $(BRCM_OPENNSL) $(BRCM_SAI)
$(SYNCD)_RDEPENDS += $(BRCM_SAI)
$(SAISERVER)_RDEPENDS += $(BRCM_SAI)
1 change: 1 addition & 0 deletions platform/broadcom/sai.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ $(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/libsa

SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV)
$(BRCM_SAI)_DEPENDS += $(BRCM_OPENNSL)
$(BRCM_SAI)_RDEPENDS += $(BRCM_OPENNSL)
$(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI)
7 changes: 7 additions & 0 deletions platform/cavium/docker-saiserver-cavm.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# docker image for cavm saiserver

DOCKER_SAISERVER_CAVM = docker-saiserver-cavm.gz
$(DOCKER_SAISERVER_CAVM)_PATH = $(PLATFORM_PATH)/docker-saiserver-cavm
$(DOCKER_SAISERVER_CAVM)_FILES += $(SAISERVER)
$(DOCKER_SAISERVER_CAVM)_LOAD_DOCKERS += $(DOCKER_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_CAVM)
35 changes: 35 additions & 0 deletions platform/cavium/docker-saiserver-cavm/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM docker-base

## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -y libsensors4-dev

{% if docker_saiserver_cavm_debs.strip() -%}
COPY \
{% for deb in docker_saiserver_cavm_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN dpkg -i \
{% for deb in docker_saiserver_cavm_debs.strip().split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %} || apt-get -y install -f
{% endif %}

## TODO: add kmod into Depends
RUN apt-get install -f kmod

COPY ["debs/saiserver", "start.sh", "/usr/bin/"]
RUN chmod +x /usr/bin/saiserver

COPY ["profile.ini", "portmap.ini", "/etc/sai/"]

## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs

ENTRYPOINT ["/bin/bash"]
CMD ["/usr/bin/start.sh"]
Loading