From d48f1908639d1fb0b5d9643270cb3c7383deb070 Mon Sep 17 00:00:00 2001 From: James Rawlings Date: Wed, 18 Dec 2024 09:46:23 +0000 Subject: [PATCH] datadog-agent: various fixes to work with latest 7.60.0 update Included: - add libpcap - symlink so build avoids downloading libpcap and uses system lib - build with python 3.12 as integration dependencies require it ``` ERROR: Package 'datadog-slurm' requires a different Python: 3.11.11 not in '>=3.12' ``` Signed-off-by: James Rawlings --- datadog-agent.yaml | 21 ++++++++++++------- .../int-core-agent_requirements-in.patch | 8 +++---- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/datadog-agent.yaml b/datadog-agent.yaml index 8a3ecd64b91..e48aff18b11 100644 --- a/datadog-agent.yaml +++ b/datadog-agent.yaml @@ -13,11 +13,12 @@ package: - datadog-agent-core-integrations - findutils - grep + - libpcap - libseccomp - shadow vars: - py-version: "3.11" + py-version: "3.12" destd: /opt/datadog-agent var-transforms: @@ -60,8 +61,8 @@ environment: - go - krb5-dev - libbpf-dev - - libpcap-dev - libedit-dev + - libpcap-dev # Add development headers - libzip - linux-headers - ninja @@ -77,9 +78,10 @@ environment: # CGo allows Go programs to call C code CGO_ENABLED: "1" # -Os optimizes the code for size and add the directory to rtlinkers includes - CGO_CFLAGS: "-Os -I${{targets.destdir}}/usr/include/" + CGO_CFLAGS: "-Os -I/usr/include/" # Pass options to the linker. - CGO_LDFLAGS: "-L${{targets.destdir}}/usr/lib/" + # CGO_LDFLAGS: "-L/usr/lib -lpcap" + CGO_LDFLAGS: "-L/usr/lib" # disables generation of debugging information # omits the symbol table and debug information, further reducing the size of the binary. GOFLAGS: "-ldflags=-w -ldflags=-s" @@ -135,6 +137,11 @@ pipeline: wget "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz" -O /tmp/clang.tar.xz -o /dev/null echo "6b3cc55d3ef413be79785c4dc02828ab3bd6b887872b143e3091692fc6acefe7 /tmp/clang.tar.xz" | sha256sum --check + # need to link libpcap.a to /home/build/dev/lib/libpcap.a else the build will attempt to download libpcap + - runs: | + mkdir -p /home/build/dev/lib + ln -s /usr/lib/libpcap.a /home/build/dev/lib/libpcap.a + - runs: | wget -O common.deb http://deb.debian.org/debian-security/pool/updates/main/l/linux-5.10/linux-headers-${LINUX_HEADERS_VERSION}-common_${LINUX_KERNEL_VERSION}_all.deb dpkg -x common.deb /tmp/common @@ -165,7 +172,6 @@ pipeline: - runs: | invoke -e rtloader.make \ - --python-runtimes=3 \ --install-prefix="${{targets.destdir}}/usr" \ --cmake-options="\ -DCMAKE_INSTALL_LIBDIR=lib \ @@ -181,7 +187,6 @@ pipeline: --bundle system-probe \ --bundle security-agent \ --exclude-rtloader \ - --python-runtimes 3 \ --no-development \ --bundle-ebpf \ --embedded-path /usr/lib @@ -287,7 +292,7 @@ subpackages: with: repository: https://github.com/DataDog/integrations-core branch: ${{vars.datadog-major-minor-x}} # 7.59.x - expected-commit: cff91adb18fe879fd875d62d285a67deb69040fe # needs to be updated with each new release + expected-commit: 3189af0e0ae840c9a4bab3131662c7fd6b0de7fb # needs to be updated with each new release - uses: patch with: patches: /home/build/int-core-datadog_checks_dev-pyproject-toml.patch /home/build/int-core-mysql-hatch-toml.patch /home/build/int-core-singlestore-hatch-toml.patch /home/build/int-core-agent_requirements-in.patch /home/build/int-core-snowflake-pyproject-toml.patch @@ -299,7 +304,7 @@ subpackages: python${{vars.py-version}} -m venv .venv # Install locked dependencies - .venv/bin/pip install --require-hashes --only-binary=:all: --no-deps -r .deps/resolved/linux-${{build.arch}}_py3.txt + .venv/bin/pip install --require-hashes --only-binary=:all: --no-deps -r .deps/resolved/linux-${{build.arch}}_${{vars.py-version}}.txt excludes="datadog_checks_base datadog_checks_dev datadog_checks_tests_helper docker_daemon esxi teleport" checks=$(invoke -r /home/build agent.collect-integrations /home/integrations/ 3 linux --excluded "$excludes") diff --git a/datadog-agent/int-core-agent_requirements-in.patch b/datadog-agent/int-core-agent_requirements-in.patch index 82016d47ec8..2c404c59820 100644 --- a/datadog-agent/int-core-agent_requirements-in.patch +++ b/datadog-agent/int-core-agent_requirements-in.patch @@ -1,13 +1,13 @@ diff --git a/agent_requirements.in b/agent_requirements.in -index b4c724713e..0713f9b365 100644 +index 859d088..11f529c 100644 --- a/agent_requirements.in +++ b/agent_requirements.in -@@ -66,7 +66,7 @@ semver==3.0.2 +@@ -65,7 +65,7 @@ securesystemslib[crypto,pynacl]==0.28.0 + semver==3.0.2 service-identity[idna]==24.1.0 simplejson==3.19.3 - six==1.16.0 -snowflake-connector-python==3.12.1 +snowflake-connector-python==3.12.3; python_version > '3.0' supervisor==4.2.5 tuf==4.0.0 - uptime==3.0.1 + uptime==3.0.1 \ No newline at end of file