Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions platform/broadcom/rules.dep
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ include $(PLATFORM_PATH)/docker-syncd-brcm-dnx-rpc.dep
ifeq ($(INCLUDE_GBSYNCD), y)
include $(PLATFORM_PATH)/../components/docker-gbsyncd-credo.dep
include $(PLATFORM_PATH)/../components/docker-gbsyncd-broncos.dep
include $(PLATFORM_PATH)/../components/docker-gbsyncd-milleniob.dep
endif
1 change: 1 addition & 0 deletions platform/broadcom/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ include $(PLATFORM_PATH)/docker-syncd-brcm-dnx-rpc.mk
ifeq ($(INCLUDE_GBSYNCD), y)
include $(PLATFORM_PATH)/../components/docker-gbsyncd-credo.mk
include $(PLATFORM_PATH)/../components/docker-gbsyncd-broncos.mk
include $(PLATFORM_PATH)/../components/docker-gbsyncd-milleniob.mk
endif

BCMCMD = bcmcmd
Expand Down
12 changes: 12 additions & 0 deletions platform/components/docker-gbsyncd-milleniob.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DPATH := $($(DOCKER_GBSYNCD_MILLENIOB)_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST)
DEP_FILES += platform/components/docker-gbsyncd-milleniob.mk
DEP_FILES += platform/components/docker-gbsyncd-milleniob.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files $(DPATH))

$(DOCKER_GBSYNCD_MILLENIOB)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_GBSYNCD_MILLENIOB)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_GBSYNCD_MILLENIOB)_DEP_FILES := $(DEP_FILES)

$(eval $(call add_dbg_docker,$(DOCKER_GBSYNCD_MILLENIOB),$(DOCKER_GBSYNCD_MILLENIOB_DBG)))
40 changes: 40 additions & 0 deletions platform/components/docker-gbsyncd-milleniob.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
LIBSAI_MILLENIOB_VERSION = 3.14.0
LIBSAI_MILLENIOB = libsaimilleniob_$(LIBSAI_MILLENIOB_VERSION)_amd64.deb

# Fill the PAI URL here
$(LIBSAI_MILLENIOB)_URL =

ifneq ($($(LIBSAI_MILLENIOB)_URL),)
SONIC_ONLINE_DEBS += $(LIBSAI_MILLENIOB)

DOCKER_GBSYNCD_MILLENIOB_STEM = docker-gbsyncd-milleniob
DOCKER_GBSYNCD_MILLENIOB = $(DOCKER_GBSYNCD_MILLENIOB_STEM).gz
DOCKER_GBSYNCD_MILLENIOB_DBG = $(DOCKER_GBSYNCD_MILLENIOB_STEM)-$(DBG_IMAGE_MARK).gz

$(DOCKER_GBSYNCD_MILLENIOB)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)

$(DOCKER_GBSYNCD_MILLENIOB)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM)

$(DOCKER_GBSYNCD_MILLENIOB)_DBG_DEPENDS += $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS)

$(DOCKER_GBSYNCD_MILLENIOB)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES)

SONIC_DOCKER_IMAGES += $(DOCKER_GBSYNCD_MILLENIOB)
SONIC_BOOKWORM_DOCKERS += $(DOCKER_GBSYNCD_MILLENIOB)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_GBSYNCD_MILLENIOB)

SONIC_DOCKER_DBG_IMAGES += $(DOCKER_GBSYNCD_MILLENIOB_DBG)
SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_GBSYNCD_MILLENIOB_DBG)
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_GBSYNCD_MILLENIOB_DBG)

$(DOCKER_GBSYNCD_MILLENIOB)_CONTAINER_NAME = gbsyncd
$(DOCKER_GBSYNCD_MILLENIOB)_RUN_OPT += --privileged -t
$(DOCKER_GBSYNCD_MILLENIOB)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_GBSYNCD_MILLENIOB)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_GBSYNCD_MILLENIOB)_RUN_OPT += -v /host/warmboot:/var/warmboot

$(DOCKER_GBSYNCD_MILLENIOB)_VERSION = 1.0.0
$(DOCKER_GBSYNCD_MILLENIOB)_PACKAGE_NAME = gbsyncd-milleniob
$(DOCKER_GBSYNCD_MILLENIOB)_PATH = $(PLATFORM_PATH)/../components/docker-gbsyncd-milleniob
$(DOCKER_GBSYNCD_MILLENIOB)_DEPENDS += $(SYNCD) $(LIBSAI_MILLENIOB)
endif
42 changes: 42 additions & 0 deletions platform/components/docker-gbsyncd-milleniob/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name

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

RUN apt-get update

RUN apt-get install -f -y iproute2 libcap2-bin libprotobuf-dev

COPY \
{% for deb in docker_gbsyncd_milleniob_debs.split(' ') -%}
{% if 'libsaibcm' not in deb -%}
debs/{{ deb }}{{' '}}
{%- endif %}
{%- endfor -%}
debs/

RUN dpkg -i \
{% for deb in docker_gbsyncd_milleniob_debs.split(' ') -%}
{% if 'libsaibcm' not in deb -%}
debs/{{ deb }}{{' '}}
{%- endif %}
{%- endfor %}

COPY ["docker-init.sh", "/usr/bin/"]
COPY ["start.sh", "/usr/bin/"]
COPY ["bcmsh", "/usr/bin/"]

COPY ["critical_processes.j2", "/usr/share/sonic/templates"]
COPY ["supervisord.conf.j2", "/usr/share/sonic/templates"]

COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["files/dsserve", "/usr/bin/"]
RUN chmod +x /usr/bin/dsserve

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

ENTRYPOINT ["/usr/bin/docker-init.sh"]
40 changes: 40 additions & 0 deletions platform/components/docker-gbsyncd-milleniob/bcmsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
usage="$(basename "$0") [-h] [-q] [-t timeout] -- interactive shell for bcm service

where:
-h show this help text
-t inactivity timeout in seconds (default 300 seconds, 0 for no timeout)
-q quite, no banner (default: verbose)"

banner="Press Enter to show prompt.
Press Ctrl+C to exit.
NOTICE: Only one bcmsh or bcmcmd can connect to the shell at same time.
"

# Default verbose
quiet=false
timeout=300

while getopts 'hqt:' option; do
case "$option" in
h) echo "$usage"
exit
;;
q) quiet=true
;;
t) timeout=$OPTARG
;;
\?) printf "illegal option: -%s\n" "$OPTARG" >&2
echo "$usage" >&2
exit 1
;;
esac
done
shift $((OPTIND - 1))

if [ "$quiet" = false ]; then
echo "$banner"
fi

/usr/bin/socat -T$timeout readline UNIX-CONNECT:/var/run/sswsyncd/sswgbsyncd.socket

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
program:dsserve
program:syncd
16 changes: 16 additions & 0 deletions platform/components/docker-gbsyncd-milleniob/docker-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /bin/sh

GB_CONFIG=/usr/share/sonic/hwsku/gearbox_config.json

if [ ! -f $GB_CONFIG ]; then
exit 0
fi

CFGGEN_ARG="-j $GB_CONFIG"

mkdir -p /etc/supervisor/conf.d/

sonic-cfggen $CFGGEN_ARG -t /usr/share/sonic/templates/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf
sonic-cfggen $CFGGEN_ARG -t /usr/share/sonic/templates/critical_processes.j2 > /etc/supervisor/critical_processes

exec /usr/local/bin/supervisord
14 changes: 14 additions & 0 deletions platform/components/docker-gbsyncd-milleniob/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

HWSKU_DIR=/usr/share/sonic/hwsku

mkdir -p /etc/sai.d/

# Create/Copy the psai.profile to /etc/sai.d/psai.profile
if [ -f $HWSKU_DIR/psai.profile.j2 ]; then
sonic-cfggen -d -t $HWSKU_DIR/psai.profile.j2 > /etc/sai.d/psai.profile
else
if [ -f $HWSKU_DIR/psai.profile ]; then
cp $HWSKU_DIR/psai.profile /etc/sai.d/psai.profile
fi
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[supervisord]
logfile_maxbytes=1MB
logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
exitcodes=0,3
events=PROCESS_STATE

[program:rsyslogd]
command=/usr/sbin/rsyslogd -n -iNONE
priority=1
autostart=false
autorestart=unexpected
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true

[program:start]
command=/usr/bin/start.sh
priority=2
autostart=false
autorestart=false
startsecs=0
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running

[program:syncd]
environment=MILLENIO_DEVICE_PATH=/usr/lib,MILLENIOB_DEVICE_PATH=/usr/lib
command=/usr/bin/dsserve -f /var/run/sswsyncd/sswgbsyncd.socket /usr/bin/syncd --diag -s -p /etc/sai.d/psai.profile -x /usr/share/sonic/hwsku/context_config.json -g 1
priority=3
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=start:exited
Loading