Skip to content

Commit 35196e0

Browse files
authored
Update smoke-tests.yml
1 parent ce26a8c commit 35196e0

File tree

1 file changed

+141
-108
lines changed

1 file changed

+141
-108
lines changed

.github/workflows/smoke-tests.yml

Lines changed: 141 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ on:
1212
- 'maint-**'
1313

1414
env:
15-
DEBIAN_FRONTEND: noninteractive
15+
DEBIAN_FRONTEND: 'noninteractive'
16+
CONCURRENCY_GROUP: '${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}'
1617
BUILD_TYPE: 'Release'
1718
DPDK_VERSION: '25.03'
1819
DPDK_REBUILD: 'false'
@@ -21,143 +22,174 @@ permissions:
2122
contents: read
2223

2324
concurrency:
24-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
25+
group: '${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}'
2526
cancel-in-progress: true
2627

2728
jobs:
28-
validation-build-mtl:
29+
# validation-build-mtl:
30+
# runs-on: [Linux, self-hosted, DPDK]
31+
# timeout-minutes: 60
32+
# steps:
33+
# - name: 'preparation: Harden Runner'
34+
# uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
35+
# with:
36+
# egress-policy: audit
37+
38+
# - name: 'preparation: Restore valid repository owner and print env'
39+
# if: always()
40+
# run: |
41+
# sudo chown -R "${USER}" "$(pwd)" || true
42+
# env | grep TEST_ || true
43+
# - name: 'preparation: Checkout MTL'
44+
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
45+
# with:
46+
# ref: '${{ github.ref }}'
47+
# - name: 'preparation: Checkout DPDK'
48+
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
49+
# if: env.DPDK_REBUILD == 'true'
50+
# with:
51+
# repository: 'DPDK/dpdk'
52+
# ref: 'v${{ env.DPDK_VERSION }}'
53+
# path: 'dpdk'
54+
# - name: 'preparation: Checkout openh264'
55+
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
56+
# with:
57+
# repository: 'cisco/openh264'
58+
# ref: 'openh264v2.4.0'
59+
# path: 'openh264'
60+
# - name: 'preparation: Checkout FFmpeg'
61+
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
62+
# with:
63+
# repository: 'FFmpeg/FFmpeg'
64+
# ref: 'release/7.0'
65+
# path: 'ffmpeg'
66+
# - name: 'configuration: Install the build dependency'
67+
# run: |
68+
# sudo apt update
69+
# sudo apt-get remove -y pipenv || true
70+
# sudo apt-get install -y \
71+
# git gcc meson tar zip \
72+
# pkg-config \
73+
# python3-dev \
74+
# python3-pyelftools \
75+
# python3-virtualenv \
76+
# python3-pip \
77+
# libnuma-dev \
78+
# libjson-c-dev \
79+
# libpcap-dev \
80+
# libgtest-dev \
81+
# libsdl2-dev \
82+
# libsdl2-ttf-dev \
83+
# libssl-dev \
84+
# systemtap-sdt-dev \
85+
# libbpf-dev \
86+
# libelf1 \
87+
# gstreamer1.0-plugins-base \
88+
# gstreamer1.0-plugins-good \
89+
# gstreamer1.0-tools \
90+
# gstreamer1.0-libav \
91+
# libgstreamer1.0-dev \
92+
# libgstreamer-plugins-base1.0-dev
93+
# - name: 'configuration: Apply dpdk patches'
94+
# if: env.DPDK_REBUILD == 'true'
95+
# run: |
96+
# patch -d "dpdk" -p1 -i <(cat patches/dpdk/${{ env.DPDK_VERSION }}/*.patch)
97+
98+
# - name: 'installation: Build dpdk'
99+
# working-directory: dpdk
100+
# if: env.DPDK_REBUILD == 'true'
101+
# run: |
102+
# meson build
103+
# ninja -C build
104+
# sudo ninja -C build install
105+
106+
# - name: 'installation: Build mtl'
107+
# run: |
108+
# ./build.sh
109+
# sudo ldconfig
110+
111+
# - name: 'installation: Build openh264'
112+
# working-directory: openh264
113+
# run: |
114+
# make -j "$(nproc)"
115+
# sudo make install
116+
# sudo ldconfig
117+
# - name: 'installation: Build FFmpeg'
118+
# working-directory: ffmpeg
119+
# run: |
120+
# git am ../ecosystem/ffmpeg_plugin/7.0/*.patch
121+
# cp ../ecosystem/ffmpeg_plugin/mtl_*.c -rf libavdevice/
122+
# cp ../ecosystem/ffmpeg_plugin/mtl_*.h -rf libavdevice/
123+
# ./configure --enable-shared --disable-static --enable-nonfree --enable-pic --enable-gpl --enable-libopenh264 --enable-encoder=libopenh264 --enable-mtl
124+
# make -j "$(nproc)"
125+
# sudo make install
126+
# sudo ldconfig
127+
128+
# - name: 'installation: Build GStreamer'
129+
# working-directory: ecosystem/gstreamer_plugin
130+
# run: |
131+
# ./build.sh
132+
133+
validation-run-tests:
134+
# needs: [validation-build-mtl]
29135
runs-on: [Linux, self-hosted, DPDK]
30-
timeout-minutes: 60
136+
timeout-minutes: 720
137+
env:
138+
PIPENV_VENV_IN_PROJECT: '1'
139+
PYTEST_RETRIES: '3'
140+
CICD_BUILD: 1
141+
CICD_BUILD_BUILD_ICE_DRIVER: 0
142+
SETUP_BUILD_AND_INSTALL_GPU_DIRECT: 0
143+
SETUP_BUILD_AND_INSTALL_ICE_DRIVER: 0
144+
SETUP_BUILD_AND_INSTALL_DPDK: 0
145+
HOOK_PYTHON: 1
146+
MTL_BUILD_AND_INSTALL: 1
147+
TOOLS_BUILD_AND_INSTALL_MTL_MONITORS: 1
148+
TOOLS_BUILD_AND_INSTALL_MTL_READPCAP: 1
149+
TOOLS_BUILD_AND_INSTALL_MTL_CPU_EMULATOR: 1
150+
ECOSYSTEM_BUILD_AND_INSTALL_FFMPEG_PLUGIN: 1
151+
ECOSYSTEM_BUILD_AND_INSTALL_GSTREAMER_PLUGIN: 1
31152
steps:
32153
- name: 'preparation: Harden Runner'
33154
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
34155
with:
35156
egress-policy: audit
157+
36158
- name: 'preparation: Restore valid repository owner and print env'
37159
if: always()
38160
run: |
39161
sudo chown -R "${USER}" "$(pwd)" || true
40162
env | grep TEST_ || true
163+
41164
- name: 'preparation: Checkout MTL'
42165
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
43166
with:
44-
ref: '${{ github.ref }}'
45-
- name: 'preparation: Checkout DPDK'
46-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47-
if: env.DPDK_REBUILD == 'true'
48-
with:
49-
repository: 'DPDK/dpdk'
50-
ref: 'v${{ env.DPDK_VERSION }}'
51-
path: 'dpdk'
52-
- name: 'preparation: Checkout openh264'
53-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
54-
with:
55-
repository: 'cisco/openh264'
56-
ref: 'openh264v2.4.0'
57-
path: 'openh264'
58-
- name: 'preparation: Checkout FFmpeg'
59-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
60-
with:
61-
repository: 'FFmpeg/FFmpeg'
62-
ref: 'release/7.0'
63-
path: 'ffmpeg'
64-
- name: 'configuration: Install the build dependency'
65-
run: |
66-
sudo apt update
67-
sudo apt-get remove -y pipenv || true
68-
sudo apt-get install -y \
69-
git gcc meson tar zip \
70-
pkg-config \
71-
python3-dev \
72-
python3-pyelftools \
73-
python3-virtualenv \
74-
python3-pip \
75-
libnuma-dev \
76-
libjson-c-dev \
77-
libpcap-dev \
78-
libgtest-dev \
79-
libsdl2-dev \
80-
libsdl2-ttf-dev \
81-
libssl-dev \
82-
systemtap-sdt-dev \
83-
libbpf-dev \
84-
libelf1 \
85-
gstreamer1.0-plugins-base \
86-
gstreamer1.0-plugins-good \
87-
gstreamer1.0-tools \
88-
gstreamer1.0-libav \
89-
libgstreamer1.0-dev \
90-
libgstreamer-plugins-base1.0-dev
91-
- name: 'configuration: Apply dpdk patches'
92-
if: env.DPDK_REBUILD == 'true'
93-
run: |
94-
patch -d "dpdk" -p1 -i <(cat patches/dpdk/${{ env.DPDK_VERSION }}/*.patch)
95-
- name: 'installation: Build dpdk'
96-
working-directory: dpdk
97-
if: env.DPDK_REBUILD == 'true'
98-
run: |
99-
meson build
100-
ninja -C build
101-
sudo ninja -C build install
102-
- name: 'installation: Build mtl'
103-
run: |
104-
./build.sh
105-
sudo ldconfig
106-
- name: 'installation: Build openh264'
107-
working-directory: openh264
108-
run: |
109-
make -j "$(nproc)"
110-
sudo make install
111-
sudo ldconfig
112-
- name: 'installation: Build FFmpeg'
113-
working-directory: ffmpeg
114-
run: |
115-
git am ../ecosystem/ffmpeg_plugin/7.0/*.patch
116-
cp ../ecosystem/ffmpeg_plugin/mtl_*.c -rf libavdevice/
117-
cp ../ecosystem/ffmpeg_plugin/mtl_*.h -rf libavdevice/
118-
./configure --enable-shared --disable-static --enable-nonfree --enable-pic --enable-gpl --enable-libopenh264 --enable-encoder=libopenh264 --enable-mtl
119-
make -j "$(nproc)"
120-
sudo make install
121-
sudo ldconfig
122-
123-
- name: 'installation: Build GStreamer'
124-
working-directory: ecosystem/gstreamer_plugin
167+
path: '${{ env.CONCURRENCY_GROUP }}/mtl'
168+
169+
- name: 'preparation: build all needed components'
170+
working-directory: '${{ env.CONCURRENCY_GROUP }}/mtl'
125171
run: |
126-
./build.sh
172+
.github/scripts/setup_environment.sh
127173
128-
validation-run-tests:
129-
needs: [validation-build-mtl]
130-
runs-on: [Linux, self-hosted, DPDK]
131-
timeout-minutes: 720
132-
env:
133-
PIPENV_VENV_IN_PROJECT: '1'
134-
PYTEST_RETRIES: '3'
135-
steps:
136-
- name: 'preparation: Harden Runner'
137-
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
138-
with:
139-
egress-policy: audit
140174
- name: 'preparation: Evaluate choosen validation-test-port-p and validation-test-port-r'
141175
run: |
142-
eval "export TEST_PORT_P=TEST_VF_PORT_P_0"
143-
eval "export TEST_PORT_R=TEST_VF_PORT_P_1"
144-
echo "TEST_PORT_P=${TEST_PORT_P}" >> "$GITHUB_ENV"
145-
echo "TEST_PORT_R=${TEST_PORT_R}" >> "$GITHUB_ENV"
146-
echo "TEST_PORT_P=${TEST_PORT_P}"
147-
echo "TEST_PORT_R=${TEST_PORT_R}"
176+
echo "TEST_PORT_P=${TEST_VF_PORT_P_0}" >> "$GITHUB_ENV"
177+
echo "TEST_PORT_R=${TEST_VF_PORT_P_1}" >> "$GITHUB_ENV"
178+
148179
- name: 'preparation: Kill MtlManager and pytest routines'
149180
run: |
150181
sudo killall -SIGINT pipenv || true
151182
sudo killall -SIGINT pytest || true
152183
sudo killall -SIGINT MtlManager || true
184+
153185
- name: 'preparation: Create VFs'
154186
run: |
155187
sudo rmmod irdma || true
156188
sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_P}" || true
157189
sudo ./script/nicctl.sh create_vf "${TEST_PF_PORT_R}" || true
158190
159191
- name: 'installation: Install pipenv environment'
160-
working-directory: tests/validation
192+
working-directory: '${{ env.CONCURRENCY_GROUP }}/mtl/tests/validation'
161193
run: |
162194
sudo apt update && \
163195
sudo apt install -y \
@@ -173,17 +205,18 @@ jobs:
173205
sudo MtlManager &
174206
175207
- name: 'execution: Run validation-bare-metal tests in virtual environment'
176-
working-directory: tests/validation
208+
working-directory: '${{ env.CONCURRENCY_GROUP }}/mtl/tests/validation'
177209
run: |
178210
sudo pipenv run pytest --topology_config=configs/topology_config.yaml --test_config=configs/test_config.yaml -m smoke --template=html/index.html --report=report.html
179211
180-
- name: "upload report"
212+
- name: "post-run: Upload report as an artifact"
181213
id: upload-report
182214
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
183215
with:
184216
name: smoke-tests-report
185217
path: |
186-
report.html
218+
'${{ env.CONCURRENCY_GROUP }}/mtl/tests/validation/report.html'
219+
187220
- name: "Add report to summary"
188221
if: always()
189222
run: |

0 commit comments

Comments
 (0)