Skip to content

Commit fbb2ce6

Browse files
committed
Add Python-Based DASH Pipeline as a drop-in replacement for BMv2 model
Signed-off-by: Farhan Tariq <[email protected]>
1 parent f836ae4 commit fbb2ce6

File tree

89 files changed

+7577
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+7577
-28
lines changed

.github/workflows/dash-bmv2-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- 'test/**.yml'
1313
- 'dash-pipeline/**'
1414
- '!dash-pipeline/dockerfiles/Dockerfile.*'
15+
- '!dash-pipeline/py_model*'
1516
- 'dash-pipeline/dockerfiles/*.env'
1617
- '!dash-pipeline/.dockerignore'
1718
- '!dash-pipeline/**.md'
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: DASH-PYMODEL-CI
2+
3+
on:
4+
push:
5+
branches: [ "**" ]
6+
paths:
7+
- '.gitmodules'
8+
- '.github/workflows/dash-pymodel-ci.yml'
9+
- 'test/**.py'
10+
- 'test/**requirements.txt'
11+
- 'test/**.sh'
12+
- 'test/**.yml'
13+
- 'dash-pipeline/**'
14+
- '!dash-pipeline/dockerfiles/Dockerfile.*'
15+
- '!dash-pipeline/bmv2*'
16+
- 'dash-pipeline/dockerfiles/*.env'
17+
- '!dash-pipeline/.dockerignore'
18+
- '!dash-pipeline/**.md'
19+
- '!dash-pipeline/**.svg'
20+
- '!dash-pipeline/**.png'
21+
- '!dash-pipeline/**.txt'
22+
pull_request:
23+
branches: [ "**" ]
24+
paths:
25+
- '.gitmodules'
26+
- '.github/workflows/dash-pymodel-ci.yml'
27+
- 'test/**.py'
28+
- 'test/**requirements.txt'
29+
- 'test/**.sh'
30+
- 'test/**.yml'
31+
- 'dash-pipeline/**'
32+
- '!dash-pipeline/dockerfiles/Dockerfile.*'
33+
- '!dash-pipeline/bmv2*'
34+
- 'dash-pipeline/dockerfiles/*.env'
35+
- '!dash-pipeline/.dockerignore'
36+
- '!dash-pipeline/**.md'
37+
- '!dash-pipeline/**.svg'
38+
- '!dash-pipeline/**.png'
39+
- '!dash-pipeline/**.txt'
40+
workflow_dispatch:
41+
42+
jobs:
43+
build:
44+
name: Build and Test Python DASH Pipeline
45+
runs-on: ubuntu-22.04
46+
env:
47+
docker_fg_flags: --privileged
48+
docker_fg_root_flags: --privileged -u root
49+
docker_bg_root_flags: -d --privileged -u root
50+
docker_bg_flags: -d --privileged
51+
defaults:
52+
run:
53+
working-directory: ./dash-pipeline
54+
steps:
55+
- uses: actions/checkout@v3
56+
- name: Set up Python
57+
uses: actions/setup-python@v4
58+
with:
59+
python-version: '3.12'
60+
- name: Upgrade pip tooling
61+
run: python -m pip install --upgrade pip setuptools wheel
62+
- name: Install pymodel Python dependencies
63+
run: python -m pip install -r py_model/requirements.txt
64+
- name: Build python based pymodel artifacts
65+
run: make py-artifacts
66+
- name: Update SAI submodule
67+
run: git submodule update --init
68+
- name: Pull/Build docker saithrift-bldr image
69+
run: make docker-saithrift-bldr
70+
- name: Pull/Build docker pymodel-bldr image
71+
run: make docker-pymodel-bldr
72+
- name: Generate SAI API
73+
run: DOCKER_FLAGS=$docker_fg_flags make sai TARGET=pymodel
74+
- name: Run pymodel
75+
run: DOCKER_FLAGS=$docker_bg_root_flags make run-pymodel HAVE_DPAPP=y
76+
- name: Pull/Build docker dpapp image
77+
run: make docker-dash-dpapp
78+
- name: Build dpapp
79+
run: DOCKER_FLAGS=$docker_fg_flags make dpapp TARGET=pymodel
80+
- name: Check if SAI spec is updated
81+
run: DOCKER_FLAGS=$docker_fg_flags make check-sai-spec
82+
- name: Prepare network
83+
run: DOCKER_FLAGS=$docker_fg_flags make network HAVE_DPAPP=y
84+
- name: Run dpapp
85+
run: DOCKER_FLAGS=$docker_bg_flags make run-dpapp TARGET=pymodel
86+
- name: Generate saithrift-server
87+
run: DOCKER_FLAGS=$docker_fg_flags make saithrift-server
88+
- name: Generate saithrift-client local docker
89+
run: DOCKER_FLAGS=$docker_fg_flags make docker-saithrift-client
90+
- name: Run saithrift server
91+
run: DOCKER_FLAGS=$docker_bg_flags make run-saithrift-server TARGET=pymodel
92+
- name: Run PTF Tests
93+
run: DOCKER_FLAGS=$docker_fg_root_flags make run-saithrift-ptftests
94+
95+
- uses: azure/docker-login@v1
96+
if: ${{ github.event_name != 'pull_request' && github.repository == 'sonic-net/DASH' }}
97+
with:
98+
login-server: sonicdash.azurecr.io
99+
username: ${{ secrets.DASH_ACR_USERNAME }}
100+
password: ${{ secrets.DASH_ACR_PASSWORD }}
101+
- name: Publish DASH pymodel builder base docker image
102+
run: make docker-publish-pymodel-bldr
103+
if: ${{ github.event_name != 'pull_request' && github.repository == 'sonic-net/DASH' }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ __pycache__/
1010
.pytest_cache/
1111
dash-pipeline/bmv2/dash_pipeline.bmv2/
1212
dash-pipeline/dpdk-pna/dash_pipeline.dpdk
13+
dash-pipeline/py_model/dash_pipeline.py_model/
14+
dash-pipeline/py_model/p4_helper/v1/__pycache__/
15+
dash-pipeline/py_model/p4_helper/config/__pycache__/
1316
dash-pipeline/SAI/lib/
1417
dash-pipeline/SAI/rpc/
1518
dash-pipeline/dpapp/build

.wordlist.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ CloudStorm
9696
cloudstorm
9797
CNIP
9898
codebase
99+
codegen
99100
collaterals
100101
compat
101102
Compat
@@ -105,7 +106,9 @@ confgen
105106
config
106107
configs
107108
configurated
108-
Conntrack
109+
conntrack
110+
ConntrackIn
111+
ConntrackOut
109112
Containerlab
110113
CP
111114
CPUs
@@ -236,6 +239,7 @@ ENIs
236239
ENI's
237240
enqueue
238241
enqueues
242+
entrypoint
239243
entrypoints
240244
enum
241245
EPUs
@@ -504,6 +508,8 @@ PTF
504508
ptf
505509
ptftests
506510
py
511+
py_model
512+
pymodel
507513
PyPi
508514
pytest
509515
PyTest
@@ -545,6 +551,7 @@ RJ
545551
Roadmap
546552
roadmap
547553
routable
554+
rpc
548555
RPC
549556
RPCs
550557
RPF
@@ -665,6 +672,7 @@ TEP
665672
testability
666673
testbed
667674
testbeds
675+
textproto
668676
TGen
669677
Tgen
670678
Tgens

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![DASH-bmv2-CI](https://github.com/sonic-net/DASH/workflows/DASH-BMV2-CI/badge.svg?branch=main)](https://github.com/sonic-net/DASH/actions/workflows/dash-bmv2-ci.yml)
2+
[![DASH-pymodel-CI](https://github.com/sonic-net/DASH/workflows/DASH-pymodel-CI/badge.svg?branch=main)](https://github.com/sonic-net/DASH/actions/workflows/dash-pymodel-ci.yml)
23
[![Spellcheck](https://github.com/sonic-net/DASH/actions/workflows/dash-md-spellcheck.yml/badge.svg)](https://github.com/sonic-net/DASH/actions/workflows/dash-md-spellcheck.yml)
34

45
# SONiC-DASH - Disaggregated API for SONiC Hosts - extending functionality to stateful workloads!
Lines changed: 60 additions & 0 deletions
Loading
Lines changed: 60 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)