Describe the bug
Currently sf-collector could not compile sysdig probe ko correctly due to lack of necessary sources even when kernel development packages installed on host.
For RHEL 7.8 host, the kernel version is 3.10.0-1127, thus sysdig probe compilation process must lookup /lib/modules/$(uname -r)/{build,source} for module building. Host provides module-related files by mounting /lib/modules to guest's /host/lib/modules; however, /lib/modules/$(uname -r)/build is a soft link to /usr/src/linux-headers-$(uname -r)/, which does not exists on guest container (since it is build from RHEL 8.1 with kernel 4.1 sources installed)
To reproduce
Steps to reproduce the behavior:
on RHEL 7.8 host, and make sure kernel source 3.10.0-1127 is installed
Launch sf-collector (see below)
sf-collector try to compile kernel module, but cannot fetch proper sources from /lib/modules/<kernel_version>/{build,source} :
$ docker run \
-e EXPORTER_ID=local \
-e FILTER='container.name!=sf-collector and container.name!=sf-exporter' \
-e INTERVAL=60 \
-e OUTPUT=/mnt/data/ \
-v /var/run/docker.sock:/host/var/run/docker.sock \
-v /dev:/host/dev \
-v /proc:/host/proc:ro \
-v /boot:/host/boot:ro \
-v /lib/modules:/host/lib/modules:ro \
-v /usr:/host/usr:ro \
-v/mnt/data:/mnt/data \
sysflowtelemetry/sf-collector:latest
* Setting up /usr/src links from host
* Unloading sysdig-probe, if present
* Running dkms install for sysdig
Creating symlink /var/lib/dkms/sysdig/0.26.4/source ->
/usr/src/sysdig-0.26.4
DKMS: add completed.
Error! echo
Your kernel headers for kernel 3.10.0-1127.el7.x86_64 cannot be found at
/lib/modules/3.10.0-1127.el7.x86_64/build or /lib/modules/3.10.0-1127.el7.x86_64/source.
* Running dkms build failed, couldn't find /var/lib/dkms/sysdig/0.26.4/build/make.log
* Trying to load a system sysdig-probe, if present
* Trying to find precompiled sysdig-probe for 3.10.0-1127.el7.x86_64
Found kernel config at /boot/config-3.10.0-1127.el7.x86_64
* Trying to download precompiled module from https://s3.amazonaws.com/download.draios.com/stable/sysdig-probe-binaries/sysdig-probe-0.26.4-x86_64-3.10.0-1127.el7.x86_64-5223157266b9a46702625b834cadc6ab.ko
curl: (22) The requested URL returned error: 404 Not Found
Download failed, consider compiling your own sysdig-probe and loading it or getting in touch with the sysdig community
E0511 04:23:26.950556 11 main.cpp:233] Runtime exception caught in main loop: error opening device /host/dev/sysdig0. Make sure you have root credentials and that the sysdig-probe module is loaded.
Expected behavior
sf-collector should launch correctly with default configuration even if sysdig probe binary not available on AWS.
Environment (please complete the following information):
OS: RHEL 7.8
SysFlow version: latest/0.1-rc3
Command line arguments and filters (if applicable): (default, see above)
Configurations (if applicable): (default, see above)
Container orchestration framework and version (if applicable): bare-metal host
Indicate project collector
Describe the bug Currently sf-collector could not compile sysdig probe ko correctly due to lack of necessary sources even when kernel development packages installed on host.
For RHEL 7.8 host, the kernel version is 3.10.0-1127, thus sysdig probe compilation process must lookup
/lib/modules/$(uname -r)/{build,source}
for module building. Host provides module-related files by mounting/lib/modules
to guest's/host/lib/modules
; however,/lib/modules/$(uname -r)/build
is a soft link to/usr/src/linux-headers-$(uname -r)/
, which does not exists on guest container (since it is build from RHEL 8.1 with kernel 4.1 sources installed)To reproduce Steps to reproduce the behavior:
/lib/modules/<kernel_version>/{build,source}
:Expected behavior sf-collector should launch correctly with default configuration even if sysdig probe binary not available on AWS.
Environment (please complete the following information):