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
Empty file added device/cisco/.gitkeep
Empty file.
7 changes: 7 additions & 0 deletions platform/checkout/cisco-smartswitch.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

[module]
repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git
ref=0.master.1.1
path=platform/cisco/src
7 changes: 7 additions & 0 deletions platform/checkout/cisco.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

[module]
repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git
ref=0.cisco.master.1.0.0
path=platform/cisco/src
2 changes: 2 additions & 0 deletions platform/cisco/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/
platform_metadata
15 changes: 15 additions & 0 deletions platform/cisco/docker-gbsyncd-cisco.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-gbsyncd-cisco.mk $(PLATFORM_PATH)/docker-gbsyncd-cisco.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(addprefix $(PLATFORM_PATH)/,$(shell cd $(PLATFORM_PATH) && git ls-files $(DOCKER_GBSYNCD_BASE_STEM)))

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

# The DBG version has the same dependencies
$(DOCKER_GBSYNCD_BASE_DBG)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_GBSYNCD_BASE_DBG)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_GBSYNCD_BASE_DBG)_DEP_FILES := $(DEP_FILES)
42 changes: 42 additions & 0 deletions platform/cisco/docker-gbsyncd-cisco.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

# docker image for Cisco gbsyncd

DOCKER_GBSYNCD_PLATFORM_CODE = cisco

include $(PLATFORM_PATH)/../template/docker-gbsyncd-bookworm.mk

$(DOCKER_GBSYNCD_BASE)_PATH := $(PLATFORM_PATH)/docker-gbsyncd-$(DOCKER_GBSYNCD_PLATFORM_CODE)

$(DOCKER_GBSYNCD_BASE)_VERSION = 1.0.0
$(DOCKER_GBSYNCD_BASE)_PACKAGE_NAME = gbsyncd-$(DOCKER_GBSYNCD_PLATFORM_CODE)

$(DOCKER_GBSYNCD_BASE)_DEPENDS += $(SYNCD) \
$(CISCO_WB_BSP_PYLIB) \
$(LIBSSL) \
$(GB_SAI) \
$(YAML)

$(DOCKER_SYNCD)_DBG_DEPENDS += \
$(SYNCD_DBG) \
$(LIBSWSSCOMMON_DBG) \
$(LIBSAIMETADATA_DBG) \
$(LIBSAIREDIS_DBG)

$(DOCKER_GBSYNCD_BASE)_RUN_OPT += \
-v /var/cache/cisco:/var/cache/cisco \
-v /opt/cisco:/opt/cisco:ro \
-v /sys/kernel/debug:/sys/kernel/debug:ro \
-v /usr/lib/cisco:/usr/lib/cisco \
-v /opt/cisco/silicon-one:/opt/cisco/silicon-one \
-e LD_LIBRARY_PATH=/usr/lib/:/opt/cisco/lib:/usr/lib/cisco \
-v /dev/shm:/dev/shm \
--env "OPTICS_DEBUG_PORT"=7500

$(DOCKER_GBSYNCD_BASE)_APT_PACKAGES += \
i2c-tools \
libcurl4-openssl-dev \
libjansson4 \
libpci3 \
libyaml
36 changes: 36 additions & 0 deletions platform/cisco/docker-gbsyncd-cisco/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

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

RUN apt-get update

RUN apt-get install -y \
iproute2 \
libcap2-bin \
gdb

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

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


COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["critical_processes", "/etc/supervisor/"]
COPY ["start.sh", "/usr/bin/"]

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

ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions platform/cisco/docker-gbsyncd-cisco/critical_processes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
program:syncd
17 changes: 17 additions & 0 deletions platform/cisco/docker-gbsyncd-cisco/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

HWSKU_DIR=/usr/share/sonic/hwsku

mkdir -p /etc/sai.d/

# Create/Copy the pai.profile to /etc/sai.d/pai.profile
if [ -f $HWSKU_DIR/pai.profile.j2 ]; then
sonic-cfggen -d -t $HWSKU_DIR/pai.profile.j2 > /etc/sai.d/pai.profile
else
if [ -f $HWSKU_DIR/pai.profile ]; then
cp $HWSKU_DIR/pai.profile /etc/sai.d/pai.profile
fi
fi
53 changes: 53 additions & 0 deletions platform/cisco/docker-gbsyncd-cisco/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

[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
buffer_size=1024

[eventlistener:supervisor-proc-exit-listener]
command=/usr/local/bin/supervisor-proc-exit-listener --container-name gbsyncd
events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING
autostart=true
autorestart=unexpected
buffer_size=1024

[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]
command=/usr/bin/syncd -s -p /etc/sai.d/pai.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
10 changes: 10 additions & 0 deletions platform/cisco/docker-orchagent.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

# docker image for orchagent

#
# DOCKER_ORCHAGENT comes from rules/docker-orchagent.mk which is
# included before the platform rules.mk
#
$(DOCKER_ORCHAGENT)_RUN_OPT += -v /var/cache/cisco:/var/cache/cisco
14 changes: 14 additions & 0 deletions platform/cisco/docker-platform-monitor.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

PLATFORM_SRC_PATH ?= $(PLATFORM_PATH)/src

DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-platform-monitor.mk $(PLATFORM_PATH)/docker-platform-monitor.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(addprefix $(PLATFORM_SRC_PATH)/,$(shell cd $(PLATFORM_SRC_PATH) && git ls-files $(CISCO_8000_PLATFORM_MODULE_REL_PATH)))
DEP_FILES += $(FILES_PATH)/$(CISCO_WB_BSP_PYLIB)


$(DOCKER_PLATFORM_MONITOR)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_PLATFORM_MONITOR)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_PLATFORM_MONITOR)_DEP_FILES := $(DEP_FILES)
35 changes: 35 additions & 0 deletions platform/cisco/docker-platform-monitor.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

#
# DOCKER_PLATFORM_MONITOR comes from rules/docker-platform-monitor.mk which is
# included before the platform rules.mk
#
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(CISCO_PACIFIC_WHEEL)

# Additional platform specific libraries.
$(DOCKER_PLATFORM_MONITOR)_DEPENDS += \
$(CISCO_WB_BSP_PYLIB) \
$(LIBSSL) \
$(YAML) \
$(IPUTILS-PING)

CISCO_BSP_PYTHON_MODULE_PATH := /opt/cisco/lib/python

$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += \
-v /var/cache/cisco:/var/cache/cisco \
-v /opt/cisco:/opt/cisco:ro \
-v /usr/lib/cisco:/usr/lib/cisco \
-v /opt/cisco/lib/.bundled-bookworm:/opt/cisco/lib/.bundled-bookworm:ro \
-v $(CISCO_BSP_PYTHON_MODULE_PATH):$(CISCO_BSP_PYTHON_MODULE_PATH) \
-v /opt/cisco/silicon-one:/opt/cisco/silicon-one \
-e LD_LIBRARY_PATH=/opt/cisco/lib/.bundled-bookworm:/usr/lib:/usr/lib/cisco:/opt/cisco/lib \
-e PYTHONPATH=$(CISCO_BSP_PYTHON_MODULE_PATH):$$PYTHONPATH \
-v /dev/shm:/dev/shm \
--env "OPTICS_DEBUG_PORT"=7500

$(DOCKER_PLATFORM_MONITOR)_APT_PACKAGES += \
i2c-tools \
libcurl4-openssl-dev \
libjansson4 \
libpci3
11 changes: 11 additions & 0 deletions platform/cisco/docker-syncd-cisco-rpc.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-syncd-cisco-rpc.mk $(PLATFORM_PATH)/docker-syncd-cisco-rpc.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
# N.B. we need to enter the platform directory first, since it's a git submodule
DEP_FILES += $(addprefix $(PLATFORM_PATH)/,$(shell cd $(PLATFORM_PATH) && git ls-files $(DOCKER_SYNCD_CISCO_RPC_STEM)))

$(DOCKER_SYNCD_CISCO_RPC)_CACHE_MODE := GIT_CONTENT_SHA
$(DOCKER_SYNCD_CISCO_RPC)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_SYNCD_CISCO_RPC)_DEP_FILES := $(DEP_FILES)
42 changes: 42 additions & 0 deletions platform/cisco/docker-syncd-cisco-rpc.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

# docker image for syncd with rpc

DOCKER_SYNCD_CISCO_RPC_STEM = docker-syncd-cisco-rpc
DOCKER_SYNCD_CISCO_RPC = $(DOCKER_SYNCD_CISCO_RPC_STEM).gz
$(DOCKER_SYNCD_CISCO_RPC)_PATH = $(PLATFORM_PATH)/$(DOCKER_SYNCD_CISCO_RPC_STEM)
$(DOCKER_SYNCD_CISCO_RPC)_DEPENDS += $(SYNCD_RPC)
$(DOCKER_SYNCD_CISCO_RPC)_PYTHON_WHEELS += $(PTF_PY3)
$(DOCKER_SYNCD_CISCO_RPC)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
ifeq ($(INSTALL_DEBUG_TOOLS), y)
$(DOCKER_SYNCD_CISCO_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \
$(LIBSWSSCOMMON_DBG) \
$(LIBSAIMETADATA_DBG) \
$(LIBSAIREDIS_DBG)
endif

$(DOCKER_SYNCD_CISCO_RPC)_PYTHON_DEBS += $(CISCO_SFPD)
$(DOCKER_SYNCD_CISCO_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_CISCO_RPC)
SONIC_BOOKWORM_DOCKERS += $(DOCKER_SYNCD_CISCO_RPC)
ifeq ($(ENABLE_SYNCD_RPC),y)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_CISCO_RPC)
endif

SONIC_BOOKWORM_DOCKERS += $(DOCKER_SYNCD_CISCO_RPC)

$(DOCKER_SYNCD_CISCO_RPC)_CONTAINER_NAME = syncd
$(DOCKER_SYNCD_CISCO_RPC)_VERSION = 1.0.0+rpc
$(DOCKER_SYNCD_CISCO_RPC)_PACKAGE_NAME = syncd
$(DOCKER_SYNCD_CISCO_RPC)_RUN_OPT += --privileged -t
$(DOCKER_SYNCD_CISCO_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_SYNCD_CISCO_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_SYNCD_CISCO_RPC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd
$(DOCKER_SYNCD_CISCO_RPC)_RUN_OPT += -v /host/warmboot:/var/warmboot
$(DOCKER_SYNCD_CISCO_RPC)_RUN_OPT += -v /var/cache/cisco:/var/cache/cisco
$(DOCKER_SYNCD_CISCO_RPC)_RUN_OPT += -v /usr/lib/cisco:/usr/lib/cisco
$(DOCKER_SYNCD_CISCO_RPC)_RUN_OPT += -v /opt/cisco/silicon-one:/opt/cisco/silicon-one
$(DOCKER_SYNCD_CISCO_RPC)_RUN_OPT += -v /var/run/config_gen:/var/run/config_gen
$(DOCKER_SYNCD_CISCO_RPC)_RUN_OPT += -e LD_LIBRARY_PATH=/usr/lib/:/usr/lib/cisco/
$(DOCKER_SYNCD_CISCO_RPC)_RUN_OPT += -v /usr/release_info:/usr/release_info
86 changes: 86 additions & 0 deletions platform/cisco/docker-syncd-cisco-rpc/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Copyright (c) 2026 Cisco Systems, Inc. and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0

{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
FROM docker-syncd-cisco-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

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

RUN apt-get purge -y syncd

## Pre-install the fundamental packages
RUN apt-get update \
&& apt-get -y install \
net-tools \
python3-pip \
python3-dev \
python-is-python3 \
python3-scapy \
build-essential \
libssl-dev \
libffi-dev \
wget \
cmake \
libnanomsg5 \
libnanomsg-dev \
libthrift-0.17.0

RUN pip3 install --upgrade pip


{% if docker_syncd_cisco_rpc_debs.strip() -%}
# Copy locally-built Debian package dependencies
{{ copy_files("debs/", docker_syncd_cisco_rpc_debs.split(' '), "/debs/") }}
{% endif %}

{% if docker_syncd_cisco_rpc_pydebs.strip() -%}
# Copy locally-built Debian package dependencies
{{ copy_files("python-debs/", docker_syncd_cisco_rpc_pydebs.split(' '), "/debs/") }}
{% endif %}

{% if docker_syncd_cisco_rpc_debs.strip() -%}
# Install locally-built Debian packages and implicitly install their dependencies
{{ install_debian_packages(docker_syncd_cisco_rpc_debs.split(' ')) }}
{% endif %}

{% if docker_syncd_cisco_rpc_pydebs.strip() -%}
# Install locally-built Debian packages and implicitly install their dependencies
{{ install_debian_packages(docker_syncd_cisco_rpc_pydebs.split(' ')) }}
{% endif %}

{% if docker_syncd_cisco_rpc_whls.strip() -%}
# Copy locally-built Python wheel dependencies
{{ copy_files("python-wheels/", docker_syncd_cisco_rpc_whls.split(' '), "/python-wheels/") }}

# Install locally-built Python wheel dependencies
{{ install_python_wheels(docker_syncd_cisco_rpc_whls.split(' ')) }}
{% endif %}

RUN pip3 install cffi==1.16.0 \
&& pip3 install wheel \
&& pip3 install nnpy \
&& mkdir -p /opt \
&& cd /opt \
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \
&& apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \
&& rm -rf /root/deps

COPY ["ptf_nn_agent.conf", "/etc/supervisor/conf.d/"]

## Clean up
RUN apt-get -y purge \
cmake \
libssl-dev \
libffi-dev \
python3-dev \
python3-pip \
libthrift-dev \
build-essential

RUN apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /debs

ENTRYPOINT ["/usr/local/bin/supervisord"]
Loading
Loading