Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ARG COLLECTOR_BUILDER_DEBUG

USER root

ENV OUTPUT_DIR=/tmp/output

RUN dnf -y update \
&& dnf -y install --nobest \
autoconf \
Expand Down Expand Up @@ -53,8 +55,9 @@ WORKDIR ${BUILD_DIR}
COPY install builder/install
COPY third_party third_party

RUN "builder/install/install-dependencies.sh" && if [ -z "${COLLECTOR_BUILDER_DEBUG}" ]; then rm -rf ${BUILD_DIR}; fi
RUN echo -e '/usr/local/lib\n/usr/local/lib64' > /etc/ld.so.conf.d/usrlocallib.conf && ldconfig
RUN --mount=type=cache,target=${OUTPUT_DIR} \
"builder/install/install-dependencies.sh" \
&& if [ -z "${COLLECTOR_BUILDER_DEBUG}" ]; then rm -rf ${BUILD_DIR}; fi

# Create directory to copy collector source into builder container
RUN mkdir /src && chmod a+rwx /src
12 changes: 4 additions & 8 deletions builder/install/05-abseil.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
#!/usr/bin/env bash

set -e
set -eu

source builder/install/cmake.sh

cd third_party/abseil-cpp

cp LICENSE "${LICENSE_DIR}/Abseil-${ABSEIL_VERSION}"

mkdir cmake-build
cd cmake-build
cmake .. \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
-DCMAKE_INSTALL_PREFIX=/usr/local \
cmake_wrap "abseil-cpp" "${OUTPUT_DIR}" \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_CXX_STANDARD=17 \
-DABSL_PROPAGATE_CXX_STD=ON

cmake --build . --target install ${NPROCS:+-j ${NPROCS}}
10 changes: 4 additions & 6 deletions builder/install/10-protobuf.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#!/usr/bin/env bash

set -e
set -eu

source builder/install/cmake.sh

cd third_party/protobuf
cp LICENSE "${LICENSE_DIR}/protobuf-${PROTOBUF_VERSION}"

mkdir -p cmake-build && cd cmake-build
cmake -S ../ \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
-DCMAKE_INSTALL_PREFIX=/usr/local \
cmake_wrap "protobuf" "${OUTPUT_DIR}" \
-DBUILD_SHARED_LIBS=OFF \
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_ABSL_PROVIDER=package
cmake --build . --target install ${NPROCS:+-j ${NPROCS}}
8 changes: 4 additions & 4 deletions builder/install/10-yaml-cpp.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env bash

set -e
set -eu

source builder/install/cmake.sh

cd third_party/yaml-cpp
cp LICENSE "${LICENSE_DIR}/yaml-cpp-${YAMLCPP_VERSION}"

cmake -B build/ \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
cmake_wrap "yaml-cpp" "${OUTPUT_DIR}" \
-DYAML_CPP_BUILD_CONTRIB=OFF \
-DYAML_CPP_BUILD_TOOLS=OFF \
-DYAML_BUILD_SHARED_LIBS=OFF \
-DYAML_CPP_INSTALL=ON
cmake --build build --target install ${NPROCS:+-j ${NPROCS}}
10 changes: 5 additions & 5 deletions builder/install/20-googletest.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash

set -e
set -eu

source builder/install/cmake.sh

cd third_party/googletest
cp LICENSE "${LICENSE_DIR}/googletest-${GOOGLETEST_REVISION}"
mkdir cmake-build
cd cmake-build
cmake -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build . --target install ${NPROCS:+-j ${NPROCS}}

cmake_wrap "googletest" "${OUTPUT_DIR}"
15 changes: 6 additions & 9 deletions builder/install/30-cares.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
#!/usr/bin/env bash

set -e
set -eu

if [ -n "${WITH_RHEL_RPMS}" ]; then
if [ -n "${WITH_RHEL_RPMS:-}" ]; then
# Already installed as an RPM, nothing more to do.
exit 0
fi

source builder/install/cmake.sh

cd third_party/c-ares
cp LICENSE.md "${LICENSE_DIR}/c-ares-${CARES_VERSION}"

mkdir cmake-build
cd cmake-build
cmake -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
cmake_wrap "c-ares" "${OUTPUT_DIR}" \
-DCARES_INSTALL=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCARES_SHARED=OFF \
-DCARES_STATIC=ON \
-DCARES_STATIC_PIC=ON \
-DCARES_BUILD_TOOLS=OFF \
..
cmake --build . --target install ${NPROCS:+-j ${NPROCS}}
-DCARES_BUILD_TOOLS=OFF
10 changes: 4 additions & 6 deletions builder/install/35-re2.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#!/usr/bin/env bash

set -e
set -eu

source builder/install/cmake.sh

cd third_party/re2

cp LICENSE "${LICENSE_DIR}/re2-${RE2_VERSION}"

mkdir cmake-build && cd cmake-build
cmake .. \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
-DCMAKE_INSTALL_PREFIX=/usr/local \
cmake_wrap "re2" "${OUTPUT_DIR}" \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_SHARED_LIBS=OFF
cmake --build . --target install ${NPROCS:+-j ${NPROCS}}
13 changes: 5 additions & 8 deletions builder/install/40-civetweb.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
#!/usr/bin/env bash

set -e
set -eu

source builder/install/cmake.sh

cd third_party/civetweb

cp LICENSE.md "${LICENSE_DIR}/CivetWeb-${CIVETWEB_VERSION}"

mkdir cmake-build
cd cmake-build
cmake -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
-DCMAKE_INSTALL_PREFIX=/usr/local \
cmake_wrap "civetweb" "${OUTPUT_DIR}" \
-DCIVETWEB_ENABLE_CXX=ON \
-DBUILD_SHARED_LIBS:BOOL=NO \
-DCIVETWEB_BUILD_TESTING=NO \
-DCIVETWEB_ENABLE_IPV6=NO \
-DCIVETWEB_ENABLE_SERVER_EXECUTABLE=NO \
..
cmake --build . --target install ${NPROCS:+-j ${NPROCS}}
-DCIVETWEB_ENABLE_SERVER_EXECUTABLE=NO
17 changes: 6 additions & 11 deletions builder/install/40-grpc.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/usr/bin/env bash

set -e
set -eu

source builder/install/cmake.sh

export CXXFLAGS="-Wno-error=class-memaccess -Wno-ignored-qualifiers -Wno-stringop-truncation -Wno-cast-function-type -Wno-attributes"

cd third_party/grpc

cp NOTICE.txt "${LICENSE_DIR}/grpc-${GRPC_REVISION}"
mkdir -p cmake/build
cd cmake/build
cmake \

cmake_wrap "grpc" "${OUTPUT_DIR}" \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG \
-DgRPC_ZLIB_PROVIDER=package \
Expand All @@ -23,12 +24,6 @@ cmake \
-DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
-DgRPC_DOWNLOAD_ARCHIVES=OFF \
-DgRPC_INSTALL=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_CXX_STANDARD=17 \
../..

make ${NPROCS:+-j ${NPROCS}}
make install
-DCMAKE_CXX_STANDARD=17
11 changes: 6 additions & 5 deletions builder/install/50-prometheus.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env bash

set -e
set -eu

source builder/install/cmake.sh

cd third_party/prometheus-cpp

cat LICENSE > "${LICENSE_DIR}/prometheus-${PROMETHEUS_CPP_REVISION}"

mkdir cmake-build
cd cmake-build
cmake -DENABLE_TESTING=OFF -DUSE_THIRDPARTY_LIBRARIES=NO -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" ../
cmake --build . --target install ${NPROCS:+-j ${NPROCS}}
cmake_wrap "prometheus" "${OUTPUT_DIR}" \
-DENABLE_TESTING=OFF \
-DUSE_THIRDPARTY_LIBRARIES=NO
13 changes: 5 additions & 8 deletions builder/install/60-jsoncpp.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
#!/usr/bin/env bash

set -e
set -eu

source builder/install/cmake.sh

cd third_party/jsoncpp

cp LICENSE "${LICENSE_DIR}/jsoncpp-${JSONCPP_REVISION}"

mkdir cmake-build
cd cmake-build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
cmake_wrap "jsoncpp" "${OUTPUT_DIR}" \
-DCMAKE_CXX_FLAGS=-fPIC \
-DJSONCPP_WITH_TESTS=OFF \
-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_OBJECT_LIBS=OFF \
..
cmake --build . --target install ${NPROCS:+-j ${NPROCS}}
-DBUILD_OBJECT_LIBS=OFF
12 changes: 6 additions & 6 deletions builder/install/60-tbb.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/usr/bin/env bash

set -e
set -eu

if [ -n "${WITH_RHEL_RPMS}" ]; then
if [ -n "${WITH_RHEL_RPMS:-}" ]; then
# Already installed as an RPM, nothing more to do.
exit 0
fi

source builder/install/cmake.sh

cd third_party/tbb
cp LICENSE.txt "${LICENSE_DIR}/tbb-${TBB_VERSION}"
cmake -B cmake-build -S . \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
-DCMAKE_INSTALL_PREFIX=/usr/local \

cmake_wrap "tbb" "${OUTPUT_DIR}" \
-DBUILD_SHARED_LIBS=OFF \
-DTBB_TEST=OFF \
-DTBBMALLOC_BUILD=OFF
cmake --build cmake-build --target install ${NPROCS:+-j ${NPROCS}}
10 changes: 4 additions & 6 deletions builder/install/70-valijson.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/usr/bin/env bash

set -e
set -eu

source builder/install/cmake.sh
cd third_party/valijson
cp LICENSE "${LICENSE_DIR}/valijson-${VALIJSON_VERSION}"

mkdir cmake-build && cd cmake-build
cmake \
cmake_wrap "valijson" "${OUTPUT_DIR}" \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-Dvalijson_BUILD_TESTS=OFF \
..
cmake --build . --target install ${NPROCS:+-j ${NPROCS}}
-Dvalijson_BUILD_TESTS=OFF
8 changes: 5 additions & 3 deletions builder/install/80-libbpf.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env bash

set -e
set -eu

cd third_party/libbpf

cp LICENSE "${LICENSE_DIR}/libbpf-${LIBBPF_VERSION}"

mkdir src/build
make BUILD_STATIC_ONLY=y OBJDIR=build "LDFLAGS=-Wl,-Bstatic" "CFLAGS=-fPIC ${EXTRA_CFLAGS_DEBUG}" \
LIBBPF_OUTPUT="${OUTPUT_DIR}/libbpf"
mkdir -p "${LIBBPF_OUTPUT}"

make BUILD_STATIC_ONLY=y OBJDIR="${LIBBPF_OUTPUT}" "LDFLAGS=-Wl,-Bstatic" "CFLAGS=-fPIC ${EXTRA_CFLAGS_DEBUG:-}" \
${NPROCS:+-j ${NPROCS}} -C src install install_uapi_headers
16 changes: 16 additions & 0 deletions builder/install/cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

function cmake_wrap() {
set -x
PKG_NAME="$1"
shift
OUTPUT_DIR="$1/${PKG_NAME}"
shift

mkdir -p "${OUTPUT_DIR}"
cmake -S . -B "${OUTPUT_DIR}" \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
-DCMAKE_INSTALL_PREFIX=/usr/local \
"$@"
cmake --build "${OUTPUT_DIR}" --target install ${NPROCS:+-j ${NPROCS}}
}
2 changes: 2 additions & 0 deletions collector/container/konflux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ ARG USE_VALGRIND=false
ARG ADDRESS_SANITIZER=false
ARG TRACE_SINSP_EVENTS=false

ENV OUTPUT_DIR=/tmp/output

WORKDIR ${BUILD_DIR}

RUN mkdir kernel-modules \
Expand Down
Loading