Skip to content

Commit 5813394

Browse files
Ci: fix path filters (#1200)
Clean up dead code that doesn't trigger or apply in any workflow. Update the path filters to include all necessary files for the CI workflows to function correctly. Optimize base_build performance by enabling parallel compilation with -j flag. Disable pushing for Docker to avoid docker_build issue. fixes: d608256 --------- Co-authored-by: Miłosz Linkiewicz <[email protected]>
1 parent e212433 commit 5813394

File tree

4 files changed

+63
-52
lines changed

4 files changed

+63
-52
lines changed

.github/path_filters.yml

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,61 @@
11
# This is used by the action https://github.com/dorny/paths-filter
22

3-
ubuntu_build: &ubuntu_build
4-
- .github/workflows/base_build.yml
5-
- '**'
3+
src: &src
4+
- 'patches/dpdk/**'
5+
- 'include/**'
6+
- 'lib/**'
7+
- 'ld_preload/**'
8+
- 'gpu_direct/**'
9+
- 'tests/src/**'
10+
- 'tests/tools/**'
11+
- tests/meson.build
12+
- tests/meson_options.txt
13+
- 'manager/**'
614

7-
linux_gtest: &linux_gtest
8-
- .github/workflows/ubuntu_build_with_gtest.yml
9-
- '.github/workflows/upl*'
10-
- 'patches/ice_drv/**'
11-
- '*src'
12-
- '*build'
15+
build: &build
16+
- build.sh
17+
- kahawai.json
18+
- meson.build
19+
- meson_options.txt
20+
- VERSION
21+
- versions.env
22+
- "script/**"
23+
24+
docker: &docker
25+
- docker/**
26+
- manager/Dockerfile
27+
- manager/.dockerignore
28+
- '.dockerignore'
29+
30+
ecosystem: &ecosystem
31+
- 'app/**'
32+
- 'tests/tools/**'
33+
- 'tools/**'
34+
- 'ecosystem/**'
35+
- 'rust/**'
36+
- 'index.rst'
37+
- 'python/**'
38+
- 'plugins/**'
39+
- 'script/build_app.sh'
40+
- 'script/build_python.sh'
41+
- 'script/build_ebpf_xdp.sh'
42+
- 'script/build_obs_plugin.sh'
43+
- 'script/build_st22_avcodec_plugin.sh'
1344

1445
ice_build: &ice_build
15-
- .github/workflows/base_build.yml
1646
- 'paths/ice_drv/**'
1747
- 'script/build_ice_driver.sh'
1848

19-
manager_build: &manager_build
20-
- .github/workflows/base_build.yml
21-
- 'manager/**'
22-
23-
plugin_build: &plugin_build
24-
- .github/workflows/base_build.yml
25-
- 'plugins/**'
26-
27-
rust_build: &rust_hooks_build
28-
- .github/workflows/base_build.yml
29-
- 'rust/**'
30-
31-
python_build: &python_hooks_build
32-
- .github/workflows/base_build.yml
33-
- 'python/**'
34-
35-
tools_monitors_build: &mtl_monitors_build
49+
ubuntu_build: &ubuntu_build
3650
- .github/workflows/base_build.yml
37-
- 'tools/ebpf/**'
51+
- *src
52+
- *build
53+
- *docker
54+
- *ecosystem
3855

39-
tools_readcap_build: &mtl_readcap_build
40-
- .github/workflows/base_build.yml
41-
- 'tools/readcap/**'
56+
linux_gtest: &linux_gtest
57+
- .github/workflows/ubuntu_build_with_gtest.yml
58+
- '.github/workflows/upl*'
59+
- *ice_build
60+
- *ubuntu_build
4261

43-
tools_cpu_emulator_build: &mtl_cpu_emulator_build
44-
- .github/workflows/base_build.yml
45-
- 'tools/sch_smi_emulate/**'

.github/scripts/setup_environment.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ script_name=$(basename "${BASH_SOURCE[0]}")
4545
script_path=$(readlink -qe "${BASH_SOURCE[0]}")
4646
setup_script_folder=${script_path/$script_name/}
4747
root_folder="${setup_script_folder}/../.."
48+
nproc=$(nproc 2>/dev/null || echo 50)
4849
# shellcheck disable=SC1091
4950
. "${root_folder}/script/common.sh"
5051

@@ -167,9 +168,8 @@ function setup_ubuntu_install_dependencies() {
167168
fi
168169
cd build || exit 1
169170
cmake .. -D CMAKE_BUILD_TYPE=Release
170-
cmake --build . --target package
171-
172-
cmake --build . --target install
171+
cmake --build . --target package -j"${nproc}"
172+
cmake --build . --target install -j"${nproc}"
173173
fi
174174

175175
if [ "${ECOSYSTEM_BUILD_AND_INSTALL_FFMPEG_PLUGIN}" == "1" ]; then
@@ -324,7 +324,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
324324
git am "${root_folder}"/patches/ice_drv/"${ICE_VER}"/*.patch
325325

326326
cd src
327-
make
327+
make -j"${nproc}"
328328
STEP=$((STEP + 1))
329329
fi
330330

@@ -458,7 +458,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
458458
git checkout v4.1.1
459459
./autogen.sh
460460
./configure
461-
make
461+
make -j"${nproc}"
462462
make install
463463
cd "${root_folder}/python/swig"
464464
swig -python -I/usr/local/include -o pymtl_wrap.c pymtl.i
@@ -478,22 +478,22 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
478478
if [ "${TOOLS_BUILD_AND_INSTALL_MTL_MONITORS}" == "1" ]; then
479479
echo "$STEP Tools MTL monitors build and install"
480480
cd "${root_folder}/tools/ebpf" || exit 1
481-
make lcore_monitor
482-
make udp_monitor
481+
make lcore_monitor -j"${nproc}"
482+
make udp_monitor -j"${nproc}"
483483
STEP=$((STEP + 1))
484484
fi
485485

486486
if [ "${TOOLS_BUILD_AND_INSTALL_MTL_READPCAP}" == "1" ]; then
487487
echo "$STEP Tools MTL readpcap build and install"
488488
cd "${root_folder}/tools/readpcap" || exit 1
489-
make
489+
make -j"${nproc}"
490490
STEP=$((STEP + 1))
491491
fi
492492

493493
if [ "${TOOLS_BUILD_AND_INSTALL_MTL_CPU_EMULATOR}" == "1" ]; then
494494
echo "$STEP Tools MTL CPU emulator build and install"
495495
cd "${root_folder}/tools/sch_smi_emulate" || exit 1
496-
make
496+
make -j"${nproc}"
497497
STEP=$((STEP + 1))
498498
fi
499499

.github/workflows/base_build.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,7 @@ jobs:
4141
outputs:
4242
# https://stackoverflow.com/questions/70326569/github-workflow-how-to-conditionally-setup-env-for-all-subsequent-jobs
4343
ubuntu_build: ${{ steps.filter.outputs.ubuntu_build == 'true' }}
44-
ice_build: ${{ steps.filter.outputs.ice_build == 'true' }}
4544
manager_build: ${{ steps.filter.outputs.manager_build == 'true' }}
46-
plugin_build: ${{ steps.filter.outputs.plugin_build == 'true' }}
47-
rust_hooks_build: ${{ steps.filter.outputs.rust_build == 'true' }}
48-
python_hooks_build: ${{ steps.filter.outputs.python_build == 'true' }}
49-
mtl_monitors_build: ${{ steps.filter.outputs.mtl_monitors_build == 'true' }}
50-
mtl_readcap_build: ${{ steps.filter.outputs.mtl_readcap_build == 'true' }}
51-
mtl_cpu_emulator_build: ${{ steps.filter.outputs.mtl_cpu_emulator_build == 'true' }}
5245

5346
steps:
5447
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/docker_build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
- name: Login to Docker Container Registry
6464
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
6565
if: ${{ env.DOCKER_REGISTRY_LOGIN == 'true' }}
66+
id: dockerLoginStep
6667
continue-on-error: true
6768
with:
6869
registry: "${{ env.DOCKER_REGISTRY }}"
@@ -72,7 +73,7 @@ jobs:
7273
- name: Build image
7374
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
7475
with:
75-
push: "${{ env.DOCKER_REGISTRY_LOGIN == 'true' }}"
76+
push: "${{ env.DOCKER_REGISTRY_LOGIN == 'true' && steps.dockerLoginStep.outcome == 'SUCCESS' && github.ref == 'refs/heads/main' }}"
7677
context: "${{ github.workspace }}"
7778
file: "${{ github.workspace }}/docker/ubuntu.dockerfile"
7879
tags: "${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REGISTRY_PREFIX }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_IMAGE_TAG }}"
@@ -113,6 +114,7 @@ jobs:
113114
- name: Login to Docker Container Registry
114115
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
115116
if: ${{ env.DOCKER_REGISTRY_LOGIN == 'true' }}
117+
id: dockerLoginStep
116118
continue-on-error: true
117119
with:
118120
registry: "${{ env.DOCKER_REGISTRY }}"
@@ -122,7 +124,7 @@ jobs:
122124
- name: Build manager image
123125
uses: docker/build-push-action@14487ce63c7a62a4a324b0bfb37086795e31c6c1 # v6.16.0
124126
with:
125-
push: "${{ env.DOCKER_REGISTRY_LOGIN == 'true' }}"
127+
push: "${{ env.DOCKER_REGISTRY_LOGIN == 'true' && steps.dockerLoginStep.outcome == 'SUCCESS' && github.ref == 'refs/heads/main' }}"
126128
context: "${{ github.workspace }}/manager"
127129
file: "${{ github.workspace }}/manager/Dockerfile"
128130
tags: "${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REGISTRY_PREFIX }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_IMAGE_TAG }}"

0 commit comments

Comments
 (0)