Skip to content

Commit

Permalink
Revert "Revert "remove airbyte-commons-docker (#21756)" (#22237)" (#2…
Browse files Browse the repository at this point in the history
…2239)

This reverts commit 6d65070.
  • Loading branch information
colesnodgrass authored Feb 6, 2023
1 parent 015174a commit f098287
Show file tree
Hide file tree
Showing 33 changed files with 100 additions and 159 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,6 @@ jobs:
${{ github.workspace }}/airbyte-bootloader/build/reports/jacoco/test/jacocoTestReport.xml,
${{ github.workspace }}/airbyte-commons/build/reports/jacoco/test/jacocoTestReport.xml,
${{ github.workspace }}/airbyte-commons-cli/build/reports/jacoco/test/jacocoTestReport.xml,
${{ github.workspace }}/airbyte-commons-docker/build/reports/jacoco/test/jacocoTestReport.xml,
${{ github.workspace }}/airbyte-commons-protocol/build/reports/jacoco/test/jacocoTestReport.xml,
${{ github.workspace }}/airbyte-commons-temporal/build/reports/jacoco/test/jacocoTestReport.xml,
${{ github.workspace }}/airbyte-commons-worker/build/reports/jacoco/test/jacocoTestReport.xml,
Expand Down Expand Up @@ -1107,7 +1106,7 @@ jobs:
helm-acceptance-test:
name: "Platform: Acceptance Tests (Helm)"
# In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-latest.
needs: [start-helm-acceptance-test-runner] # required to start the main job when the runner is ready
needs: [ start-helm-acceptance-test-runner ] # required to start the main job when the runner is ready
runs-on: ${{ needs.start-helm-acceptance-test-runner.outputs.label }} # run the job on the newly created runner
# this is the label of the runner
environment: more-secrets
Expand Down
13 changes: 0 additions & 13 deletions airbyte-commons-docker/build.gradle

This file was deleted.

3 changes: 0 additions & 3 deletions airbyte-commons-docker/readme.md

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 1 addition & 2 deletions airbyte-commons-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ dependencies {

implementation project(':airbyte-analytics')
implementation project(':airbyte-api')
implementation project(':airbyte-commons-docker')
implementation project(':airbyte-commons-temporal')
implementation project(':airbyte-commons-worker')
implementation project(':airbyte-config:init')
Expand Down Expand Up @@ -66,4 +65,4 @@ dependencies {
testImplementation 'org.mockito:mockito-inline:4.7.0'
}

Task publishArtifactsTask = getPublishArtifactsTask("$rootProject.ext.version", project)
Task publishArtifactsTask = getPublishArtifactsTask("$rootProject.ext.version", project)
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import io.airbyte.api.model.generated.PrivateDestinationDefinitionReadList;
import io.airbyte.api.model.generated.ReleaseStage;
import io.airbyte.api.model.generated.WorkspaceIdRequestBody;
import io.airbyte.commons.docker.DockerUtils;
import io.airbyte.commons.resources.MoreResources;
import io.airbyte.commons.server.ServerConstants;
import io.airbyte.commons.server.converters.ApiPojoConverters;
Expand All @@ -32,7 +31,11 @@
import io.airbyte.commons.version.AirbyteProtocolVersion;
import io.airbyte.commons.version.AirbyteProtocolVersionRange;
import io.airbyte.commons.version.Version;
import io.airbyte.config.*;
import io.airbyte.config.ActorDefinitionResourceRequirements;
import io.airbyte.config.ActorType;
import io.airbyte.config.Configs;
import io.airbyte.config.EnvConfigs;
import io.airbyte.config.StandardDestinationDefinition;
import io.airbyte.config.persistence.ConfigNotFoundException;
import io.airbyte.config.persistence.ConfigRepository;
import io.airbyte.protocol.models.ConnectorSpecification;
Expand Down Expand Up @@ -295,7 +298,7 @@ public void deleteDestinationDefinition(final DestinationDefinitionIdRequestBody

private ConnectorSpecification getSpecForImage(final String dockerRepository, final String imageTag, final boolean isCustomConnector)
throws IOException {
final String imageName = DockerUtils.getTaggedImageName(dockerRepository, imageTag);
final String imageName = dockerRepository + ":" + imageTag;
final SynchronousResponse<ConnectorSpecification> getSpecResponse = schedulerSynchronousClient.createGetSpecJob(imageName, isCustomConnector);
return SpecFetcher.getSpecFromJob(getSpecResponse);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import io.airbyte.api.model.generated.StreamTransform;
import io.airbyte.api.model.generated.StreamTransform.TransformTypeEnum;
import io.airbyte.api.model.generated.SynchronousJobRead;
import io.airbyte.commons.docker.DockerUtils;
import io.airbyte.commons.enums.Enums;
import io.airbyte.commons.features.FeatureFlags;
import io.airbyte.commons.json.Jsons;
Expand Down Expand Up @@ -153,7 +152,7 @@ public CheckConnectionRead checkSourceConnectionFromSourceId(final SourceIdReque
throws ConfigNotFoundException, IOException, JsonValidationException {
final SourceConnection source = configRepository.getSourceConnection(sourceIdRequestBody.getSourceId());
final StandardSourceDefinition sourceDef = configRepository.getStandardSourceDefinition(source.getSourceDefinitionId());
final String imageName = DockerUtils.getTaggedImageName(sourceDef.getDockerRepository(), sourceDef.getDockerImageTag());
final String imageName = sourceDef.getDockerRepository() + ":" + sourceDef.getDockerImageTag();
final boolean isCustomConnector = sourceDef.getCustom();
final Version protocolVersion = new Version(sourceDef.getProtocolVersion());

Expand All @@ -177,7 +176,7 @@ public CheckConnectionRead checkSourceConnectionFromSourceCreate(final SourceCor

final Version protocolVersion = new Version(sourceDef.getProtocolVersion());

final String imageName = DockerUtils.getTaggedImageName(sourceDef.getDockerRepository(), sourceDef.getDockerImageTag());
final String imageName = sourceDef.getDockerRepository() + ":" + sourceDef.getDockerImageTag();
final boolean isCustomConnector = sourceDef.getCustom();
return reportConnectionStatus(synchronousSchedulerClient.createSourceCheckConnectionJob(source, imageName, protocolVersion, isCustomConnector));
}
Expand All @@ -202,7 +201,7 @@ public CheckConnectionRead checkDestinationConnectionFromDestinationId(final Des
throws ConfigNotFoundException, IOException, JsonValidationException {
final DestinationConnection destination = configRepository.getDestinationConnection(destinationIdRequestBody.getDestinationId());
final StandardDestinationDefinition destinationDef = configRepository.getStandardDestinationDefinition(destination.getDestinationDefinitionId());
final String imageName = DockerUtils.getTaggedImageName(destinationDef.getDockerRepository(), destinationDef.getDockerImageTag());
final String imageName = destinationDef.getDockerRepository() + ":" + destinationDef.getDockerImageTag();
final boolean isCustomConnector = destinationDef.getCustom();
final Version protocolVersion = new Version(destinationDef.getProtocolVersion());
return reportConnectionStatus(
Expand All @@ -224,7 +223,7 @@ public CheckConnectionRead checkDestinationConnectionFromDestinationCreate(final
.withDestinationDefinitionId(destinationConfig.getDestinationDefinitionId())
.withConfiguration(partialConfig)
.withWorkspaceId(destinationConfig.getWorkspaceId());
final String imageName = DockerUtils.getTaggedImageName(destDef.getDockerRepository(), destDef.getDockerImageTag());
final String imageName = destDef.getDockerRepository() + ":" + destDef.getDockerImageTag();
final Version protocolVersion = new Version(destDef.getProtocolVersion());
return reportConnectionStatus(
synchronousSchedulerClient.createDestinationCheckConnectionJob(destination, imageName, protocolVersion, isCustomConnector));
Expand All @@ -250,7 +249,7 @@ public SourceDiscoverSchemaRead discoverSchemaForSourceFromSourceId(final Source
throws ConfigNotFoundException, IOException, JsonValidationException {
final SourceConnection source = configRepository.getSourceConnection(discoverSchemaRequestBody.getSourceId());
final StandardSourceDefinition sourceDef = configRepository.getStandardSourceDefinition(source.getSourceDefinitionId());
final String imageName = DockerUtils.getTaggedImageName(sourceDef.getDockerRepository(), sourceDef.getDockerImageTag());
final String imageName = sourceDef.getDockerRepository() + ":" + sourceDef.getDockerImageTag();
final boolean isCustomConnector = sourceDef.getCustom();

final String configHash = HASH_FUNCTION.hashBytes(Jsons.serialize(source.getConfiguration()).getBytes(
Expand Down Expand Up @@ -298,7 +297,7 @@ public SourceDiscoverSchemaRead discoverSchemaForSourceFromSourceCreate(final So
sourceCreate.getConnectionConfiguration(),
sourceDef.getSpec());

final String imageName = DockerUtils.getTaggedImageName(sourceDef.getDockerRepository(), sourceDef.getDockerImageTag());
final String imageName = sourceDef.getDockerRepository() + ":" + sourceDef.getDockerImageTag();
final boolean isCustomConnector = sourceDef.getCustom();
// todo (cgardens) - narrow the struct passed to the client. we are not setting fields that are
// technically declared as required.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import io.airbyte.api.model.generated.SourceDefinitionUpdate;
import io.airbyte.api.model.generated.SourceRead;
import io.airbyte.api.model.generated.WorkspaceIdRequestBody;
import io.airbyte.commons.docker.DockerUtils;
import io.airbyte.commons.resources.MoreResources;
import io.airbyte.commons.server.ServerConstants;
import io.airbyte.commons.server.converters.ApiPojoConverters;
Expand All @@ -33,7 +32,11 @@
import io.airbyte.commons.version.AirbyteProtocolVersion;
import io.airbyte.commons.version.AirbyteProtocolVersionRange;
import io.airbyte.commons.version.Version;
import io.airbyte.config.*;
import io.airbyte.config.ActorDefinitionResourceRequirements;
import io.airbyte.config.ActorType;
import io.airbyte.config.Configs;
import io.airbyte.config.EnvConfigs;
import io.airbyte.config.StandardSourceDefinition;
import io.airbyte.config.persistence.ConfigNotFoundException;
import io.airbyte.config.persistence.ConfigRepository;
import io.airbyte.protocol.models.ConnectorSpecification;
Expand Down Expand Up @@ -296,7 +299,7 @@ public void deleteSourceDefinition(final SourceDefinitionIdRequestBody sourceDef

private ConnectorSpecification getSpecForImage(final String dockerRepository, final String imageTag, final boolean isCustomConnector)
throws IOException {
final String imageName = DockerUtils.getTaggedImageName(dockerRepository, imageTag);
final String imageName = dockerRepository + ":" + imageTag;
final SynchronousResponse<ConnectorSpecification> getSpecResponse = schedulerSynchronousClient.createGetSpecJob(imageName, isCustomConnector);
return SpecFetcher.getSpecFromJob(getSpecResponse);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import io.airbyte.api.model.generated.PrivateDestinationDefinitionReadList;
import io.airbyte.api.model.generated.ReleaseStage;
import io.airbyte.api.model.generated.WorkspaceIdRequestBody;
import io.airbyte.commons.docker.DockerUtils;
import io.airbyte.commons.json.Jsons;
import io.airbyte.commons.server.errors.IdNotFoundKnownException;
import io.airbyte.commons.server.errors.UnsupportedProtocolVersionException;
Expand Down Expand Up @@ -382,7 +381,7 @@ void testCreateDestinationDefinitionShouldCheckProtocolVersion() throws URISynta
final String invalidProtocolVersion = "121.5.6";
final StandardDestinationDefinition destination = generateDestinationDefinition();
destination.getSpec().setProtocolVersion(invalidProtocolVersion);
final String imageName = DockerUtils.getTaggedImageName(destination.getDockerRepository(), destination.getDockerImageTag());
final String imageName = destination.getDockerRepository() + ":" + destination.getDockerImageTag();

when(uuidSupplier.get()).thenReturn(destination.getDestinationDefinitionId());
when(schedulerSynchronousClient.createGetSpecJob(imageName, true)).thenReturn(new SynchronousResponse<>(
Expand Down Expand Up @@ -417,7 +416,7 @@ void testCreateDestinationDefinitionShouldCheckProtocolVersion() throws URISynta
@DisplayName("createCustomDestinationDefinition should correctly create a destinationDefinition")
void testCreateCustomDestinationDefinition() throws URISyntaxException, IOException, JsonValidationException {
final StandardDestinationDefinition destination = generateDestinationDefinition();
final String imageName = DockerUtils.getTaggedImageName(destination.getDockerRepository(), destination.getDockerImageTag());
final String imageName = destination.getDockerRepository() + ":" + destination.getDockerImageTag();

when(uuidSupplier.get()).thenReturn(destination.getDestinationDefinitionId());
when(schedulerSynchronousClient.createGetSpecJob(imageName, true)).thenReturn(new SynchronousResponse<>(
Expand Down Expand Up @@ -474,7 +473,7 @@ void testCreateCustomDestinationDefinitionWithInvalidProtocol() throws URISyntax
final String invalidProtocol = "122.1.22";
final StandardDestinationDefinition destination = generateDestinationDefinition();
destination.getSpec().setProtocolVersion(invalidProtocol);
final String imageName = DockerUtils.getTaggedImageName(destination.getDockerRepository(), destination.getDockerImageTag());
final String imageName = destination.getDockerRepository() + ":" + destination.getDockerImageTag();

when(uuidSupplier.get()).thenReturn(destination.getDestinationDefinitionId());
when(schedulerSynchronousClient.createGetSpecJob(imageName, true)).thenReturn(new SynchronousResponse<>(
Expand Down Expand Up @@ -521,7 +520,7 @@ void testUpdateDestination() throws ConfigNotFoundException, IOException, JsonVa
assertNotEquals(newDockerImageTag, currentTag);
assertNotEquals(newProtocolVersion, currentDestination.getProtocolVersion());

final String newImageName = DockerUtils.getTaggedImageName(destinationDefinition.getDockerRepository(), newDockerImageTag);
final String newImageName = destinationDefinition.getDockerRepository() + ":" + newDockerImageTag;
final ConnectorSpecification newSpec = new ConnectorSpecification()
.withConnectionSpecification(Jsons.jsonNode(ImmutableMap.of("foo2", "bar2")))
.withProtocolVersion(newProtocolVersion);
Expand Down Expand Up @@ -557,7 +556,7 @@ void testOutOfProtocolRangeUpdateDestination() throws ConfigNotFoundException, I
assertNotEquals(newDockerImageTag, currentTag);
assertNotEquals(newProtocolVersion, currentDestination.getProtocolVersion());

final String newImageName = DockerUtils.getTaggedImageName(destinationDefinition.getDockerRepository(), newDockerImageTag);
final String newImageName = destinationDefinition.getDockerRepository() + ":" + newDockerImageTag;
final ConnectorSpecification newSpec = new ConnectorSpecification()
.withConnectionSpecification(Jsons.jsonNode(ImmutableMap.of("foo2", "bar2")))
.withProtocolVersion(newProtocolVersion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import io.airbyte.api.model.generated.SourceUpdate;
import io.airbyte.api.model.generated.StreamTransform;
import io.airbyte.api.model.generated.StreamTransform.TransformTypeEnum;
import io.airbyte.commons.docker.DockerUtils;
import io.airbyte.commons.enums.Enums;
import io.airbyte.commons.features.EnvVariableFeatureFlags;
import io.airbyte.commons.json.Jsons;
Expand Down Expand Up @@ -103,12 +102,12 @@ class SchedulerHandlerTest {

private static final String SOURCE_DOCKER_REPO = "srcimage";
private static final String SOURCE_DOCKER_TAG = "tag";
private static final String SOURCE_DOCKER_IMAGE = DockerUtils.getTaggedImageName(SOURCE_DOCKER_REPO, SOURCE_DOCKER_TAG);
private static final String SOURCE_DOCKER_IMAGE = SOURCE_DOCKER_REPO + ":" + SOURCE_DOCKER_TAG;
private static final String SOURCE_PROTOCOL_VERSION = "0.4.5";

private static final String DESTINATION_DOCKER_REPO = "dstimage";
private static final String DESTINATION_DOCKER_TAG = "tag";
private static final String DESTINATION_DOCKER_IMAGE = DockerUtils.getTaggedImageName(DESTINATION_DOCKER_REPO, DESTINATION_DOCKER_TAG);
private static final String DESTINATION_DOCKER_IMAGE = DESTINATION_DOCKER_REPO + ":" + DESTINATION_DOCKER_TAG;
private static final String DESTINATION_PROTOCOL_VERSION = "0.7.9";
private static final String NAME = "name";
private static final String DOGS = "dogs";
Expand Down
Loading

0 comments on commit f098287

Please sign in to comment.