Skip to content

Commit 72c21b3

Browse files
razvannightkr
andauthored
feat: run containerdebug in the background (#554)
* feat: run containerdebug in the background * cargo update * fix: remove unused env var * cargo update * reintroduce CONTAINERDEBUG_LOG_DIRECTORY * factor out ctnrdebug test * Sync Cargo.nix --------- Co-authored-by: Natalie Klestrup Röijezon <nat@nullable.se>
1 parent 8f100f4 commit 72c21b3

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- Run a `containerdebug` process in the background of each Hive container to collect debugging information ([#554]).
10+
711
### Changed
812

913
- Bump `stackable-operator` from `0.82.0` to `0.83.0` ([#553]).
@@ -16,6 +20,7 @@ All notable changes to this project will be documented in this file.
1620

1721
[#544]: https://github.com/stackabletech/hive-operator/pull/544
1822
[#553]: https://github.com/stackabletech/hive-operator/pull/553
23+
[#554]: https://github.com/stackabletech/hive-operator/pull/554
1924

2025
## [24.11.0] - 2024-11-18
2126

rust/operator-binary/src/controller.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,12 @@ fn build_metastore_rolegroup_statefulset(
850850
container_builder.add_env_vars(vec![
851851
env_var_from_secret(DB_USERNAME_ENV, &credentials_secret_name, "username"),
852852
env_var_from_secret(DB_PASSWORD_ENV, &credentials_secret_name, "password"),
853+
// Needed for the `containerdebug` process to log it's tracing information to.
854+
EnvVar {
855+
name: "CONTAINERDEBUG_LOG_DIRECTORY".to_string(),
856+
value: Some(format!("{STACKABLE_LOG_DIR}/containerdebug")),
857+
value_from: None,
858+
},
853859
]);
854860

855861
let mut pod_builder = PodBuilder::new();
@@ -913,6 +919,7 @@ fn build_metastore_rolegroup_statefulset(
913919
{COMMON_BASH_TRAP_FUNCTIONS}
914920
{remove_vector_shutdown_file_command}
915921
prepare_signal_handlers
922+
containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &
916923
{start_command}
917924
wait_for_termination $!
918925
{create_vector_shutdown_file_command}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# This test checks if the containerdebug-state.json file is present and valid
3+
apiVersion: kuttl.dev/v1beta1
4+
kind: TestAssert
5+
timeout: 60
6+
commands:
7+
- script: kubectl exec -n $NAMESPACE --container hive hive-metastore-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status '"valid JSON"'

0 commit comments

Comments
 (0)