diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/OrchestratorConstants.java b/airbyte-commons-temporal/src/main/java/io/airbyte/commons/temporal/sync/OrchestratorConstants.java similarity index 98% rename from airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/OrchestratorConstants.java rename to airbyte-commons-temporal/src/main/java/io/airbyte/commons/temporal/sync/OrchestratorConstants.java index 02afc3b94516..7a7c7806d7d0 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/OrchestratorConstants.java +++ b/airbyte-commons-temporal/src/main/java/io/airbyte/commons/temporal/sync/OrchestratorConstants.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.temporal.sync; +package io.airbyte.commons.temporal.sync; import com.uber.m3.util.ImmutableSet; import io.airbyte.commons.features.EnvVariableFeatureFlags; diff --git a/airbyte-commons-worker/build.gradle b/airbyte-commons-worker/build.gradle new file mode 100644 index 000000000000..3358029e4706 --- /dev/null +++ b/airbyte-commons-worker/build.gradle @@ -0,0 +1,65 @@ +import org.jsonschema2pojo.SourceType + +plugins { + id "java-library" + id 'com.github.eirnym.js2p' version '1.0' +} + +group 'io.airbyte...' +version '0.40.14' + +repositories { + mavenCentral() +} + +dependencies { + annotationProcessor platform(libs.micronaut.bom) + annotationProcessor libs.bundles.micronaut.annotation.processor + + implementation platform(libs.micronaut.bom) + implementation libs.bundles.micronaut + + implementation 'io.fabric8:kubernetes-client:5.12.2' + implementation 'io.temporal:temporal-sdk:1.8.1' + implementation 'org.apache.ant:ant:1.10.10' + implementation 'org.apache.commons:commons-text:1.9' + + implementation project(':airbyte-commons-protocol') + implementation project(':airbyte-commons-temporal') + implementation project(':airbyte-config:config-models') + implementation project(':airbyte-json-validation') + implementation project(':airbyte-metrics:metrics-lib') + implementation project(':airbyte-persistence:job-persistence') + implementation project(':airbyte-protocol:protocol-models') + + testAnnotationProcessor platform(libs.micronaut.bom) + testAnnotationProcessor libs.bundles.micronaut.test.annotation.processor + + testImplementation libs.bundles.micronaut.test + testImplementation 'com.jayway.jsonpath:json-path:2.7.0' + testImplementation 'org.mockito:mockito-inline:4.7.0' + testImplementation libs.postgresql + testImplementation libs.platform.testcontainers + testImplementation libs.platform.testcontainers.postgresql + + testImplementation project(':airbyte-commons-docker') +} + +jsonSchema2Pojo { + sourceType = SourceType.YAMLSCHEMA + source = files("${sourceSets.main.output.resourcesDir}/workers_models") + targetDirectory = new File(project.buildDir, 'generated/src/gen/java/') + removeOldOutput = true + + targetPackage = 'io.airbyte.persistence.job.models' + + useLongIntegers = true + generateBuilders = true + includeConstructors = false + includeSetters = true +} + +Properties env = new Properties() +rootProject.file('.env.dev').withInputStream { env.load(it) } + +Task publishArtifactsTask = getPublishArtifactsTask("$rootProject.ext.version", project) diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/ContainerOrchestratorConfig.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/ContainerOrchestratorConfig.java similarity index 90% rename from airbyte-workers/src/main/java/io/airbyte/workers/ContainerOrchestratorConfig.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/ContainerOrchestratorConfig.java index c3f29292e7cf..ce2b8e7a4759 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/ContainerOrchestratorConfig.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/ContainerOrchestratorConfig.java @@ -2,10 +2,10 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers; +package io.airbyte.commons.worker; +import io.airbyte.commons.worker.storage.DocumentStoreClient; import io.airbyte.config.Configs.WorkerEnvironment; -import io.airbyte.workers.general.DocumentStoreClient; import io.fabric8.kubernetes.client.KubernetesClient; public record ContainerOrchestratorConfig( diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/RecordSchemaValidator.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/RecordSchemaValidator.java similarity index 96% rename from airbyte-workers/src/main/java/io/airbyte/workers/RecordSchemaValidator.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/RecordSchemaValidator.java index a4364b0c0848..d1b50fffe798 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/RecordSchemaValidator.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/RecordSchemaValidator.java @@ -2,14 +2,14 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers; +package io.airbyte.commons.worker; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import io.airbyte.commons.worker.exception.RecordSchemaValidationException; import io.airbyte.protocol.models.AirbyteRecordMessage; import io.airbyte.validation.json.JsonSchemaValidator; import io.airbyte.validation.json.JsonValidationException; -import io.airbyte.workers.exception.RecordSchemaValidationException; import java.util.HashSet; import java.util.List; import java.util.Map; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/Worker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/Worker.java similarity index 80% rename from airbyte-workers/src/main/java/io/airbyte/workers/Worker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/Worker.java index 1a8b28bae57d..34cbc4a1f4e0 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/Worker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/Worker.java @@ -2,10 +2,9 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers; +package io.airbyte.commons.worker; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.general.DefaultReplicationWorker; +import io.airbyte.commons.worker.exception.WorkerException; import java.nio.file.Path; public interface Worker { diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/WorkerConfigs.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/WorkerConfigs.java similarity index 99% rename from airbyte-workers/src/main/java/io/airbyte/workers/WorkerConfigs.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/WorkerConfigs.java index a8997e271088..dea142c5a9eb 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/WorkerConfigs.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/WorkerConfigs.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers; +package io.airbyte.commons.worker; import io.airbyte.config.Configs; import io.airbyte.config.ResourceRequirements; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/WorkerConstants.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/WorkerConstants.java similarity index 94% rename from airbyte-workers/src/main/java/io/airbyte/workers/WorkerConstants.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/WorkerConstants.java index 0b3fd4a213ff..682046cfb0f2 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/WorkerConstants.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/WorkerConstants.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers; +package io.airbyte.commons.worker; public class WorkerConstants { diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/WorkerMetricReporter.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/WorkerMetricReporter.java similarity index 97% rename from airbyte-workers/src/main/java/io/airbyte/workers/WorkerMetricReporter.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/WorkerMetricReporter.java index 44a1ae107324..a29639b98798 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/WorkerMetricReporter.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/WorkerMetricReporter.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers; +package io.airbyte.commons.worker; import io.airbyte.metrics.lib.MetricAttribute; import io.airbyte.metrics.lib.MetricClient; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/WorkerUtils.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/WorkerUtils.java similarity index 96% rename from airbyte-workers/src/main/java/io/airbyte/workers/WorkerUtils.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/WorkerUtils.java index 5c580417bc20..18c797f5c092 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/WorkerUtils.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/WorkerUtils.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers; +package io.airbyte.commons.worker; import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.config.ConnectorJobOutput; @@ -16,9 +16,9 @@ import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.AirbyteMessage.Type; import io.airbyte.protocol.models.AirbyteTraceMessage; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.helper.FailureHelper; -import io.airbyte.workers.helper.FailureHelper.ConnectorCommand; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.helper.FailureHelper; +import io.airbyte.commons.worker.helper.FailureHelper.ConnectorCommand; import java.nio.file.Path; import java.time.Duration; import java.time.temporal.ChronoUnit; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/WorkerConfigurationBeanFactory.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/config/WorkerConfigurationBeanFactory.java similarity index 99% rename from airbyte-workers/src/main/java/io/airbyte/workers/config/WorkerConfigurationBeanFactory.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/config/WorkerConfigurationBeanFactory.java index a943cc211553..d25e810b428d 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/WorkerConfigurationBeanFactory.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/config/WorkerConfigurationBeanFactory.java @@ -2,16 +2,16 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.config; +package io.airbyte.commons.worker.config; import com.google.common.base.Splitter; import com.google.common.base.Strings; +import io.airbyte.commons.worker.WorkerConfigs; import io.airbyte.commons.map.MoreMaps; import io.airbyte.config.Configs.DeploymentMode; import io.airbyte.config.Configs.WorkerEnvironment; import io.airbyte.config.ResourceRequirements; import io.airbyte.config.TolerationPOJO; -import io.airbyte.workers.WorkerConfigs; import io.micronaut.context.annotation.Factory; import io.micronaut.context.annotation.Requires; import io.micronaut.context.annotation.Value; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/WorkerMode.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/config/WorkerMode.java similarity index 90% rename from airbyte-workers/src/main/java/io/airbyte/workers/config/WorkerMode.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/config/WorkerMode.java index 66e164b2fbca..1a78e40a2fea 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/WorkerMode.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/config/WorkerMode.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.config; +package io.airbyte.commons.worker.config; /** * Defines the different execution modes for the workers application. diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/exception/RecordSchemaValidationException.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/exception/RecordSchemaValidationException.java similarity index 94% rename from airbyte-workers/src/main/java/io/airbyte/workers/exception/RecordSchemaValidationException.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/exception/RecordSchemaValidationException.java index c74dbc2f0fea..816bceb226c3 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/exception/RecordSchemaValidationException.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/exception/RecordSchemaValidationException.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.exception; +package io.airbyte.commons.worker.exception; import java.util.Set; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/exception/WorkerException.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/exception/WorkerException.java similarity index 86% rename from airbyte-workers/src/main/java/io/airbyte/workers/exception/WorkerException.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/exception/WorkerException.java index 90a4b4b8c701..61715e028944 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/exception/WorkerException.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/exception/WorkerException.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.exception; +package io.airbyte.commons.worker.exception; public class WorkerException extends Exception { diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/DbtTransformationRunner.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/DbtTransformationRunner.java similarity index 93% rename from airbyte-workers/src/main/java/io/airbyte/workers/general/DbtTransformationRunner.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/DbtTransformationRunner.java index df0ff0807151..5f3b8d07636e 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/DbtTransformationRunner.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/DbtTransformationRunner.java @@ -2,11 +2,14 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.general; +package io.airbyte.commons.worker.general; import com.fasterxml.jackson.databind.JsonNode; import com.google.common.base.Strings; import com.google.common.collect.ImmutableMap; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.process.AirbyteIntegrationLauncher; +import io.airbyte.commons.worker.process.ProcessFactory; import io.airbyte.commons.io.LineGobbler; import io.airbyte.commons.logging.LoggingHelper.Color; import io.airbyte.commons.logging.MdcScope; @@ -14,11 +17,8 @@ import io.airbyte.commons.resources.MoreResources; import io.airbyte.config.OperatorDbt; import io.airbyte.config.ResourceRequirements; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.normalization.NormalizationRunner; -import io.airbyte.workers.process.AirbyteIntegrationLauncher; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.normalization.NormalizationRunner; import java.nio.file.Path; import java.util.ArrayList; import java.util.Collections; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/DbtTransformationWorker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/DbtTransformationWorker.java similarity index 95% rename from airbyte-workers/src/main/java/io/airbyte/workers/general/DbtTransformationWorker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/DbtTransformationWorker.java index abc454b28787..ef27653a6137 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/DbtTransformationWorker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/DbtTransformationWorker.java @@ -2,13 +2,13 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.general; +package io.airbyte.commons.worker.general; +import io.airbyte.commons.worker.Worker; import io.airbyte.commons.io.LineGobbler; import io.airbyte.config.OperatorDbtInput; import io.airbyte.config.ResourceRequirements; -import io.airbyte.workers.Worker; -import io.airbyte.workers.exception.WorkerException; +import io.airbyte.commons.worker.exception.WorkerException; import java.nio.file.Files; import java.nio.file.Path; import java.time.Duration; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultNormalizationWorker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/DefaultNormalizationWorker.java similarity index 93% rename from airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultNormalizationWorker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/DefaultNormalizationWorker.java index d48c196b9ff3..0bb1727abd55 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultNormalizationWorker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/DefaultNormalizationWorker.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.general; +package io.airbyte.commons.worker.general; import io.airbyte.commons.io.LineGobbler; import io.airbyte.config.Configs.WorkerEnvironment; @@ -10,10 +10,10 @@ import io.airbyte.config.NormalizationInput; import io.airbyte.config.NormalizationSummary; import io.airbyte.protocol.models.AirbyteTraceMessage; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.helper.FailureHelper; -import io.airbyte.workers.normalization.NormalizationRunner; -import io.airbyte.workers.normalization.NormalizationWorker; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.helper.FailureHelper; +import io.airbyte.commons.worker.normalization.NormalizationRunner; +import io.airbyte.commons.worker.normalization.NormalizationWorker; import java.nio.file.Files; import java.nio.file.Path; import java.time.Duration; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultReplicationWorker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/DefaultReplicationWorker.java similarity index 97% rename from airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultReplicationWorker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/DefaultReplicationWorker.java index 7ce35ae0b9ee..1f91ab4f2ef0 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultReplicationWorker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/DefaultReplicationWorker.java @@ -2,9 +2,14 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.general; +package io.airbyte.commons.worker.general; import com.fasterxml.jackson.databind.ObjectMapper; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.internal.AirbyteDestination; +import io.airbyte.commons.worker.internal.AirbyteMapper; +import io.airbyte.commons.worker.internal.AirbyteSource; +import io.airbyte.commons.worker.internal.MessageTracker; import io.airbyte.commons.io.LineGobbler; import io.airbyte.config.FailureReason; import io.airbyte.config.ReplicationAttemptSummary; @@ -19,14 +24,11 @@ import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.AirbyteMessage.Type; import io.airbyte.protocol.models.AirbyteRecordMessage; -import io.airbyte.workers.*; -import io.airbyte.workers.exception.RecordSchemaValidationException; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.helper.FailureHelper; -import io.airbyte.workers.internal.AirbyteDestination; -import io.airbyte.workers.internal.AirbyteMapper; -import io.airbyte.workers.internal.AirbyteSource; -import io.airbyte.workers.internal.MessageTracker; +import io.airbyte.commons.worker.RecordSchemaValidator; +import io.airbyte.commons.worker.WorkerMetricReporter; +import io.airbyte.commons.worker.exception.RecordSchemaValidationException; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.helper.FailureHelper; import java.nio.file.Path; import java.util.ArrayList; import java.util.HashMap; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/ReplicationWorker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/ReplicationWorker.java similarity index 74% rename from airbyte-workers/src/main/java/io/airbyte/workers/general/ReplicationWorker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/ReplicationWorker.java index 2ef57848b62c..8a67471cd5ad 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/ReplicationWorker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/general/ReplicationWorker.java @@ -2,10 +2,10 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.general; +package io.airbyte.commons.worker.general; +import io.airbyte.commons.worker.Worker; import io.airbyte.config.ReplicationOutput; import io.airbyte.config.StandardSyncInput; -import io.airbyte.workers.Worker; public interface ReplicationWorker extends Worker {} diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/helper/FailureHelper.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/helper/FailureHelper.java similarity index 99% rename from airbyte-workers/src/main/java/io/airbyte/workers/helper/FailureHelper.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/helper/FailureHelper.java index e2e92d939010..3c75b000efaa 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/helper/FailureHelper.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/helper/FailureHelper.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.helper; +package io.airbyte.commons.worker.helper; import com.fasterxml.jackson.annotation.JsonValue; import io.airbyte.config.AttemptFailureSummary; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteDestination.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteDestination.java similarity index 98% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteDestination.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteDestination.java index 3add86d4fc5c..8cfcb9f0ec9e 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteDestination.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteDestination.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import io.airbyte.commons.functional.CheckedConsumer; import io.airbyte.config.WorkerDestinationConfig; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteMapper.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteMapper.java similarity index 91% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteMapper.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteMapper.java index 7d97d358f7e2..4010b3124815 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteMapper.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteMapper.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteMessageTracker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteMessageTracker.java similarity index 97% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteMessageTracker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteMessageTracker.java index 259d8b3f192c..d55e2399fe95 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteMessageTracker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteMessageTracker.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Charsets; @@ -10,6 +10,9 @@ import com.google.common.collect.HashBiMap; import com.google.common.hash.HashFunction; import com.google.common.hash.Hashing; +import io.airbyte.commons.worker.internal.StateMetricsTracker.StateMetricsTrackerNoStateMatchException; +import io.airbyte.commons.worker.internal.state_aggregator.DefaultStateAggregator; +import io.airbyte.commons.worker.internal.state_aggregator.StateAggregator; import io.airbyte.commons.features.EnvVariableFeatureFlags; import io.airbyte.commons.json.Jsons; import io.airbyte.config.FailureReason; @@ -19,10 +22,7 @@ import io.airbyte.protocol.models.AirbyteStateMessage; import io.airbyte.protocol.models.AirbyteStateMessage.AirbyteStateType; import io.airbyte.protocol.models.AirbyteTraceMessage; -import io.airbyte.workers.helper.FailureHelper; -import io.airbyte.workers.internal.StateMetricsTracker.StateMetricsTrackerNoStateMatchException; -import io.airbyte.workers.internal.state_aggregator.DefaultStateAggregator; -import io.airbyte.workers.internal.state_aggregator.StateAggregator; +import io.airbyte.commons.worker.helper.FailureHelper; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.HashMap; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteProtocolPredicate.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteProtocolPredicate.java similarity index 95% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteProtocolPredicate.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteProtocolPredicate.java index bd61e714b670..08fffe84f469 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteProtocolPredicate.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteProtocolPredicate.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.protocol.models.AirbyteProtocolSchema; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteSource.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteSource.java similarity index 97% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteSource.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteSource.java index 0bc1626ffde9..8446a67d7bfc 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteSource.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteSource.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import io.airbyte.config.WorkerSourceConfig; import io.airbyte.protocol.models.AirbyteMessage; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteStreamFactory.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteStreamFactory.java similarity index 86% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteStreamFactory.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteStreamFactory.java index def328f04306..232d52c447aa 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/AirbyteStreamFactory.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/AirbyteStreamFactory.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import io.airbyte.protocol.models.AirbyteMessage; import java.io.BufferedReader; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/DefaultAirbyteDestination.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/DefaultAirbyteDestination.java similarity index 95% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/DefaultAirbyteDestination.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/DefaultAirbyteDestination.java index 87b1a7f79c11..adead663ab5d 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/DefaultAirbyteDestination.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/DefaultAirbyteDestination.java @@ -2,10 +2,12 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import com.google.common.base.Charsets; import com.google.common.base.Preconditions; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.WorkerUtils; import io.airbyte.commons.io.IOs; import io.airbyte.commons.io.LineGobbler; import io.airbyte.commons.json.Jsons; @@ -15,10 +17,8 @@ import io.airbyte.config.WorkerDestinationConfig; import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.AirbyteMessage.Type; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.process.IntegrationLauncher; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.process.IntegrationLauncher; import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/DefaultAirbyteSource.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/DefaultAirbyteSource.java similarity index 95% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/DefaultAirbyteSource.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/DefaultAirbyteSource.java index 5e8415fc96d4..9caaf3f53930 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/DefaultAirbyteSource.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/DefaultAirbyteSource.java @@ -2,10 +2,12 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.WorkerUtils; import io.airbyte.commons.features.EnvVariableFeatureFlags; import io.airbyte.commons.io.IOs; import io.airbyte.commons.io.LineGobbler; @@ -16,10 +18,8 @@ import io.airbyte.config.WorkerSourceConfig; import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.AirbyteMessage.Type; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.process.IntegrationLauncher; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.process.IntegrationLauncher; import java.nio.file.Path; import java.time.Duration; import java.time.temporal.ChronoUnit; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/DefaultAirbyteStreamFactory.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/DefaultAirbyteStreamFactory.java similarity index 98% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/DefaultAirbyteStreamFactory.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/DefaultAirbyteStreamFactory.java index 6f57949b93a7..851904abb966 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/DefaultAirbyteStreamFactory.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/DefaultAirbyteStreamFactory.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.commons.json.Jsons; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/EmptyAirbyteSource.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/EmptyAirbyteSource.java similarity index 99% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/EmptyAirbyteSource.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/EmptyAirbyteSource.java index 9bbeb99be12a..e87c363e79e5 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/EmptyAirbyteSource.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/EmptyAirbyteSource.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import io.airbyte.commons.json.Jsons; import io.airbyte.config.ResetSourceConfiguration; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/HeartbeatMonitor.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/HeartbeatMonitor.java similarity index 97% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/HeartbeatMonitor.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/HeartbeatMonitor.java index ae2734fc1617..c16218ad5d21 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/HeartbeatMonitor.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/HeartbeatMonitor.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import com.google.common.annotations.VisibleForTesting; import java.time.Duration; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/MessageTracker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/MessageTracker.java similarity index 98% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/MessageTracker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/MessageTracker.java index 86994fd785c8..0b32f3abc6d7 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/MessageTracker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/MessageTracker.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import io.airbyte.config.FailureReason; import io.airbyte.config.State; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/NamespacingMapper.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/NamespacingMapper.java similarity index 98% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/NamespacingMapper.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/NamespacingMapper.java index 59e1ff792bdd..2b0f0e4111ec 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/NamespacingMapper.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/NamespacingMapper.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import io.airbyte.commons.json.Jsons; import io.airbyte.config.JobSyncConfig.NamespaceDefinitionType; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/StateDeltaTracker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/StateDeltaTracker.java similarity index 99% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/StateDeltaTracker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/StateDeltaTracker.java index 480b4678f076..7cdca338ea28 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/StateDeltaTracker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/StateDeltaTracker.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import com.google.common.annotations.VisibleForTesting; import java.nio.ByteBuffer; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/StateMetricsTracker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/StateMetricsTracker.java similarity index 99% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/StateMetricsTracker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/StateMetricsTracker.java index b77ca9550d1e..c95c06c04d0d 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/StateMetricsTracker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/StateMetricsTracker.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import io.airbyte.protocol.models.AirbyteStateMessage; import io.airbyte.protocol.models.AirbyteStateMessage.AirbyteStateType; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/VersionedAirbyteStreamFactory.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/VersionedAirbyteStreamFactory.java similarity index 98% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/VersionedAirbyteStreamFactory.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/VersionedAirbyteStreamFactory.java index 98b01931a2d2..39b0fba891be 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/VersionedAirbyteStreamFactory.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/VersionedAirbyteStreamFactory.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.internal; import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.commons.json.Jsons; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/state_aggregator/DefaultStateAggregator.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/state_aggregator/DefaultStateAggregator.java similarity index 97% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/state_aggregator/DefaultStateAggregator.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/state_aggregator/DefaultStateAggregator.java index 5eabc899bc4e..7ac26270a723 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/state_aggregator/DefaultStateAggregator.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/state_aggregator/DefaultStateAggregator.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal.state_aggregator; +package io.airbyte.commons.worker.internal.state_aggregator; import com.google.common.base.Preconditions; import io.airbyte.config.State; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/state_aggregator/SingleStateAggregator.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/state_aggregator/SingleStateAggregator.java similarity index 95% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/state_aggregator/SingleStateAggregator.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/state_aggregator/SingleStateAggregator.java index 0cfe422ea1f7..e020e9fdea09 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/state_aggregator/SingleStateAggregator.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/state_aggregator/SingleStateAggregator.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal.state_aggregator; +package io.airbyte.commons.worker.internal.state_aggregator; import io.airbyte.commons.json.Jsons; import io.airbyte.config.State; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/state_aggregator/StateAggregator.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/state_aggregator/StateAggregator.java similarity index 81% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/state_aggregator/StateAggregator.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/state_aggregator/StateAggregator.java index 97c02e7b0a90..261c69683d5a 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/state_aggregator/StateAggregator.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/state_aggregator/StateAggregator.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal.state_aggregator; +package io.airbyte.commons.worker.internal.state_aggregator; import io.airbyte.config.State; import io.airbyte.protocol.models.AirbyteStateMessage; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/internal/state_aggregator/StreamStateAggregator.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/state_aggregator/StreamStateAggregator.java similarity index 94% rename from airbyte-workers/src/main/java/io/airbyte/workers/internal/state_aggregator/StreamStateAggregator.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/state_aggregator/StreamStateAggregator.java index 4d3247b2549d..583dcf2f756b 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/internal/state_aggregator/StreamStateAggregator.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/internal/state_aggregator/StreamStateAggregator.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal.state_aggregator; +package io.airbyte.commons.worker.internal.state_aggregator; import io.airbyte.commons.json.Jsons; import io.airbyte.config.State; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/normalization/DefaultNormalizationRunner.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/DefaultNormalizationRunner.java similarity index 96% rename from airbyte-workers/src/main/java/io/airbyte/workers/normalization/DefaultNormalizationRunner.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/DefaultNormalizationRunner.java index 3db73387fec0..81fa12faa2e2 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/normalization/DefaultNormalizationRunner.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/DefaultNormalizationRunner.java @@ -2,12 +2,16 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.normalization; +package io.airbyte.commons.worker.normalization; import com.fasterxml.jackson.databind.JsonNode; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Strings; import com.google.common.collect.ImmutableMap; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.process.AirbyteIntegrationLauncher; +import io.airbyte.commons.worker.process.ProcessFactory; import io.airbyte.commons.io.IOs; import io.airbyte.commons.io.LineGobbler; import io.airbyte.commons.json.Jsons; @@ -23,11 +27,7 @@ import io.airbyte.protocol.models.AirbyteMessage.Type; import io.airbyte.protocol.models.AirbyteTraceMessage; import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.process.AirbyteIntegrationLauncher; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.exception.WorkerException; import java.io.InputStream; import java.nio.file.Path; import java.util.Collections; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationAirbyteStreamFactory.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/NormalizationAirbyteStreamFactory.java similarity index 97% rename from airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationAirbyteStreamFactory.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/NormalizationAirbyteStreamFactory.java index 3cd8385fdd4f..fdc63fbda79c 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationAirbyteStreamFactory.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/NormalizationAirbyteStreamFactory.java @@ -2,15 +2,15 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.normalization; +package io.airbyte.commons.worker.normalization; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeType; +import io.airbyte.commons.worker.internal.AirbyteStreamFactory; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.logging.MdcScope; import io.airbyte.protocol.models.AirbyteLogMessage; import io.airbyte.protocol.models.AirbyteMessage; -import io.airbyte.workers.internal.AirbyteStreamFactory; import java.io.BufferedReader; import java.util.ArrayList; import java.util.List; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationRunner.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/NormalizationRunner.java similarity index 98% rename from airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationRunner.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/NormalizationRunner.java index dcb2f17f5066..e753995ff498 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationRunner.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/NormalizationRunner.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.normalization; +package io.airbyte.commons.worker.normalization; import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.config.OperatorDbt; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationRunnerFactory.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/NormalizationRunnerFactory.java similarity index 95% rename from airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationRunnerFactory.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/NormalizationRunnerFactory.java index 9a5c1b9e6373..f32a78378a87 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationRunnerFactory.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/NormalizationRunnerFactory.java @@ -2,11 +2,11 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.normalization; +package io.airbyte.commons.worker.normalization; import com.google.common.collect.ImmutableMap; -import io.airbyte.workers.normalization.DefaultNormalizationRunner.DestinationType; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.process.ProcessFactory; +import io.airbyte.commons.worker.normalization.DefaultNormalizationRunner.DestinationType; import java.util.Map; import org.apache.commons.lang3.tuple.ImmutablePair; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationWorker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/NormalizationWorker.java similarity index 74% rename from airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationWorker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/NormalizationWorker.java index a3f1f0e38ee3..553510d98943 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationWorker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/normalization/NormalizationWorker.java @@ -2,10 +2,10 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.normalization; +package io.airbyte.commons.worker.normalization; +import io.airbyte.commons.worker.Worker; import io.airbyte.config.NormalizationInput; import io.airbyte.config.NormalizationSummary; -import io.airbyte.workers.Worker; public interface NormalizationWorker extends Worker {} diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/AirbyteIntegrationLauncher.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/AirbyteIntegrationLauncher.java similarity index 98% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/AirbyteIntegrationLauncher.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/AirbyteIntegrationLauncher.java index 405293663946..7de399f9e620 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/AirbyteIntegrationLauncher.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/AirbyteIntegrationLauncher.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; @@ -11,7 +11,7 @@ import io.airbyte.commons.features.FeatureFlags; import io.airbyte.config.ResourceRequirements; import io.airbyte.config.WorkerEnvConstants; -import io.airbyte.workers.exception.WorkerException; +import io.airbyte.commons.worker.exception.WorkerException; import java.nio.file.Path; import java.util.Collections; import java.util.HashMap; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/AsyncKubePodStatus.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/AsyncKubePodStatus.java similarity index 91% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/AsyncKubePodStatus.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/AsyncKubePodStatus.java index 7fea544b6cc7..94e2a713beb5 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/AsyncKubePodStatus.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/AsyncKubePodStatus.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; public enum AsyncKubePodStatus { NOT_STARTED, // Pod hasn't been started yet. diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/AsyncOrchestratorPodProcess.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/AsyncOrchestratorPodProcess.java similarity index 99% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/AsyncOrchestratorPodProcess.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/AsyncOrchestratorPodProcess.java index a1017cac2891..f89504d621d0 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/AsyncOrchestratorPodProcess.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/AsyncOrchestratorPodProcess.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; import io.airbyte.commons.features.EnvVariableFeatureFlags; import io.airbyte.commons.io.IOs; @@ -10,7 +10,7 @@ import io.airbyte.config.EnvConfigs; import io.airbyte.config.ResourceRequirements; import io.airbyte.config.helpers.LogClientSingleton; -import io.airbyte.workers.general.DocumentStoreClient; +import io.airbyte.commons.worker.storage.DocumentStoreClient; import io.fabric8.kubernetes.api.model.ContainerBuilder; import io.fabric8.kubernetes.api.model.ContainerPort; import io.fabric8.kubernetes.api.model.DeletionPropagation; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/DockerProcessFactory.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/DockerProcessFactory.java similarity index 97% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/DockerProcessFactory.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/DockerProcessFactory.java index 743a429a772d..e680d4e0e321 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/DockerProcessFactory.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/DockerProcessFactory.java @@ -2,20 +2,20 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Joiner; import com.google.common.base.Strings; import com.google.common.collect.Lists; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.WorkerUtils; import io.airbyte.commons.io.IOs; import io.airbyte.commons.io.LineGobbler; import io.airbyte.commons.map.MoreMaps; import io.airbyte.commons.resources.MoreResources; import io.airbyte.config.ResourceRequirements; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.exception.WorkerException; +import io.airbyte.commons.worker.exception.WorkerException; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/ExitCodeWatcher.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/ExitCodeWatcher.java similarity index 99% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/ExitCodeWatcher.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/ExitCodeWatcher.java index 9e0f887dcf9f..937ee6d1d5cb 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/ExitCodeWatcher.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/ExitCodeWatcher.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; import com.google.common.collect.MoreCollectors; import io.fabric8.kubernetes.api.model.ContainerStatus; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/IntegrationLauncher.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/IntegrationLauncher.java similarity index 94% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/IntegrationLauncher.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/IntegrationLauncher.java index 0b06f1eda4db..d3de795cca53 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/IntegrationLauncher.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/IntegrationLauncher.java @@ -2,9 +2,9 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; -import io.airbyte.workers.exception.WorkerException; +import io.airbyte.commons.worker.exception.WorkerException; import java.nio.file.Path; /** diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubeContainerInfo.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubeContainerInfo.java similarity index 75% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/KubeContainerInfo.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubeContainerInfo.java index bafe637c3bf8..22046c0143c4 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubeContainerInfo.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubeContainerInfo.java @@ -2,6 +2,6 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; public record KubeContainerInfo(String image, String pullPolicy) {} diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePod.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePod.java similarity index 88% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/KubePod.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePod.java index c2fbcc2e6367..411dfee65227 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePod.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePod.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; import java.util.concurrent.TimeUnit; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodInfo.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePodInfo.java similarity index 79% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodInfo.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePodInfo.java index 897b083d5f26..7989ea9a8f03 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodInfo.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePodInfo.java @@ -2,6 +2,6 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; public record KubePodInfo(String namespace, String name, KubeContainerInfo mainContainerInfo) {} diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePodProcess.java similarity index 99% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePodProcess.java index 793b0f0dc47b..161f27a2d797 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePodProcess.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; import io.airbyte.commons.io.IOs; import io.airbyte.commons.lang.Exceptions; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcessInfo.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePodProcessInfo.java similarity index 96% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcessInfo.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePodProcessInfo.java index 364b4bbbc106..ae9c53b0f44e 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcessInfo.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePodProcessInfo.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; import java.lang.ProcessHandle.Info; import java.time.Duration; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodResourceHelper.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePodResourceHelper.java similarity index 95% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodResourceHelper.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePodResourceHelper.java index aecac264075f..6499bf8f9eaf 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodResourceHelper.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePodResourceHelper.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; import io.fabric8.kubernetes.api.model.ContainerStatus; import io.fabric8.kubernetes.api.model.Pod; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePortManagerSingleton.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePortManagerSingleton.java similarity index 98% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/KubePortManagerSingleton.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePortManagerSingleton.java index 206da25b8729..44a8dd96dca1 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePortManagerSingleton.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubePortManagerSingleton.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Sets; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubeProcessFactory.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubeProcessFactory.java similarity index 97% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/KubeProcessFactory.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubeProcessFactory.java index 99227c82cc8f..eaf92d1a035f 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubeProcessFactory.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/KubeProcessFactory.java @@ -2,14 +2,14 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; import com.google.common.annotations.VisibleForTesting; +import io.airbyte.commons.worker.WorkerConfigs; import io.airbyte.commons.lang.Exceptions; import io.airbyte.commons.map.MoreMaps; import io.airbyte.config.ResourceRequirements; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.exception.WorkerException; +import io.airbyte.commons.worker.exception.WorkerException; import io.fabric8.kubernetes.client.KubernetesClient; import java.net.InetAddress; import java.nio.file.Path; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/ProcessFactory.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/ProcessFactory.java similarity index 97% rename from airbyte-workers/src/main/java/io/airbyte/workers/process/ProcessFactory.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/ProcessFactory.java index 676114796ca6..675074c4ee89 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/ProcessFactory.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/process/ProcessFactory.java @@ -2,10 +2,10 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.process; +package io.airbyte.commons.worker.process; import io.airbyte.config.ResourceRequirements; -import io.airbyte.workers.exception.WorkerException; +import io.airbyte.commons.worker.exception.WorkerException; import java.nio.file.Path; import java.util.Map; import java.util.regex.Matcher; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/storage/DockerComposeDocumentStoreClient.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/DockerComposeDocumentStoreClient.java similarity index 95% rename from airbyte-workers/src/main/java/io/airbyte/workers/storage/DockerComposeDocumentStoreClient.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/DockerComposeDocumentStoreClient.java index c6d2c57ab50b..6a00d6f6d3d4 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/storage/DockerComposeDocumentStoreClient.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/DockerComposeDocumentStoreClient.java @@ -2,10 +2,9 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.storage; +package io.airbyte.commons.worker.storage; import io.airbyte.commons.io.IOs; -import io.airbyte.workers.general.DocumentStoreClient; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/DocumentStoreClient.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/DocumentStoreClient.java similarity index 94% rename from airbyte-workers/src/main/java/io/airbyte/workers/general/DocumentStoreClient.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/DocumentStoreClient.java index d92c960f9f9e..89133c8d78ca 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/DocumentStoreClient.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/DocumentStoreClient.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.general; +package io.airbyte.commons.worker.storage; import java.util.Optional; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/storage/GcsDocumentStoreClient.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/GcsDocumentStoreClient.java similarity index 95% rename from airbyte-workers/src/main/java/io/airbyte/workers/storage/GcsDocumentStoreClient.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/GcsDocumentStoreClient.java index d0dab2f0dac5..48d5230db7fc 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/storage/GcsDocumentStoreClient.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/GcsDocumentStoreClient.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.storage; +package io.airbyte.commons.worker.storage; import com.google.cloud.storage.Blob; import com.google.cloud.storage.BlobId; @@ -10,7 +10,6 @@ import com.google.cloud.storage.Storage; import io.airbyte.config.storage.CloudStorageConfigs.GcsConfig; import io.airbyte.config.storage.DefaultGcsClientFactory; -import io.airbyte.workers.general.DocumentStoreClient; import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.util.Optional; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/storage/S3DocumentStoreClient.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/S3DocumentStoreClient.java similarity index 97% rename from airbyte-workers/src/main/java/io/airbyte/workers/storage/S3DocumentStoreClient.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/S3DocumentStoreClient.java index 592cf9d08dea..200da909248b 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/storage/S3DocumentStoreClient.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/S3DocumentStoreClient.java @@ -2,13 +2,12 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.storage; +package io.airbyte.commons.worker.storage; import io.airbyte.config.storage.CloudStorageConfigs.MinioConfig; import io.airbyte.config.storage.CloudStorageConfigs.S3Config; import io.airbyte.config.storage.DefaultS3ClientFactory; import io.airbyte.config.storage.MinioS3ClientFactory; -import io.airbyte.workers.general.DocumentStoreClient; import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.util.Optional; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/storage/StateClients.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/StateClients.java similarity index 90% rename from airbyte-workers/src/main/java/io/airbyte/workers/storage/StateClients.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/StateClients.java index b6bc7bd1ba45..bd160db2ed0b 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/storage/StateClients.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/storage/StateClients.java @@ -2,10 +2,9 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.storage; +package io.airbyte.commons.worker.storage; import io.airbyte.config.storage.CloudStorageConfigs; -import io.airbyte.workers.general.DocumentStoreClient; import java.nio.file.Path; public class StateClients { diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/DbtLauncherWorker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/sync/DbtLauncherWorker.java similarity index 91% rename from airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/DbtLauncherWorker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/sync/DbtLauncherWorker.java index 52ebaa9ce3a9..87d77f2bce5f 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/DbtLauncherWorker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/sync/DbtLauncherWorker.java @@ -2,15 +2,15 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.temporal.sync; +package io.airbyte.commons.worker.sync; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.temporal.TemporalUtils; import io.airbyte.config.OperatorDbtInput; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.ContainerOrchestratorConfig; -import io.airbyte.workers.WorkerConfigs; +import io.airbyte.commons.worker.ContainerOrchestratorConfig; +import io.airbyte.commons.worker.WorkerConfigs; import io.temporal.activity.ActivityExecutionContext; import java.util.Map; import java.util.UUID; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/LauncherWorker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/sync/LauncherWorker.java similarity index 94% rename from airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/LauncherWorker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/sync/LauncherWorker.java index 7b1d848ad958..29056971bd90 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/LauncherWorker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/sync/LauncherWorker.java @@ -2,25 +2,26 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.temporal.sync; +package io.airbyte.commons.worker.sync; import com.google.common.base.Stopwatch; +import io.airbyte.commons.worker.Worker; import io.airbyte.commons.features.EnvVariableFeatureFlags; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.lang.Exceptions; import io.airbyte.commons.temporal.TemporalUtils; +import io.airbyte.commons.temporal.sync.OrchestratorConstants; import io.airbyte.config.ResourceRequirements; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.ContainerOrchestratorConfig; -import io.airbyte.workers.Worker; -import io.airbyte.workers.config.WorkerConfigurationBeanFactory; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.process.AsyncKubePodStatus; -import io.airbyte.workers.process.AsyncOrchestratorPodProcess; -import io.airbyte.workers.process.KubeContainerInfo; -import io.airbyte.workers.process.KubePodInfo; -import io.airbyte.workers.process.KubePodResourceHelper; -import io.airbyte.workers.process.KubeProcessFactory; +import io.airbyte.commons.worker.ContainerOrchestratorConfig; +import io.airbyte.commons.worker.config.WorkerConfigurationBeanFactory; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.process.AsyncKubePodStatus; +import io.airbyte.commons.worker.process.AsyncOrchestratorPodProcess; +import io.airbyte.commons.worker.process.KubeContainerInfo; +import io.airbyte.commons.worker.process.KubePodInfo; +import io.airbyte.commons.worker.process.KubePodResourceHelper; +import io.airbyte.commons.worker.process.KubeProcessFactory; import io.fabric8.kubernetes.api.model.DeletionPropagation; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.client.KubernetesClientException; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/NormalizationLauncherWorker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/sync/NormalizationLauncherWorker.java similarity index 92% rename from airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/NormalizationLauncherWorker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/sync/NormalizationLauncherWorker.java index 62bbaadbdb36..6278a450f68c 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/NormalizationLauncherWorker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/sync/NormalizationLauncherWorker.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.temporal.sync; +package io.airbyte.commons.worker.sync; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.temporal.TemporalUtils; @@ -10,8 +10,8 @@ import io.airbyte.config.NormalizationSummary; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.ContainerOrchestratorConfig; -import io.airbyte.workers.WorkerConfigs; +import io.airbyte.commons.worker.ContainerOrchestratorConfig; +import io.airbyte.commons.worker.WorkerConfigs; import io.temporal.activity.ActivityExecutionContext; import java.util.Map; import java.util.UUID; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/ReplicationLauncherWorker.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/sync/ReplicationLauncherWorker.java similarity index 95% rename from airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/ReplicationLauncherWorker.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/sync/ReplicationLauncherWorker.java index c8da41af2bf3..1c3f111d0e1b 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/ReplicationLauncherWorker.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/sync/ReplicationLauncherWorker.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.temporal.sync; +package io.airbyte.commons.worker.sync; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.temporal.TemporalUtils; @@ -11,7 +11,7 @@ import io.airbyte.config.StandardSyncInput; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.ContainerOrchestratorConfig; +import io.airbyte.commons.worker.ContainerOrchestratorConfig; import io.temporal.activity.ActivityExecutionContext; import java.util.Map; import java.util.UUID; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/internal/AirbyteMessageUtils.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/test_utils/AirbyteMessageUtils.java similarity index 99% rename from airbyte-workers/src/test/java/io/airbyte/workers/internal/AirbyteMessageUtils.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/test_utils/AirbyteMessageUtils.java index e39d240dc352..db6fae51656a 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/internal/AirbyteMessageUtils.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/test_utils/AirbyteMessageUtils.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers.internal; +package io.airbyte.commons.worker.test_utils; import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.ImmutableMap; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/TestConfigHelpers.java b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/test_utils/TestConfigHelpers.java similarity index 99% rename from airbyte-workers/src/test/java/io/airbyte/workers/TestConfigHelpers.java rename to airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/test_utils/TestConfigHelpers.java index 6ccbd7f1faa6..d2463ecb35cc 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/TestConfigHelpers.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/commons/worker/test_utils/TestConfigHelpers.java @@ -2,7 +2,7 @@ * Copyright (c) 2022 Airbyte, Inc., all rights reserved. */ -package io.airbyte.workers; +package io.airbyte.commons.worker.test_utils; import com.fasterxml.jackson.databind.JsonNode; import io.airbyte.commons.json.Jsons; diff --git a/airbyte-commons-worker/src/main/resources/image_exists.sh b/airbyte-commons-worker/src/main/resources/image_exists.sh new file mode 100755 index 000000000000..9879415e9116 --- /dev/null +++ b/airbyte-commons-worker/src/main/resources/image_exists.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +set -e + +function _error() { + echo "$@" && exit 1 +} + +function _usage() { + _error "Usage: ./image_exists.sh imageName" +} + +function docker_exists_in_local() { + docker inspect --type=image "$1" 2> /dev/null | jq '. | length' +} + +main() { + [[ $# -eq 1 ]] || _usage + imageName=$1 + + echo "Checking if ${imageName} exists..." + # handle the case where the image exists ONLY on the local machine. + LOCAL=$(docker_exists_in_local ${imageName}) + + if [[ $LOCAL -eq 0 ]]; then + echo "${imageName} not found locally. Attempting to pull the image..." + # handle the case where the image exists in the remote and either has never been pulled or has already been pulled + # and is already up to date. + RESULT=$(docker pull $imageName 2> /dev/null | awk '/Status: Image is up to date/ || /Status: Downloaded newer image/') + [ -z "$RESULT" ] && _error "Image does not exist." + echo "Pulled ${imageName} from remote." + else + echo "${imageName} was found locally." + fi + + exit 0 +} + +main "$@" diff --git a/airbyte-workers/src/main/resources/workers_models/IntegrationLauncherConfig.yaml b/airbyte-commons-worker/src/main/resources/workers_models/IntegrationLauncherConfig.yaml similarity index 100% rename from airbyte-workers/src/main/resources/workers_models/IntegrationLauncherConfig.yaml rename to airbyte-commons-worker/src/main/resources/workers_models/IntegrationLauncherConfig.yaml diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/RecordSchemaValidatorTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/RecordSchemaValidatorTest.java similarity index 85% rename from airbyte-workers/src/test/java/io/airbyte/workers/RecordSchemaValidatorTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/RecordSchemaValidatorTest.java index e3365e466f41..ac120e2f731d 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/RecordSchemaValidatorTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/RecordSchemaValidatorTest.java @@ -6,11 +6,14 @@ import static org.junit.jupiter.api.Assertions.assertThrows; +import io.airbyte.commons.worker.RecordSchemaValidator; +import io.airbyte.commons.worker.WorkerUtils; import io.airbyte.config.StandardSync; import io.airbyte.config.StandardSyncInput; import io.airbyte.protocol.models.AirbyteMessage; -import io.airbyte.workers.exception.RecordSchemaValidationException; -import io.airbyte.workers.internal.AirbyteMessageUtils; +import io.airbyte.commons.worker.exception.RecordSchemaValidationException; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; +import io.airbyte.commons.worker.test_utils.TestConfigHelpers; import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/WorkerConfigsTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/WorkerConfigsTest.java similarity index 99% rename from airbyte-workers/src/test/java/io/airbyte/workers/WorkerConfigsTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/WorkerConfigsTest.java index bdf0c6c43905..08881891ba10 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/WorkerConfigsTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/WorkerConfigsTest.java @@ -8,6 +8,7 @@ import static org.mockito.Mockito.when; import com.google.common.collect.ImmutableMap; +import io.airbyte.commons.worker.WorkerConfigs; import io.airbyte.config.Configs; import io.airbyte.config.EnvConfigs; import io.airbyte.config.ResourceRequirements; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/WorkerUtilsTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/WorkerUtilsTest.java similarity index 97% rename from airbyte-workers/src/test/java/io/airbyte/workers/WorkerUtilsTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/WorkerUtilsTest.java index 39da15dd4cf1..cd7db4e2ecbd 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/WorkerUtilsTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/WorkerUtilsTest.java @@ -12,11 +12,14 @@ import static org.mockito.Mockito.when; import com.fasterxml.jackson.databind.JsonNode; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.WorkerUtils; import io.airbyte.config.Configs; import io.airbyte.config.EnvConfigs; import io.airbyte.config.StandardSync; import io.airbyte.config.StandardSyncInput; -import io.airbyte.workers.internal.HeartbeatMonitor; +import io.airbyte.commons.worker.internal.HeartbeatMonitor; +import io.airbyte.commons.worker.test_utils.TestConfigHelpers; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.Map; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultNormalizationWorkerTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/general/DefaultNormalizationWorkerTest.java similarity index 93% rename from airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultNormalizationWorkerTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/general/DefaultNormalizationWorkerTest.java index c4f8e2fc20dd..198b7e0a6747 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultNormalizationWorkerTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/general/DefaultNormalizationWorkerTest.java @@ -12,6 +12,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import io.airbyte.commons.worker.general.DefaultNormalizationWorker; import io.airbyte.config.Configs.WorkerEnvironment; import io.airbyte.config.EnvConfigs; import io.airbyte.config.FailureReason.FailureOrigin; @@ -20,11 +21,11 @@ import io.airbyte.config.StandardSync; import io.airbyte.config.StandardSyncInput; import io.airbyte.protocol.models.AirbyteTraceMessage; -import io.airbyte.workers.TestConfigHelpers; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.internal.AirbyteMessageUtils; -import io.airbyte.workers.normalization.NormalizationRunner; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.normalization.NormalizationRunner; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; +import io.airbyte.commons.worker.test_utils.TestConfigHelpers; import java.nio.file.Files; import java.nio.file.Path; import java.util.stream.Stream; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultReplicationWorkerTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/general/DefaultReplicationWorkerTest.java similarity index 97% rename from airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultReplicationWorkerTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/general/DefaultReplicationWorkerTest.java index 95b2fcc91933..b277cfa049e9 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultReplicationWorkerTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/general/DefaultReplicationWorkerTest.java @@ -20,6 +20,11 @@ import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.ImmutableMap; +import io.airbyte.commons.worker.RecordSchemaValidator; +import io.airbyte.commons.worker.WorkerMetricReporter; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.general.DefaultReplicationWorker; +import io.airbyte.commons.worker.general.ReplicationWorker; import io.airbyte.commons.io.IOs; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.string.Strings; @@ -45,14 +50,14 @@ import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.AirbyteTraceMessage; import io.airbyte.validation.json.JsonSchemaValidator; -import io.airbyte.workers.*; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.helper.FailureHelper; -import io.airbyte.workers.internal.AirbyteDestination; -import io.airbyte.workers.internal.AirbyteMessageTracker; -import io.airbyte.workers.internal.AirbyteMessageUtils; -import io.airbyte.workers.internal.AirbyteSource; -import io.airbyte.workers.internal.NamespacingMapper; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.helper.FailureHelper; +import io.airbyte.commons.worker.internal.AirbyteDestination; +import io.airbyte.commons.worker.internal.AirbyteMessageTracker; +import io.airbyte.commons.worker.internal.AirbyteSource; +import io.airbyte.commons.worker.internal.NamespacingMapper; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; +import io.airbyte.commons.worker.test_utils.TestConfigHelpers; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/helper/FailureHelperTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/helper/FailureHelperTest.java similarity index 97% rename from airbyte-workers/src/test/java/io/airbyte/workers/helper/FailureHelperTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/helper/FailureHelperTest.java index cb0e374e96f4..962ff64195d7 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/helper/FailureHelperTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/helper/FailureHelperTest.java @@ -7,14 +7,15 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; +import io.airbyte.commons.worker.helper.FailureHelper; import io.airbyte.config.FailureReason; import io.airbyte.config.FailureReason.FailureOrigin; import io.airbyte.config.FailureReason.FailureType; import io.airbyte.config.Metadata; import io.airbyte.protocol.models.AirbyteErrorTraceMessage; import io.airbyte.protocol.models.AirbyteTraceMessage; -import io.airbyte.workers.helper.FailureHelper.ConnectorCommand; -import io.airbyte.workers.internal.AirbyteMessageUtils; +import io.airbyte.commons.worker.helper.FailureHelper.ConnectorCommand; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; import java.util.List; import java.util.Map; import java.util.Set; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/internal/AirbyteMessageTrackerTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/AirbyteMessageTrackerTest.java similarity index 96% rename from airbyte-workers/src/test/java/io/airbyte/workers/internal/AirbyteMessageTrackerTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/AirbyteMessageTrackerTest.java index 6eb5882d670f..7bd22aee830f 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/internal/AirbyteMessageTrackerTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/AirbyteMessageTrackerTest.java @@ -7,13 +7,17 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +import io.airbyte.commons.worker.internal.AirbyteMessageTracker; +import io.airbyte.commons.worker.internal.StateDeltaTracker; +import io.airbyte.commons.worker.internal.StateMetricsTracker; import io.airbyte.commons.json.Jsons; import io.airbyte.config.FailureReason; import io.airbyte.config.State; import io.airbyte.protocol.models.AirbyteMessage; -import io.airbyte.workers.helper.FailureHelper; -import io.airbyte.workers.internal.StateDeltaTracker.StateDeltaTrackerException; -import io.airbyte.workers.internal.state_aggregator.StateAggregator; +import io.airbyte.commons.worker.helper.FailureHelper; +import io.airbyte.commons.worker.internal.StateDeltaTracker.StateDeltaTrackerException; +import io.airbyte.commons.worker.internal.state_aggregator.StateAggregator; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.BeforeEach; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/internal/AirbyteProtocolPredicateTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/AirbyteProtocolPredicateTest.java similarity index 90% rename from airbyte-workers/src/test/java/io/airbyte/workers/internal/AirbyteProtocolPredicateTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/AirbyteProtocolPredicateTest.java index 9750e4fbf7b3..5531b8852a4d 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/internal/AirbyteProtocolPredicateTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/AirbyteProtocolPredicateTest.java @@ -4,10 +4,12 @@ package io.airbyte.workers.internal; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import io.airbyte.commons.worker.internal.AirbyteProtocolPredicate; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/internal/DefaultAirbyteDestinationTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/DefaultAirbyteDestinationTest.java similarity index 93% rename from airbyte-workers/src/test/java/io/airbyte/workers/internal/DefaultAirbyteDestinationTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/DefaultAirbyteDestinationTest.java index 9a2eef1cf3a6..ed0aaa07ddc4 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/internal/DefaultAirbyteDestinationTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/DefaultAirbyteDestinationTest.java @@ -17,6 +17,9 @@ import static org.mockito.Mockito.when; import com.google.common.collect.Lists; +import io.airbyte.commons.worker.internal.AirbyteDestination; +import io.airbyte.commons.worker.internal.AirbyteStreamFactory; +import io.airbyte.commons.worker.internal.DefaultAirbyteDestination; import io.airbyte.commons.io.IOs; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.logging.LoggingHelper.Color; @@ -25,11 +28,12 @@ import io.airbyte.config.helpers.LogClientSingleton; import io.airbyte.config.helpers.LogConfigs; import io.airbyte.protocol.models.AirbyteMessage; -import io.airbyte.workers.TestConfigHelpers; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.process.IntegrationLauncher; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.process.IntegrationLauncher; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; +import io.airbyte.commons.worker.test_utils.TestConfigHelpers; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/internal/DefaultAirbyteSourceTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/DefaultAirbyteSourceTest.java similarity index 94% rename from airbyte-workers/src/test/java/io/airbyte/workers/internal/DefaultAirbyteSourceTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/DefaultAirbyteSourceTest.java index 38fcf48daf1d..e1cae373a704 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/internal/DefaultAirbyteSourceTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/DefaultAirbyteSourceTest.java @@ -17,6 +17,10 @@ import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; +import io.airbyte.commons.worker.internal.AirbyteSource; +import io.airbyte.commons.worker.internal.AirbyteStreamFactory; +import io.airbyte.commons.worker.internal.DefaultAirbyteSource; +import io.airbyte.commons.worker.internal.HeartbeatMonitor; import io.airbyte.commons.io.IOs; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.logging.LoggingHelper.Color; @@ -30,9 +34,10 @@ import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; import io.airbyte.protocol.models.Field; import io.airbyte.protocol.models.JsonSchemaType; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.process.IntegrationLauncher; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.process.IntegrationLauncher; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/internal/DefaultAirbyteStreamFactoryTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/DefaultAirbyteStreamFactoryTest.java similarity index 95% rename from airbyte-workers/src/test/java/io/airbyte/workers/internal/DefaultAirbyteStreamFactoryTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/DefaultAirbyteStreamFactoryTest.java index 226fd06fdc4b..3ecd0689bd1c 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/internal/DefaultAirbyteStreamFactoryTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/DefaultAirbyteStreamFactoryTest.java @@ -13,10 +13,13 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; +import io.airbyte.commons.worker.internal.AirbyteProtocolPredicate; +import io.airbyte.commons.worker.internal.DefaultAirbyteStreamFactory; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.logging.MdcScope.Builder; import io.airbyte.protocol.models.AirbyteLogMessage; import io.airbyte.protocol.models.AirbyteMessage; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStream; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/internal/EmptyAirbyteSourceTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/EmptyAirbyteSourceTest.java similarity index 99% rename from airbyte-workers/src/test/java/io/airbyte/workers/internal/EmptyAirbyteSourceTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/EmptyAirbyteSourceTest.java index 5455606f367e..56e20de87131 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/internal/EmptyAirbyteSourceTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/EmptyAirbyteSourceTest.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.Lists; +import io.airbyte.commons.worker.internal.EmptyAirbyteSource; import io.airbyte.commons.json.Jsons; import io.airbyte.config.ResetSourceConfiguration; import io.airbyte.config.State; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/internal/HeartbeatMonitorTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/HeartbeatMonitorTest.java similarity index 96% rename from airbyte-workers/src/test/java/io/airbyte/workers/internal/HeartbeatMonitorTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/HeartbeatMonitorTest.java index d28fff9d81e8..0f4f43426486 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/internal/HeartbeatMonitorTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/HeartbeatMonitorTest.java @@ -9,6 +9,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import io.airbyte.commons.worker.internal.HeartbeatMonitor; import java.time.Duration; import java.time.Instant; import java.time.temporal.ChronoUnit; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/internal/NamespacingMapperTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/NamespacingMapperTest.java similarity index 98% rename from airbyte-workers/src/test/java/io/airbyte/workers/internal/NamespacingMapperTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/NamespacingMapperTest.java index 8c19f199fc8a..dd7624d4ba3f 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/internal/NamespacingMapperTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/NamespacingMapperTest.java @@ -6,6 +6,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; +import io.airbyte.commons.worker.internal.NamespacingMapper; import io.airbyte.commons.json.Jsons; import io.airbyte.config.JobSyncConfig.NamespaceDefinitionType; import io.airbyte.protocol.models.AirbyteMessage; @@ -13,6 +14,7 @@ import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; import io.airbyte.protocol.models.Field; import io.airbyte.protocol.models.JsonSchemaType; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; import org.junit.jupiter.api.Test; class NamespacingMapperTest { diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/internal/StateDeltaTrackerTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/StateDeltaTrackerTest.java similarity index 97% rename from airbyte-workers/src/test/java/io/airbyte/workers/internal/StateDeltaTrackerTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/StateDeltaTrackerTest.java index 3df44d94a5fd..351c508331df 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/internal/StateDeltaTrackerTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/StateDeltaTrackerTest.java @@ -4,7 +4,8 @@ package io.airbyte.workers.internal; -import io.airbyte.workers.internal.StateDeltaTracker.StateDeltaTrackerException; +import io.airbyte.commons.worker.internal.StateDeltaTracker; +import io.airbyte.commons.worker.internal.StateDeltaTracker.StateDeltaTrackerException; import java.util.Collections; import java.util.HashMap; import java.util.Map; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/internal/StateMetricsTrackerTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/StateMetricsTrackerTest.java similarity index 96% rename from airbyte-workers/src/test/java/io/airbyte/workers/internal/StateMetricsTrackerTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/StateMetricsTrackerTest.java index dd17e18566af..936a820cf43f 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/internal/StateMetricsTrackerTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/StateMetricsTrackerTest.java @@ -7,10 +7,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; +import io.airbyte.commons.worker.internal.StateMetricsTracker; import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.AirbyteStateMessage; -import io.airbyte.workers.internal.StateMetricsTracker.StateMetricsTrackerNoStateMatchException; -import io.airbyte.workers.internal.StateMetricsTracker.StateMetricsTrackerOomException; +import io.airbyte.commons.worker.internal.StateMetricsTracker.StateMetricsTrackerNoStateMatchException; +import io.airbyte.commons.worker.internal.StateMetricsTracker.StateMetricsTrackerOomException; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import org.junit.jupiter.api.BeforeEach; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/internal/state_aggregator/StateAggregatorTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/state_aggregator/StateAggregatorTest.java similarity index 98% rename from airbyte-workers/src/test/java/io/airbyte/workers/internal/state_aggregator/StateAggregatorTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/state_aggregator/StateAggregatorTest.java index 83761bf5b194..848373d7efec 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/internal/state_aggregator/StateAggregatorTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/internal/state_aggregator/StateAggregatorTest.java @@ -9,6 +9,8 @@ import static io.airbyte.protocol.models.AirbyteStateMessage.AirbyteStateType.STREAM; import com.google.common.collect.Lists; +import io.airbyte.commons.worker.internal.state_aggregator.DefaultStateAggregator; +import io.airbyte.commons.worker.internal.state_aggregator.StateAggregator; import io.airbyte.commons.json.Jsons; import io.airbyte.config.State; import io.airbyte.protocol.models.AirbyteGlobalState; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/normalization/DefaultNormalizationRunnerTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/normalization/DefaultNormalizationRunnerTest.java similarity index 94% rename from airbyte-workers/src/test/java/io/airbyte/workers/normalization/DefaultNormalizationRunnerTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/normalization/DefaultNormalizationRunnerTest.java index 6b182f2c656e..e33680d78d8c 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/normalization/DefaultNormalizationRunnerTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/normalization/DefaultNormalizationRunnerTest.java @@ -15,6 +15,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.ImmutableMap; +import io.airbyte.commons.worker.normalization.DefaultNormalizationRunner; +import io.airbyte.commons.worker.normalization.NormalizationRunner; +import io.airbyte.commons.worker.normalization.NormalizationRunnerFactory; import io.airbyte.commons.io.IOs; import io.airbyte.commons.json.Jsons; import io.airbyte.commons.logging.LoggingHelper.Color; @@ -23,12 +26,12 @@ import io.airbyte.config.helpers.LogClientSingleton; import io.airbyte.config.helpers.LogConfigs; import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.normalization.DefaultNormalizationRunner.DestinationType; -import io.airbyte.workers.process.AirbyteIntegrationLauncher; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.normalization.DefaultNormalizationRunner.DestinationType; +import io.airbyte.commons.worker.process.AirbyteIntegrationLauncher; +import io.airbyte.commons.worker.process.ProcessFactory; import java.io.ByteArrayInputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/normalization/NormalizationRunnerFactoryTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/normalization/NormalizationRunnerFactoryTest.java similarity index 80% rename from airbyte-workers/src/test/java/io/airbyte/workers/normalization/NormalizationRunnerFactoryTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/normalization/NormalizationRunnerFactoryTest.java index 4db4152b7373..3108d17bef40 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/normalization/NormalizationRunnerFactoryTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/normalization/NormalizationRunnerFactoryTest.java @@ -8,8 +8,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; -import io.airbyte.workers.normalization.DefaultNormalizationRunner.DestinationType; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.normalization.DefaultNormalizationRunner; +import io.airbyte.commons.worker.normalization.DefaultNormalizationRunner.DestinationType; +import io.airbyte.commons.worker.normalization.NormalizationRunnerFactory; +import io.airbyte.commons.worker.process.ProcessFactory; import java.util.Map.Entry; import org.apache.commons.lang3.tuple.ImmutablePair; import org.junit.jupiter.api.BeforeEach; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/process/AirbyteIntegrationLauncherTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/process/AirbyteIntegrationLauncherTest.java similarity index 82% rename from airbyte-workers/src/test/java/io/airbyte/workers/process/AirbyteIntegrationLauncherTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/process/AirbyteIntegrationLauncherTest.java index 03bf563792b3..4930a104438f 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/process/AirbyteIntegrationLauncherTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/process/AirbyteIntegrationLauncherTest.java @@ -4,22 +4,24 @@ package io.airbyte.workers.process; -import static io.airbyte.workers.process.AirbyteIntegrationLauncher.CHECK_JOB; -import static io.airbyte.workers.process.AirbyteIntegrationLauncher.DISCOVER_JOB; -import static io.airbyte.workers.process.AirbyteIntegrationLauncher.JOB_TYPE; -import static io.airbyte.workers.process.AirbyteIntegrationLauncher.READ_STEP; -import static io.airbyte.workers.process.AirbyteIntegrationLauncher.SPEC_JOB; -import static io.airbyte.workers.process.AirbyteIntegrationLauncher.SYNC_JOB; -import static io.airbyte.workers.process.AirbyteIntegrationLauncher.SYNC_STEP; -import static io.airbyte.workers.process.AirbyteIntegrationLauncher.WRITE_STEP; +import static io.airbyte.commons.worker.process.AirbyteIntegrationLauncher.CHECK_JOB; +import static io.airbyte.commons.worker.process.AirbyteIntegrationLauncher.DISCOVER_JOB; +import static io.airbyte.commons.worker.process.AirbyteIntegrationLauncher.JOB_TYPE; +import static io.airbyte.commons.worker.process.AirbyteIntegrationLauncher.READ_STEP; +import static io.airbyte.commons.worker.process.AirbyteIntegrationLauncher.SPEC_JOB; +import static io.airbyte.commons.worker.process.AirbyteIntegrationLauncher.SYNC_JOB; +import static io.airbyte.commons.worker.process.AirbyteIntegrationLauncher.SYNC_STEP; +import static io.airbyte.commons.worker.process.AirbyteIntegrationLauncher.WRITE_STEP; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; +import io.airbyte.commons.worker.process.AirbyteIntegrationLauncher; +import io.airbyte.commons.worker.process.ProcessFactory; import io.airbyte.commons.features.EnvVariableFeatureFlags; import io.airbyte.config.EnvConfigs; import io.airbyte.config.WorkerEnvConstants; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.exception.WorkerException; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.exception.WorkerException; import java.nio.file.Path; import java.util.Collections; import java.util.Map; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/process/DockerProcessFactoryTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/process/DockerProcessFactoryTest.java similarity index 96% rename from airbyte-workers/src/test/java/io/airbyte/workers/process/DockerProcessFactoryTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/process/DockerProcessFactoryTest.java index ba8170320962..95981ac520ee 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/process/DockerProcessFactoryTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/process/DockerProcessFactoryTest.java @@ -12,13 +12,15 @@ import com.google.common.base.Stopwatch; import com.google.common.collect.ImmutableMap; +import io.airbyte.commons.worker.process.DockerProcessFactory; +import io.airbyte.commons.worker.process.ProcessFactory; import io.airbyte.commons.io.IOs; import io.airbyte.commons.io.LineGobbler; import io.airbyte.commons.json.Jsons; import io.airbyte.config.EnvConfigs; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.exception.WorkerException; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.exception.WorkerException; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/process/KubePodProcessTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/process/KubePodProcessTest.java similarity index 98% rename from airbyte-workers/src/test/java/io/airbyte/workers/process/KubePodProcessTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/process/KubePodProcessTest.java index 5d324690da0c..66e0253559a9 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/process/KubePodProcessTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/process/KubePodProcessTest.java @@ -7,6 +7,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; +import io.airbyte.commons.worker.process.KubePodProcess; import io.airbyte.commons.docker.DockerUtils; import io.airbyte.commons.string.Strings; import io.fabric8.kubernetes.api.model.ContainerBuilder; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/process/ProcessFactoryTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/process/ProcessFactoryTest.java similarity index 92% rename from airbyte-workers/src/test/java/io/airbyte/workers/process/ProcessFactoryTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/process/ProcessFactoryTest.java index b8924253bee6..b80b8b1a4fe9 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/process/ProcessFactoryTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/process/ProcessFactoryTest.java @@ -4,6 +4,9 @@ package io.airbyte.workers.process; +import io.airbyte.commons.worker.process.AirbyteIntegrationLauncher; +import io.airbyte.commons.worker.process.KubeProcessFactory; +import io.airbyte.commons.worker.process.ProcessFactory; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/storage/DockerComposeDocumentStoreClientTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/storage/DockerComposeDocumentStoreClientTest.java similarity index 95% rename from airbyte-workers/src/test/java/io/airbyte/workers/storage/DockerComposeDocumentStoreClientTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/storage/DockerComposeDocumentStoreClientTest.java index 19f36cb4f983..27fee228c704 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/storage/DockerComposeDocumentStoreClientTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/storage/DockerComposeDocumentStoreClientTest.java @@ -8,6 +8,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import io.airbyte.commons.worker.storage.DockerComposeDocumentStoreClient; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/storage/GcsDocumentStoreClientTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/storage/GcsDocumentStoreClientTest.java similarity index 96% rename from airbyte-workers/src/test/java/io/airbyte/workers/storage/GcsDocumentStoreClientTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/storage/GcsDocumentStoreClientTest.java index 7e8c7143f37a..b2e13796a773 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/storage/GcsDocumentStoreClientTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/storage/GcsDocumentStoreClientTest.java @@ -10,6 +10,7 @@ import com.google.cloud.storage.Storage; import com.google.cloud.storage.StorageOptions; +import io.airbyte.commons.worker.storage.GcsDocumentStoreClient; import java.nio.file.Path; import java.util.Optional; import java.util.UUID; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/storage/S3DocumentStoreClientTest.java b/airbyte-commons-worker/src/test/java/io/airbyte/workers/storage/S3DocumentStoreClientTest.java similarity index 96% rename from airbyte-workers/src/test/java/io/airbyte/workers/storage/S3DocumentStoreClientTest.java rename to airbyte-commons-worker/src/test/java/io/airbyte/workers/storage/S3DocumentStoreClientTest.java index a5f8a251bf61..52b3602494fb 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/storage/S3DocumentStoreClientTest.java +++ b/airbyte-commons-worker/src/test/java/io/airbyte/workers/storage/S3DocumentStoreClientTest.java @@ -8,6 +8,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import io.airbyte.commons.worker.storage.S3DocumentStoreClient; import java.nio.file.Path; import java.util.Optional; import java.util.UUID; diff --git a/airbyte-container-orchestrator/build.gradle b/airbyte-container-orchestrator/build.gradle index d088356a5047..8fdb9bd8be17 100644 --- a/airbyte-container-orchestrator/build.gradle +++ b/airbyte-container-orchestrator/build.gradle @@ -14,11 +14,11 @@ dependencies { implementation project(':airbyte-config:config-models') implementation project(':airbyte-config:config-persistence') implementation project(':airbyte-commons-temporal') + implementation project(':airbyte-commons-worker') implementation project(':airbyte-db:db-lib') implementation project(':airbyte-json-validation') implementation project(':airbyte-protocol:protocol-models') implementation project(':airbyte-persistence:job-persistence') - implementation project(':airbyte-workers') implementation project(':airbyte-metrics:metrics-lib') testImplementation 'org.mockito:mockito-inline:2.13.0' diff --git a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/AsyncStateManager.java b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/AsyncStateManager.java index 991128ff4450..57ca1d9f9361 100644 --- a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/AsyncStateManager.java +++ b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/AsyncStateManager.java @@ -4,8 +4,8 @@ package io.airbyte.container_orchestrator; -import io.airbyte.workers.process.AsyncKubePodStatus; -import io.airbyte.workers.process.KubePodInfo; +import io.airbyte.commons.worker.process.AsyncKubePodStatus; +import io.airbyte.commons.worker.process.KubePodInfo; /** * The state manager writes the "truth" for states of the async pod process. If the store isn't diff --git a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/ContainerOrchestratorApp.java b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/ContainerOrchestratorApp.java index 7b9a5d9b6fba..78b4a15b1037 100644 --- a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/ContainerOrchestratorApp.java +++ b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/ContainerOrchestratorApp.java @@ -8,25 +8,25 @@ import io.airbyte.commons.features.FeatureFlags; import io.airbyte.commons.logging.LoggingHelper; import io.airbyte.commons.logging.MdcScope; +import io.airbyte.commons.temporal.sync.OrchestratorConstants; import io.airbyte.config.Configs; import io.airbyte.config.EnvConfigs; import io.airbyte.config.helpers.LogClientSingleton; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.process.AsyncKubePodStatus; -import io.airbyte.workers.process.AsyncOrchestratorPodProcess; -import io.airbyte.workers.process.DockerProcessFactory; -import io.airbyte.workers.process.KubePodInfo; -import io.airbyte.workers.process.KubePodProcess; -import io.airbyte.workers.process.KubePortManagerSingleton; -import io.airbyte.workers.process.KubeProcessFactory; -import io.airbyte.workers.process.ProcessFactory; -import io.airbyte.workers.storage.StateClients; -import io.airbyte.workers.temporal.sync.DbtLauncherWorker; -import io.airbyte.workers.temporal.sync.NormalizationLauncherWorker; -import io.airbyte.workers.temporal.sync.OrchestratorConstants; -import io.airbyte.workers.temporal.sync.ReplicationLauncherWorker; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.process.AsyncKubePodStatus; +import io.airbyte.commons.worker.process.AsyncOrchestratorPodProcess; +import io.airbyte.commons.worker.process.DockerProcessFactory; +import io.airbyte.commons.worker.process.KubePodInfo; +import io.airbyte.commons.worker.process.KubePodProcess; +import io.airbyte.commons.worker.process.KubePortManagerSingleton; +import io.airbyte.commons.worker.process.KubeProcessFactory; +import io.airbyte.commons.worker.process.ProcessFactory; +import io.airbyte.commons.worker.storage.StateClients; +import io.airbyte.commons.worker.sync.DbtLauncherWorker; +import io.airbyte.commons.worker.sync.NormalizationLauncherWorker; +import io.airbyte.commons.worker.sync.ReplicationLauncherWorker; import io.fabric8.kubernetes.client.DefaultKubernetesClient; import io.fabric8.kubernetes.client.KubernetesClient; import java.io.IOException; diff --git a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/DbtJobOrchestrator.java b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/DbtJobOrchestrator.java index b46a34d9acf7..0ed347b0d80b 100644 --- a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/DbtJobOrchestrator.java +++ b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/DbtJobOrchestrator.java @@ -8,14 +8,14 @@ import io.airbyte.config.OperatorDbtInput; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.general.DbtTransformationRunner; -import io.airbyte.workers.general.DbtTransformationWorker; -import io.airbyte.workers.normalization.NormalizationRunnerFactory; -import io.airbyte.workers.process.KubePodProcess; -import io.airbyte.workers.process.ProcessFactory; -import io.airbyte.workers.temporal.sync.ReplicationLauncherWorker; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.general.DbtTransformationRunner; +import io.airbyte.commons.worker.general.DbtTransformationWorker; +import io.airbyte.commons.worker.normalization.NormalizationRunnerFactory; +import io.airbyte.commons.worker.process.KubePodProcess; +import io.airbyte.commons.worker.process.ProcessFactory; +import io.airbyte.commons.worker.sync.ReplicationLauncherWorker; import java.nio.file.Path; import java.util.Optional; import lombok.extern.slf4j.Slf4j; diff --git a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/DefaultAsyncStateManager.java b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/DefaultAsyncStateManager.java index 2114066d5495..39986a0b3ad4 100644 --- a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/DefaultAsyncStateManager.java +++ b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/DefaultAsyncStateManager.java @@ -4,9 +4,9 @@ package io.airbyte.container_orchestrator; -import io.airbyte.workers.general.DocumentStoreClient; -import io.airbyte.workers.process.AsyncKubePodStatus; -import io.airbyte.workers.process.KubePodInfo; +import io.airbyte.commons.worker.process.AsyncKubePodStatus; +import io.airbyte.commons.worker.process.KubePodInfo; +import io.airbyte.commons.worker.storage.DocumentStoreClient; import java.util.List; import lombok.extern.slf4j.Slf4j; diff --git a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/JobOrchestrator.java b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/JobOrchestrator.java index 65395b7547a7..a7102ab0728b 100644 --- a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/JobOrchestrator.java +++ b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/JobOrchestrator.java @@ -5,11 +5,11 @@ package io.airbyte.container_orchestrator; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.temporal.sync.OrchestratorConstants; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.process.AsyncOrchestratorPodProcess; -import io.airbyte.workers.process.KubePodInfo; -import io.airbyte.workers.process.KubePodProcess; -import io.airbyte.workers.temporal.sync.OrchestratorConstants; +import io.airbyte.commons.worker.process.AsyncOrchestratorPodProcess; +import io.airbyte.commons.worker.process.KubePodInfo; +import io.airbyte.commons.worker.process.KubePodProcess; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/NoOpOrchestrator.java b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/NoOpOrchestrator.java index 1a5a62d766df..e07f0ecccd9a 100644 --- a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/NoOpOrchestrator.java +++ b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/NoOpOrchestrator.java @@ -4,7 +4,7 @@ package io.airbyte.container_orchestrator; -import io.airbyte.workers.process.AsyncOrchestratorPodProcess; +import io.airbyte.commons.worker.process.AsyncOrchestratorPodProcess; import java.util.Optional; import lombok.extern.slf4j.Slf4j; diff --git a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/NormalizationJobOrchestrator.java b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/NormalizationJobOrchestrator.java index 2427ccafe06b..5ce668a04bc5 100644 --- a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/NormalizationJobOrchestrator.java +++ b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/NormalizationJobOrchestrator.java @@ -10,13 +10,13 @@ import io.airbyte.config.NormalizationSummary; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.general.DefaultNormalizationWorker; -import io.airbyte.workers.normalization.NormalizationRunnerFactory; -import io.airbyte.workers.normalization.NormalizationWorker; -import io.airbyte.workers.process.KubePodProcess; -import io.airbyte.workers.process.ProcessFactory; -import io.airbyte.workers.temporal.sync.ReplicationLauncherWorker; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.general.DefaultNormalizationWorker; +import io.airbyte.commons.worker.normalization.NormalizationRunnerFactory; +import io.airbyte.commons.worker.normalization.NormalizationWorker; +import io.airbyte.commons.worker.process.KubePodProcess; +import io.airbyte.commons.worker.process.ProcessFactory; +import io.airbyte.commons.worker.sync.ReplicationLauncherWorker; import java.nio.file.Path; import java.util.Optional; import lombok.extern.slf4j.Slf4j; diff --git a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/ReplicationJobOrchestrator.java b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/ReplicationJobOrchestrator.java index 53d575ff2e2c..34d397f2cd50 100644 --- a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/ReplicationJobOrchestrator.java +++ b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/ReplicationJobOrchestrator.java @@ -14,23 +14,23 @@ import io.airbyte.metrics.lib.MetricEmittingApps; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.RecordSchemaValidator; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.WorkerMetricReporter; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.general.DefaultReplicationWorker; -import io.airbyte.workers.general.ReplicationWorker; -import io.airbyte.workers.internal.AirbyteMessageTracker; -import io.airbyte.workers.internal.AirbyteSource; -import io.airbyte.workers.internal.DefaultAirbyteDestination; -import io.airbyte.workers.internal.DefaultAirbyteSource; -import io.airbyte.workers.internal.EmptyAirbyteSource; -import io.airbyte.workers.internal.NamespacingMapper; -import io.airbyte.workers.process.AirbyteIntegrationLauncher; -import io.airbyte.workers.process.IntegrationLauncher; -import io.airbyte.workers.process.KubePodProcess; -import io.airbyte.workers.process.ProcessFactory; -import io.airbyte.workers.temporal.sync.ReplicationLauncherWorker; +import io.airbyte.commons.worker.RecordSchemaValidator; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.WorkerMetricReporter; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.general.DefaultReplicationWorker; +import io.airbyte.commons.worker.general.ReplicationWorker; +import io.airbyte.commons.worker.internal.AirbyteMessageTracker; +import io.airbyte.commons.worker.internal.AirbyteSource; +import io.airbyte.commons.worker.internal.DefaultAirbyteDestination; +import io.airbyte.commons.worker.internal.DefaultAirbyteSource; +import io.airbyte.commons.worker.internal.EmptyAirbyteSource; +import io.airbyte.commons.worker.internal.NamespacingMapper; +import io.airbyte.commons.worker.process.AirbyteIntegrationLauncher; +import io.airbyte.commons.worker.process.IntegrationLauncher; +import io.airbyte.commons.worker.process.KubePodProcess; +import io.airbyte.commons.worker.process.ProcessFactory; +import io.airbyte.commons.worker.sync.ReplicationLauncherWorker; import java.nio.file.Path; import java.util.Optional; import lombok.extern.slf4j.Slf4j; diff --git a/airbyte-container-orchestrator/src/test/java/io/airbyte/container_orchestrator/DefaultAsyncStateManagerTest.java b/airbyte-container-orchestrator/src/test/java/io/airbyte/container_orchestrator/DefaultAsyncStateManagerTest.java index 76b2b85b929c..9f857eb43b30 100644 --- a/airbyte-container-orchestrator/src/test/java/io/airbyte/container_orchestrator/DefaultAsyncStateManagerTest.java +++ b/airbyte-container-orchestrator/src/test/java/io/airbyte/container_orchestrator/DefaultAsyncStateManagerTest.java @@ -9,10 +9,10 @@ import static org.mockito.Mockito.*; import static org.mockito.Mockito.when; -import io.airbyte.workers.general.DocumentStoreClient; -import io.airbyte.workers.process.AsyncKubePodStatus; -import io.airbyte.workers.process.KubeContainerInfo; -import io.airbyte.workers.process.KubePodInfo; +import io.airbyte.commons.worker.process.AsyncKubePodStatus; +import io.airbyte.commons.worker.process.KubeContainerInfo; +import io.airbyte.commons.worker.process.KubePodInfo; +import io.airbyte.commons.worker.storage.DocumentStoreClient; import java.util.Optional; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/airbyte-integrations/bases/standard-destination-test/build.gradle b/airbyte-integrations/bases/standard-destination-test/build.gradle index bc9aee6076fe..edc9bdb84971 100644 --- a/airbyte-integrations/bases/standard-destination-test/build.gradle +++ b/airbyte-integrations/bases/standard-destination-test/build.gradle @@ -3,6 +3,7 @@ plugins { } dependencies { implementation project(':airbyte-db:db-lib') + implementation project(':airbyte-commons-worker') implementation project(':airbyte-config:config-models') implementation project(':airbyte-integrations:bases:base-java') implementation project(':airbyte-protocol:protocol-models') diff --git a/airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/DestinationAcceptanceTest.java b/airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/DestinationAcceptanceTest.java index c503edd6e323..ed41f1d4eebc 100644 --- a/airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/DestinationAcceptanceTest.java +++ b/airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/DestinationAcceptanceTest.java @@ -43,19 +43,19 @@ import io.airbyte.protocol.models.Field; import io.airbyte.protocol.models.JsonSchemaType; import io.airbyte.protocol.models.SyncMode; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.general.DbtTransformationRunner; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.general.DbtTransformationRunner; import io.airbyte.workers.general.DefaultCheckConnectionWorker; import io.airbyte.workers.general.DefaultGetSpecWorker; import io.airbyte.workers.helper.EntrypointEnvChecker; -import io.airbyte.workers.internal.AirbyteDestination; -import io.airbyte.workers.internal.DefaultAirbyteDestination; -import io.airbyte.workers.normalization.NormalizationRunner; -import io.airbyte.workers.normalization.NormalizationRunnerFactory; -import io.airbyte.workers.process.AirbyteIntegrationLauncher; -import io.airbyte.workers.process.DockerProcessFactory; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.internal.AirbyteDestination; +import io.airbyte.commons.worker.internal.DefaultAirbyteDestination; +import io.airbyte.commons.worker.normalization.NormalizationRunner; +import io.airbyte.commons.worker.normalization.NormalizationRunnerFactory; +import io.airbyte.commons.worker.process.AirbyteIntegrationLauncher; +import io.airbyte.commons.worker.process.DockerProcessFactory; +import io.airbyte.commons.worker.process.ProcessFactory; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/LocalAirbyteDestination.java b/airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/LocalAirbyteDestination.java index 8446a483644c..8de6f7230fc9 100644 --- a/airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/LocalAirbyteDestination.java +++ b/airbyte-integrations/bases/standard-destination-test/src/main/java/io/airbyte/integrations/standardtest/destination/LocalAirbyteDestination.java @@ -8,7 +8,7 @@ import io.airbyte.integrations.base.AirbyteMessageConsumer; import io.airbyte.integrations.base.Destination; import io.airbyte.protocol.models.AirbyteMessage; -import io.airbyte.workers.internal.AirbyteDestination; +import io.airbyte.commons.worker.internal.AirbyteDestination; import java.nio.file.Path; import java.util.Optional; diff --git a/airbyte-integrations/bases/standard-source-test/build.gradle b/airbyte-integrations/bases/standard-source-test/build.gradle index f6d787893dc9..b27667a27491 100644 --- a/airbyte-integrations/bases/standard-source-test/build.gradle +++ b/airbyte-integrations/bases/standard-source-test/build.gradle @@ -13,6 +13,7 @@ import org.jsoup.Jsoup; dependencies { implementation project(':airbyte-db:db-lib') + implementation project(':airbyte-commons-worker') implementation project(':airbyte-config:config-models') implementation project(':airbyte-config:config-persistence') implementation project(':airbyte-protocol:protocol-models') diff --git a/airbyte-integrations/bases/standard-source-test/src/main/java/io/airbyte/integrations/standardtest/source/AbstractSourceConnectorTest.java b/airbyte-integrations/bases/standard-source-test/src/main/java/io/airbyte/integrations/standardtest/source/AbstractSourceConnectorTest.java index 26d786fa784e..bdc4b42c144f 100644 --- a/airbyte-integrations/bases/standard-source-test/src/main/java/io/airbyte/integrations/standardtest/source/AbstractSourceConnectorTest.java +++ b/airbyte-integrations/bases/standard-source-test/src/main/java/io/airbyte/integrations/standardtest/source/AbstractSourceConnectorTest.java @@ -26,17 +26,17 @@ import io.airbyte.protocol.models.AirbyteRecordMessage; import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.exception.WorkerException; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.exception.WorkerException; import io.airbyte.workers.general.DefaultCheckConnectionWorker; import io.airbyte.workers.general.DefaultDiscoverCatalogWorker; import io.airbyte.workers.general.DefaultGetSpecWorker; import io.airbyte.workers.helper.EntrypointEnvChecker; -import io.airbyte.workers.internal.AirbyteSource; -import io.airbyte.workers.internal.DefaultAirbyteSource; -import io.airbyte.workers.process.AirbyteIntegrationLauncher; -import io.airbyte.workers.process.DockerProcessFactory; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.internal.AirbyteSource; +import io.airbyte.commons.worker.internal.DefaultAirbyteSource; +import io.airbyte.commons.worker.process.AirbyteIntegrationLauncher; +import io.airbyte.commons.worker.process.DockerProcessFactory; +import io.airbyte.commons.worker.process.ProcessFactory; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; diff --git a/airbyte-integrations/bases/standard-source-test/src/main/java/io/airbyte/integrations/standardtest/source/PythonSourceAcceptanceTest.java b/airbyte-integrations/bases/standard-source-test/src/main/java/io/airbyte/integrations/standardtest/source/PythonSourceAcceptanceTest.java index b024cb99760c..6d4c3b0848b4 100644 --- a/airbyte-integrations/bases/standard-source-test/src/main/java/io/airbyte/integrations/standardtest/source/PythonSourceAcceptanceTest.java +++ b/airbyte-integrations/bases/standard-source-test/src/main/java/io/airbyte/integrations/standardtest/source/PythonSourceAcceptanceTest.java @@ -15,7 +15,7 @@ import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.workers.WorkerUtils; +import io.airbyte.commons.worker.WorkerUtils; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/airbyte-server/build.gradle b/airbyte-server/build.gradle index e3dddbe3ca50..b39aad432696 100644 --- a/airbyte-server/build.gradle +++ b/airbyte-server/build.gradle @@ -11,6 +11,7 @@ dependencies { implementation project(':airbyte-api') implementation project(':airbyte-commons-docker') implementation project(':airbyte-commons-temporal') + implementation project(':airbyte-commons-worker') implementation project(':airbyte-config:init') implementation project(':airbyte-config:config-models') implementation project(':airbyte-config:config-persistence') diff --git a/airbyte-server/src/main/java/io/airbyte/server/ServerApp.java b/airbyte-server/src/main/java/io/airbyte/server/ServerApp.java index c50b443e203d..1855dce1e01a 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/ServerApp.java +++ b/airbyte-server/src/main/java/io/airbyte/server/ServerApp.java @@ -55,7 +55,7 @@ import io.airbyte.server.scheduler.EventRunner; import io.airbyte.server.scheduler.TemporalEventRunner; import io.airbyte.validation.json.JsonValidationException; -import io.airbyte.workers.normalization.NormalizationRunnerFactory; +import io.airbyte.commons.worker.normalization.NormalizationRunnerFactory; import io.airbyte.workers.temporal.ConnectionManagerUtils; import io.airbyte.workers.temporal.StreamResetRecordsHelper; import io.airbyte.workers.temporal.TemporalClient; diff --git a/airbyte-workers/build.gradle b/airbyte-workers/build.gradle index 2e740fe29aa9..94626fdaab9f 100644 --- a/airbyte-workers/build.gradle +++ b/airbyte-workers/build.gradle @@ -1,8 +1,5 @@ -import org.jsonschema2pojo.SourceType - plugins { id 'application' - id 'com.github.eirnym.js2p' version '1.0' id 'airbyte-integration-test-java' } @@ -44,6 +41,7 @@ dependencies { implementation project(':airbyte-commons-docker') implementation project(':airbyte-commons-protocol') implementation project(':airbyte-commons-temporal') + implementation project(':airbyte-commons-worker') implementation project(':airbyte-config:config-models') implementation project(':airbyte-config:config-persistence') implementation project(':airbyte-config:init') @@ -83,20 +81,6 @@ dependencies { integrationTestJavaImplementation libs.bundles.micronaut.test } -jsonSchema2Pojo { - sourceType = SourceType.YAMLSCHEMA - source = files("${sourceSets.main.output.resourcesDir}/workers_models") - targetDirectory = new File(project.buildDir, 'generated/src/gen/java/') - removeOldOutput = true - - targetPackage = 'io.airbyte.persistence.job.models' - - useLongIntegers = true - generateBuilders = true - includeConstructors = false - includeSetters = true -} - mainClassName = 'io.airbyte.workers.Application' application { diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/ApplicationInitializer.java b/airbyte-workers/src/main/java/io/airbyte/workers/ApplicationInitializer.java index d183f4a3b816..2e2b8e22942c 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/ApplicationInitializer.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/ApplicationInitializer.java @@ -16,8 +16,8 @@ import io.airbyte.db.check.impl.JobsDatabaseAvailabilityCheck; import io.airbyte.metrics.lib.MetricClientFactory; import io.airbyte.metrics.lib.MetricEmittingApps; -import io.airbyte.workers.config.WorkerMode; -import io.airbyte.workers.process.KubePortManagerSingleton; +import io.airbyte.commons.worker.config.WorkerMode; +import io.airbyte.commons.worker.process.KubePortManagerSingleton; import io.airbyte.workers.temporal.check.connection.CheckConnectionWorkflowImpl; import io.airbyte.workers.temporal.discover.catalog.DiscoverCatalogWorkflowImpl; import io.airbyte.workers.temporal.scheduling.ConnectionManagerWorkflowImpl; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/ActivityBeanFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/config/ActivityBeanFactory.java index 04f86556a501..a5e239ec35c7 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/ActivityBeanFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/config/ActivityBeanFactory.java @@ -4,8 +4,9 @@ package io.airbyte.workers.config; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.commons.temporal.TemporalUtils; -import io.airbyte.workers.exception.WorkerException; +import io.airbyte.commons.worker.exception.WorkerException; import io.airbyte.workers.temporal.check.connection.CheckConnectionActivity; import io.airbyte.workers.temporal.discover.catalog.DiscoverCatalogActivity; import io.airbyte.workers.temporal.scheduling.activities.AutoDisableConnectionActivity; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/ApiClientBeanFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/config/ApiClientBeanFactory.java index 4d7e319b0f4d..2fd889520788 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/ApiClientBeanFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/config/ApiClientBeanFactory.java @@ -9,6 +9,7 @@ import com.auth0.jwt.algorithms.Algorithm; import com.google.auth.oauth2.ServiceAccountCredentials; import io.airbyte.api.client.AirbyteApiClient; +import io.airbyte.commons.worker.config.WorkerMode; import io.micronaut.context.BeanProvider; import io.micronaut.context.annotation.Factory; import io.micronaut.context.annotation.Prototype; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/ApplicationBeanFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/config/ApplicationBeanFactory.java index c14c2431cfa9..87953e8a699d 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/ApplicationBeanFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/config/ApplicationBeanFactory.java @@ -5,6 +5,7 @@ package io.airbyte.workers.config; import io.airbyte.analytics.TrackingClient; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.commons.features.EnvVariableFeatureFlags; import io.airbyte.commons.features.FeatureFlags; import io.airbyte.commons.version.AirbyteVersion; @@ -24,7 +25,7 @@ import io.airbyte.persistence.job.WebUrlHelper; import io.airbyte.persistence.job.WorkspaceHelper; import io.airbyte.persistence.job.tracker.JobTracker; -import io.airbyte.workers.WorkerConfigs; +import io.airbyte.commons.worker.WorkerConfigs; import io.micronaut.context.annotation.Factory; import io.micronaut.context.annotation.Requires; import io.micronaut.context.annotation.Value; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/ContainerOrchestratorConfigBeanFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/config/ContainerOrchestratorConfigBeanFactory.java index e77a5d735326..d549d84688fb 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/ContainerOrchestratorConfigBeanFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/config/ContainerOrchestratorConfigBeanFactory.java @@ -6,9 +6,9 @@ import io.airbyte.config.Configs.WorkerEnvironment; import io.airbyte.config.storage.CloudStorageConfigs; -import io.airbyte.workers.ContainerOrchestratorConfig; -import io.airbyte.workers.general.DocumentStoreClient; -import io.airbyte.workers.storage.StateClients; +import io.airbyte.commons.worker.ContainerOrchestratorConfig; +import io.airbyte.commons.worker.storage.DocumentStoreClient; +import io.airbyte.commons.worker.storage.StateClients; import io.fabric8.kubernetes.client.DefaultKubernetesClient; import io.micronaut.context.annotation.Factory; import io.micronaut.context.annotation.Requires; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/DatabaseBeanFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/config/DatabaseBeanFactory.java index 9403a1c21014..e2c7c8908c32 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/DatabaseBeanFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/config/DatabaseBeanFactory.java @@ -4,6 +4,7 @@ package io.airbyte.workers.config; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.config.persistence.ConfigPersistence; import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.config.persistence.DatabaseConfigPersistence; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/JobErrorReportingBeanFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/config/JobErrorReportingBeanFactory.java index f5ba3350d35a..b3781194a619 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/JobErrorReportingBeanFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/config/JobErrorReportingBeanFactory.java @@ -4,6 +4,7 @@ package io.airbyte.workers.config; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.config.Configs.DeploymentMode; import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.persistence.job.WebUrlHelper; @@ -12,7 +13,7 @@ import io.airbyte.persistence.job.errorreporter.LoggingJobErrorReportingClient; import io.airbyte.persistence.job.errorreporter.SentryExceptionHelper; import io.airbyte.persistence.job.errorreporter.SentryJobErrorReportingClient; -import io.airbyte.workers.normalization.NormalizationRunnerFactory; +import io.airbyte.commons.worker.normalization.NormalizationRunnerFactory; import io.micronaut.context.annotation.Factory; import io.micronaut.context.annotation.Requires; import io.micronaut.context.annotation.Value; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/ProcessFactoryBeanFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/config/ProcessFactoryBeanFactory.java index e3f499624fc4..c0e0c83a4632 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/ProcessFactoryBeanFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/config/ProcessFactoryBeanFactory.java @@ -4,10 +4,11 @@ package io.airbyte.workers.config; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.process.DockerProcessFactory; -import io.airbyte.workers.process.KubeProcessFactory; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.config.WorkerMode; +import io.airbyte.commons.worker.process.DockerProcessFactory; +import io.airbyte.commons.worker.process.KubeProcessFactory; +import io.airbyte.commons.worker.process.ProcessFactory; import io.fabric8.kubernetes.client.DefaultKubernetesClient; import io.fabric8.kubernetes.client.KubernetesClient; import io.micronaut.context.annotation.Factory; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/SecretPersistenceBeanFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/config/SecretPersistenceBeanFactory.java index 1b15ce5b2c4b..791e6c30506f 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/SecretPersistenceBeanFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/config/SecretPersistenceBeanFactory.java @@ -4,6 +4,7 @@ package io.airbyte.workers.config; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.config.persistence.split_secrets.GoogleSecretManagerPersistence; import io.airbyte.config.persistence.split_secrets.LocalTestingSecretPersistence; import io.airbyte.config.persistence.split_secrets.RealSecretsHydrator; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/TemporalBeanFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/config/TemporalBeanFactory.java index 96aa20611129..c41e0e1a1a72 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/TemporalBeanFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/config/TemporalBeanFactory.java @@ -7,6 +7,7 @@ import io.airbyte.analytics.Deployment; import io.airbyte.analytics.TrackingClient; import io.airbyte.analytics.TrackingClientSingleton; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.commons.features.FeatureFlags; import io.airbyte.commons.temporal.TemporalUtils; import io.airbyte.commons.version.AirbyteVersion; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/CheckConnectionWorker.java b/airbyte-workers/src/main/java/io/airbyte/workers/general/CheckConnectionWorker.java index 559838b5690d..42a63380ba41 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/CheckConnectionWorker.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/general/CheckConnectionWorker.java @@ -6,6 +6,6 @@ import io.airbyte.config.ConnectorJobOutput; import io.airbyte.config.StandardCheckConnectionInput; -import io.airbyte.workers.Worker; +import io.airbyte.commons.worker.Worker; public interface CheckConnectionWorker extends Worker {} diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultCheckConnectionWorker.java b/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultCheckConnectionWorker.java index c29af2c84a96..90ec97c7d3d0 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultCheckConnectionWorker.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultCheckConnectionWorker.java @@ -16,12 +16,12 @@ import io.airbyte.protocol.models.AirbyteConnectionStatus; import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.AirbyteMessage.Type; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.internal.AirbyteStreamFactory; -import io.airbyte.workers.internal.DefaultAirbyteStreamFactory; -import io.airbyte.workers.process.IntegrationLauncher; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.internal.AirbyteStreamFactory; +import io.airbyte.commons.worker.internal.DefaultAirbyteStreamFactory; +import io.airbyte.commons.worker.process.IntegrationLauncher; import java.io.InputStream; import java.nio.file.Path; import java.util.ArrayList; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultDiscoverCatalogWorker.java b/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultDiscoverCatalogWorker.java index 209fdbcdb559..cf23f813e4ad 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultDiscoverCatalogWorker.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultDiscoverCatalogWorker.java @@ -14,12 +14,12 @@ import io.airbyte.protocol.models.AirbyteCatalog; import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.AirbyteMessage.Type; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.internal.AirbyteStreamFactory; -import io.airbyte.workers.internal.DefaultAirbyteStreamFactory; -import io.airbyte.workers.process.IntegrationLauncher; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.internal.AirbyteStreamFactory; +import io.airbyte.commons.worker.internal.DefaultAirbyteStreamFactory; +import io.airbyte.commons.worker.process.IntegrationLauncher; import java.io.InputStream; import java.nio.file.Path; import java.util.ArrayList; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultGetSpecWorker.java b/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultGetSpecWorker.java index cf6fbbb417a7..440b2c89a65a 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultGetSpecWorker.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/general/DefaultGetSpecWorker.java @@ -12,11 +12,11 @@ import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.AirbyteMessage.Type; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.internal.AirbyteStreamFactory; -import io.airbyte.workers.internal.DefaultAirbyteStreamFactory; -import io.airbyte.workers.process.IntegrationLauncher; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.internal.AirbyteStreamFactory; +import io.airbyte.commons.worker.internal.DefaultAirbyteStreamFactory; +import io.airbyte.commons.worker.process.IntegrationLauncher; import java.io.InputStream; import java.nio.file.Path; import java.util.ArrayList; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/DiscoverCatalogWorker.java b/airbyte-workers/src/main/java/io/airbyte/workers/general/DiscoverCatalogWorker.java index c2f7eccc3cdf..9c759053d3bf 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/DiscoverCatalogWorker.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/general/DiscoverCatalogWorker.java @@ -6,6 +6,6 @@ import io.airbyte.config.ConnectorJobOutput; import io.airbyte.config.StandardDiscoverCatalogInput; -import io.airbyte.workers.Worker; +import io.airbyte.commons.worker.Worker; public interface DiscoverCatalogWorker extends Worker {} diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/EchoWorker.java b/airbyte-workers/src/main/java/io/airbyte/workers/general/EchoWorker.java index 7a5279aae531..77829cb2a054 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/EchoWorker.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/general/EchoWorker.java @@ -4,7 +4,7 @@ package io.airbyte.workers.general; -import io.airbyte.workers.Worker; +import io.airbyte.commons.worker.Worker; import java.nio.file.Path; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/general/GetSpecWorker.java b/airbyte-workers/src/main/java/io/airbyte/workers/general/GetSpecWorker.java index 58dae6388419..12821563a2fb 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/general/GetSpecWorker.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/general/GetSpecWorker.java @@ -6,6 +6,6 @@ import io.airbyte.config.ConnectorJobOutput; import io.airbyte.config.JobGetSpecConfig; -import io.airbyte.workers.Worker; +import io.airbyte.commons.worker.Worker; public interface GetSpecWorker extends Worker {} diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/helper/ConnectionHelper.java b/airbyte-workers/src/main/java/io/airbyte/workers/helper/ConnectionHelper.java index 3232b25abbec..bdf5bd64a7e7 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/helper/ConnectionHelper.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/helper/ConnectionHelper.java @@ -17,7 +17,7 @@ import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.persistence.job.WorkspaceHelper; import io.airbyte.validation.json.JsonValidationException; -import io.airbyte.workers.config.WorkerMode; +import io.airbyte.commons.worker.config.WorkerMode; import io.micronaut.context.annotation.Requires; import jakarta.inject.Singleton; import java.io.IOException; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/helper/EntrypointEnvChecker.java b/airbyte-workers/src/main/java/io/airbyte/workers/helper/EntrypointEnvChecker.java index 9b59867ada27..601891efd5e3 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/helper/EntrypointEnvChecker.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/helper/EntrypointEnvChecker.java @@ -4,8 +4,8 @@ package io.airbyte.workers.helper; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.process.ProcessFactory; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/run/TemporalWorkerRunFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/run/TemporalWorkerRunFactory.java index 44bcb8a1a400..79e90a9cf0cc 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/run/TemporalWorkerRunFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/run/TemporalWorkerRunFactory.java @@ -17,7 +17,7 @@ import io.airbyte.persistence.job.models.Job; import io.airbyte.workers.JobStatus; import io.airbyte.workers.OutputAndStatus; -import io.airbyte.workers.WorkerConstants; +import io.airbyte.commons.worker.WorkerConstants; import io.airbyte.workers.temporal.TemporalClient; import io.airbyte.workers.temporal.TemporalResponse; import java.nio.file.Path; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/run/WorkerRun.java b/airbyte-workers/src/main/java/io/airbyte/workers/run/WorkerRun.java index 33dd11a69306..39d606582fd4 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/run/WorkerRun.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/run/WorkerRun.java @@ -7,7 +7,7 @@ import io.airbyte.commons.functional.CheckedSupplier; import io.airbyte.config.JobOutput; import io.airbyte.workers.OutputAndStatus; -import io.airbyte.workers.WorkerUtils; +import io.airbyte.commons.worker.WorkerUtils; import java.nio.file.Files; import java.nio.file.Path; import java.util.concurrent.Callable; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalAttemptExecution.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalAttemptExecution.java index a15b109bbb3c..6519e5ad337a 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalAttemptExecution.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalAttemptExecution.java @@ -15,8 +15,8 @@ import io.airbyte.config.helpers.LogClientSingleton; import io.airbyte.config.helpers.LogConfigs; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.Worker; -import io.airbyte.workers.WorkerUtils; +import io.airbyte.commons.worker.Worker; +import io.airbyte.commons.worker.WorkerUtils; import io.temporal.activity.Activity; import io.temporal.activity.ActivityExecutionContext; import java.nio.file.Path; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalClient.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalClient.java index bcb646db3ac4..8a7aff824884 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalClient.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalClient.java @@ -24,8 +24,8 @@ import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; import io.airbyte.protocol.models.StreamDescriptor; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.config.WorkerMode; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.workers.temporal.check.connection.CheckConnectionWorkflow; import io.airbyte.workers.temporal.discover.catalog.DiscoverCatalogWorkflow; import io.airbyte.workers.temporal.exception.DeletedWorkflowException; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/check/connection/CheckConnectionActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/check/connection/CheckConnectionActivityImpl.java index b53e60211999..c978174a3133 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/check/connection/CheckConnectionActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/check/connection/CheckConnectionActivityImpl.java @@ -16,13 +16,13 @@ import io.airbyte.config.helpers.LogConfigs; import io.airbyte.config.persistence.split_secrets.SecretsHydrator; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; -import io.airbyte.workers.Worker; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.config.WorkerMode; +import io.airbyte.commons.worker.Worker; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.workers.general.DefaultCheckConnectionWorker; -import io.airbyte.workers.process.AirbyteIntegrationLauncher; -import io.airbyte.workers.process.IntegrationLauncher; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.process.AirbyteIntegrationLauncher; +import io.airbyte.commons.worker.process.IntegrationLauncher; +import io.airbyte.commons.worker.process.ProcessFactory; import io.airbyte.workers.temporal.TemporalAttemptExecution; import io.micronaut.context.annotation.Requires; import io.micronaut.context.annotation.Value; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/discover/catalog/DiscoverCatalogActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/discover/catalog/DiscoverCatalogActivityImpl.java index 76a1f6235b6c..baac8e2e605f 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/discover/catalog/DiscoverCatalogActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/discover/catalog/DiscoverCatalogActivityImpl.java @@ -16,15 +16,15 @@ import io.airbyte.config.persistence.split_secrets.SecretsHydrator; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.Worker; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.config.WorkerMode; +import io.airbyte.commons.worker.Worker; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.workers.general.DefaultDiscoverCatalogWorker; -import io.airbyte.workers.internal.AirbyteStreamFactory; -import io.airbyte.workers.internal.DefaultAirbyteStreamFactory; -import io.airbyte.workers.process.AirbyteIntegrationLauncher; -import io.airbyte.workers.process.IntegrationLauncher; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.internal.AirbyteStreamFactory; +import io.airbyte.commons.worker.internal.DefaultAirbyteStreamFactory; +import io.airbyte.commons.worker.process.AirbyteIntegrationLauncher; +import io.airbyte.commons.worker.process.IntegrationLauncher; +import io.airbyte.commons.worker.process.ProcessFactory; import io.airbyte.workers.temporal.TemporalAttemptExecution; import io.micronaut.context.annotation.Requires; import io.micronaut.context.annotation.Value; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowImpl.java index d35f6c515ed4..51c400921780 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowImpl.java @@ -26,8 +26,8 @@ import io.airbyte.metrics.lib.OssMetricsRegistry; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.helper.FailureHelper; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.helper.FailureHelper; import io.airbyte.workers.temporal.annotations.TemporalActivityStub; import io.airbyte.workers.temporal.check.connection.CheckConnectionActivity; import io.airbyte.workers.temporal.check.connection.CheckConnectionActivity.CheckConnectionInput; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/SyncCheckConnectionFailure.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/SyncCheckConnectionFailure.java index d8391e560f77..2d26cc536064 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/SyncCheckConnectionFailure.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/SyncCheckConnectionFailure.java @@ -12,7 +12,7 @@ import io.airbyte.config.StandardSyncSummary; import io.airbyte.config.SyncStats; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.helper.FailureHelper; +import io.airbyte.commons.worker.helper.FailureHelper; import java.util.List; import lombok.extern.slf4j.Slf4j; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/AutoDisableConnectionActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/AutoDisableConnectionActivityImpl.java index 67809505267f..93cccb412cdf 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/AutoDisableConnectionActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/AutoDisableConnectionActivityImpl.java @@ -19,7 +19,7 @@ import io.airbyte.persistence.job.models.JobStatus; import io.airbyte.persistence.job.models.JobWithStatusAndTimestamp; import io.airbyte.validation.json.JsonValidationException; -import io.airbyte.workers.config.WorkerMode; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.workers.temporal.exception.RetryableException; import io.micronaut.context.annotation.Requires; import io.micronaut.context.annotation.Value; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConfigFetchActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConfigFetchActivityImpl.java index c6909a4c2875..500b3ab0d451 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConfigFetchActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConfigFetchActivityImpl.java @@ -14,7 +14,7 @@ import io.airbyte.persistence.job.JobPersistence; import io.airbyte.persistence.job.models.Job; import io.airbyte.validation.json.JsonValidationException; -import io.airbyte.workers.config.WorkerMode; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.workers.temporal.exception.RetryableException; import io.micronaut.context.annotation.Requires; import io.micronaut.context.annotation.Value; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConnectionDeletionActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConnectionDeletionActivityImpl.java index 5b138443b74d..b84b2706eb32 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConnectionDeletionActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/ConnectionDeletionActivityImpl.java @@ -6,7 +6,7 @@ import io.airbyte.config.persistence.ConfigNotFoundException; import io.airbyte.validation.json.JsonValidationException; -import io.airbyte.workers.config.WorkerMode; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.workers.helper.ConnectionHelper; import io.airbyte.workers.temporal.exception.RetryableException; import io.micronaut.context.annotation.Requires; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/GenerateInputActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/GenerateInputActivityImpl.java index 503ba9bc8e02..2066dbc67ddb 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/GenerateInputActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/GenerateInputActivityImpl.java @@ -15,8 +15,8 @@ import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.Job; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.config.WorkerMode; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.workers.temporal.exception.RetryableException; import io.micronaut.context.annotation.Requires; import jakarta.inject.Singleton; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/JobCreationAndStatusUpdateActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/JobCreationAndStatusUpdateActivityImpl.java index 354b56363867..fb4c5f04fa4c 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/JobCreationAndStatusUpdateActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/JobCreationAndStatusUpdateActivityImpl.java @@ -41,8 +41,8 @@ import io.airbyte.protocol.models.StreamDescriptor; import io.airbyte.validation.json.JsonValidationException; import io.airbyte.workers.JobStatus; -import io.airbyte.workers.config.WorkerMode; -import io.airbyte.workers.helper.FailureHelper; +import io.airbyte.commons.worker.config.WorkerMode; +import io.airbyte.commons.worker.helper.FailureHelper; import io.airbyte.workers.run.TemporalWorkerRunFactory; import io.airbyte.workers.run.WorkerRun; import io.airbyte.workers.temporal.exception.RetryableException; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/RecordMetricActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/RecordMetricActivityImpl.java index 870a96b0e938..4d765d10061e 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/RecordMetricActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/RecordMetricActivityImpl.java @@ -8,7 +8,7 @@ import io.airbyte.metrics.lib.MetricAttribute; import io.airbyte.metrics.lib.MetricClient; import io.airbyte.metrics.lib.MetricTags; -import io.airbyte.workers.config.WorkerMode; +import io.airbyte.commons.worker.config.WorkerMode; import io.micronaut.context.annotation.Requires; import jakarta.inject.Singleton; import java.util.ArrayList; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/StreamResetActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/StreamResetActivityImpl.java index e4b2014dce23..35d072287b9e 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/StreamResetActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/StreamResetActivityImpl.java @@ -4,7 +4,7 @@ package io.airbyte.workers.temporal.scheduling.activities; -import io.airbyte.workers.config.WorkerMode; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.workers.temporal.StreamResetRecordsHelper; import io.micronaut.context.annotation.Requires; import jakarta.inject.Singleton; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/WorkflowConfigActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/WorkflowConfigActivityImpl.java index 558868f04a4b..df910e085d6c 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/WorkflowConfigActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/scheduling/activities/WorkflowConfigActivityImpl.java @@ -4,7 +4,7 @@ package io.airbyte.workers.temporal.scheduling.activities; -import io.airbyte.workers.config.WorkerMode; +import io.airbyte.commons.worker.config.WorkerMode; import io.micronaut.context.annotation.Property; import io.micronaut.context.annotation.Requires; import jakarta.inject.Singleton; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/spec/SpecActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/spec/SpecActivityImpl.java index 5cdb899fdfba..a9bb2cbde376 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/spec/SpecActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/spec/SpecActivityImpl.java @@ -13,13 +13,13 @@ import io.airbyte.config.helpers.LogConfigs; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.Worker; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.config.WorkerMode; +import io.airbyte.commons.worker.Worker; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.config.WorkerMode; import io.airbyte.workers.general.DefaultGetSpecWorker; -import io.airbyte.workers.process.AirbyteIntegrationLauncher; -import io.airbyte.workers.process.IntegrationLauncher; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.process.AirbyteIntegrationLauncher; +import io.airbyte.commons.worker.process.IntegrationLauncher; +import io.airbyte.commons.worker.process.ProcessFactory; import io.airbyte.workers.temporal.TemporalAttemptExecution; import io.micronaut.context.annotation.Requires; import io.micronaut.context.annotation.Value; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/DbtTransformationActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/DbtTransformationActivityImpl.java index 1ee47429ae79..426500b8939c 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/DbtTransformationActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/DbtTransformationActivityImpl.java @@ -20,13 +20,14 @@ import io.airbyte.config.persistence.split_secrets.SecretsHydrator; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.ContainerOrchestratorConfig; -import io.airbyte.workers.Worker; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.general.DbtTransformationRunner; -import io.airbyte.workers.general.DbtTransformationWorker; -import io.airbyte.workers.normalization.NormalizationRunnerFactory; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.ContainerOrchestratorConfig; +import io.airbyte.commons.worker.Worker; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.general.DbtTransformationRunner; +import io.airbyte.commons.worker.general.DbtTransformationWorker; +import io.airbyte.commons.worker.normalization.NormalizationRunnerFactory; +import io.airbyte.commons.worker.process.ProcessFactory; +import io.airbyte.commons.worker.sync.DbtLauncherWorker; import io.airbyte.workers.temporal.TemporalAttemptExecution; import io.micronaut.context.annotation.Value; import io.temporal.activity.Activity; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/NormalizationActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/NormalizationActivityImpl.java index cfa4a4659334..06ef168fa54b 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/NormalizationActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/NormalizationActivityImpl.java @@ -23,12 +23,13 @@ import io.airbyte.config.persistence.split_secrets.SecretsHydrator; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.ContainerOrchestratorConfig; -import io.airbyte.workers.Worker; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.general.DefaultNormalizationWorker; -import io.airbyte.workers.normalization.NormalizationRunnerFactory; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.ContainerOrchestratorConfig; +import io.airbyte.commons.worker.Worker; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.general.DefaultNormalizationWorker; +import io.airbyte.commons.worker.normalization.NormalizationRunnerFactory; +import io.airbyte.commons.worker.process.ProcessFactory; +import io.airbyte.commons.worker.sync.NormalizationLauncherWorker; import io.airbyte.workers.temporal.TemporalAttemptExecution; import io.micronaut.context.annotation.Value; import io.temporal.activity.Activity; diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/ReplicationActivityImpl.java b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/ReplicationActivityImpl.java index 955f18bc6bb6..58a1699a3640 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/ReplicationActivityImpl.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/temporal/sync/ReplicationActivityImpl.java @@ -27,22 +27,23 @@ import io.airbyte.metrics.lib.MetricEmittingApps; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.ContainerOrchestratorConfig; -import io.airbyte.workers.RecordSchemaValidator; -import io.airbyte.workers.Worker; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.WorkerMetricReporter; -import io.airbyte.workers.WorkerUtils; -import io.airbyte.workers.general.DefaultReplicationWorker; -import io.airbyte.workers.internal.AirbyteMessageTracker; -import io.airbyte.workers.internal.AirbyteSource; -import io.airbyte.workers.internal.DefaultAirbyteDestination; -import io.airbyte.workers.internal.DefaultAirbyteSource; -import io.airbyte.workers.internal.EmptyAirbyteSource; -import io.airbyte.workers.internal.NamespacingMapper; -import io.airbyte.workers.process.AirbyteIntegrationLauncher; -import io.airbyte.workers.process.IntegrationLauncher; -import io.airbyte.workers.process.ProcessFactory; +import io.airbyte.commons.worker.ContainerOrchestratorConfig; +import io.airbyte.commons.worker.RecordSchemaValidator; +import io.airbyte.commons.worker.Worker; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.WorkerMetricReporter; +import io.airbyte.commons.worker.WorkerUtils; +import io.airbyte.commons.worker.general.DefaultReplicationWorker; +import io.airbyte.commons.worker.internal.AirbyteMessageTracker; +import io.airbyte.commons.worker.internal.AirbyteSource; +import io.airbyte.commons.worker.internal.DefaultAirbyteDestination; +import io.airbyte.commons.worker.internal.DefaultAirbyteSource; +import io.airbyte.commons.worker.internal.EmptyAirbyteSource; +import io.airbyte.commons.worker.internal.NamespacingMapper; +import io.airbyte.commons.worker.process.AirbyteIntegrationLauncher; +import io.airbyte.commons.worker.process.IntegrationLauncher; +import io.airbyte.commons.worker.process.ProcessFactory; +import io.airbyte.commons.worker.sync.ReplicationLauncherWorker; import io.airbyte.workers.temporal.TemporalAttemptExecution; import io.micronaut.context.annotation.Value; import io.temporal.activity.Activity; diff --git a/airbyte-workers/src/test-integration/java/io/airbyte/workers/process/AsyncOrchestratorPodProcessIntegrationTest.java b/airbyte-workers/src/test-integration/java/io/airbyte/workers/process/AsyncOrchestratorPodProcessIntegrationTest.java index d3b794315811..8f74d593c764 100644 --- a/airbyte-workers/src/test-integration/java/io/airbyte/workers/process/AsyncOrchestratorPodProcessIntegrationTest.java +++ b/airbyte-workers/src/test-integration/java/io/airbyte/workers/process/AsyncOrchestratorPodProcessIntegrationTest.java @@ -7,14 +7,17 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +import io.airbyte.commons.worker.process.AsyncOrchestratorPodProcess; +import io.airbyte.commons.worker.process.KubeContainerInfo; +import io.airbyte.commons.worker.process.KubePodInfo; import io.airbyte.commons.json.Jsons; +import io.airbyte.commons.temporal.sync.OrchestratorConstants; import io.airbyte.config.EnvConfigs; import io.airbyte.config.storage.CloudStorageConfigs; import io.airbyte.config.storage.MinioS3ClientFactory; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.general.DocumentStoreClient; -import io.airbyte.workers.storage.S3DocumentStoreClient; -import io.airbyte.workers.temporal.sync.OrchestratorConstants; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.storage.DocumentStoreClient; +import io.airbyte.commons.worker.storage.S3DocumentStoreClient; import io.fabric8.kubernetes.api.model.ContainerBuilder; import io.fabric8.kubernetes.api.model.ContainerPort; import io.fabric8.kubernetes.api.model.EnvVar; diff --git a/airbyte-workers/src/test-integration/java/io/airbyte/workers/process/KubePodProcessIntegrationTest.java b/airbyte-workers/src/test-integration/java/io/airbyte/workers/process/KubePodProcessIntegrationTest.java index 55035ad738b0..de2124b7e955 100644 --- a/airbyte-workers/src/test-integration/java/io/airbyte/workers/process/KubePodProcessIntegrationTest.java +++ b/airbyte-workers/src/test-integration/java/io/airbyte/workers/process/KubePodProcessIntegrationTest.java @@ -13,11 +13,14 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; +import io.airbyte.commons.worker.process.ExitCodeWatcher; +import io.airbyte.commons.worker.process.KubePortManagerSingleton; +import io.airbyte.commons.worker.process.KubeProcessFactory; import io.airbyte.commons.lang.Exceptions; import io.airbyte.config.EnvConfigs; import io.airbyte.config.ResourceRequirements; -import io.airbyte.workers.WorkerConfigs; -import io.airbyte.workers.exception.WorkerException; +import io.airbyte.commons.worker.WorkerConfigs; +import io.airbyte.commons.worker.exception.WorkerException; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.client.DefaultKubernetesClient; import io.fabric8.kubernetes.client.KubernetesClient; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultCheckConnectionWorkerTest.java b/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultCheckConnectionWorkerTest.java index 0095be0c6b0a..09eeb8e45476 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultCheckConnectionWorkerTest.java +++ b/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultCheckConnectionWorkerTest.java @@ -27,11 +27,11 @@ import io.airbyte.protocol.models.AirbyteConnectionStatus; import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.AirbyteMessage.Type; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.internal.AirbyteMessageUtils; -import io.airbyte.workers.internal.AirbyteStreamFactory; -import io.airbyte.workers.process.IntegrationLauncher; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.internal.AirbyteStreamFactory; +import io.airbyte.commons.worker.process.IntegrationLauncher; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultDiscoverCatalogWorkerTest.java b/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultDiscoverCatalogWorkerTest.java index 94b5868af0b3..f45961a25d54 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultDiscoverCatalogWorkerTest.java +++ b/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultDiscoverCatalogWorkerTest.java @@ -36,11 +36,11 @@ import io.airbyte.protocol.models.CatalogHelpers; import io.airbyte.protocol.models.Field; import io.airbyte.protocol.models.JsonSchemaType; -import io.airbyte.workers.WorkerConstants; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.internal.AirbyteMessageUtils; -import io.airbyte.workers.internal.AirbyteStreamFactory; -import io.airbyte.workers.process.IntegrationLauncher; +import io.airbyte.commons.worker.WorkerConstants; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.internal.AirbyteStreamFactory; +import io.airbyte.commons.worker.process.IntegrationLauncher; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.nio.file.Files; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultGetSpecWorkerTest.java b/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultGetSpecWorkerTest.java index 2b06a7669fab..741f4b8ee140 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultGetSpecWorkerTest.java +++ b/airbyte-workers/src/test/java/io/airbyte/workers/general/DefaultGetSpecWorkerTest.java @@ -25,9 +25,9 @@ import io.airbyte.protocol.models.AirbyteMessage; import io.airbyte.protocol.models.AirbyteMessage.Type; import io.airbyte.protocol.models.ConnectorSpecification; -import io.airbyte.workers.exception.WorkerException; -import io.airbyte.workers.internal.AirbyteMessageUtils; -import io.airbyte.workers.process.IntegrationLauncher; +import io.airbyte.commons.worker.exception.WorkerException; +import io.airbyte.commons.worker.process.IntegrationLauncher; +import io.airbyte.commons.worker.test_utils.AirbyteMessageUtils; import java.io.ByteArrayInputStream; import java.io.IOException; import java.nio.file.Files; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/run/TemporalWorkerRunFactoryTest.java b/airbyte-workers/src/test/java/io/airbyte/workers/run/TemporalWorkerRunFactoryTest.java index f199b60ac48f..e23ee709d4ce 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/run/TemporalWorkerRunFactoryTest.java +++ b/airbyte-workers/src/test/java/io/airbyte/workers/run/TemporalWorkerRunFactoryTest.java @@ -21,7 +21,7 @@ import io.airbyte.config.StandardSyncOutput; import io.airbyte.persistence.job.models.Job; import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; -import io.airbyte.workers.WorkerConstants; +import io.airbyte.commons.worker.WorkerConstants; import io.airbyte.workers.temporal.TemporalClient; import io.airbyte.workers.temporal.TemporalResponse; import java.io.IOException; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/temporal/TemporalAttemptExecutionTest.java b/airbyte-workers/src/test/java/io/airbyte/workers/temporal/TemporalAttemptExecutionTest.java index f88252e5003a..cbb70a5ce030 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/temporal/TemporalAttemptExecutionTest.java +++ b/airbyte-workers/src/test/java/io/airbyte/workers/temporal/TemporalAttemptExecutionTest.java @@ -21,7 +21,7 @@ import io.airbyte.config.Configs; import io.airbyte.db.init.DatabaseInitializationException; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.Worker; +import io.airbyte.commons.worker.Worker; import io.temporal.serviceclient.CheckedExceptionWrapper; import java.io.IOException; import java.nio.file.Files; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowTest.java b/airbyte-workers/src/test/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowTest.java index 8c91948b05f2..0e519b2e439a 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowTest.java +++ b/airbyte-workers/src/test/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowTest.java @@ -25,7 +25,7 @@ import io.airbyte.config.StandardSyncInput; import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; -import io.airbyte.workers.WorkerConstants; +import io.airbyte.commons.worker.WorkerConstants; import io.airbyte.workers.temporal.check.connection.CheckConnectionActivity; import io.airbyte.workers.temporal.scheduling.activities.AutoDisableConnectionActivity; import io.airbyte.workers.temporal.scheduling.activities.AutoDisableConnectionActivity.AutoDisableConnectionActivityInput; diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/temporal/sync/SyncWorkflowTest.java b/airbyte-workers/src/test/java/io/airbyte/workers/temporal/sync/SyncWorkflowTest.java index 1e29735bc316..0d9d0baf3c11 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/temporal/sync/SyncWorkflowTest.java +++ b/airbyte-workers/src/test/java/io/airbyte/workers/temporal/sync/SyncWorkflowTest.java @@ -29,8 +29,8 @@ import io.airbyte.persistence.job.models.IntegrationLauncherConfig; import io.airbyte.persistence.job.models.JobRunConfig; import io.airbyte.protocol.models.ConfiguredAirbyteCatalog; -import io.airbyte.workers.TestConfigHelpers; import io.airbyte.workers.temporal.support.TemporalProxyHelper; +import io.airbyte.commons.worker.test_utils.TestConfigHelpers; import io.micronaut.context.BeanRegistration; import io.micronaut.inject.BeanIdentifier; import io.temporal.activity.ActivityCancellationType; diff --git a/settings.gradle b/settings.gradle index 3dd9eb7c9b1d..8653fd11da50 100644 --- a/settings.gradle +++ b/settings.gradle @@ -79,6 +79,7 @@ include ':airbyte-test-utils' include ':airbyte-workers' // reused by acceptance tests in connector base. include ':airbyte-analytics' // transitively used by airbyte-workers. include ':airbyte-commons-temporal' +include ':airbyte-commons-worker' include ':airbyte-config:config-persistence' // transitively used by airbyte-workers. include ':airbyte-persistence:job-persistence' // transitively used by airbyte-workers. include ':airbyte-db:jooq' // transitively used by airbyte-workers. @@ -151,4 +152,3 @@ if (!System.getenv().containsKey("SUB_BUILD") || System.getenv().get("SUB_BUILD" } } } -