Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 &"),
Copy link

Copilot AI Apr 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format! macro is used with placeholders like {STACKABLE_LOG_DIR} but no arguments are provided. If you intend for these to be literal curly braces, consider escaping them by using double braces (e.g. "{{STACKABLE_LOG_DIR}}") or supply the required variables.

Suggested change
format!("CONTAINERDEBUG_LOG_DIRECTORY={STACKABLE_LOG_DIR}/containerdebug containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &"),
format!("CONTAINERDEBUG_LOG_DIRECTORY={{STACKABLE_LOG_DIR}}/containerdebug containerdebug --output={{STACKABLE_LOG_DIR}}/containerdebug-state.json --loop &"),

Copilot uses AI. Check for mistakes.
"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 &"),
Copy link

Copilot AI Apr 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format! macro is used with placeholders like {STACKABLE_LOG_DIR} but no arguments are provided. If these braces are intended to be literal, escape them by using double braces (e.g. "{{STACKABLE_LOG_DIR}}") or provide the proper values.

Suggested change
format!("CONTAINERDEBUG_LOG_DIRECTORY={STACKABLE_LOG_DIR}/containerdebug containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &"),
format!("CONTAINERDEBUG_LOG_DIRECTORY={{STACKABLE_LOG_DIR}}/containerdebug containerdebug --output={{STACKABLE_LOG_DIR}}/containerdebug-state.json --loop &"),

Copilot uses AI. Check for mistakes.
"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 &"),
Copy link

Copilot AI Apr 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format! macro is used with placeholders like {STACKABLE_LOG_DIR} but no corresponding arguments are provided. Either escape the curly braces if literal output is intended, or pass the needed variable values.

Suggested change
format!("CONTAINERDEBUG_LOG_DIRECTORY={STACKABLE_LOG_DIR}/containerdebug containerdebug --output={STACKABLE_LOG_DIR}/containerdebug-state.json --loop &"),
format!("CONTAINERDEBUG_LOG_DIRECTORY={}/containerdebug containerdebug --output={}/containerdebug-state.json --loop &", STACKABLE_LOG_DIR, STACKABLE_LOG_DIR),

Copilot uses AI. Check for mistakes.
"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 --container airflow airflow-scheduler-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status
- script: kubectl exec -n $NAMESPACE --container airflow airflow-webserver-default-0 -- cat /stackable/log/containerdebug-state.json | jq --exit-status
Loading