build-cn9k #170
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-cn9k | |
on: | |
push: | |
schedule: | |
- cron: "0 0 * * *" | |
pull_request: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
packages: write | |
jobs: | |
ubuntu-cn9k-build: | |
name: ubuntu-cn9k-arm64 | |
runs-on: ubuntu-24.04-arm | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4.2.2 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Generate cache keys | |
id: get_ref_keys | |
run: | | |
echo 'ccache=ccache-'$(date -u +%Y-m%M) >> $GITHUB_OUTPUT | |
- name: Retrieve ccache cache | |
uses: actions/cache@v4 | |
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: | | |
mkdir -p "${PWD}/artifacts" | |
git tag --points-at HEAD > /tmp/tags | |
[ -s /tmp/tags ] && PKG_POSTFIX= || PKG_POSTFIX=-devel | |
FW_PKG_POSTFIX="" | |
if [ $PKG_POSTFIX = -devel ]; then | |
FW_PKG_POSTFIX="" | |
else | |
FW_PKG_POSTFIX=$PKG_POSTFIX | |
fi | |
echo "FW_PKG_POSTFIX=${FW_PKG_POSTFIX}" >> "${PWD}/artifacts/env" | |
[ -s /tmp/tags ] && NIGHTLY=false || NIGHTLY=true | |
echo "PKG_VERSION_NAME=`./src/scripts/version | awk -F '-' '{print $1}'`" >> "${PWD}/artifacts/env" | |
echo "MRVL_PKG_VERSION=`cat MRVL_VERSION`" >> "${PWD}/artifacts/env" | |
echo "CPT_PKG_VERSION=`cat CPT_PKG_VERSION`" >> "${PWD}/artifacts/env" | |
echo "DPDK_PKG_VERSION=`cat DPDK_VERSION | grep RELEASE_VERSION | awk -F'=' '{print $2}'`" >> "${PWD}/artifacts/env" | |
echo "DPDK_BASE_PKG_VERSION=`cat DPDK_VERSION | grep BASE_VERSION | awk -F'=' '{print $2}' | awk -F'.' '{print $1"."$2}'`" >> "${PWD}/artifacts/env" | |
echo "PKG_POSTFIX=${PKG_POSTFIX}" >> "${PWD}/artifacts/env" | |
source "${PWD}/artifacts/env" | |
echo "NIGHTLY=${NIGHTLY}" >> $GITHUB_OUTPUT | |
echo "DPDK_PKG_VERSION=${DPDK_PKG_VERSION}" >> $GITHUB_OUTPUT | |
echo "DPDK_BASE_PKG_VERSION=${DPDK_BASE_PKG_VERSION}" >> $GITHUB_OUTPUT | |
- name: Build VPP and generate package | |
id: build | |
run: | | |
mkdir -p ~/.ccache | |
BASE_DIR=${PWD} | |
sudo apt-get update -q -y | |
sudo apt-get install -y apt-utils gcc meson sudo make dialog ccache git 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 | |
BASE_DIR=${PWD} | |
source ${BASE_DIR}/artifacts/env | |
DISTRO=ubuntu-`lsb_release -rs` | |
echo "DISTRO=${DISTRO}" >> ${BASE_DIR}/artifacts/env | |
echo "cache_dir = ~/.ccache" > ~/.ccache/ccache.conf | |
ccache -p | |
git config --global --add safe.directory "${PWD}" | |
sudo APT_ARGS='-y -q' make install-deps | |
make build-release VPP_PLATFORM=octeon9 | |
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'-cn9k'$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'-cn9k (= '$DPDK_PKG_VERSION'), cpt-firmware-cn9k'${FW_PKG_POSTFIX}' (= '$CPT_PKG_VERSION')' >> DEBIAN/control | |
echo "Architecture: arm64" >> DEBIAN/control | |
echo "Homepage: https://wiki.fd.io/view/VPP" >> DEBIAN/control | |
echo "Description: Vector Packet Processing (VPP) for Octeon9" >> DEBIAN/control | |
cd - | |
mv "${PWD}/install" "${PWD}/vpp-${PKG_VERSION_NAME}-cn9k${PKG_POSTFIX}_${MRVL_PKG_VERSION}_arm64" | |
dpkg --build "vpp-${PKG_VERSION_NAME}-cn9k${PKG_POSTFIX}_${MRVL_PKG_VERSION}_arm64" | |
cp "vpp-${PKG_VERSION_NAME}-cn9k${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} | |
[[ "$PKG_POSTFIX" == "-devel" ]] && IS_DEVEL="true" || IS_DEVEL="false" | |
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' }} | |
with: | |
name: vpp-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn9k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}_arm64.deb | |
path: ${{ github.workspace }}/artifacts/vpp-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn9k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}_arm64.deb | |
- name: Delete existing release | |
if: ${{ github.event_name == 'push' }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
if gh release view vpp-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn9k-${{ 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 }}-cn9k-${{ 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 cn9k package | |
uses: softprops/action-gh-release@v2.0.4 | |
if: ${{ github.event_name == 'push' }} | |
with: | |
draft: false | |
tag_name: vpp-${{ steps.artifacts.outputs.PKG_VERSION_NAME }}-cn9k-${{ 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 }}-cn9k${{ steps.artifacts.outputs.PKG_POSTFIX }}_${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}_arm64.deb | |
- name: Dispatch package update event | |
if: ${{ github.event_name == 'push' }} | |
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 }}-cn9k-${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}-${{ steps.artifacts.outputs.DISTRO }}-${{ steps.artifacts.outputs.TAG }}", | |
"dpdk_tag" : "dpdk-cn9k-${{ 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" : "cn9k", | |
"devel": "${{ steps.artifacts.outputs.IS_DEVEL }}"}}' |