-
Notifications
You must be signed in to change notification settings - Fork 3
214 lines (209 loc) · 14.3 KB
/
build-cn10k.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: build-cn10k
on:
push:
schedule:
- cron: "0 0 * * *"
pull_request:
permissions:
contents: write
pages: write
id-token: write
packages: write
jobs:
ubuntu-cn10k-build:
name: ubuntu-cn10k-arm64
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- arch: aarch64
distro: ubuntu22.04
compiler: gcc
library: static
steps:
- name: Checkout sources
uses: actions/[email protected]
with:
fetch-depth: 0
fetch-tags: true
- name: Generate cache keys
id: get_ref_keys
run: |
echo 'ccache=ccache-${{ matrix.distro }}-${{ matrix.compiler }}-${{ matrix.arch }}-'$(date -u +%Y-w%W) >> $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 "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
- uses: uraimo/[email protected]
name: Build VPP and generate package
id: build
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
githubToken: ${{ github.token }}
setup: |
mkdir -p ~/.ccache
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
--volume "${HOME}/.ccache:/root/.ccache"
shell: /bin/bash
install: |
apt-get update -q -y
apt-get install -y apt-utils gcc meson sudo make dialog ccache git build-essential software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get update -q -y
apt-get install -y aspell aspell-en autopoint autotools-dev binfmt-support binutils binutils-aarch64-linux-gnu
apt-get install -y binutils-common bsdextrautils bzip2 ca-certificates clang-14 cmake-data cpp cpp-11 cpp-12 dbus
apt-get install -y dctrl-tools debugedit dh-autoreconf dh-elpa-helper dh-strip-nondeterminism dictionaries-common dirmngr
apt-get install -y distro-info-data dpkg-dev dwz emacsen-common fakeroot file fontconfig-config fonts-dejavu-core g++ g++-11
apt-get install -y gcc gcc-11 gcc-11-base gcc-12 gettext gettext-base git-man gnupg gnupg-l10n gnupg-utils gpg gpg-agent
apt-get install -y gpg-wks-client gpg-wks-server gpgconf gpgsm groff-base hunspell-en-us icu-devtools intltool-debian
apt-get install -y javascript-common kmod less libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
apt-get install -y libapparmor1 libapr1 libarchive-cpio-perl libarchive-zip-perl libarchive13 libasan6 libasan8 libaspell15
apt-get install -y libassuan0 libatomic1 libbcg729-0 libbinutils libbrotli1 libbsd0 libc-ares2 libc-dev-bin libc-devtools
apt-get install -y libc6-dev libcap2-bin libcbor0.8 libcc1-0 libclang-common-14-dev libclang-cpp11 libclang-cpp14
apt-get install -y libclang1-14 libcommon-sense-perl libconfuse-common libconfuse-doc libconfuse2 libcrypt-dev libctf-nobfd0
apt-get install -y libctf0 libcurl3-gnutls libcurl4 libdbus-1-3 libdbus-1-dev libdebhelper-perl libdeflate0 libdpkg-perl
apt-get install -y libdw1 libedit2 libelf1 libenchant-2-2 liberror-perl libexpat1 libexpat1-dev libfakeroot libfido2-1
apt-get install -y libfile-fcntllock-perl libfile-stripnondeterminism-perl libfontconfig1 libfreetype6 libgc1 libgcc-11-dev
apt-get install -y libgcc-12-dev libgd-perl libgd3 libgdbm-compat4 libgdbm6 libglib2.0-0 libglib2.0-data libgomp1
apt-get install -y libhiredis0.14 libhunspell-1.7-0 libhwasan0 libicu-dev libicu70 libiperf0 libisl23 libitm1 libjbig0
apt-get install -y libjpeg-turbo8 libjpeg8 libjs-jquery libjs-sphinxdoc libjs-underscore libjson-perl libjson-xs-perl
apt-get install -y libjsoncpp25 libkmod2 libksba8 libldap-2.5-0 libldap-common libllvm11 libllvm14 liblocale-gettext-perl
apt-get install -y liblsan0 libltdl-dev libltdl7 liblua5.2-0 libmagic-mgc libmagic1 libmail-sendmail-perl libmaxminddb0
apt-get install -y libmd0 libmnl0 libmpc3 libmpdec3 libmpfr6 libncurses-dev libnghttp2-14 libnl-3-200 libnl-genl-3-200
apt-get install -y libnl-route-3-200 libnpth0 libnsl-dev libnuma1 libobjc-11-dev libobjc4 libpam-cap libpcap0.8
apt-get install -y libpcap0.8-dev libperl5.34 libperlio-gzip-perl libpfm4 libpipeline1 libpng16-16 libpsl5 libpython3-dev
apt-get install -y libpython3-stdlib libpython3.10 libpython3.10-dev libpython3.10-minimal libpython3.10-stdlib libreadline8
apt-get install -y librhash0 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libsbc1 libsctp-dev libsctp1
apt-get install -y libsigsegv2 libsmi2ldbl libsnappy1v5 libspandsp2 libspeexdsp1 libsqlite3-0 libssh-4 libssh-gcrypt-4
apt-get install -y libstdc++-11-dev libsub-override-perl libsubunit-dev libsubunit0 libsys-hostname-long-perl
apt-get install -y libtext-iconv-perl libtiff5 libtinfo-dev libtirpc-dev libtsan0 libtsan2 libtypes-serialiser-perl
apt-get install -y libubsan1 libuchardet0 libuv1 libwebp7 libwireshark-data libwireshark15 libwiretap12 libwsutil13 libx11-6
apt-get install -y libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxml2 libxml2-dev libxmuu1 libxpm4 libxslt1.1
apt-get install -y libyaml-0-2 libz3-4 libz3-dev linux-headers-5.15.0-107 linux-headers-5.15.0-107-generic
apt-get install -y linux-headers-generic linux-libc-dev llvm-14 llvm-14-dev llvm-14-linker-tools llvm-14-runtime
apt-get install -y llvm-14-tools lsb-release lto-disabled-list m4 man-db manpages manpages-dev media-types netbase
apt-get install -y openssh-client openssl patch perl perl-modules-5.34 pinentry-curses po-debconf publicsuffix
apt-get install -y python-babel-localedata python3 python3-attr python3-babel python3-bs4 python3-certifi python3-chardet
apt-get install -y python3-distlib python3-distutils python3-filelock python3-html5lib python3-idna
apt-get install -y python3-importlib-metadata python3-jinja2 python3-lib2to3 python3-lxml python3-markupsafe python3-minimal
apt-get install -y python3-more-itertools python3-pip-whl python3-pkg-resources python3-platformdirs python3-pygments
apt-get install -y python3-pyrsistent python3-requests python3-setuptools-whl python3-six python3-soupsieve python3-tz
apt-get install -y python3-urllib3 python3-webencodings python3-wheel python3-wheel-whl python3-zipp python3.10
apt-get install -y python3.10-dev python3.10-minimal python3.10-venv readline-common rpcsvc-proto shared-mime-info tzdata
apt-get install -y ucf uuid-dev wireshark-common xauth xdg-user-dirs xz-utils zlib1g-dev libgmpxx4ldbl
apt-get install -y check chrpath clang clang-format-11 cmake cscope debhelper dh-python dkms liblz4-dev
apt-get install -y ethtool exuberant-ctags gcovr git-review iperf iperf3 lcov libapr1-dev liblzma-dev wget
apt-get install -y libconfuse-dev libelf-dev libffi7 libmnl-dev libnl-3-dev libnl-route-3-dev libzstd-dev
apt-get install -y libnuma-dev libpcap-dev libssl-dev nasm ninja-build python3-all python3-dev nettle-dev
apt-get install -y python3-jsonschema pkg-config python3-pip python3-ply python3-setuptools python3-venv
apt-get install -y python3-virtualenv tshark lsb-release doxygen libarchive-dev libbsd-dev libbpf-dev
apt-get install -y libnl-xfrm-3-dev sphinx-common python3-sphinx-rtd-theme libfdt-dev libjansson-dev
apt-get install -y python3-pyelftools gcc-13 bzip2-doc libacl1-dev libattr1-dev libbz2-dev libgmp-dev
pip3 install meson --upgrade
run: |
source /artifacts/env
DISTRO=ubuntu-`lsb_release -rs`
echo "DISTRO=${DISTRO}" >> /artifacts/env
echo "cache_dir = /root/.ccache" > /root/.ccache/ccache.conf
ccache -p
git config --global --add safe.directory "${PWD}"
APT_ARGS='-y -q' make install-deps
make build-release VPP_PLATFORM=octeon10
mkdir -p "${PWD}/install/DEBIAN"
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 ([email protected])" >> DEBIAN/control
echo 'Depends: python3, python3-ply, dpdk-'$DPDK_BASE_PKG_VERSION'-cn10k (= '$DPDK_PKG_VERSION'), cpt-firmware-cn10k'${FW_PKG_POSTFIX}' (= '$MRVL_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 Octeon10" >> DEBIAN/control
cd -
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" /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/[email protected]
if: ${{ github.event_name == 'push' }}
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' }}
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
- name: Release VPP cn10k package
uses: softprops/[email protected]
if: ${{ github.event_name == 'push' }}
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' }}
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 }}-${{ steps.artifacts.outputs.MRVL_PKG_VERSION }}-${{ steps.artifacts.outputs.DISTRO }}-${{ steps.artifacts.outputs.TAG }}",
"dpdk_tag" : "dpdk-cn10k-${{ 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 }}"}}'