You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now collector requires a gRPC server for it to run, when we need to debug an issue we have to either:
Deploy it alongside a full StackRox deployment.
Deploy it with a mock gRPC server that mocks sensor’s behaviour
It’d be great if we could directly run the collector binary without any external requirements, since it would make debugging quick changes a lot faster (compile the binary and run vs. compile, create the image, setup the environment, deploy the image with the change, etc.).
In order to get this done, the first requirement would be to make the grpc connection optional:
We also want to keep the behavior of running with the GRPC server to still be the default, so any changes need to be placed behind a feature flag, an environment variable like COLLECTOR_STANDALONE set to a none empty string would be nice. Here is an example on how we handle these flags:
if (module_download_base_url && *module_download_base_url) return module_download_base_url;
CLOG(DEBUG) << "MODULE_DOWNLOAD_BASE_URL not set";
return"";
}
The final step would be to adjust the signal handlers we currently have to either be ignored or print to stdout. I think the easiest way would be to create a new signal handler and set it here:
For a first implementation, a signal handler printing process information to stdout would be nice and the network signal can be directly turned off when running in standalone, leaving its implementation for a follow up.
We have instructions on running the collector-builder image as a development environment in our how to start guide, running the collector binary directly in that container without any companion containers is the end goal.
The text was updated successfully, but these errors were encountered:
Right now collector requires a gRPC server for it to run, when we need to debug an issue we have to either:
It’d be great if we could directly run the collector binary without any external requirements, since it would make debugging quick changes a lot faster (compile the binary and run vs. compile, create the image, setup the environment, deploy the image with the change, etc.).
In order to get this done, the first requirement would be to make the grpc connection optional:
collector/collector/collector.cpp
Lines 398 to 407 in 1f55f21
I believe there are some checks in the configuration that also fail and prevent collector from running but I can’t find the exact place, it’s in either of these files:
https://github.com/stackrox/collector/blob/master/collector/lib/CollectorArgs.cpp
https://github.com/stackrox/collector/blob/master/collector/lib/CollectorConfig.cpp
We also want to keep the behavior of running with the GRPC server to still be the default, so any changes need to be placed behind a feature flag, an environment variable like
COLLECTOR_STANDALONE
set to a none empty string would be nice. Here is an example on how we handle these flags:collector/collector/lib/Utility.cpp
Lines 296 to 302 in 1f55f21
The final step would be to adjust the signal handlers we currently have to either be ignored or print to stdout. I think the easiest way would be to create a new signal handler and set it here:
collector/collector/lib/SysdigService.cpp
Lines 65 to 71 in 1f55f21
For a first implementation, a signal handler printing process information to stdout would be nice and the network signal can be directly turned off when running in standalone, leaving its implementation for a follow up.
We have instructions on running the collector-builder image as a development environment in our how to start guide, running the collector binary directly in that container without any companion containers is the end goal.
The text was updated successfully, but these errors were encountered: