Skip to content

Commit 5e74b0b

Browse files
Merge branch 'master' into andy.anske/ocsf-transformations-zeek
2 parents 29e5c07 + d54c6b8 commit 5e74b0b

4,833 files changed

Lines changed: 514444 additions & 91922 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.builders/build.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import argparse
4+
import json
45
import os
56
import shutil
67
import subprocess
@@ -77,6 +78,8 @@ def build_macos():
7778
help='Path to a folder where things will be installed during builder setup.')
7879
parser.add_argument('--skip-setup', default=False, action='store_true',
7980
help='Skip builder setup, assuming it has already been set up.')
81+
parser.add_argument('--constraints',
82+
help='Path to a pip constraints file for pinning transitive dependency versions.')
8083
args = parser.parse_args()
8184

8285
image: str = args.image
@@ -108,6 +111,11 @@ def build_macos():
108111
shutil.copytree(HERE / 'scripts', mount_dir / 'scripts')
109112
shutil.copytree(HERE / 'patches', mount_dir / 'patches')
110113

114+
if args.constraints:
115+
constraints_path = Path(args.constraints)
116+
if constraints_path.is_file():
117+
shutil.copy(constraints_path, mount_dir / 'constraints.txt')
118+
111119
prefix_path = builder_root / 'prefix'
112120
env = {
113121
**os.environ,
@@ -153,6 +161,10 @@ def build_macos():
153161
final_requirements = mount_dir / 'frozen.txt'
154162
shutil.move(final_requirements, output_dir)
155163

164+
# Move the dependency sizes to the output directory
165+
dependency_sizes_dir = mount_dir / 'sizes.json'
166+
shutil.move(dependency_sizes_dir, output_dir)
167+
156168

157169
def build_image():
158170
parser = argparse.ArgumentParser(prog='builder', allow_abbrev=False)
@@ -163,6 +175,8 @@ def build_image():
163175
parser.add_argument('--no-run', action='store_true')
164176
parser.add_argument('-a', '--build-arg', dest='build_args', nargs='+')
165177
parser.add_argument('-v', '--verbose', action='store_true')
178+
parser.add_argument('--constraints',
179+
help='Path to a pip constraints file for pinning transitive dependency versions.')
166180
args = parser.parse_args()
167181

168182
image: str = args.image
@@ -210,6 +224,11 @@ def build_image():
210224
shutil.copytree(HERE / 'scripts', mount_dir / 'scripts')
211225
shutil.copytree(HERE / 'patches', mount_dir / 'patches')
212226

227+
if args.constraints:
228+
constraints_path = Path(args.constraints)
229+
if constraints_path.is_file():
230+
shutil.copy(constraints_path, mount_dir / 'constraints.txt')
231+
213232
# Create outputs on the host so they can be removed
214233
wheels_dir = mount_dir / 'wheels'
215234
wheels_dir.mkdir()
@@ -246,6 +265,9 @@ def build_image():
246265
# Move the final requirements file to the output directory
247266
shutil.move(final_requirements, output_dir)
248267

268+
# Move the dependency sizes to the output directory
269+
shutil.move(mount_dir / 'sizes.json', output_dir)
270+
249271

250272
def main():
251273
if sys.platform == 'darwin':
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
hatchling==1.21.1
2-
setuptools==75.6.0
2+
hatch-requirements-txt
3+
setuptools==77.0.3
34
wheel==0.38.4
45
setuptools-scm
56
setuptools-rust>=1.7.0
67
maturin
78
cffi>=1.12
8-
cython==3.0.11
9+
cython==3.2.1
910
tomli>=2.0.1

.builders/images/install-from-source.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Optional:
1111
# - CONFIGURE_SCRIPT: Alternative to the default ./configure
1212
# - INSTALL_COMMAND: Specify a command for installation other than the default `make install`
13+
# - PATCHES: Paths to patches to apply, relative to the patches folder
1314

1415
set -euxo pipefail
1516

@@ -23,6 +24,11 @@ curl "${url}" -Lo "${workdir}/${archive_name}"
2324
echo "${SHA256} ${workdir}/${archive_name}" | sha256sum --check
2425
tar -C "${workdir}" -xf "${workdir}/${archive_name}"
2526
pushd "${workdir}/${relative_path}"
27+
28+
for p in ${PATCHES:-}; do
29+
patch -p1 -i "${DD_MOUNT_DIR}/patches/${p}"
30+
done
31+
2632
${CONFIGURE_SCRIPT:-./configure} "$@"
2733
make -j $(nproc)
2834
${INSTALL_COMMAND:-make install}

.builders/images/linux-aarch64/Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ ENV CXXFLAGS="${CFLAGS}"
1616
ENV LDFLAGS="-Wl,-rpath,'\$\$ORIGIN' -Wl,--strip-debug"
1717

1818
# openssl
19-
RUN yum install -y perl-IPC-Cmd perl-CPANPLUS && \
19+
RUN yum install -y perl-IPC-Cmd perl-CPANPLUS perl-core && \
2020
cpanp -i List::Util 1.66 && \
2121
DOWNLOAD_URL="https://www.openssl.org/source/openssl-{{version}}.tar.gz" \
22-
VERSION="3.5.2" \
23-
SHA256="c53a47e5e441c930c3928cf7bf6fb00e5d129b630e0aa873b08258656e7345ec" \
22+
VERSION="3.6.2" \
23+
SHA256="aaf51a1fe064384f811daeaeb4ec4dce7340ec8bd893027eee676af31e83a04f" \
2424
RELATIVE_PATH="openssl-{{version}}" \
2525
# https://docs.python.org/3/using/unix.html#custom-openssl
2626
INSTALL_COMMAND="make install_sw" \
@@ -36,11 +36,11 @@ RUN yum install -y perl-IPC-Cmd perl-CPANPLUS && \
3636
ldconfig
3737

3838
# Compile and install Python 3
39-
ENV PYTHON3_VERSION=3.12.10
39+
ENV PYTHON3_VERSION=3.13.13
4040
RUN yum install -y libffi-devel && \
4141
DOWNLOAD_URL="https://python.org/ftp/python/{{version}}/Python-{{version}}.tgz" \
4242
VERSION="${PYTHON3_VERSION}" \
43-
SHA256="15d9c623abfd2165fe816ea1fb385d6ed8cf3c664661ab357f1782e3036a6dac" \
43+
SHA256="f9cde7b0e2ec8165d7326e2a0f59ea2686ce9d0c617dbbb3d66a7e54d31b74b9" \
4444
RELATIVE_PATH="Python-{{version}}" \
4545
bash install-from-source.sh \
4646
--prefix=/opt/python/${PYTHON3_VERSION} \
@@ -110,7 +110,7 @@ RUN yum install -y flex && \
110110
VERSION="16.9" \
111111
SHA256="07c00fb824df0a0c295f249f44691b86e3266753b380c96f633c3311e10bd005" \
112112
RELATIVE_PATH="postgresql-{{version}}" \
113-
bash install-from-source.sh --without-readline --with-openssl --without-icu
113+
bash install-from-source.sh --without-readline --with-openssl --without-icu --with-gssapi
114114
# Add paths to pg_config and to the library
115115
ENV PATH="/usr/local/pgsql/bin:${PATH}"
116116
ENV LD_LIBRARY_PATH="/usr/local/pgsql/lib/:${LD_LIBRARY_PATH}"
@@ -125,6 +125,9 @@ RUN \
125125
# This is the folder where unixODBC searches for driver config and where we ask customers to copy their config to
126126
--sysconfdir=/opt/datadog-agent/embedded/etc
127127

128+
# zstd for librdkafka compression support
129+
RUN yum install -y epel-release && yum install -y libzstd-devel
130+
128131
# Dependencies needed to build librdkafka (and thus, confluent-kafka) with kerberos support
129132
RUN \
130133
DOWNLOAD_URL="https://github.com/LMDB/lmdb/archive/LMDB_{{version}}.tar.gz" \
@@ -154,8 +157,8 @@ RUN \
154157
# curl
155158
RUN \
156159
DOWNLOAD_URL="https://curl.haxx.se/download/curl-{{version}}.tar.gz" \
157-
VERSION="8.16.0" \
158-
SHA256="a21e20476e39eca5a4fc5cfb00acf84bbc1f5d8443ec3853ad14c26b3c85b970" \
160+
VERSION="8.19.0" \
161+
SHA256="2a2c11db4c122691aa23b4363befda1bfd801770bfebf41e1d21cee4f2ab0f71" \
159162
RELATIVE_PATH="curl-{{version}}" \
160163
bash install-from-source.sh \
161164
--disable-manual \

.builders/images/linux-aarch64/build_script.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ if [[ "${DD_BUILD_PYTHON_VERSION}" == "3" ]]; then
2121
LDFLAGS="${LDFLAGS} -L/usr/local/lib -lkrb5 -lgssapi_krb5 -llmdb" \
2222
DOWNLOAD_URL="https://github.com/confluentinc/librdkafka/archive/refs/tags/v{{version}}.tar.gz" \
2323
VERSION="${kafka_version}" \
24-
SHA256="a2c87186b081e2705bb7d5338d5a01bc88d43273619b372ccb7bb0d264d0ca9f" \
24+
SHA256="14972092e4115f6e99f798a7cb420cbf6daa0c73502b3c52ae42fb5b418eea8f" \
2525
RELATIVE_PATH="librdkafka-{{version}}" \
26-
bash install-from-source.sh --enable-sasl --enable-curl
26+
PATCHES="librdkafka-fix-coord-request-uaf.patch" \
27+
bash install-from-source.sh --enable-sasl --enable-curl --enable-zstd
2728
always_build+=("confluent-kafka")
2829

2930
# The version of pyodbc is dynamically linked against a version of the odbc which doesn't come included in the wheel

.builders/images/linux-x86_64/Dockerfile

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ ENV CXXFLAGS="${CFLAGS}"
1616
ENV LDFLAGS="-Wl,-rpath,'\$\$ORIGIN' -Wl,--strip-debug"
1717

1818
# openssl
19-
RUN yum install -y perl-IPC-Cmd perl-CPANPLUS && \
19+
RUN yum install -y perl-IPC-Cmd perl-CPANPLUS perl-core && \
2020
cpanp -i List::Util 1.66 && \
2121
DOWNLOAD_URL="https://www.openssl.org/source/openssl-{{version}}.tar.gz" \
22-
VERSION="3.5.2" \
23-
SHA256="c53a47e5e441c930c3928cf7bf6fb00e5d129b630e0aa873b08258656e7345ec" \
22+
VERSION="3.6.2" \
23+
SHA256="aaf51a1fe064384f811daeaeb4ec4dce7340ec8bd893027eee676af31e83a04f" \
2424
RELATIVE_PATH="openssl-{{version}}" \
2525
# https://docs.python.org/3/using/unix.html#custom-openssl
2626
INSTALL_COMMAND="make install_sw" \
@@ -35,11 +35,11 @@ RUN yum install -y perl-IPC-Cmd perl-CPANPLUS && \
3535
ldconfig
3636

3737
# Compile and install Python 3
38-
ENV PYTHON3_VERSION=3.12.10
38+
ENV PYTHON3_VERSION=3.13.13
3939
RUN yum install -y libffi-devel && \
4040
DOWNLOAD_URL="https://python.org/ftp/python/{{version}}/Python-{{version}}.tgz" \
4141
VERSION="${PYTHON3_VERSION}" \
42-
SHA256="15d9c623abfd2165fe816ea1fb385d6ed8cf3c664661ab357f1782e3036a6dac" \
42+
SHA256="f9cde7b0e2ec8165d7326e2a0f59ea2686ce9d0c617dbbb3d66a7e54d31b74b9" \
4343
RELATIVE_PATH="Python-{{version}}" \
4444
bash install-from-source.sh --prefix=/opt/python/${PYTHON3_VERSION} --with-ensurepip=yes --enable-ipv6 --with-dbmliborder=
4545
ENV PATH="/opt/python/${PYTHON3_VERSION}/bin:${PATH}"
@@ -114,7 +114,7 @@ RUN yum install -y flex && \
114114
VERSION="16.9" \
115115
SHA256="07c00fb824df0a0c295f249f44691b86e3266753b380c96f633c3311e10bd005" \
116116
RELATIVE_PATH="postgresql-{{version}}" \
117-
bash install-from-source.sh --without-readline --with-openssl --without-icu
117+
bash install-from-source.sh --without-readline --with-openssl --without-icu --with-gssapi
118118
# Add paths to pg_config and to the library
119119
ENV PATH="/usr/local/pgsql/bin:${PATH}"
120120
ENV LD_LIBRARY_PATH="/usr/local/pgsql/lib/:${LD_LIBRARY_PATH}"
@@ -129,6 +129,9 @@ RUN \
129129
# This is the folder where unixODBC searches for driver config and where we ask customers to copy their config to
130130
--sysconfdir=/opt/datadog-agent/embedded/etc
131131

132+
# zstd for librdkafka compression support
133+
RUN yum install -y epel-release && yum install -y libzstd-devel
134+
132135
# Dependencies needed to build librdkafka (and thus, confluent-kafka) with kerberos support
133136
RUN \
134137
DOWNLOAD_URL="https://github.com/LMDB/lmdb/archive/LMDB_{{version}}.tar.gz" \
@@ -158,8 +161,8 @@ RUN \
158161
# curl
159162
RUN \
160163
DOWNLOAD_URL="https://curl.haxx.se/download/curl-{{version}}.tar.gz" \
161-
VERSION="8.16.0" \
162-
SHA256="a21e20476e39eca5a4fc5cfb00acf84bbc1f5d8443ec3853ad14c26b3c85b970" \
164+
VERSION="8.19.0" \
165+
SHA256="2a2c11db4c122691aa23b4363befda1bfd801770bfebf41e1d21cee4f2ab0f71" \
163166
RELATIVE_PATH="curl-{{version}}" \
164167
bash install-from-source.sh \
165168
--disable-manual \

.builders/images/linux-x86_64/build_script.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ if [[ "${DD_BUILD_PYTHON_VERSION}" == "3" ]]; then
1818
LDFLAGS="${LDFLAGS} -L/usr/local/lib -lkrb5 -lgssapi_krb5 -llmdb" \
1919
DOWNLOAD_URL="https://github.com/confluentinc/librdkafka/archive/refs/tags/v{{version}}.tar.gz" \
2020
VERSION="${kafka_version}" \
21-
SHA256="a2c87186b081e2705bb7d5338d5a01bc88d43273619b372ccb7bb0d264d0ca9f" \
21+
SHA256="14972092e4115f6e99f798a7cb420cbf6daa0c73502b3c52ae42fb5b418eea8f" \
2222
RELATIVE_PATH="librdkafka-{{version}}" \
23-
bash install-from-source.sh --enable-sasl --enable-curl
23+
PATCHES="librdkafka-fix-coord-request-uaf.patch" \
24+
bash install-from-source.sh --enable-sasl --enable-curl --enable-zstd
2425
always_build+=("confluent-kafka")
2526

2627
# The version of pyodbc is dynamically linked against a version of the odbc which doesn't come included in the wheel

.builders/images/macos/builder_setup.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
set -euxo pipefail
44

5-
"${DD_PYTHON3}" -m pip install --no-warn-script-location --upgrade pip
65
"${DD_PYTHON3}" -m pip install --no-warn-script-location virtualenv
76
"${DD_PYTHON3}" -m virtualenv py3
87

@@ -23,8 +22,8 @@ cp -R /opt/mqm "${DD_PREFIX_PATH}"
2322

2423
# openssl
2524
DOWNLOAD_URL="https://www.openssl.org/source/openssl-{{version}}.tar.gz" \
26-
VERSION="3.5.2" \
27-
SHA256="c53a47e5e441c930c3928cf7bf6fb00e5d129b630e0aa873b08258656e7345ec" \
25+
VERSION="3.6.2" \
26+
SHA256="aaf51a1fe064384f811daeaeb4ec4dce7340ec8bd893027eee676af31e83a04f" \
2827
RELATIVE_PATH="openssl-{{version}}" \
2928
CONFIGURE_SCRIPT="./config" \
3029
install-from-source \
@@ -71,8 +70,8 @@ RELATIVE_PATH="libxslt-{{version}}" \
7170

7271
# curl
7372
DOWNLOAD_URL="https://curl.haxx.se/download/curl-{{version}}.tar.gz" \
74-
VERSION="8.16.0" \
75-
SHA256="a21e20476e39eca5a4fc5cfb00acf84bbc1f5d8443ec3853ad14c26b3c85b970" \
73+
VERSION="8.19.0" \
74+
SHA256="2a2c11db4c122691aa23b4363befda1bfd801770bfebf41e1d21cee4f2ab0f71" \
7675
RELATIVE_PATH="curl-{{version}}" \
7776
install-from-source \
7877
--disable-manual \
@@ -103,6 +102,18 @@ RELATIVE_PATH="postgresql-{{version}}" \
103102
# Add paths to pg_config and to the library
104103
echo PATH="${DD_PREFIX_PATH}/bin:${PATH:-}" >> "$DD_ENV_FILE"
105104

105+
# zstd for librdkafka compression support
106+
# Keep version in sync with github.com/DataDog/datadog-agent/deps/repos.MODULE.bazel
107+
DOWNLOAD_URL="https://github.com/facebook/zstd/releases/download/v{{version}}/zstd-{{version}}.tar.gz" \
108+
VERSION="1.5.7" \
109+
SHA256="eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3" \
110+
RELATIVE_PATH="zstd-{{version}}" \
111+
CONFIGURE_SCRIPT="true" \
112+
INSTALL_COMMAND="make prefix=${DD_PREFIX_PATH} install" \
113+
install-from-source
114+
# Fix install name so delocate can bundle it from the correct path
115+
install_name_tool -id "${DD_PREFIX_PATH}/lib/libzstd.1.dylib" "${DD_PREFIX_PATH}/lib/libzstd.1.dylib"
116+
106117
# Dependencies needed to build librdkafka (and thus, confluent-kafka) with kerberos support
107118
DOWNLOAD_URL="https://github.com/LMDB/lmdb/archive/LMDB_{{version}}.tar.gz" \
108119
VERSION="0.9.29" \

.builders/images/macos/extra_build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ if [[ "${DD_BUILD_PYTHON_VERSION}" == "3" ]]; then
1313
LDFLAGS="${LDFLAGS} -L${DD_PREFIX_PATH}/lib -lgssapi_krb5 -llmdb" \
1414
DOWNLOAD_URL="https://github.com/confluentinc/librdkafka/archive/refs/tags/v{{version}}.tar.gz" \
1515
VERSION="${kafka_version}" \
16-
SHA256="a2c87186b081e2705bb7d5338d5a01bc88d43273619b372ccb7bb0d264d0ca9f" \
16+
SHA256="14972092e4115f6e99f798a7cb420cbf6daa0c73502b3c52ae42fb5b418eea8f" \
1717
RELATIVE_PATH="librdkafka-{{version}}" \
18-
bash install-from-source.sh --prefix="${DD_PREFIX_PATH}" --enable-sasl --enable-curl
18+
bash install-from-source.sh --prefix="${DD_PREFIX_PATH}" --enable-sasl --enable-curl --enable-zstd
1919

2020
# lmdb doesnt't get the actual full path in its install name which means delocate won't find it
2121
# Luckily we can patch it here so that it does.
22-
install_name_tool -change liblmdb.so "${DD_PREFIX_PATH}/lib/liblmdb.so" "${DD_PREFIX_PATH}/lib//librdkafka.1.dylib"
22+
install_name_tool -change liblmdb.so "${DD_PREFIX_PATH}/lib/liblmdb.so" "${DD_PREFIX_PATH}/lib/librdkafka.1.dylib"
23+
install_name_tool -change /usr/local/lib/libzstd.1.dylib "${DD_PREFIX_PATH}/lib/libzstd.1.dylib" "${DD_PREFIX_PATH}/lib/librdkafka.1.dylib"
2324
always_build+=("confluent-kafka")
2425
fi
2526

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
python-dotenv==1.0.0
2-
urllib3==2.2.0
2+
urllib3==2.6.3
33
auditwheel==6.0.0; sys_platform == 'linux'
44
delvewheel==1.5.2; sys_platform == 'win32'
55
delocate==0.13.0; sys_platform == 'darwin'
6+
wheel==0.46.2
7+
packaging>=20.9 # Required by wheel>=0.46.0 (de-vendored)
8+
pathspec==0.12.1

0 commit comments

Comments
 (0)