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

Remove Integrations.java and initially persisted specs #535

Merged
merged 21 commits into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion airbyte-scheduler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies {
implementation project(':airbyte-config:models')
implementation project(':airbyte-config:persistence')
implementation project(':airbyte-db')
implementation project(':airbyte-integrations')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was needed for Integrations.java

implementation project(':airbyte-workers')

testImplementation "org.testcontainers:postgresql:1.15.0-rc2"
Expand Down
1 change: 0 additions & 1 deletion airbyte-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ dependencies {
implementation project(':airbyte-config:persistence')
implementation project(':airbyte-config:init')
implementation project(':airbyte-db')
implementation project(':airbyte-integrations')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was needed for Integrations.java

implementation project(':airbyte-scheduler')

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public ConfigurationApi(final ConfigRepository configRepository, final Scheduler
webBackendConnectionsHandler = new WebBackendConnectionsHandler(connectionsHandler, sourceImplementationsHandler, jobHistoryHandler);
webBackendSourceImplementationHandler = new WebBackendSourceImplementationHandler(sourceImplementationsHandler, schedulerHandler);
webBackendDestinationImplementationHandler = new WebBackendDestinationImplementationHandler(destinationImplementationsHandler, schedulerHandler);
debugInfoHandler = new DebugInfoHandler();
debugInfoHandler = new DebugInfoHandler(configRepository);
}

// WORKSPACE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,25 @@

import com.google.common.collect.Lists;
import io.airbyte.api.model.DebugRead;
import io.airbyte.integrations.Integrations;
import io.airbyte.commons.docker.DockerUtils;
import io.airbyte.config.persistence.ConfigRepository;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
import javax.annotation.Nullable;
import org.apache.commons.io.IOUtils;

public class DebugInfoHandler {

private ConfigRepository configRepository;

public DebugInfoHandler(ConfigRepository configRepository) {
this.configRepository = configRepository;
}

public DebugRead getInfo() {
List<Map<String, String>> integrationImages = getIntegrationImages();
List<Map<String, String>> runningCoreImages = getRunningCoreImages();
Expand Down Expand Up @@ -88,10 +95,14 @@ private static List<Map<String, String>> getRunningCoreImages() {
}
}

private static List<Map<String, String>> getIntegrationImages() {
private List<Map<String, String>> getIntegrationImages() {
try {
return Arrays.stream(Integrations.values())
.map(Integrations::getTaggedImage)
Stream<String> sourceImages =
configRepository.listStandardSources().stream().map(s -> DockerUtils.getTaggedImageName(s.getDockerRepository(), s.getDockerImageTag()));
Stream<String> destinationImages =
configRepository.listStandardDestinations().stream()
.map(d -> DockerUtils.getTaggedImageName(d.getDockerRepository(), d.getDockerImageTag()));
return Stream.concat(sourceImages, destinationImages)
.map(image -> {
try {
String hash = runAndGetOutput(Lists.newArrayList("docker", "images", "--no-trunc", "--quiet", image));
Expand Down
Loading