-
Notifications
You must be signed in to change notification settings - Fork 93
134 lines (132 loc) · 4.78 KB
/
dash-bmv2-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: DASH-BMV2-CI
on:
push:
branches: [ "**" ]
paths:
- '.gitmodules'
- '.github/workflows/dash-bmv2-ci.yml'
- 'test/**.py'
- 'test/**requirements.txt'
- 'test/**.sh'
- 'test/**.yml'
- 'dash-pipeline/**'
- '!dash-pipeline/dockerfiles/Dockerfile.*'
- 'dash-pipeline/dockerfiles/*.env'
- '!dash-pipeline/.dockerignore'
- '!dash-pipeline/**.md'
- '!dash-pipeline/**.svg'
- '!dash-pipeline/**.png'
- '!dash-pipeline/**.txt'
pull_request:
branches: [ "**" ]
paths:
- '.gitmodules'
- '.github/workflows/dash-bmv2-ci.yml'
- 'test/**.py'
- 'test/**requirements.txt'
- 'test/**.sh'
- 'test/**.yml'
- 'dash-pipeline/**'
- '!dash-pipeline/dockerfiles/Dockerfile.*'
- 'dash-pipeline/dockerfiles/*.env'
- '!dash-pipeline/.dockerignore'
- '!dash-pipeline/**.md'
- '!dash-pipeline/**.svg'
- '!dash-pipeline/**.png'
- '!dash-pipeline/**.txt'
workflow_dispatch:
jobs:
build:
name: Build and Test DASH Pipeline
runs-on: ubuntu-20.04
continue-on-error: true
strategy:
fail-fast: false
env:
docker_fg_flags: --privileged --memory=4g
docker_fg_root_flags: --privileged -u root --memory=4g
docker_bg_flags: -d --privileged --memory=4g
defaults:
run:
working-directory: ./dash-pipeline
steps:
- uses: actions/checkout@v3
- name: Pull docker p4c image
run: make docker-dash-p4c
- name: Build P4 software switch (bmv2) and P4Info
run: DOCKER_FLAGS=$docker_fg_flags make p4
- name: Install SAI submodule
run: git submodule update --init
- name: Pull/Build docker saithrift-bldr image
run: make docker-saithrift-bldr
- name: Pull/Build docker bmv2-bldr image
run: make docker-bmv2-bldr
- name: Generate SAI API
run: DOCKER_FLAGS=$docker_fg_flags make sai
- name: Pull/Build docker dpapp image
run: make docker-dash-dpapp
- name: Build bmv2 dpapp
run: DOCKER_FLAGS=$docker_fg_flags make dpapp
- name: Check if SAI spec is updated
run: DOCKER_FLAGS=$docker_fg_flags make check-sai-spec
- name: Build libsai c++ tests
run: DOCKER_FLAGS=$docker_fg_flags make test
- name: Prepare network
run: DOCKER_FLAGS=$docker_fg_flags make network HAVE_DPAPP=y
- name: Run P4 software switch (bmv2) with P4Runtime
run: DOCKER_FLAGS=$docker_bg_flags make run-switch HAVE_DPAPP=y
- name: Force bmv2 to load forwarding pipeline config via dummy libsai call
run: DOCKER_FLAGS=$docker_fg_flags make init-switch
- name: Test SAI library over P4RT to switch
run: DOCKER_FLAGS=$docker_fg_flags make run-libsai-test
- name: Generate saithrift-server
run: DOCKER_FLAGS=$docker_fg_flags make saithrift-server
- name: Generate saithrift-client local docker
run: DOCKER_FLAGS=$docker_fg_flags make docker-saithrift-client
- name: Run saithrift server
run: DOCKER_FLAGS=$docker_bg_flags make run-saithrift-server
- name: Run dpapp
run: |
sleep 2 #wait a moment for saithrift-server ready
cat /proc/cpuinfo
cat /proc/meminfo
sysctl vm.max_map_count
free -h
df -h
top -b -n 1
DOCKER_FLAGS=$docker_bg_flags make run-dpapp HAVE_DPAPP=y
- name: Check dpapp status
run: |
sleep 7 #wait a moment for dpapp ready
docker info
cat /proc/meminfo | grep -i huge
docker stats --no-stream
docker top dash-dpapp-$USER
docker logs -t dash-dpapp-$USER
- name: Run PTF Tests
timeout-minutes: 10
run: DOCKER_FLAGS=$docker_fg_root_flags make run-saithrift-ptftests
- name: Check dpapp status again
if: ${{ always() }}
run: |
docker stats --no-stream
tail -50 /var/log/syslog
docker top dash-dpapp-$USER
docker logs -t dash-dpapp-$USER
- name: Deploy ixia-c Traffic Generator
run: DOCKER_FLAGS=$docker_fg_flags make deploy-ixiac
- name: Run Pytests
run: DOCKER_FLAGS=$docker_fg_root_flags make run-saithrift-pytests
- name: Pull/Build SAI-Challenger client builder docker image
run: DOCKER_FLAGS=$docker_fg_flags make docker-saichallenger-client-bldr
- name: Build SAI-Challenger client docker image
run: DOCKER_FLAGS=$docker_fg_flags make docker-saichallenger-client
- name: Run SAI-Challenger Tests
run: DOCKER_FLAGS=$docker_fg_root_flags make run-saichallenger-tests
- name: Build libsai debian packages
run: DOCKER_FLAGS=$docker_fg_root_flags make libsai-debs
- uses: actions/upload-artifact@v3
with:
name: libsai-debian-packages
path: /home/runner/work/DASH/DASH/dash-pipeline/SAI/debian/*deb
if-no-files-found: error