Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement dpdk_build_check #72

Merged
merged 6 commits into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 51 additions & 23 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,65 +31,93 @@ env:

jobs:
#---------------------------------------------------------------------
# check_krnlmon_dpdk
# 1 - dpdk_build_check
#---------------------------------------------------------------------
check_krnlmon_dpdk:
dpdk_build_check:
runs-on: ubuntu-latest

steps:
- name: Check out krnlmon repository
- name: Check out networking-recipe
uses: actions/checkout@v3
with:
path: krnlmon
repository: ipdk-io/networking-recipe
submodules: recursive
path: recipe

- name: Check out SAI repository
uses: actions/checkout@v3
- name: Install dpdk-sde
uses: robinraju/[email protected]
with:
repository: opencomputeproject/SAI
path: SAI
repository: ${{ env.SDE_REPOSITORY }}
tag: ${{ env.SDE_TAG }}
fileName: ${{ env.SDE_FILENAME }}
- run: |
sudo tar -xzf $SDE_FILENAME -C /
rm $SDE_FILENAME

- name: Check out networking-recipe
uses: actions/checkout@v3
- name: Install stratum-deps
uses: robinraju/[email protected]
with:
repository: ipdk-io/networking-recipe
path: recipe
repository: ${{ env.DEPS_REPOSITORY }}
tag: ${{ env.DEPS_TAG }}
fileName: ${{ env.DEPS_FILENAME }}
- run: |
sudo tar -xzf $DEPS_FILENAME -C /
rm $DEPS_FILENAME

- name: Install prerequisites
run: |
sudo apt install $PREREQS

- name: Install DPDK SDE
- name: Build krnlmon
working-directory: recipe
run: |
export DEPEND_INSTALL=$DEPS_INSTALL_DIR
export SDE_INSTALL=$SDE_INSTALL_DIR
./make-all.sh --target=dpdk --rpath --no-ovs --no-build
cmake --build build -j4 --target krnlmon
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--target krnlmon?

What does this mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It instructs cmake to build the krnlmon target. It's the equivalent of make -C build krnlmon.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didnt realize krnlmon target was supported

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're just full of surprises. 😉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since krnlmon is treated as separate target, is krnlmon a separate process and not a thread anymore? Do we need to start krnlmon separately?

Copy link
Contributor Author

@ffoulkes ffoulkes Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow just checks to see if krnlmon compiles okay. The output is a library (libkrnlmon). The result is not runnable.

The workflow runs when a PR is created against the krnlmon repository. Anything we do here should be largely independent of networking-recipe. (There's a weakness here, in that krnlmon depends on several include files in networking-recipe/cmake. I'm crossing my fingers that this does not become an issue. I should probably move them to a separate repository and include it as a submodule, but I've been reluctant to do so for so few files.)

Krnlmon has very few dependencies, so the process completes in ~30 seconds. We want our build checks to be fast.


#---------------------------------------------------------------------
# 2 - dpdk_unit_tests
#---------------------------------------------------------------------
dpdk_unit_tests:
runs-on: ubuntu-latest

steps:
- name: Check out networking-recipe
uses: actions/checkout@v3
with:
repository: ipdk-io/networking-recipe
submodules: recursive
path: recipe

- name: Install dpdk-sde
uses: robinraju/[email protected]
with:
repository: ${{ env.SDE_REPOSITORY }}
tag: ${{ env.SDE_TAG }}
fileName: ${{ env.SDE_FILENAME }}

- run: |
sudo tar -xzf $SDE_FILENAME -C /
rm $SDE_FILENAME

- name: Install stratum dependencies
- name: Install stratum-deps
uses: robinraju/[email protected]
with:
repository: ${{ env.DEPS_REPOSITORY }}
tag: ${{ env.DEPS_TAG }}
fileName: ${{ env.DEPS_FILENAME }}

- run: |
sudo tar -xzf $DEPS_FILENAME -C /
rm $DEPS_FILENAME

- name: Create pipeline.cmake file
working-directory: krnlmon
- name: Install prerequisites
run: |
echo "set(CMAKE_MODULE_PATH \"$GITHUB_WORKSPACE/recipe/cmake\" CACHE PATH \"\")" > pipeline.cmake
echo "set(SAI_SOURCE_DIR \"$GITHUB_WORKSPACE/SAI\" CACHE PATH \"\")" >> pipeline.cmake
sudo apt install $PREREQS

- name: Run unit tests
working-directory: krnlmon
- name: Run dpdk unit tests
working-directory: recipe
run: |
export DEPEND_INSTALL=$DEPS_INSTALL_DIR
export SDE_INSTALL=$SDE_INSTALL_DIR
cmake -S . -B build -C pipeline.cmake -DTDI_TARGET=DPDK
./make-all.sh --target=dpdk --no-ovs --no-build
cmake --build build --target krnlmon-test