Skip to content

Commit

Permalink
remove kerberos builds steps from integration build images
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Neale committed Sep 16, 2024
1 parent 333a5ec commit 3d60c24
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 114 deletions.
26 changes: 0 additions & 26 deletions .builders/images/linux-aarch64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -129,32 +129,6 @@ RUN \
# This is the folder where unixODBC searches for driver config and where we ask customers to copy their config to
--sysconfdir=/opt/datadog-agent/embedded/etc

# Dependencies needed to build librdkafka (and thus, confluent-kafka) with kerberos support
RUN \
DOWNLOAD_URL="https://github.com/LMDB/lmdb/archive/LMDB_{{version}}.tar.gz" \
VERSION="0.9.29" \
SHA256="22054926b426c66d8f2bc22071365df6e35f3aacf19ad943bc6167d4cae3bebb" \
RELATIVE_PATH="lmdb-LMDB_{{version}}/libraries/liblmdb" \
# No ./configure, use a NOOP
CONFIGURE_SCRIPT="true" \
bash install-from-source.sh
RUN \
DOWNLOAD_URL="https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v{{version}}/e2fsprogs-{{version}}.tar.gz" \
VERSION="1.47.0" \
SHA256="0b4fe723d779b0927fb83c9ae709bc7b40f66d7df36433bef143e41c54257084" \
RELATIVE_PATH="e2fsprogs-{{version}}" \
bash install-from-source.sh --enable-elf-shlibs
RUN \
# Add -fPIC to let librdkafka link against it statically
CFLAGS="${CFLAGS} -fPIC" \
# Explicitly ask the linker to use gssapi_krb5, otherwise static compilation fails
LDFLAGS="${LDFLAGS} -L/usr/local/lib -lgssapi_krb5" \
DOWNLOAD_URL="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-{{version}}/cyrus-sasl-{{version}}.tar.gz" \
VERSION="2.1.28" \
SHA256="7ccfc6abd01ed67c1a0924b353e526f1b766b21f42d4562ee635a8ebfc5bb38c" \
RELATIVE_PATH="cyrus-sasl-{{version}}" \
bash install-from-source.sh --with-dblib=lmdb --enable-gssapi=/usr/local \
--enable-static --disable-shared
# curl
RUN \
DOWNLOAD_URL="https://curl.haxx.se/download/curl-{{version}}.tar.gz" \
Expand Down
13 changes: 0 additions & 13 deletions .builders/images/linux-aarch64/build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@ sed -i '/pymqi==/d' /home/requirements.in
always_build=()

if [[ "${DD_BUILD_PYTHON_VERSION}" == "3" ]]; then
# confluent-kafka and librdkafka need to be compiled from source to get kerberos support
# The librdkafka version needs to stay in sync with the confluent-kafka version,
# thus we extract the version from the requirements file.
kafka_version=$(grep 'confluent-kafka==' /home/requirements.in | sed -E 's/^.*([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+).*$/\1/')
# Libraries need to be explicitly specified for static linking to work properly
LDFLAGS="${LDFLAGS} -L/usr/local/lib -lkrb5 -lgssapi_krb5 -llmdb" \
DOWNLOAD_URL="https://github.com/confluentinc/librdkafka/archive/refs/tags/v{{version}}.tar.gz" \
VERSION="${kafka_version}" \
SHA256="3dc62de731fd516dfb1032861d9a580d4d0b5b0856beb0f185d06df8e6c26259" \
RELATIVE_PATH="librdkafka-{{version}}" \
bash install-from-source.sh --enable-sasl --enable-curl
always_build+=("confluent-kafka")

# The version of pyodbc is dynamically linked against a version of the odbc which doesn't come included in the wheel
# That causes the omnibus' health check to flag it. Forcing the build so that we do include it in the wheel.
always_build+=("pyodbc")
Expand Down
26 changes: 0 additions & 26 deletions .builders/images/linux-x86_64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,32 +102,6 @@ RUN \
# This is the folder where unixODBC searches for driver config and where we ask customers to copy their config to
--sysconfdir=/opt/datadog-agent/embedded/etc

# Dependencies needed to build librdkafka (and thus, confluent-kafka) with kerberos support
RUN \
DOWNLOAD_URL="https://github.com/LMDB/lmdb/archive/LMDB_{{version}}.tar.gz" \
VERSION="0.9.29" \
SHA256="22054926b426c66d8f2bc22071365df6e35f3aacf19ad943bc6167d4cae3bebb" \
RELATIVE_PATH="lmdb-LMDB_{{version}}/libraries/liblmdb" \
# No ./configure, use a NOOP
CONFIGURE_SCRIPT="true" \
bash install-from-source.sh
RUN \
DOWNLOAD_URL="https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v{{version}}/e2fsprogs-{{version}}.tar.gz" \
VERSION="1.47.0" \
SHA256="0b4fe723d779b0927fb83c9ae709bc7b40f66d7df36433bef143e41c54257084" \
RELATIVE_PATH="e2fsprogs-{{version}}" \
bash install-from-source.sh --enable-elf-shlibs
RUN \
# Add -fPIC to let librdkafka link against it statically
CFLAGS="${CFLAGS} -fPIC" \
# Explicitly ask the linker to use gssapi_krb5, otherwise static compilation fails
LDFLAGS="${LDFLAGS} -L/usr/local/lib -lgssapi_krb5" \
DOWNLOAD_URL="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-{{version}}/cyrus-sasl-{{version}}.tar.gz" \
VERSION="2.1.28" \
SHA256="7ccfc6abd01ed67c1a0924b353e526f1b766b21f42d4562ee635a8ebfc5bb38c" \
RELATIVE_PATH="cyrus-sasl-{{version}}" \
bash install-from-source.sh --with-dblib=lmdb --enable-gssapi=/usr/local \
--enable-static --disable-shared
# curl
RUN \
DOWNLOAD_URL="https://curl.haxx.se/download/curl-{{version}}.tar.gz" \
Expand Down
13 changes: 0 additions & 13 deletions .builders/images/linux-x86_64/build_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ build_wheels() {
always_build=()

if [[ "${DD_BUILD_PYTHON_VERSION}" == "3" ]]; then
# confluent-kafka and librdkafka need to be compiled from source to get kerberos support
# The librdkafka version needs to stay in sync with the confluent-kafka version,
# thus we extract the version from the requirements file.
kafka_version=$(grep 'confluent-kafka==' /home/requirements.in | sed -E 's/^.*([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+).*$/\1/')
# Libraries need to be explicitly specified for static linking to work properly
LDFLAGS="${LDFLAGS} -L/usr/local/lib -lkrb5 -lgssapi_krb5 -llmdb" \
DOWNLOAD_URL="https://github.com/confluentinc/librdkafka/archive/refs/tags/v{{version}}.tar.gz" \
VERSION="${kafka_version}" \
SHA256="3dc62de731fd516dfb1032861d9a580d4d0b5b0856beb0f185d06df8e6c26259" \
RELATIVE_PATH="librdkafka-{{version}}" \
bash install-from-source.sh --enable-sasl --enable-curl
always_build+=("confluent-kafka")

# The version of pyodbc is dynamically linked against a version of the odbc which doesn't come included in the wheel
# That causes the omnibus' health check to flag it. Forcing the build so that we do include it in the wheel.
always_build+=("pyodbc")
Expand Down
18 changes: 0 additions & 18 deletions .builders/images/macos-x86_64/builder_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,3 @@ RELATIVE_PATH="curl-{{version}}" \
# Remove the binary installed so that we consistenly use the same original `curl` binary
rm "${DD_PREFIX_PATH}/bin/curl"

# Dependencies needed to build librdkafka (and thus, confluent-kafka) with kerberos support
DOWNLOAD_URL="https://github.com/LMDB/lmdb/archive/LMDB_{{version}}.tar.gz" \
VERSION="0.9.29" \
SHA256="22054926b426c66d8f2bc22071365df6e35f3aacf19ad943bc6167d4cae3bebb" \
RELATIVE_PATH="lmdb-LMDB_{{version}}/libraries/liblmdb" \
CONFIGURE_SCRIPT="true" \
INSTALL_COMMAND="make prefix=${DD_PREFIX_PATH} install" \
XCFLAGS=${CFLAGS} \
install-from-source
# CFLAGS and LDFLAGS add compiler and linker flags to make static compilation work
CFLAGS="${CFLAGS} -fPIC" \
LDFLAGS="${LDFLAGS} -L${DD_PREFIX_PATH}/lib -lgssapi_krb5" \
DOWNLOAD_URL="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-{{version}}/cyrus-sasl-{{version}}.tar.gz" \
VERSION="2.1.28" \
SHA256="7ccfc6abd01ed67c1a0924b353e526f1b766b21f42d4562ee635a8ebfc5bb38c" \
RELATIVE_PATH="cyrus-sasl-{{version}}" \
install-from-source --with-dblib=lmdb --enable-gssapi="${DD_PREFIX_PATH}" --disable-macos-framework \
--enable-static --disable-shared
18 changes: 0 additions & 18 deletions .builders/images/macos-x86_64/extra_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,6 @@ set -exu
# Packages which must be built from source
always_build=()

if [[ "${DD_BUILD_PYTHON_VERSION}" == "3" ]]; then
# confluent-kafka and librdkafka need to be compiled from source to get kerberos support
# The librdkafka version needs to stay in sync with the confluent-kafka version,
# thus we extract the version from the requirements file.
kafka_version=$(grep 'confluent-kafka==' "${DD_MOUNT_DIR}/requirements.in" | sed -E 's/^.*([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+).*$/\1/')
LDFLAGS="${LDFLAGS} -L${DD_PREFIX_PATH}/lib -lgssapi_krb5 -llmdb" \
DOWNLOAD_URL="https://github.com/confluentinc/librdkafka/archive/refs/tags/v{{version}}.tar.gz" \
VERSION="${kafka_version}" \
SHA256="3dc62de731fd516dfb1032861d9a580d4d0b5b0856beb0f185d06df8e6c26259" \
RELATIVE_PATH="librdkafka-{{version}}" \
bash install-from-source.sh --prefix="${DD_PREFIX_PATH}" --enable-sasl --enable-curl

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

# Make sure IBM MQ libraries are found under /opt/mqm even when we're using the builder cache
sudo cp -Rf "${DD_PREFIX_PATH}/mqm" /opt

Expand Down

0 comments on commit 3d60c24

Please sign in to comment.