-
Notifications
You must be signed in to change notification settings - Fork 6
Test submit OTSS and Syncd-ot code #8
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
Changes from 30 commits
0540f20
5a5683e
796c940
54c33eb
e915fb1
f66b4ed
964350f
d64fbae
5f63586
1940ed3
8d6a2f9
f89a046
463b889
c50af7e
ca94d9e
dc684b4
4f3d383
b2c2de4
bec6c5d
38d604a
cf683ad
2eb6be8
779c517
c6de161
edabf27
6643576
8fc8d7a
4228759
6ccba2b
0ce1a5f
f9c078f
3741d2d
4a20965
82af0b3
e45910b
ae7946a
0b5ee46
bca0fc3
6f0cd69
52d0ff3
4aa15a1
4251d2b
970d527
120450d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: ot-pre-202411-vs-build | ||
|
||
on: | ||
push: | ||
branches: [ "otn_pre_202411" ] | ||
pull_request: | ||
branches: [ "otn_pre_202411" ] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: sonic-otn-server | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
path: 202411_${{github.run_number}} | ||
|
||
- name: build | ||
run: | | ||
cd 202411_${{github.run_number}} | ||
make init | ||
make configure PLATFORM=ot-vs | ||
make target/sonic-ot-vs.img.gz | ||
|
||
- name: 'Upload Artifact' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: otn-202411-artifact | ||
path: | | ||
202411_${{github.run_number}}/sonic-installer.img | ||
202411_${{github.run_number}}/target/*.img.gz |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,8 +29,9 @@ ifeq ($(NOBULLSEYE),0) | |
BUILD_BULLSEYE=1 | ||
endif | ||
|
||
PLATFORM_PATH := platform/$(if $(PLATFORM),$(PLATFORM),$(CONFIGURED_PLATFORM)) | ||
PLATFORM_CHECKOUT := platform/checkout | ||
PLATFORM_ROOT := $(if $(shell echo $(PLATFORM) | grep 'ot-'),ot-platform,platform) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. grep 'ot-' will pick up all the platform name include the substring "ot-", such as "slot-", "hot-" |
||
PLATFORM_PATH := $(PLATFORM_ROOT)/$(if $(PLATFORM),$(PLATFORM),$(CONFIGURED_PLATFORM)) | ||
PLATFORM_CHECKOUT := $(PLATFORM_ROOT)/checkout | ||
PLATFORM_CHECKOUT_FILE := $(PLATFORM_CHECKOUT)/$(PLATFORM).ini | ||
PLATFORM_CHECKOUT_CMD := $(shell if [ -f $(PLATFORM_CHECKOUT_FILE) ]; then PLATFORM_PATH=$(PLATFORM_PATH) j2 $(PLATFORM_CHECKOUT)/template.j2 $(PLATFORM_CHECKOUT_FILE); fi) | ||
MAKE_WITH_RETRY := ./scripts/run_with_retry $(MAKE) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,7 +136,13 @@ endif | |
rules/config.user: | ||
$(Q)echo -n "" | ||
|
||
#include different configurations based on target platform | ||
ifneq ($(shell echo $(CONFIGURED_PLATFORM) | grep 'ot-'),) | ||
include rules/config-ot | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rule/config is meant for each vendor to edit to fit their device features. We can always add more nobs, No need to introduce a new file config-ot. I don't see rules/config-ot file in this PR. |
||
else | ||
include rules/config | ||
endif | ||
|
||
-include rules/config.user | ||
|
||
ifneq ($(DEFAULT_CONTAINER_REGISTRY),) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,6 +185,9 @@ The supported ASIC vendors are: | |
* PLATFORM=innovium | ||
* PLATFORM=vs | ||
|
||
The supported OTN vendors are: | ||
* PLATFORM=ot-vs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vs stands for virtual switch. suggest to use ot-kvm as platform name. see comments in onie.mk file on how to do it. |
||
|
||
## Usage for ARM Architecture | ||
|
||
ARM build has dependency in docker version 18. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Base docker build | ||
FROM docker-ot-orchagent-sonic:latest | ||
|
||
# Copy the cache data to host | ||
From scratch as output | ||
COPY --from=docker-ot-orchagent-sonic:latest /cache.tgz cache.tgz | ||
|
||
# Clean up the cache data | ||
FROM docker-ot-orchagent-sonic:latest as final | ||
RUN rm /cache.tgz | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} | ||
FROM docker-config-engine-bullseye | ||
|
||
ARG docker_container_name | ||
|
||
# Make apt-get non-interactive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && \ | ||
apt-get install -f -y \ | ||
# Needed for installing netifaces Python package | ||
build-essential \ | ||
python3-dev | ||
|
||
{% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %} | ||
# Fix for gcc/python/iputils-ping not found in arm docker | ||
RUN apt-get install -y \ | ||
gcc | ||
{% endif %} | ||
|
||
{% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %} | ||
# Remove installed gcc | ||
RUN apt-get remove -y gcc | ||
{% endif %} | ||
|
||
{% if docker_ot_orchagent_debs.strip() -%} | ||
# Copy locally-built Debian package dependencies | ||
{{ copy_files("debs/", docker_ot_orchagent_debs.split(' '), "/debs/") }} | ||
|
||
# Install locally-built Debian packages and implicitly install their dependencies | ||
{{ install_debian_packages(docker_ot_orchagent_debs.split(' ')) }} | ||
{%- endif %} | ||
|
||
{% if docker_ot_orchagent_whls.strip() -%} | ||
# Copy locally-built Python wheel dependencies | ||
{{ copy_files("python-wheels/", docker_ot_orchagent_whls.split(' '), "/python-wheels/") }} | ||
|
||
# Install locally-built Python wheel dependencies | ||
{{ install_python_wheels(docker_ot_orchagent_whls.split(' ')) }} | ||
{% endif %} | ||
|
||
# Clean up | ||
RUN apt-get purge -y \ | ||
build-essential \ | ||
python3-dev && \ | ||
apt-get clean -y && \ | ||
apt-get autoclean -y && \ | ||
apt-get autoremove -y && \ | ||
rm -rf /debs ~/.cache | ||
|
||
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] | ||
COPY ["orchagent.sh", "/usr/bin/"] | ||
|
||
# Copy all Jinja2 template files into the templates folder | ||
COPY ["*.j2", "/usr/share/sonic/templates/"] | ||
|
||
# Copy all regex json files and rsyslog_plugin.conf to rsyslog.d | ||
COPY ["*.json", "/etc/rsyslog.d/"] | ||
COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"] | ||
|
||
RUN sonic-cfggen -t /usr/share/sonic/templates/docker-init.j2 > /usr/bin/docker-init.sh | ||
RUN rm -f /usr/share/sonic/templates/docker-init.j2 | ||
RUN chmod 755 /usr/bin/docker-init.sh | ||
|
||
# Create swss rsyslog_plugin conf file | ||
RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/swss_events.conf | ||
RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2 | ||
RUN rm -f /etc/rsyslog.d/events_info.json | ||
|
||
ENTRYPOINT ["/usr/bin/docker-init.sh"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# read SONiC immutable variables | ||
[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment | ||
|
||
function help() | ||
{ | ||
echo -e "Usage: $0 -n [0 to $(($NUM_ASIC-1))] [OPTION]... " 1>&2; exit 1; | ||
} | ||
|
||
DOCKER_EXEC_FLAGS="i" | ||
|
||
# Determine whether stdout is on a terminal | ||
if [ -t 1 ] ; then | ||
DOCKER_EXEC_FLAGS+="t" | ||
fi | ||
|
||
DEV="" | ||
PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} | ||
|
||
# Parse the device specific asic conf file, if it exists | ||
ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf | ||
[ -f $ASIC_CONF ] && . $ASIC_CONF | ||
|
||
if [[ ($NUM_ASIC -gt 1) ]]; then | ||
while getopts ":n:h:" opt; do | ||
case "${opt}" in | ||
h) help | ||
;; | ||
n) DEV=${OPTARG} | ||
[ $DEV -lt $NUM_ASIC -a $DEV -ge 0 ] || help | ||
;; | ||
esac | ||
done | ||
|
||
if [ -z "${DEV}" ]; then | ||
help | ||
fi | ||
|
||
# Skip the arguments -n <inst> while passing to docker command | ||
shift 2 | ||
fi | ||
|
||
docker exec -$DOCKER_EXEC_FLAGS swss$DEV swssloglevel "$@" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
BUFFER_CALCULATION_MODE=$(redis-cli -n 4 hget "DEVICE_METADATA|localhost" buffer_model) | ||
|
||
if [ "$BUFFER_CALCULATION_MODE" == "dynamic" ]; then | ||
BUFFERMGRD_ARGS="-a /etc/sonic/asic_table.json" | ||
if [ -f /etc/sonic/peripheral_table.json ]; then | ||
BUFFERMGRD_PERIPHERIAL_ARGS=" -p /etc/sonic/peripheral_table.json" | ||
fi | ||
if [ -f /etc/sonic/zero_profiles.json ]; then | ||
BUFFERMGRD_ZERO_PROFILE_ARGS=" -z /etc/sonic/zero_profiles.json" | ||
fi | ||
else | ||
# Should we use the fallback MAC in case it is not found in Device.Metadata | ||
BUFFERMGRD_ARGS="-l /usr/share/sonic/hwsku/pg_profile_lookup.ini" | ||
fi | ||
|
||
exec /usr/bin/buffermgrd ${BUFFERMGRD_ARGS} ${BUFFERMGRD_PERIPHERIAL_ARGS} ${BUFFERMGRD_ZERO_PROFILE_ARGS} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
program:orchagent | ||
program:linecardmgrd | ||
program:configsyncd |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
mkdir -p /etc/swss/config.d/ | ||
mkdir -p /etc/supervisor/ | ||
mkdir -p /etc/supervisor/conf.d/ | ||
|
||
|
||
CFGGEN_PARAMS=" \ | ||
-d \ | ||
-y /etc/sonic/constants.yml \ | ||
-t /usr/share/sonic/templates/critical_processes.j2,/etc/supervisor/critical_processes \ | ||
-t /usr/share/sonic/templates/watchdog_processes.j2,/etc/supervisor/watchdog_processes \ | ||
-t /usr/share/sonic/templates/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf | ||
" | ||
|
||
sonic-cfggen $CFGGEN_PARAMS | ||
|
||
# Executed platform specific initialization tasks. | ||
if [ -x /usr/share/sonic/platform/platform-init ]; then | ||
/usr/share/sonic/platform/platform-init | ||
fi | ||
|
||
# Executed HWSKU specific initialization tasks. | ||
if [ -x /usr/share/sonic/hwsku/hwsku-init ]; then | ||
/usr/share/sonic/hwsku/hwsku-init | ||
fi | ||
|
||
TZ=$(cat /etc/timezone) | ||
rm -rf /etc/localtime | ||
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime | ||
|
||
exec /usr/local/bin/supervisord |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"yang_module": "sonic-events-swss", | ||
"proclist": [ | ||
{ | ||
"name": "swss", | ||
"parse_json": "swss_regex.json" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
|
||
SWSS_VARS_FILE=/usr/share/sonic/templates/swss_vars.j2 | ||
|
||
# Retrieve SWSS vars from sonic-cfggen | ||
SWSS_VARS=$(sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t $SWSS_VARS_FILE) || exit 1 | ||
export platform=$(echo $SWSS_VARS | jq -r '.asic_type') | ||
export sub_platform=$(echo $SWSS_VARS | jq -r '.asic_subtype') | ||
|
||
# Create a folder for SwSS record files | ||
mkdir -p /var/log/swss | ||
ORCHAGENT_ARGS="-d /var/log/swss " | ||
|
||
# Set orchagent pop batch size to 8192 | ||
ORCHAGENT_ARGS+="-b 8192 " | ||
|
||
# Set synchronous mode if it is enabled in CONFIG_DB | ||
SYNC_MODE=$(echo $SWSS_VARS | jq -r '.synchronous_mode') | ||
if [ "$SYNC_MODE" == "enable" ]; then | ||
ORCHAGENT_ARGS+="-s " | ||
fi | ||
|
||
# Check if there is an "asic_id field" in the DEVICE_METADATA in configDB. | ||
#"DEVICE_METADATA": { | ||
# "localhost": { | ||
# .... | ||
# "asic_id": "0", | ||
# } | ||
#}, | ||
# ID field could be integers just to denote the asic instance like 0,1,2... | ||
# OR could be PCI device ID's which will be strings like "03:00.0" | ||
# depending on what the SAI/SDK expects. | ||
asic_id=$(echo $SWSS_VARS | jq -r '.asic_id') | ||
if [ -n "$asic_id" ] | ||
then | ||
ORCHAGENT_ARGS+="-i $asic_id " | ||
fi | ||
|
||
# for multi asic platforms add the asic name to the record file names | ||
if [[ "$NAMESPACE_ID" ]]; then | ||
ORCHAGENT_ARGS+="-f swss.asic$NAMESPACE_ID.rec -j otairedis.asic$NAMESPACE_ID.rec " | ||
fi | ||
|
||
hwsku=`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['hwsku']"` | ||
if [ -n "$hwsku" ] | ||
then | ||
ORCHAGENT_ARGS+="-c /etc/sonic/linecards/$hwsku/flexcounter.json " | ||
fi | ||
|
||
exec /usr/bin/orchagent ${ORCHAGENT_ARGS} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all platforms (total 9) in sonic are under 'platform' directory. ot-platform folder diverges from existing directory structure? I don't see any technical reason for that.