Skip to content

Commit 55da14d

Browse files
Ci: nightly tests not working
1 parent c1f9901 commit 55da14d

File tree

4 files changed

+87
-87
lines changed

4 files changed

+87
-87
lines changed

.github/actions/build/action.yml

Lines changed: 11 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,14 @@ name: Build
22
runs:
33
using: composite
44
steps:
5-
- name: 'preparation: Checkout openh264'
6-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7-
with:
8-
repository: 'cisco/openh264'
9-
ref: 'openh264v2.4.0'
10-
path: 'openh264'
11-
- name: 'preparation: Checkout FFmpeg'
12-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
13-
with:
14-
repository: 'FFmpeg/FFmpeg'
15-
ref: 'release/7.0'
16-
path: 'ffmpeg'
17-
- name: 'configuration: Install the build dependency'
18-
run: |
19-
sudo apt update
20-
sudo apt-get remove -y pipenv || true
21-
sudo apt-get install -y \
22-
git gcc meson tar zip \
23-
pkg-config \
24-
python3 \
25-
python3-pyelftools \
26-
python3-virtualenv \
27-
python3-pip \
28-
libnuma-dev \
29-
libjson-c-dev \
30-
libpcap-dev \
31-
libgtest-dev \
32-
libsdl2-dev \
33-
libsdl2-ttf-dev \
34-
libssl-dev \
35-
systemtap-sdt-dev \
36-
libbpf-dev \
37-
libelf1 \
38-
gstreamer1.0-plugins-base \
39-
gstreamer1.0-plugins-good \
40-
gstreamer1.0-tools \
41-
gstreamer1.0-libav \
42-
libgstreamer1.0-dev \
43-
libgstreamer-plugins-base1.0-dev \
44-
patch \
45-
unzip
46-
shell: bash
47-
- name: 'installation: Build mtl'
48-
run: |
49-
./build.sh
50-
sudo ldconfig
51-
shell: bash
52-
- name: 'installation: Build FFmpeg'
53-
working-directory: ecosystem/ffmpeg_plugin
54-
run: ./build.sh
55-
shell: bash
56-
- name: 'installation: Build GStreamer'
57-
working-directory: ecosystem/gstreamer_plugin
58-
run: |
59-
./build.sh
60-
shell: bash
5+
- name: Setup environment and build
6+
shell: bash
7+
env:
8+
SETUP_BUILD_AND_INSTALL_DPDK: '0'
9+
SETUP_BUILD_AND_INSTALL_ICE_DRIVER: '0'
10+
SETUP_BUILD_AND_INSTALL_EBPF_XDP: '0'
11+
SETUP_BUILD_AND_INSTALL_GPU_DIRECT: '0'
12+
MTL_BUILD_AND_INSTALL: '1'
13+
ECOSYSTEM_BUILD_AND_INSTALL_FFMPEG_PLUGIN: '1'
14+
ECOSYSTEM_BUILD_AND_INSTALL_GSTREAMER_PLUGIN: '1'
15+
run: bash .github/scripts/setup_environment.sh

.github/scripts/setup_environment.sh

Lines changed: 50 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,19 @@ function setup_ubuntu_install_dependencies() {
143143
exit 1
144144
fi
145145

146-
cd "level-zero-${ONE_API_GPU_VER}" || exit 1
146+
pushd "level-zero-${ONE_API_GPU_VER}" >/dev/null || exit 1
147147

148148
if mkdir build; then
149149
rm -rf build
150150
mkdir build
151151
fi
152-
cd build || exit 1
152+
pushd build >/dev/null || exit 1
153153
cmake .. -D CMAKE_BUILD_TYPE=Release
154154
cmake --build . --target package -j"${nproc}"
155155
cmake --build . --target install -j"${nproc}"
156+
popd >/dev/null
157+
popd >/dev/null
158+
rm -rf "${setup_script_folder}/level-zero-${ONE_API_GPU_VER}"
156159
fi
157160

158161
if [ "${ECOSYSTEM_BUILD_AND_INSTALL_FFMPEG_PLUGIN}" == "1" ]; then
@@ -253,7 +256,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
253256
if [ "${SETUP_BUILD_AND_INSTALL_GPU_DIRECT}" == "1" ]; then
254257
echo "$STEP Install the build dependency for GPU Direct"
255258
# shellcheck disable=SC1091
256-
cd "${root_folder}/gpu_direct" || exit 1
259+
pushd "${root_folder}/gpu_direct" >/dev/null || exit 1
257260

258261
if [[ ":$LIBRARY_PATH:" != *":/usr/local/lib:"* ]]; then
259262
export LIBRARY_PATH="/usr/local/lib:$LIBRARY_PATH"
@@ -268,6 +271,8 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
268271
echo "mtl_gpu_direct is NOT available via pkg-config."
269272
fi
270273

274+
popd >/dev/null
275+
271276
STEP=$((STEP + 1))
272277
fi
273278

@@ -290,21 +295,25 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
290295
if [ -z "$setup_script_folder" ] || [ -z "$ICE_VER" ] || [ -z "$ICE_DMID" ]; then
291296
exit 3
292297
fi
293-
cd "${setup_script_folder}"
298+
pushd "${setup_script_folder}" >/dev/null || exit 1
294299

295300
echo "Building e810 driver version: $ICE_VER form mirror $ICE_DMID"
296301

297302
wget "https://downloadmirror.intel.com/${ICE_DMID}/ice-${ICE_VER}.tar.gz"
298303
tar xvzf "ice-${ICE_VER}.tar.gz"
299-
cd "ice-${ICE_VER}"
304+
pushd "ice-${ICE_VER}" >/dev/null || exit 1
300305

301306
git init
302307
git add .
303308
git commit -m "init version ${ICE_VER}"
304309
git am "${root_folder}"/patches/ice_drv/"${ICE_VER}"/*.patch
305310

306-
cd src
311+
pushd src >/dev/null || exit 1
307312
make -j"${nproc}"
313+
popd >/dev/null
314+
popd >/dev/null
315+
rm -rf "ice-${ICE_VER}" "ice-${ICE_VER}.tar.gz"
316+
popd >/dev/null
308317
STEP=$((STEP + 1))
309318
fi
310319

@@ -318,40 +327,48 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
318327

319328
if [ "${MTL_BUILD_AND_INSTALL_DEBUG}" == "1" ]; then
320329
echo "$STEP MTL debug build and install"
321-
cd "${root_folder}" && ./build.sh debug
330+
pushd "${root_folder}" >/dev/null || exit 1
331+
./build.sh debug
332+
popd >/dev/null
322333
STEP=$((STEP + 1))
323334
fi
324335

325336
if [ "${MTL_BUILD_AND_INSTALL}" == "1" ]; then
326337
echo "$STEP MTL build and install"
327-
cd "${root_folder}" && ./build.sh
338+
pushd "${root_folder}" >/dev/null || exit 1
339+
./build.sh
340+
popd >/dev/null
328341
STEP=$((STEP + 1))
329342
fi
330343

331344
if [ "${MTL_BUILD_AND_INSTALL_DOCKER}" == "1" ]; then
332345
echo "$STEP MTL docker build and install"
333-
cd "${root_folder}/docker" || exit 1
346+
pushd "${root_folder}/docker" >/dev/null || exit 1
334347

335348
if [ -n "${http_proxy}" ] && [ -n "${https_proxy}" ]; then
336349
docker build -t mtl:latest -f ubuntu.dockerfile --build-arg HTTP_PROXY="${http_proxy}" --build-arg HTTPS_PROXY="${https_proxy}" ../
337350
else
338351
docker build -t mtl:latest -f ubuntu.dockerfile ../
339352
fi
340353

354+
popd >/dev/null
355+
341356
STEP=$((STEP + 1))
342357
fi
343358

344359
if [ "${MTL_BUILD_AND_INSTALL_DOCKER_MANAGER}" == "1" ]; then
345360
echo "$STEP MTL docker manager build and install"
346361

347-
cd "${root_folder}/manager" | exit 1
362+
pushd "${root_folder}/manager" >/dev/null || exit 1
348363

349364
if [ -n "${http_proxy}" ] && [ -n "${https_proxy}" ]; then
350365
docker build --build-arg VERSION="$(cat ../VERSION)" -t mtl-manager:latest --build-arg HTTP_PROXY="${http_proxy}" --build-arg HTTPS_PROXY="${https_proxy}" .
351366
else
352367
docker build --build-arg VERSION="$(cat ../VERSION)" -t mtl-manager:latest .
353368
fi
354369

370+
popd >/dev/null
371+
355372
STEP=$((STEP + 1))
356373
fi
357374

@@ -372,7 +389,9 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
372389
if [ "${ECOSYSTEM_BUILD_AND_INSTALL_GSTREAMER_PLUGIN}" == "1" ]; then
373390
echo "$STEP Ecosystem GStreamer plugin build and install"
374391

375-
bash "${root_folder}/ecosystem/gstreamer_plugin/build.sh"
392+
pushd "${root_folder}/ecosystem/gstreamer_plugin" >/dev/null || exit 1
393+
bash build.sh
394+
popd >/dev/null
376395
STEP=$((STEP + 1))
377396
fi
378397

@@ -390,20 +409,23 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
390409

391410
if [ "${ECOSYSTEM_BUILD_AND_INSTALL_OBS_PLUGIN}" == "1" ]; then
392411
echo "$STEP Ecosystem OBS plugin build and install"
393-
cd "${root_folder}/ecosystem/obs_mtl" || exit 1
394-
cd linux-mtl
412+
pushd "${root_folder}/ecosystem/obs_mtl" >/dev/null || exit 1
413+
pushd linux-mtl >/dev/null || exit 1
395414
meson setup build
396415
meson compile -C build
397416
meson install -C build
417+
popd >/dev/null
418+
popd >/dev/null
398419
STEP=$((STEP + 1))
399420
fi
400421

401422
if [ "${PLUGIN_BUILD_AND_INSTALL_SAMPLE}" == "1" ]; then
402423
echo "$STEP Plugin sample build and install"
403-
cd "${root_folder}/plugins" || exit 1
424+
pushd "${root_folder}/plugins" >/dev/null || exit 1
404425
meson setup build
405426
meson compile -C build
406427
meson install -C build
428+
popd >/dev/null
407429
STEP=$((STEP + 1))
408430
fi
409431

@@ -421,53 +443,60 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
421443

422444
if [ "${HOOK_PYTHON}" == "1" ]; then
423445
echo "$STEP Hook Python"
424-
cd "${root_folder}" || exit 1
446+
pushd "${root_folder}" >/dev/null || exit 1
425447
if [ -d swig ]; then
426448
echo "SWIG directory already exists, skipping clone."
427449
else
428450
echo "Cloning SWIG repository..."
429451
git clone https://github.com/swig/swig.git
430452
fi
431-
cd swig/
453+
pushd swig >/dev/null || exit 1
432454
git checkout v4.1.1
433455
./autogen.sh
434456
./configure
435457
make -j"${nproc}"
436458
make install
437-
cd "${root_folder}/python/swig"
459+
popd >/dev/null
460+
pushd "${root_folder}/python/swig" >/dev/null || exit 1
438461
swig -python -I/usr/local/include -o pymtl_wrap.c pymtl.i
439462
python3 setup.py build_ext --inplace
440463
python3 setup.py install
464+
popd >/dev/null
465+
popd >/dev/null
441466
STEP=$((STEP + 1))
442467
fi
443468

444469
if [ "${HOOK_RUST}" == "1" ]; then
445470
echo "$STEP Hook Rust"
446-
cd "${root_folder}/rust" || exit 1
471+
pushd "${root_folder}/rust" >/dev/null || exit 1
447472
cargo update home --precise "${RUST_HOOK_CARGO_VER}"
448473
cargo build --release
474+
popd >/dev/null
449475
STEP=$((STEP + 1))
450476
fi
451477

452478
if [ "${TOOLS_BUILD_AND_INSTALL_MTL_MONITORS}" == "1" ]; then
453479
echo "$STEP Tools MTL monitors build and install"
454-
cd "${root_folder}/tools/ebpf" || exit 1
480+
pushd "${root_folder}/tools/ebpf" >/dev/null || exit 1
455481
make lcore_monitor -j"${nproc}"
456482
make udp_monitor -j"${nproc}"
483+
popd >/dev/null
457484
STEP=$((STEP + 1))
458485
fi
459486

460487
if [ "${TOOLS_BUILD_AND_INSTALL_MTL_READPCAP}" == "1" ]; then
461488
echo "$STEP Tools MTL readpcap build and install"
462-
cd "${root_folder}/tools/readpcap" || exit 1
489+
pushd "${root_folder}/tools/readpcap" >/dev/null || exit 1
463490
make -j"${nproc}"
491+
popd >/dev/null
464492
STEP=$((STEP + 1))
465493
fi
466494

467495
if [ "${TOOLS_BUILD_AND_INSTALL_MTL_CPU_EMULATOR}" == "1" ]; then
468496
echo "$STEP Tools MTL CPU emulator build and install"
469-
cd "${root_folder}/tools/sch_smi_emulate" || exit 1
497+
pushd "${root_folder}/tools/sch_smi_emulate" >/dev/null || exit 1
470498
make -j"${nproc}"
499+
popd >/dev/null
471500
STEP=$((STEP + 1))
472501
fi
473502

script/build_dpdk.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ if [ "$sourced" -eq 0 ]; then
6565

6666
if [ ! -d "$dpdk_folder" ]; then
6767
echo "Clone DPDK source code"
68-
wget https://github.com/DPDK/dpdk/archive/refs/tags/v"${DPDK_VER}".zip
69-
unzip v"${DPDK_VER}".zip
68+
archive_name="v${DPDK_VER}.zip"
69+
rm -f "$archive_name"
70+
wget "https://github.com/DPDK/dpdk/archive/refs/tags/${archive_name}" -O "$archive_name"
71+
unzip "$archive_name"
72+
rm -f "$archive_name"
7073

7174
cd "$dpdk_folder" || exit 1
7275
for patch_file in ../../patches/dpdk/"$DPDK_VER"/*.patch; do
@@ -81,6 +84,12 @@ if [ "$sourced" -eq 0 ]; then
8184
echo "Build and install DPDK now"
8285
meson build
8386
ninja -C build
84-
cd build
85-
sudo ninja install
87+
(
88+
cd build || exit 1
89+
sudo ninja install
90+
)
91+
92+
cd "$script_folder" || exit 1
93+
echo "Removing downloaded DPDK source directory '$dpdk_folder'."
94+
rm -rf "$dpdk_folder"
8695
fi

script/build_ice_driver.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ fi
3131
(return 0 2>/dev/null) && sourced=1 || sourced=0
3232

3333
if [ "$sourced" -eq 0 ]; then
34+
archive_name="ice-${ICE_VER}.tar.gz"
3435
echo "Building e810 driver version: $ICE_VER form mirror $ICE_DMID"
3536

36-
wget "https://downloadmirror.intel.com/${ICE_DMID}/ice-${ICE_VER}.tar.gz"
37-
if [ ! -f "ice-${ICE_VER}.tar.gz" ]; then
38-
echo "Failed to download ice-${ICE_VER}.tar.gz"
37+
rm -f "$archive_name"
38+
wget "https://downloadmirror.intel.com/${ICE_DMID}/${archive_name}" -O "$archive_name"
39+
if [ ! -f "$archive_name" ]; then
40+
echo "Failed to download $archive_name"
3941
exit 1
4042
fi
4143

@@ -44,10 +46,12 @@ if [ "$sourced" -eq 0 ]; then
4446
exit 1
4547
fi
4648

47-
tar xvzf "ice-${ICE_VER}.tar.gz"
49+
tar xvzf "$archive_name"
50+
51+
rm -f "$archive_name"
4852

4953
if [ ! -d "ice-${ICE_VER}" ]; then
50-
echo "Failed to extract ice-${ICE_VER}.tar.gz"
54+
echo "Failed to extract $archive_name"
5155
exit 1
5256
fi
5357

@@ -64,5 +68,8 @@ if [ "$sourced" -eq 0 ]; then
6468
sudo rmmod irdma || echo "irdma not loaded"
6569
sudo rmmod ice
6670
sudo modprobe ice
67-
cd -
71+
72+
cd "$script_folder" || exit 1
73+
echo "Removing downloaded ice-${ICE_VER} sources."
74+
rm -rf "ice-${ICE_VER}"
6875
fi

0 commit comments

Comments
 (0)