diff --git a/CHANGELOG.md b/CHANGELOG.md index 46a875db..5cc085e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 7d7be665..89c23f4f 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -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(), ]); } @@ -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(), ]), } diff --git a/tests/templates/kuttl/smoke/40-assert.yaml.j2 b/tests/templates/kuttl/smoke/40-assert.yaml.j2 index 81337261..6679ca53 100644 --- a/tests/templates/kuttl/smoke/40-assert.yaml.j2 +++ b/tests/templates/kuttl/smoke/40-assert.yaml.j2 @@ -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