]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Install libbpf and libxdp in our CI image
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 16 Jan 2024 10:42:45 +0000 (11:42 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 23 Jan 2024 11:54:27 +0000 (12:54 +0100)
.github/workflows/build-and-test-all.yml
.github/workflows/codeql-analysis.yml
tasks.py

index 2b97fd36f302e91f7b023a7336abca425d97bcc0..7528f78352efef155eaafb11a797981d0cdccf59 100644 (file)
@@ -626,7 +626,7 @@ jobs:
           name: dnsdist-full-${{ matrix.sanitizers }}-${{ env.normalized-branch-name }}
           path: /opt/dnsdist
       - run: inv install-clang-runtime
-      - run: inv install-dnsdist-test-deps
+      - run: inv install-dnsdist-test-deps 'with-xdp'
       - run: inv test-dnsdist
       - run: inv generate-coverage-info /opt/dnsdist/bin/dnsdist $GITHUB_WORKSPACE
         if: ${{ env.COVERAGE == 'yes' && matrix.sanitizers != 'tsan' }}
index 38a0d87b5bbc566d79674909f9eb406b6d74ea75..ea0493e72900ab6f0e86b9821cce9fa41e1457ad 100644 (file)
@@ -147,7 +147,7 @@ jobs:
     - name: Install dependencies for dnsdist
       if: matrix.product == 'dnsdist'
       run: |
-        inv install-dnsdist-build-deps
+        inv install-dnsdist-build-deps --skipXDP=True
     - name: Autoreconf dnsdist
       if: matrix.product == 'dnsdist'
       working-directory: ./pdns/dnsdistdist/
index 599f7690565d7e69d6a5cbf078a6fe0e41abf065..d8f54a91b05fbe0af99d8da4742bc6ccbfaf4585 100644 (file)
--- a/tasks.py
+++ b/tasks.py
@@ -84,6 +84,10 @@ dnsdist_build_deps = [
     'libre2-dev',
     'libsnmp-dev',
 ]
+dnsdist_xdp_build_deps = [
+    'libbpf-dev',
+    'libxdp-dev',
+]
 auth_test_deps = [   # FIXME: we should be generating some of these from shlibdeps in build
     'authbind',
     'bc',
@@ -294,26 +298,30 @@ def install_rec_test_deps(c): # FIXME: rename this, we do way more than apt-get
     c.sudo('chmod 755 /var/agentx')
 
 @task
-def install_dnsdist_test_deps(c): # FIXME: rename this, we do way more than apt-get
-    c.sudo('apt-get install -y \
-              libluajit-5.1-2 \
-              libboost-all-dev \
-              libcap2 \
-              libcdb1 \
-              libcurl4-openssl-dev \
-              libfstrm0 \
-              libgnutls30 \
-              libh2o-evloop0.13 \
-              liblmdb0 \
-              libnghttp2-14 \
-              "libre2-[1-9]+" \
-              libssl-dev \
-              libsystemd0 \
-              libsodium23 \
-              lua-socket \
-              patch \
-              protobuf-compiler \
-              python3-venv snmpd prometheus')
+def install_dnsdist_test_deps(c, xdp=True): # FIXME: rename this, we do way more than apt-get
+    deps = 'libluajit-5.1-2 \
+            libboost-all-dev \
+            libcap2 \
+            libcdb1 \
+            libcurl4-openssl-dev \
+            libfstrm0 \
+            libgnutls30 \
+            libh2o-evloop0.13 \
+            liblmdb0 \
+            libnghttp2-14 \
+            "libre2-[1-9]+" \
+            libssl-dev \
+            libsystemd0 \
+            libsodium23 \
+            lua-socket \
+            patch \
+            protobuf-compiler \
+            python3-venv snmpd prometheus'
+    if xdp:
+        deps = deps + 'libbpf1 \
+               libxdp1'
+
+    c.sudo(f'apt-get install -y {deps}')
     c.run('sed "s/agentxperms 0700 0755 dnsdist/agentxperms 0777 0755/g" regression-tests.dnsdist/snmpd.conf | sudo tee /etc/snmp/snmpd.conf')
     c.sudo('/etc/init.d/snmpd restart')
     time.sleep(5)
@@ -323,9 +331,9 @@ def install_dnsdist_test_deps(c): # FIXME: rename this, we do way more than apt-
 def install_rec_build_deps(c):
     c.sudo('apt-get install -y --no-install-recommends ' +  ' '.join(all_build_deps + git_build_deps + rec_build_deps))
 
-@task
-def install_dnsdist_build_deps(c):
-    c.sudo('apt-get install -y --no-install-recommends ' +  ' '.join(all_build_deps + git_build_deps + dnsdist_build_deps))
+@task(optional=['skipXDP'])
+def install_dnsdist_build_deps(c, skipXDP=False):
+    c.sudo('apt-get install -y --no-install-recommends ' +  ' '.join(all_build_deps + git_build_deps + dnsdist_build_deps + dnsdist_xdp_build_deps if not skipXDP else []))
 
 @task
 def ci_autoconf(c):