Skip to content

Commit 6f8954d

Browse files
Fix: fix cicd builds
CiCd setup is broken due to the actions failing to build the project. Fix via switching building to the script.
1 parent b319ccc commit 6f8954d

File tree

6 files changed

+191
-51
lines changed

6 files changed

+191
-51
lines changed

.github/path_filters.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ build: &build
1818
- kahawai.json
1919
- meson.build
2020
- meson_options.txt
21+
- .github/workflows/ubuntu_build.yml
2122
- VERSION
2223

2324
windows_gtest: &windows_gtest

.github/scripts/setup_environment.sh

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
#!/bin/bash
2+
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
# Copyright 2025 Intel Corporation
5+
6+
set -xe
7+
8+
# SET DEFAULT ARGUMENTS
9+
: "${BUILD_AND_INSTALL_DPDK:=1}"
10+
: "${BUILD_AND_INSTALL_ICE_DRIVER:=1}"
11+
12+
# CICD ONLY ARGUMENTS
13+
: "${BUILD_E810_DRIVER:=0}"
14+
15+
function ubuntu_install_dependencies() {
16+
echo "1.1. Install the build dependency from OS software store"
17+
18+
apt-get update
19+
apt-get install -y \
20+
git \
21+
gcc \
22+
meson \
23+
python3 \
24+
python3-pip \
25+
pkg-config \
26+
libnuma-dev \
27+
libjson-c-dev \
28+
libpcap-dev \
29+
libgtest-dev \
30+
libssl-dev \
31+
systemtap-sdt-dev \
32+
llvm \
33+
clang \
34+
libsdl2-dev \
35+
libsdl2-ttf-dev \
36+
37+
# CiCd only
38+
apt install -y python3-venv sudo wget doxygen
39+
python3 -m venv /tmp/mtl-venv
40+
. /tmp/mtl-venv/bin/activate
41+
git config --global user.email "[email protected]"
42+
git config --global user.name "Your Name"
43+
# CiCd only end
44+
45+
pip install --upgrade pip
46+
pip install pyelftools ninja
47+
48+
sudo apt-get install -y linux-headers-$(uname -r)
49+
}
50+
51+
if [ -f /etc/os-release ]; then
52+
. /etc/os-release
53+
case "$ID" in
54+
ubuntu)
55+
echo "Detected OS: Ubuntu"
56+
ubuntu_install_dependencies
57+
;;
58+
centos)
59+
echo "Detected OS: CentOS"
60+
echo "For now unsuported OS, please use Ubuntu"
61+
exit 2
62+
;;
63+
rhel)
64+
echo "Detected OS: RHEL"
65+
echo "For now unsuported OS, please use Ubuntu"
66+
exit 2
67+
;;
68+
rockos|rocky)
69+
echo "Detected OS: Rocky Linux"
70+
echo "For now unsuported OS, please use Ubuntu"
71+
exit 2
72+
;;
73+
*)
74+
echo "OS not recognized: $ID"
75+
echo "For now unsuported OS, please use Ubuntu"
76+
exit 2
77+
;;
78+
esac
79+
else
80+
echo "/etc/os-release not found. Cannot determine OS."
81+
exit 2
82+
fi
83+
84+
if [ "${BUILD_AND_INSTALL_DPDK}" == "1" ]; then
85+
echo "2. DPDK build and install"
86+
bash "$(dirname "$0")/../../script/build_dpdk.sh"
87+
fi
88+
89+
if [ "${BUILD_E810_DRIVER}" == "1" ]; then
90+
echo "3. ICE driver build"
91+
. "$(dirname "$0")/../../script/build_ice_driver.sh"
92+
cd "${script_folder}"
93+
94+
echo "Building e810 driver version: $ice_driver_ver form mirror $download_mirror"
95+
96+
wget "https://downloadmirror.intel.com/${download_mirror}/ice-${ice_driver_ver}.tar.gz"
97+
tar xvzf ice-1.16.3.tar.gz
98+
cd ice-1.16.3
99+
100+
git init
101+
git add .
102+
git commit -m "init version ${ice_driver_ver}"
103+
git am ../../patches/ice_drv/${ice_driver_ver}/*.patch
104+
105+
cd src
106+
make
107+
fi
108+
109+
if [ "${BUILD_AND_INSTALL_ICE_DRIVER}" == "1" ]; then
110+
echo "3. ICE driver build and install"
111+
bash "$(dirname "$0")/../../script/build_ice_driver.sh"
112+
fi
113+
114+

.github/workflows/base_build.yml renamed to .github/workflows/ubuntu_build.yml

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Base Build
1+
name: Ubuntu build
22

33
on:
44
# allow manually trigger
@@ -14,8 +14,7 @@ on:
1414

1515
permissions:
1616
contents: read
17-
env:
18-
DPDK_VERSION: 25.03
17+
1918
jobs:
2019
changes:
2120
runs-on: ubuntu-latest
@@ -25,7 +24,6 @@ jobs:
2524
changed: ${{ steps.filter.outputs.ubuntu_build == 'true' }}
2625
steps:
2726
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28-
2927
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v2
3028
id: filter
3129
with:
@@ -55,32 +53,14 @@ jobs:
5553
source: '.'
5654
extensions: 'hpp,h,cpp,c,cc'
5755

58-
- name: checkout dpdk repo
59-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
60-
with:
61-
repository: 'DPDK/dpdk'
62-
ref: v${{ env.DPDK_VERSION }}
63-
path: dpdk
64-
65-
- name: Install the build dependency
66-
run: |
67-
apt-get update -y
68-
apt-get install -y sudo git gcc meson python3 python3-pyelftools pkg-config libnuma-dev libjson-c-dev libpcap-dev libgtest-dev libsdl2-dev libsdl2-ttf-dev libssl-dev systemtap-sdt-dev llvm clang
69-
apt-get install -y doxygen
70-
apt-get install -y make m4 clang llvm zlib1g-dev libelf-dev libcap-ng-dev libcap2-bin gcc-multilib
71-
72-
- name: Build DPDK from source
73-
working-directory: dpdk
74-
run: |
75-
meson build
76-
ninja -C build
77-
cd build
78-
sudo ninja install
79-
- name: Git config
80-
working-directory: "${{ github.workspace }}"
56+
- name: Install the build dependencies
57+
env:
58+
BUILD_AND_INSTALL_DPDK: 1
59+
BUILD_E810_DRIVER: 1
60+
# ICE driver installation is disabled (not supported in GitHub Actions)
61+
BUILD_AND_INSTALL_ICE_DRIVER: 0
8162
run: |
82-
git config --global user.email "[email protected]"
83-
git config --global user.name "Your Name"
63+
.github/scripts/setup_environment.sh
8464
8565
- name: Build
8666
working-directory: "${{ github.workspace }}"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> [!TIP]
44
> [Full Documentation](https://openvisualcloud.github.io/Media-Transport-Library/README.html) for [Media Transport Library](https://openvisualcloud.github.io/Media-Transport-Library/README.html).
5-
[![Base build](https://github.com/OpenVisualCloud/Media-Transport-Library/actions/workflows/base_build.yml/badge.svg)](https://github.com/OpenVisualCloud/Media-Transport-Library/actions/workflows/base_build.yml)
5+
[![Ubuntu build](https://github.com/OpenVisualCloud/Media-Transport-Library/actions/workflows/ubuntu_build.yml/badge.svg)](https://github.com/OpenVisualCloud/Media-Transport-Library/actions/workflows/ubuntu_build.yml)
66
[![Test](https://github.com/OpenVisualCloud/Media-Transport-Library/actions/workflows/ubuntu_build_with_gtest.yml/badge.svg)](https://github.com/OpenVisualCloud/Media-Transport-Library/actions/workflows/ubuntu_build_with_gtest.yml)
77
[![OpenSSF
88
Scorecard](https://api.securityscorecards.dev/projects/github.com/OpenVisualCloud/Media-Transport-Library/badge)](https://api.securityscorecards.dev/projects/github.com/OpenVisualCloud/Media-Transport-Library)

script/build_dpdk.sh

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
set -e
77

8-
script_name=$(basename "$0")
9-
script_path=$(readlink -qe "$0")
8+
script_name=$(basename "${BASH_SOURCE[0]}")
9+
script_path=$(readlink -qe "${BASH_SOURCE[0]}")
1010
script_folder=${script_path/$script_name/}
1111
cd "${script_folder}"
1212

@@ -17,22 +17,26 @@ else
1717
dpdk_ver=25.03
1818
fi
1919

20-
echo "DPDK version: $dpdk_ver"
21-
22-
if [ ! -d "dpdk" ]; then
23-
# check out dpdk code
24-
echo "Clone DPDK source code"
25-
git clone https://github.com/DPDK/dpdk.git
26-
fi
27-
cd dpdk
28-
git checkout v"$dpdk_ver"
29-
git switch -c v"$dpdk_ver"
30-
31-
# apply the patches
32-
git am ../../patches/dpdk/"$dpdk_ver"/*.patch
33-
34-
# build and install dpdk now
35-
meson build
36-
ninja -C build
37-
cd build
38-
sudo ninja install
20+
(return 0 2>/dev/null) && sourced=1 || sourced=0
21+
22+
if [ "$sourced" -eq 0 ]; then
23+
echo "DPDK version: $dpdk_ver"
24+
25+
if [ ! -d "dpdk" ]; then
26+
# check out dpdk code
27+
echo "Clone DPDK source code"
28+
git clone https://github.com/DPDK/dpdk.git
29+
fi
30+
cd dpdk
31+
git checkout v"$dpdk_ver"
32+
git switch -c v"$dpdk_ver"
33+
34+
# apply the patches
35+
git am ../../patches/dpdk/"$dpdk_ver"/*.patch
36+
37+
# build and install dpdk now
38+
meson build
39+
ninja -C build
40+
cd build
41+
sudo ninja install
42+
fi

script/build_ice_driver.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
# Copyright 2025 Intel Corporation
5+
6+
set -e
7+
8+
download_mirror=843928
9+
script_name=$(basename "${BASH_SOURCE[0]}")
10+
script_path=$(readlink -qe "${BASH_SOURCE[0]}")
11+
script_folder=${script_path/$script_name/}
12+
set -x
13+
cd "${script_folder}"
14+
15+
if [ -n "$1" ]; then
16+
ice_driver_ver=$1
17+
else
18+
ice_driver_ver=1.16.3
19+
fi
20+
21+
(return 0 2>/dev/null) && sourced=1 || sourced=0
22+
23+
if [ "$sourced" -eq 0 ]; then
24+
echo "Building e810 driver version: $ice_driver_ver form mirror $download_mirror"
25+
26+
wget "https://downloadmirror.intel.com/${download_mirror}/ice-${ice_driver_ver}.tar.gz"
27+
tar xvzf ice-1.16.3.tar.gz
28+
cd ice-1.16.3
29+
30+
git init
31+
git add .
32+
git commit -m "init version ${ice_driver_ver}"
33+
git am ../../patches/ice_drv/${ice_driver_ver}/*.patch
34+
35+
cd src
36+
make
37+
sudo make install
38+
sudo rmmod ice
39+
sudo modprobe ice
40+
cd -
41+
fi

0 commit comments

Comments
 (0)