Skip to content

Commit 99d10c2

Browse files
authored
Fix issues with Micronaut and Kube acceptance tests (#16891)
* Fix issues with Micronaut and Kube acceptance tests * Defer default bean creation until actually needed
1 parent 973fa68 commit 99d10c2

File tree

6 files changed

+29
-12
lines changed

6 files changed

+29
-12
lines changed

airbyte-workers/src/main/java/io/airbyte/workers/config/JobErrorReportingBeanFactory.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import io.micronaut.context.annotation.Factory;
1717
import io.micronaut.context.annotation.Requires;
1818
import io.micronaut.context.annotation.Value;
19+
import java.util.Optional;
1920
import javax.inject.Named;
2021
import javax.inject.Singleton;
2122

@@ -47,24 +48,14 @@ public JobErrorReportingClient loggingJobErrorReportingClient() {
4748
return new LoggingJobErrorReportingClient();
4849
}
4950

50-
@Singleton
51-
@Requires(property = "airbyte.worker.job.error-reporting.strategy",
52-
value = "")
53-
@Requires(property = "airbyte.worker.plane",
54-
notEquals = "DATA_PLANE")
55-
@Named("jobErrorReportingClient")
56-
public JobErrorReportingClient defaultJobErrorReportingClient() {
57-
return loggingJobErrorReportingClient();
58-
}
59-
6051
@Singleton
6152
@Requires(property = "airbyte.worker.plane",
6253
notEquals = "DATA_PLANE")
6354
public JobErrorReporter jobErrorReporter(
6455
@Value("${airbyte.version}") final String airbyteVersion,
6556
final ConfigRepository configRepository,
6657
final DeploymentMode deploymentMode,
67-
@Named("jobErrorReportingClient") final JobErrorReportingClient jobErrorReportingClient,
58+
@Named("jobErrorReportingClient") final Optional<JobErrorReportingClient> jobErrorReportingClient,
6859
final WebUrlHelper webUrlHelper) {
6960
return new JobErrorReporter(
7061
configRepository,
@@ -73,7 +64,7 @@ public JobErrorReporter jobErrorReporter(
7364
NormalizationRunnerFactory.BASE_NORMALIZATION_IMAGE_NAME,
7465
NormalizationRunnerFactory.NORMALIZATION_VERSION,
7566
webUrlHelper,
76-
jobErrorReportingClient);
67+
jobErrorReportingClient.orElseGet(() -> new LoggingJobErrorReportingClient()));
7768
}
7869

7970
}

kube/overlays/dev-integration-test/.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ JOB_KUBE_MAIN_CONTAINER_IMAGE_PULL_POLICY=
7272
CONTAINER_ORCHESTRATOR_ENABLED=true
7373
CONTAINER_ORCHESTRATOR_IMAGE=
7474

75+
# Cloud Storage Configuration
76+
WORKER_LOGS_STORAGE_TYPE=MINIO
77+
WORKER_STATE_STORAGE_TYPE=MINIO
78+
7579
# Open Telemetry Configuration
7680
METRIC_CLIENT=
7781
OTEL_COLLECTOR_ENDPOINT=

kube/overlays/dev/.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ JOB_KUBE_MAIN_CONTAINER_IMAGE_PULL_POLICY=
7474
CONTAINER_ORCHESTRATOR_ENABLED=true
7575
CONTAINER_ORCHESTRATOR_IMAGE=
7676

77+
# Cloud Storage Configuration
78+
WORKER_LOGS_STORAGE_TYPE=MINIO
79+
WORKER_STATE_STORAGE_TYPE=MINIO
80+
7781
# Open Telemetry Configuration
7882
METRIC_CLIENT=
7983
OTEL_COLLECTOR_ENDPOINT=

kube/overlays/stable-with-resource-limits/.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ CONTAINER_ORCHESTRATOR_ENABLED=true
7070

7171
CONNECTOR_SPECIFIC_RESOURCE_DEFAULTS_ENABLED=true
7272

73+
# Cloud Storage Configuration
74+
WORKER_LOGS_STORAGE_TYPE=MINIO
75+
WORKER_STATE_STORAGE_TYPE=MINIO
76+
7377
# Open Telemetry Configuration
7478
METRIC_CLIENT=
7579
OTEL_COLLECTOR_ENDPOINT=

kube/overlays/stable/.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ JOB_KUBE_MAIN_CONTAINER_IMAGE_PULL_POLICY=
7474
CONTAINER_ORCHESTRATOR_ENABLED=true
7575
CONTAINER_ORCHESTRATOR_IMAGE=
7676

77+
# Cloud Storage Configuration
78+
WORKER_LOGS_STORAGE_TYPE=MINIO
79+
WORKER_STATE_STORAGE_TYPE=MINIO
80+
7781
# Open Telemetry Configuration
7882
METRIC_CLIENT=
7983
OTEL_COLLECTOR_ENDPOINT=

kube/resources/worker.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,16 @@ spec:
285285
configMapKeyRef:
286286
name: airbyte-env
287287
key: WORKERS_MICRONAUT_ENVIRONMENTS
288+
- name: WORKER_LOGS_STORAGE_TYPE
289+
valueFrom:
290+
configMapKeyRef:
291+
name: airbyte-env
292+
key: WORKER_LOGS_STORAGE_TYPE
293+
- name: WORKER_STATE_STORAGE_TYPE
294+
valueFrom:
295+
configMapKeyRef:
296+
name: airbyte-env
297+
key: WORKER_STATE_STORAGE_TYPE
288298
ports:
289299
- containerPort: 9000 # for heartbeat server
290300
- containerPort: 9001 # start temporal worker port pool

0 commit comments

Comments
 (0)