Skip to content

Commit 0a34da1

Browse files
Add logging support to the git-sync container
1 parent fe1ccb3 commit 0a34da1

File tree

7 files changed

+112
-28
lines changed

7 files changed

+112
-28
lines changed

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crate-hashes.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/operator-binary/src/airflow_controller.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,10 @@ pub async fn reconcile_airflow(
484484
&resolved_product_image,
485485
&env_vars_from_rolegroup_config(rolegroup_config),
486486
&airflow.volume_mounts(),
487+
LOG_VOLUME_NAME,
488+
&merged_airflow_config
489+
.logging
490+
.for_container(&Container::GitSync),
487491
)
488492
.context(InvalidGitSyncSpecSnafu)?;
489493

@@ -628,6 +632,10 @@ async fn build_executor_template(
628632
resolved_product_image,
629633
&env_vars_from(&common_config.env_overrides),
630634
&airflow.volume_mounts(),
635+
LOG_VOLUME_NAME,
636+
&merged_executor_config
637+
.logging
638+
.for_container(&Container::GitSync),
631639
)
632640
.context(InvalidGitSyncSpecSnafu)?;
633641

rust/operator-binary/src/crd/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,7 @@ pub enum Container {
711711
Airflow,
712712
Vector,
713713
Base,
714+
GitSync,
714715
}
715716

716717
#[derive(Clone, Debug, Default, Fragment, JsonSchema, PartialEq)]

tests/templates/kuttl/logging/41-install-airflow-cluster.yaml.j2

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ spec:
7070
vectorAggregatorConfigMapName: airflow-vector-aggregator-discovery
7171
loadExamples: true
7272
credentialsSecret: test-airflow-credentials
73+
dagsGitSync:
74+
- repo: https://github.com/stackabletech/example-dags
75+
gitFolder: dags
7376
webservers:
7477
config:
7578
resources:
@@ -93,6 +96,14 @@ spec:
9396
loggers:
9497
ROOT:
9598
level: INFO
99+
git-sync:
100+
console:
101+
level: INFO
102+
file:
103+
level: INFO
104+
loggers:
105+
ROOT:
106+
level: INFO
96107
vector:
97108
console:
98109
level: INFO
@@ -128,6 +139,8 @@ spec:
128139
cpu:
129140
min: 50m
130141
max: 250m
142+
memory:
143+
limit: 3Gi
131144
roleGroups:
132145
automatic-log-config:
133146
replicas: 1
@@ -143,6 +156,14 @@ spec:
143156
loggers:
144157
ROOT:
145158
level: DEBUG
159+
git-sync:
160+
console:
161+
level: INFO
162+
file:
163+
level: INFO
164+
loggers:
165+
ROOT:
166+
level: INFO
146167
vector:
147168
console:
148169
level: INFO
@@ -181,6 +202,14 @@ spec:
181202
loggers:
182203
ROOT:
183204
level: DEBUG
205+
git-sync:
206+
console:
207+
level: INFO
208+
file:
209+
level: INFO
210+
loggers:
211+
ROOT:
212+
level: INFO
184213
vector:
185214
console:
186215
level: INFO
@@ -198,6 +227,8 @@ spec:
198227
cpu:
199228
min: 100m
200229
max: 500m
230+
memory:
231+
limit: 1Gi
201232
roleGroups:
202233
automatic-log-config:
203234
replicas: 1
@@ -213,6 +244,14 @@ spec:
213244
loggers:
214245
ROOT:
215246
level: INFO
247+
git-sync:
248+
console:
249+
level: INFO
250+
file:
251+
level: INFO
252+
loggers:
253+
ROOT:
254+
level: INFO
216255
vector:
217256
console:
218257
level: INFO

tests/templates/kuttl/logging/airflow-vector-aggregator-values.yaml.j2

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ customConfig:
3030
condition: >-
3131
.pod == "airflow-webserver-automatic-log-config-0" &&
3232
.container == "airflow"
33+
filteredAutomaticLogConfigWebserverGitSync:
34+
type: filter
35+
inputs: [validEvents]
36+
condition: >-
37+
.pod == "airflow-webserver-automatic-log-config-0" &&
38+
.container == "git-sync-0"
3339
filteredAutomaticLogConfigWebserverVector:
3440
type: filter
3541
inputs: [validEvents]
@@ -54,6 +60,12 @@ customConfig:
5460
condition: >-
5561
.pod == "airflow-scheduler-automatic-log-config-0" &&
5662
.container == "airflow"
63+
filteredAutomaticLogConfigSchedulerGitSync:
64+
type: filter
65+
inputs: [validEvents]
66+
condition: >-
67+
.pod == "airflow-scheduler-automatic-log-config-0" &&
68+
.container == "git-sync-0"
5769
filteredAutomaticLogConfigSchedulerVector:
5870
type: filter
5971
inputs: [validEvents]
@@ -79,6 +91,18 @@ customConfig:
7991
condition: >-
8092
.pod == "airflow-worker-automatic-log-config-0" &&
8193
.container == "airflow"
94+
filteredAutomaticLogConfigWorkerGitSync:
95+
type: filter
96+
inputs: [validEvents]
97+
condition: >-
98+
.pod == "airflow-worker-automatic-log-config-0" &&
99+
.container == "git-sync-0"
100+
filteredAutomaticLogConfigWorkerGitSyncInit:
101+
type: filter
102+
inputs: [validEvents]
103+
condition: >-
104+
.pod == "airflow-worker-automatic-log-config-0" &&
105+
.container == "git-sync-0-init"
82106
filteredAutomaticLogConfigWorkerVector:
83107
type: filter
84108
inputs: [validEvents]
@@ -104,6 +128,12 @@ customConfig:
104128
condition: >-
105129
starts_with(string!(.pod), "example-trigger-target-dag-bash-task-") &&
106130
.container == "base"
131+
filteredExampleTriggerTargetDagBashGitSyncInit:
132+
type: filter
133+
inputs: [validEvents]
134+
condition: >-
135+
starts_with(string!(.pod), "example-trigger-target-dag-bash-task-") &&
136+
.container == "git-sync-0-init"
107137
filteredExampleTriggerTargetDagBashTaskVector:
108138
type: filter
109139
inputs: [validEvents]
@@ -116,6 +146,12 @@ customConfig:
116146
condition: >-
117147
starts_with(string!(.pod), "example-trigger-target-dag-run-this-") &&
118148
.container == "base"
149+
filteredExampleTriggerTargetDagRunThisGitSyncInit:
150+
type: filter
151+
inputs: [validEvents]
152+
condition: >-
153+
starts_with(string!(.pod), "example-trigger-target-dag-run-this-") &&
154+
.container == "git-sync-0-init"
119155
filteredExampleTriggerTargetDagRunThisVector:
120156
type: filter
121157
inputs: [validEvents]

0 commit comments

Comments
 (0)