Skip to content

Commit 0e81184

Browse files
authored
feat: run containerdebug in the background (#557)
* feat: run containerdebug in the background * add --container
1 parent abf1e8c commit 0e81184

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Added
6+
7+
- Run a `containerdebug` process in the background of each Airflow container to collect debugging information ([#557]).
8+
59
### Fixed
610

711
- BREAKING: Use distinct ServiceAccounts for the Stacklets, so that multiple Stacklets can be
@@ -11,6 +15,7 @@
1115

1216
[#545]: https://github.com/stackabletech/airflow-operator/pull/545
1317
[#547]: https://github.com/stackabletech/airflow-operator/pull/547
18+
[#557]: https://github.com/stackabletech/airflow-operator/pull/557
1419

1520
## [24.11.0] - 2024-11-18
1621

rust/crd/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ impl AirflowRole {
344344
command.extend(Self::authentication_start_commands(auth_config));
345345
command.extend(vec![
346346
"prepare_signal_handlers".to_string(),
347+
format!("CONTAINERDEBUG_LOG_DIRECTORY={STACKABLE_LOG_DIR}/containerdebug containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &"),
347348
"airflow webserver &".to_string(),
348349
]);
349350
}
@@ -361,10 +362,12 @@ impl AirflowRole {
361362
--role \"Admin\""
362363
.to_string(),
363364
"prepare_signal_handlers".to_string(),
365+
format!("CONTAINERDEBUG_LOG_DIRECTORY={STACKABLE_LOG_DIR}/containerdebug containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &"),
364366
"airflow scheduler &".to_string(),
365367
]),
366368
AirflowRole::Worker => command.extend(vec![
367369
"prepare_signal_handlers".to_string(),
370+
format!("CONTAINERDEBUG_LOG_DIRECTORY={STACKABLE_LOG_DIR}/containerdebug containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &"),
368371
"airflow celery worker &".to_string(),
369372
]),
370373
}

tests/templates/kuttl/smoke/40-assert.yaml.j2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,11 @@ status:
7979
expectedPods: 1
8080
currentHealthy: 1
8181
disruptionsAllowed: 1
82+
---
83+
# This test checks if the containerdebug-state.json file is present and valid
84+
apiVersion: kuttl.dev/v1beta1
85+
kind: TestAssert
86+
timeout: 600
87+
commands:
88+
- script: kubectl exec -n $NAMESPACE --container airflow airflow-scheduler-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status
89+
- script: kubectl exec -n $NAMESPACE --container airflow airflow-webserver-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status

0 commit comments

Comments
 (0)