Skip to content

build-cn10k-vpp

build-cn10k-vpp #116

name: build-cn10k-vpp
on:
workflow_dispatch:
pull_request:
schedule:
- cron: "0 0 * * *"
push:
tags:
- '[0-9][0-9].[0-9][0-9].0'
permissions:
contents: write
packages: write
pages: write
id-token: write
env:
COMPONENT: vpp
jobs:
ubuntu-cn10k-build:
name: ubuntu-cn10k-arm64
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout sources
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Generate cache keys
id: get_ref_keys
run: |
echo 'ccache=ccache-'$(date -u +%Y-%m) >> $GITHUB_OUTPUT
- name: Retrieve ccache cache
uses: actions/cache@v4.2.3
with:
path: ~/.ccache
key: ${{ steps.get_ref_keys.outputs.ccache }}-${{ github.ref }}
restore-keys: |
${{ steps.get_ref_keys.outputs.ccache }}-refs/heads/main
- name: Extract version details
id: version
run: |
set -x
mkdir -p "${PWD}/artifacts"
EVENT="${{ github.event_name }}"
BASE=$(cut -d. -f1,2 < VERSION)
# If event is a Tag Push
if [ "$EVENT" = "push" ]; then
# Start release cycle of minor=0
# PKG_POSTFIX is empty to signify non-devel
# Treat HEAD as "release" only if a release tag (YY.MM.0) points at it.
if git tag --points-at HEAD --list '[0-9][0-9].[0-9][0-9].0' | grep -q .; then
MINOR=0
PKG_POSTFIX=""
IS_DEVEL=false
else
#ignore minor for scheduled cron jobs
MINOR=0
PKG_POSTFIX="-devel"
IS_DEVEL=true
fi
else
# Find the latest Tag for this component and base (dao-1.2.*), version-sort, and select the newest.
LAST=$(git tag -l "${COMPONENT}-${BASE}.*" | sort -V | tail -n1)
# If no previous tag exists for this base, start at .0; else increment the existing minor.
if [ -z "$LAST" ]; then MINOR=0 ; else
MINOR=$(echo "$LAST" | awk -F. '{print $3}')
MINOR=$((MINOR+1))
fi
# -devel specified by the PKG_POSTFIX
PKG_POSTFIX="-devel"
IS_DEVEL=true
fi
MRVL_PKG_VERSION="${BASE}.${MINOR}"
echo "IS_DEVEL=${IS_DEVEL}" >> "${PWD}/artifacts/env"
echo "MRVL_PKG_VERSION=${MRVL_PKG_VERSION}" >> "${PWD}/artifacts/env"
echo "PKG_POSTFIX=${PKG_POSTFIX}" >> "${PWD}/artifacts/env"
DPDK_PKG_VERSION=`cat DPDK_VERSION | grep RELEASE_VERSION | awk -F'=' '{print $2}'`
DPDK_BASE_PKG_VERSION=`cat DPDK_VERSION | grep BASE_VERSION | awk -F'=' '{print $2}' | awk -F'.' '{print $1"."$2}'`
echo "DPDK_PKG_VERSION=$DPDK_PKG_VERSION" >> artifacts/env
echo "DPDK_BASE_PKG_VERSION=$DPDK_BASE_PKG_VERSION" >> artifacts/env
echo "DPDK_PKG_VERSION=$DPDK_PKG_VERSION" >> "$GITHUB_OUTPUT"
echo "DPDK_BASE_PKG_VERSION=$DPDK_BASE_PKG_VERSION" >> "$GITHUB_OUTPUT"
- name: push component patch tag
if: github.event_name == 'workflow_dispatch'
run: |
set -x
source artifacts/env
NEWTAG="${COMPONENT}-${MRVL_PKG_VERSION}"
git config user.name "github-bot-accelerator"
git config user.email "github-bot-accelerator@marvell.com"
git tag -l "$NEWTAG" | grep -q . || git tag -a "$NEWTAG" -m "devel bump $NEWTAG"
git push origin "$NEWTAG"
- name: Build VPP and generate package
id: build
run: |
set -x
BASE_DIR=${PWD}
sudo apt-get update -q -y
sudo apt-get install -y apt-utils gcc meson sudo make dialog ccache git gh build-essential software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update -q -y
sudo apt-get install -y curl autoconf automake debhelper dkms
sudo apt-get install -y libtool libapr1-dev dh-python libconfuse-dev git-review exuberant-ctags
sudo apt-get install -y cscope pkg-config gcovr lcov chrpath libnuma-dev python3-all
sudo apt-get install -y python3-setuptools check libffi-dev python3-ply libunwind-dev cmake
sudo apt-get install -y ninja-build python3-jsonschema python3-yaml python3-venv python3-dev
sudo apt-get install -y python3-pip libnl-3-dev libnl-route-3-dev libmnl-dev python3-virtualenv
sudo apt-get install -y libssl-dev libelf-dev libpcap-dev iperf3 nasm iperf ethtool tshark jq
sudo apt-get install -y llvm clang clang-format-15 enchant-2 libffi8
sudo apt-get install -y aspell aspell-en autopoint autotools-dev binfmt-support binutils binutils-aarch64-linux-gnu
sudo apt-get install -y binutils-common bsdextrautils bzip2 ca-certificates clang-14 cmake-data cpp cpp-11 cpp-12 dbus
sudo apt-get install -y dctrl-tools debugedit dh-autoreconf dh-elpa-helper dh-strip-nondeterminism dictionaries-common dirmngr
sudo apt-get install -y distro-info-data dpkg-dev dwz emacsen-common fakeroot file fontconfig-config fonts-dejavu-core g++ g++-11
sudo apt-get install -y gcc gcc-11 gcc-11-base gcc-12 gcc-13 gettext gettext-base git-man gnupg gnupg-l10n gnupg-utils gpg gpg-agent
sudo apt-get install -y gpg-wks-client gpg-wks-server gpgconf gpgsm groff-base hunspell-en-us icu-devtools intltool-debian
sudo apt-get install -y javascript-common kmod less libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
sudo apt-get install -y libapparmor1 libapr1 libarchive-cpio-perl libarchive-zip-perl libarchive13 libasan6 libasan8 libaspell15
sudo apt-get install -y libassuan0 libatomic1 libbcg729-0 libbinutils libbrotli1 libbsd0 libc-ares2 libc-dev-bin libc-devtools
sudo apt-get install -y libc6-dev libcap2-bin libcbor0.10 libcc1-0 libclang-common-14-dev libclang-cpp14
sudo apt-get install -y libclang1-14 libcommon-sense-perl libconfuse-common libconfuse-doc libconfuse2 libcrypt-dev libctf-nobfd0
sudo apt-get install -y libctf0 libcurl3-gnutls libcurl4 libdbus-1-3 libdbus-1-dev libdebhelper-perl libdeflate0 libdpkg-perl
sudo apt-get install -y libdw1 libedit2 libelf1 libenchant-2-2 liberror-perl libexpat1 libexpat1-dev libfakeroot libfido2-1
sudo apt-get install -y libfile-fcntllock-perl libfile-stripnondeterminism-perl libfontconfig1 libfreetype6 libgc1 libgcc-11-dev
sudo apt-get install -y libgcc-12-dev libgd-perl libgd3 libgdbm-compat4 libgdbm6 libglib2.0-0 libglib2.0-data libgomp1
sudo apt-get install -y libhiredis1.1.0 libhunspell-1.7-0 libhwasan0 libicu-dev libicu74 libiperf0 libisl23 libitm1 libjbig0
sudo apt-get install -y libjpeg-turbo8 libjpeg8 libjs-jquery libjs-sphinxdoc libjs-underscore libjson-perl libjson-xs-perl
sudo apt-get install -y libjsoncpp25 libkmod2 libksba8 libldap2 libldap2-dev libldap-common libllvm14t64 liblocale-gettext-perl
sudo apt-get install -y liblsan0 libltdl-dev libltdl7 liblua5.2-0 libmagic-mgc libmagic1 libmail-sendmail-perl libmaxminddb0
sudo apt-get install -y libmd0 libmnl0 libmpc3 libmpfr6 libncurses-dev libnghttp2-14 libnl-3-200 libnl-genl-3-200
sudo apt-get install -y libnl-route-3-200 libnpth0 libnsl-dev libnuma1 libobjc-11-dev libobjc4 libpam-cap libpcap0.8
sudo apt-get install -y libpcap0.8-dev libperl5.38t64 libperlio-gzip-perl libpfm4 libpipeline1 libpng16-16 libpsl5 libpython3-dev
sudo apt-get install -y libpython3-stdlib libpython3.12t64 libpython3.12-dev libpython3.12-minimal libreadline8
sudo apt-get install -y librhash0 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libsbc1 libsctp-dev libsctp1
sudo apt-get install -y libsigsegv2 libsmi2ldbl libsnappy1v5 libspandsp2 libspeexdsp1 libsqlite3-0 libssh-4 libssh-gcrypt-4
sudo apt-get install -y libstdc++-11-dev libsub-override-perl libsubunit-dev libsubunit0 libsys-hostname-long-perl
sudo apt-get install -y libtext-iconv-perl libtiff6 libtinfo-dev libtirpc-dev libtsan0 libtsan2 libtypes-serialiser-perl
sudo apt-get install -y libubsan1 libuchardet0 libuv1 libwebp7 libwireshark-data libwireshark17t64 libwiretap14t64 libwsutil15t64 libx11-6
sudo apt-get install -y libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxml2 libxml2-dev libxmuu1 libxpm4 libxslt1.1
sudo apt-get install -y libyaml-0-2 libz3-4 libz3-dev linux-headers-6.8.0-51 linux-headers-6.8.0-51-generic
sudo apt-get install -y linux-headers-generic linux-libc-dev llvm-14 llvm-14-dev llvm-14-linker-tools llvm-14-runtime
sudo apt-get install -y llvm-14-tools lsb-release lto-disabled-list m4 man-db manpages manpages-dev media-types netbase
sudo apt-get install -y openssh-client openssl patch perl perl-modules-5.38 pinentry-curses po-debconf publicsuffix
sudo apt-get install -y python-babel-localedata python3 python3-attr python3-babel python3-bs4 python3-certifi python3-chardet
sudo apt-get install -y python3-distlib python3-filelock python3-html5lib python3-idna
sudo apt-get install -y python3-importlib-metadata python3-jinja2 python3-lib2to3 python3-lxml python3-markupsafe python3-minimal
sudo apt-get install -y python3-more-itertools python3-pip-whl python3-pkg-resources python3-platformdirs python3-pygments
sudo apt-get install -y python3-pyrsistent python3-requests python3-setuptools-whl python3-six python3-soupsieve python3-tz
sudo apt-get install -y python3-urllib3 python3-webencodings python3-wheel python3-wheel-whl python3-zipp python3.10
sudo apt-get install -y python3-minimal readline-common rpcsvc-proto shared-mime-info tzdata
sudo apt-get install -y ucf uuid-dev wireshark-common xauth xdg-user-dirs xz-utils zlib1g-dev libgmpxx4ldbl
sudo apt-get install -y liblz4-dev liblzma-dev wget libzstd-dev nettle-dev lsb-release doxygen libarchive-dev
sudo apt-get install -y libnl-xfrm-3-dev sphinx-common python3-sphinx-rtd-theme libfdt-dev libjansson-dev libbsd-dev
sudo apt-get install -y python3-pyelftools gcc-14 bzip2-doc libacl1-dev libattr1-dev libbz2-dev libgmp-dev libbpf-dev libconfig-dev
source ${BASE_DIR}/artifacts/env
DISTRO=ubuntu-`lsb_release -rs`
echo "DISTRO=${DISTRO}" >> ${BASE_DIR}/artifacts/env
ccache -p
git config --global --add safe.directory "${PWD}"
git clone "https://github.com/MarvellEmbeddedProcessors/vpp.git"
cd "${PWD}/vpp"
PKG_VERSION_NAME=`./src/scripts/version | awk -F '-' '{print $1}'`
echo "PKG_VERSION_NAME=${PKG_VERSION_NAME}" >> "${BASE_DIR}/artifacts/env"
CPT_PKG_VERSION=`cat DEP_PKG_VERSION | grep CPT_PKG_VERSION | awk -F'=' '{print $2}'`
sudo APT_ARGS='-y -q' make install-deps
[[ "$PKG_POSTFIX" == "-devel" ]] && TAG=devel || TAG=${MRVL_PKG_VERSION}
GH_REPO=MarvellEmbeddedProcessors/dao
BASE="${MRVL_PKG_VERSION%.*}"
BEST=$(curl -fsSL "https://api.github.com/repos/${GH_REPO}/releases?per_page=100" | jq -r '.[].tag_name' | grep -E "^oct-ep-target-cn10k-${BASE}\.[0-9]+-${DISTRO}-${TAG}$" | sort -V | tail -n1)
OCT_PKG_VERSION=$(echo "$BEST" | cut -d- -f5)
OCT_TAG=${BEST}
wget -q "https://github.com/MarvellEmbeddedProcessors/dao/releases/download/${OCT_TAG}/oct-ep-target-cn10k${PKG_POSTFIX}_${OCT_PKG_VERSION}_arm64.deb"
sudo apt-get install -y "./oct-ep-target-cn10k${PKG_POSTFIX}_${OCT_PKG_VERSION}_arm64.deb"
make build-release VPP_PLATFORM=octeon10
version_range() {
local var="$1"
local full="${!var}"
local year=$(echo "$full" | cut -d. -f1)
local month=$(echo "$full" | cut -d. -f2)
local base="${year}.${month}.0"
local upper="${year}.$((10#$month + 1)).0"
export "${var}_BASE"="${base}"
export "${var}_UPPER"="${upper}"
}
version_range MRVL_PKG_VERSION
mkdir -p "${PWD}/install/DEBIAN"
mkdir -p "${PWD}/install/usr/share/vpp/api"
cp -r build-root/install-vpp-native/vpp/share/vpp/api/* "${PWD}/install/usr/share/vpp/api"
mv build-root/install-vpp-native/vpp/* install/.
cd "${PWD}/install"
echo 'Package: vpp-'$PKG_VERSION_NAME'-cn10k'$PKG_POSTFIX >> DEBIAN/control
echo 'Version: '$MRVL_PKG_VERSION >> DEBIAN/control
echo "Maintainer: Jerin Jacob (jerinj@marvell.com)" >> DEBIAN/control
echo 'Depends: python3, python3-ply, dpdk-${DPDK_BASE_PKG_VERSION}-cn10k${PKG_POSTFIX} (>= ${DPDK_PKG_VERSION}), cpt-firmware-cn10k (= '$CPT_PKG_VERSION'), oct-ep-target-cn10k'$PKG_POSTFIX' (>= '$MRVL_PKG_VERSION_BASE'), oct-ep-target-cn10k'$PKG_POSTFIX' (<< '$MRVL_PKG_VERSION_UPPER')' >> DEBIAN/control
echo "Architecture: arm64" >> DEBIAN/control
echo "Homepage: https://wiki.fd.io/view/VPP" >> DEBIAN/control
echo "Description: Vector Packet Processing (VPP) for Octeon10" >> DEBIAN/control
cd -
rm -rf "${PWD}/install/~" "${PWD}/install/home"
mv "${PWD}/install" "${PWD}/vpp-${PKG_VERSION_NAME}-cn10k${PKG_POSTFIX}_${MRVL_PKG_VERSION}_arm64"
dpkg --build "vpp-${PKG_VERSION_NAME}-cn10k${PKG_POSTFIX}_${MRVL_PKG_VERSION}_arm64"
cp "vpp-${PKG_VERSION_NAME}-cn10k${PKG_POSTFIX}_${MRVL_PKG_VERSION}_arm64.deb" ${BASE_DIR}/artifacts/.
- name: Export version name
id: artifacts
run: |
source "${PWD}/artifacts/env"
echo $PKG_VERSION_NAME
echo "PKG_VERSION_NAME=${PKG_VERSION_NAME}" >> "$GITHUB_OUTPUT"
echo $MRVL_PKG_VERSION
echo "MRVL_PKG_VERSION=${MRVL_PKG_VERSION}" >> "$GITHUB_OUTPUT"
echo $DISTRO
echo "DISTRO=${DISTRO}" >> "$GITHUB_OUTPUT"
echo $PKG_POSTFIX
echo "PKG_POSTFIX=${PKG_POSTFIX}" >> "$GITHUB_OUTPUT"
[[ "$PKG_POSTFIX" == "-devel" ]] && TAG=devel || TAG=${MRVL_PKG_VERSION}
echo "TAG=${TAG}" >> "$GITHUB_OUTPUT"
echo "IS_DEVEL=${IS_DEVEL}" >> "$GITHUB_OUTPUT"
- name: Upload debian package as artifact
uses: actions/upload-artifact@v4.3.1
if: ${{ github.event_name == 'push' }} || ${{ github.event_name == 'workflow_dispatch' }}
with:
name: vpp-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}_arm64.deb
path: ${{ github.workspace }}/artifacts/vpp-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}_arm64.deb
- name: Delete existing release
if: ${{ github.event_name == 'push' }} || ${{ github.event_name == 'workflow_dispatch' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
if gh release view vpp-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn10k-${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}-${{ steps.artifacts.outputs.DISTRO }}-${{ steps.artifacts.outputs.TAG }}; then
gh release delete vpp-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn10k-${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}-${{ steps.artifacts.outputs.DISTRO }}-${{ steps.artifacts.outputs.TAG }} --cleanup-tag -y
else
echo "Release not found"
fi
continue-on-error: true
- name: Release VPP cn10k package
uses: softprops/action-gh-release@v2.2.2
if: ${{ github.event_name == 'push' }} || ${{ github.event_name == 'workflow_dispatch' }}
with:
draft: false
tag_name: vpp-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn10k-${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}-${{ steps.artifacts.outputs.DISTRO }}-${{ steps.artifacts.outputs.TAG }}
files: |
${{ github.workspace }}/artifacts/vpp-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}_arm64.deb
- name: Dispatch package update event
if: ${{ github.event_name == 'push' }} || ${{ github.event_name == 'workflow_dispatch' }}
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PPA_REPO_SECRET }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/marvellembeddedprocessors/packages/dispatches \
-d '{"event_type":"dispatch-event", "client_payload": {"package" : "vpp",
"tag": "vpp-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn10k-${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}-${{ steps.artifacts.outputs.DISTRO }}-${{ steps.artifacts.outputs.TAG }}",
"dpdk_tag" : "dpdk-cn10k${{ steps.artifacts.outputs.PKG_POSTFIX }}-${{ steps.version.outputs.DPDK_BASE_PKG_VERSION }}_${{ steps.version.outputs.DPDK_PKG_VERSION }}-${{ steps.artifacts.outputs.DISTRO }}-${{ steps.version.outputs.DPDK_PKG_VERSION }}",
"has_dpdk" : "true", "distro" : "${{ steps.artifacts.outputs.DISTRO }}",
"platform" : "cn10k",
"devel": "${{ steps.artifacts.outputs.IS_DEVEL }}"}}'