Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bmoric/remove dep server worker #17894

Merged
merged 40 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
33b83bf
test [ci skip]
benmoriceau Oct 4, 2022
4134048
Remove the dependency between orchestrator APP and the worker
benmoriceau Oct 10, 2022
0d20286
Merge branch 'master' into bmoric/remove-dep-container-orchestrator-w…
benmoriceau Oct 10, 2022
d37bc19
Autogenerated files
benmoriceau Oct 10, 2022
bcf3431
Add missing annotation
benmoriceau Oct 10, 2022
db1f95d
Remove unused json2Schema block from worker
benmoriceau Oct 10, 2022
e7d1592
Move tess
benmoriceau Oct 10, 2022
0881cee
Missing deps and format
benmoriceau Oct 10, 2022
5c74045
Fix test build
benmoriceau Oct 10, 2022
7e2d449
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Oct 10, 2022
203071a
TMP
benmoriceau Oct 11, 2022
390b8eb
Add missing dependencies
benmoriceau Oct 11, 2022
4b6634d
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Oct 11, 2022
cbae067
PR comments
benmoriceau Oct 11, 2022
7efa2c7
Tmp
benmoriceau Oct 11, 2022
636e507
[ci skip] Tmp
benmoriceau Oct 11, 2022
628b721
Fix acceptance test and add the seed dependency
benmoriceau Oct 11, 2022
4c0de3c
Fix build
benmoriceau Oct 11, 2022
a3bce17
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Oct 11, 2022
279447f
Merge branch 'bmoric/remove-dep-container-orchestrator-worker' of git…
benmoriceau Oct 11, 2022
b1defe5
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Oct 12, 2022
4b2c8f2
For diff
benmoriceau Oct 12, 2022
72a11f8
tmp
benmoriceau Oct 12, 2022
dcfb012
Build pass
benmoriceau Oct 13, 2022
ae2748b
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Oct 13, 2022
5424358
make the worker to be on the platform only
benmoriceau Oct 13, 2022
b243256
fix setting.yaml
benmoriceau Oct 13, 2022
68843af
Fix pmd
benmoriceau Oct 13, 2022
4898e50
Fix Cron
benmoriceau Oct 13, 2022
25a26d4
Add chart
benmoriceau Oct 13, 2022
6b8465b
Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/rem…
benmoriceau Oct 14, 2022
6e4e1aa
Fix cron
benmoriceau Oct 14, 2022
7f915cb
Merge branch 'master' into bmoric/remove-dep-server-worker
benmoriceau Oct 14, 2022
d241c64
Fix server build.gradle
benmoriceau Oct 14, 2022
fada02f
Fix jar conflict
benmoriceau Oct 14, 2022
2f12031
Merge branch 'bmoric/remove-dep-server-worker' of github.com:airbyteh…
benmoriceau Oct 14, 2022
5d0cac0
Merge branch 'master' into bmoric/remove-dep-server-worker
benmoriceau Oct 17, 2022
77d3402
PR comments
benmoriceau Oct 17, 2022
4e6ab3f
Add cron micronaut environemnt
benmoriceau Oct 17, 2022
9f8c233
Merge branch 'master' into bmoric/remove-dep-server-worker
benmoriceau Oct 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2022 Airbyte, Inc., all rights reserved.
*/

package io.airbyte.commons.temporal.config;

import io.airbyte.config.Configs.WorkerEnvironment;
import io.micronaut.context.annotation.Factory;
import io.micronaut.context.env.Environment;
import jakarta.inject.Singleton;

@Factory
public class CommonFactory {

@Singleton
public WorkerEnvironment workerEnvironment(final Environment environment) {
return environment.getActiveNames().contains(Environment.KUBERNETES) ? WorkerEnvironment.KUBERNETES : WorkerEnvironment.DOCKER;
}

}
10 changes: 0 additions & 10 deletions airbyte-commons-worker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ plugins {
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
Expand Down Expand Up @@ -61,7 +54,4 @@ jsonSchema2Pojo {
includeSetters = true
}

Properties env = new Properties()
rootProject.file('.env.dev').withInputStream { env.load(it) }

Task publishArtifactsTask = getPublishArtifactsTask("$rootProject.ext.version", project)
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ public class WorkerConstants {

public static final String RESET_JOB_SOURCE_DOCKER_IMAGE_STUB = "airbyte_empty";

public static final String WORKER_ENVIRONMENT = "WORKER_ENVIRONMENT";

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
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.WorkerConstants;
import io.airbyte.workers.exception.WorkerException;
import io.airbyte.workers.process.AsyncKubePodStatus;
import io.airbyte.workers.process.AsyncOrchestratorPodProcess;
Expand Down Expand Up @@ -105,7 +105,7 @@ public OUTPUT run(final INPUT input, final Path jobRoot) throws WorkerException
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));

// Manually add the worker environment to the env var map
envMap.put(WorkerConfigurationBeanFactory.WORKER_ENVIRONMENT, containerOrchestratorConfig.workerEnvironment().name());
envMap.put(WorkerConstants.WORKER_ENVIRONMENT, containerOrchestratorConfig.workerEnvironment().name());

final Map<String, String> fileMap = new HashMap<>(additionalFileMap);
fileMap.putAll(Map.of(
Expand Down
1 change: 1 addition & 0 deletions airbyte-container-orchestrator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies {
implementation project(':airbyte-config:config-persistence')
implementation project(':airbyte-commons-temporal')
implementation project(':airbyte-commons-worker')
implementation project(':airbyte-config:init')
implementation project(':airbyte-db:db-lib')
implementation project(':airbyte-json-validation')
implementation project(':airbyte-protocol:protocol-models')
Expand Down
3 changes: 2 additions & 1 deletion airbyte-integrations/bases/base-normalization/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ airbytePython {

dependencies {
implementation project(':airbyte-workers')
implementation project(':airbyte-commons-worker')
}

// we need to access the sshtunneling script from airbyte-workers for ssh support
task copySshScript(type: Copy, dependsOn: [project(':airbyte-workers').processResources]) {
task copySshScript(type: Copy, dependsOn: [project(':airbyte-commons-worker').processResources]) {
from "${project(':airbyte-workers').buildDir}/resources/main"
into "${buildDir}"
include "sshtunneling.sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ dependencies {
integrationTestJavaImplementation project(':airbyte-integrations:bases:standard-destination-test')
integrationTestJavaImplementation project(':airbyte-integrations:connectors:destination-gcs')
integrationTestJavaImplementation project(':airbyte-workers')
integrationTestJavaImplementation project(':airbyte-commons-worker')
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import io.airbyte.config.Configs.DeploymentMode;
import io.airbyte.config.Configs.SecretPersistenceType;
import io.airbyte.config.Configs.TrackingStrategy;
import io.airbyte.config.Configs.WorkerEnvironment;
import io.airbyte.config.persistence.ConfigRepository;
import io.airbyte.config.persistence.StatePersistence;
import io.airbyte.config.persistence.split_secrets.JsonSecretsProcessor;
Expand All @@ -29,7 +28,6 @@
import io.micronaut.context.annotation.Factory;
import io.micronaut.context.annotation.Requires;
import io.micronaut.context.annotation.Value;
import io.micronaut.context.env.Environment;
import io.micronaut.core.util.StringUtils;
import jakarta.inject.Named;
import jakarta.inject.Singleton;
Expand Down Expand Up @@ -69,11 +67,6 @@ public TrackingStrategy trackingStrategy(@Value("${airbyte.tracking-strategy}")
return convertToEnum(trackingStrategy, TrackingStrategy::valueOf, TrackingStrategy.LOGGING);
}

@Singleton
public WorkerEnvironment workerEnvironment(final Environment environment) {
return environment.getActiveNames().contains(Environment.KUBERNETES) ? WorkerEnvironment.KUBERNETES : WorkerEnvironment.DOCKER;
}

@Singleton
@Named("workspaceRoot")
public Path workspaceRoot(@Value("${airbyte.workspace.root}") final String workspaceRoot) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.airbyte.config.ResourceRequirements;
import io.airbyte.config.TolerationPOJO;
import io.airbyte.workers.WorkerConfigs;
import io.airbyte.workers.WorkerConstants;
import io.micronaut.context.annotation.Factory;
import io.micronaut.context.annotation.Requires;
import io.micronaut.context.annotation.Value;
Expand Down Expand Up @@ -41,7 +42,6 @@ public class WorkerConfigurationBeanFactory {
private static final String DOCKER = "DOCKER";
private static final String JOB_DEFAULT_ENV_PREFIX = "JOB_DEFAULT_ENV_";
private static final String KUBERNETES = "KUBERNETES";
public static final String WORKER_ENVIRONMENT = "WORKER_ENVIRONMENT";

@Singleton
@Named("checkJobKubeAnnotations")
Expand Down Expand Up @@ -105,7 +105,7 @@ public Map<String, String> jobDefaultEnvMap(
final Map<String, String> jobSharedEnvMap = Map.of(AIRBYTE_ROLE, airbyteRole,
AIRBYTE_VERSION, airbyteVersion,
DEPLOYMENT_MODE, deploymentMode.name(),
WORKER_ENVIRONMENT, environment.getActiveNames().contains(Environment.KUBERNETES) ? KUBERNETES : DOCKER);
WorkerConstants.WORKER_ENVIRONMENT, environment.getActiveNames().contains(Environment.KUBERNETES) ? KUBERNETES : DOCKER);
return MoreMaps.merge(jobPrefixedEnvMap, jobSharedEnvMap);
}

Expand Down
39 changes: 0 additions & 39 deletions airbyte-workers/src/main/resources/image_exists.sh

This file was deleted.