Skip to content

Commit

Permalink
feat: run containerdebug in the background
Browse files Browse the repository at this point in the history
  • Loading branch information
razvan committed Dec 9, 2024
1 parent abf1e8c commit 76fa224
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Added

- Run a `containerdebug` process in the background of each Airflow container to collect debugging information ([#557]).

### Fixed

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

[#545]: https://github.com/stackabletech/airflow-operator/pull/545
[#547]: https://github.com/stackabletech/airflow-operator/pull/547
[#557]: https://github.com/stackabletech/airflow-operator/pull/557

## [24.11.0] - 2024-11-18

Expand Down
3 changes: 3 additions & 0 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ impl AirflowRole {
command.extend(Self::authentication_start_commands(auth_config));
command.extend(vec![
"prepare_signal_handlers".to_string(),
format!("CONTAINERDEBUG_LOG_DIRECTORY={STACKABLE_LOG_DIR}/containerdebug containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &"),
"airflow webserver &".to_string(),
]);
}
Expand All @@ -361,10 +362,12 @@ impl AirflowRole {
--role \"Admin\""
.to_string(),
"prepare_signal_handlers".to_string(),
format!("CONTAINERDEBUG_LOG_DIRECTORY={STACKABLE_LOG_DIR}/containerdebug containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &"),
"airflow scheduler &".to_string(),
]),
AirflowRole::Worker => command.extend(vec![
"prepare_signal_handlers".to_string(),
format!("CONTAINERDEBUG_LOG_DIRECTORY={STACKABLE_LOG_DIR}/containerdebug containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &"),
"airflow celery worker &".to_string(),
]),
}
Expand Down
8 changes: 8 additions & 0 deletions tests/templates/kuttl/smoke/40-assert.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,11 @@ status:
expectedPods: 1
currentHealthy: 1
disruptionsAllowed: 1
---
# This test checks if the containerdebug-state.json file is present and valid
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 600
commands:
- script: kubectl exec -n $NAMESPACE airflow-scheduler-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status
- script: kubectl exec -n $NAMESPACE airflow-webserver-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status

0 comments on commit 76fa224

Please sign in to comment.