UNPKG

@puls-atlas/cli

Version:

The Puls Atlas CLI tool for managing Atlas projects

74 lines 3.92 kB
import { createAirbyteServiceSecretPayload } from './secret.js'; import { resolveAirbyteServiceSelection } from './selection.js'; import { createDefaultServicePlatformClusterConfig } from '../../platform.js'; import { loadSearchRuntimeHints } from '../../serviceRuntimeHints.js'; import { ServiceDescriptor } from '../contracts/ServiceDescriptor.js'; import { ServiceLifecycle } from '../contracts/ServiceLifecycle.js'; import { createDefaultAirbyteServiceConfigSection, validateAirbyteServiceConfigSection } from './config.js'; import { doesAirbyteTerraformImportTargetExist, getAirbyteTerraformImportTargets, logAirbyteTerraformApplyFailureDetails, resolveAirbyteRuntimeInputs, validateAirbyteDeployment } from './deployment.js'; import { AIRBYTE_SERVICE_DEFAULT_MODULE_SOURCE, AIRBYTE_SERVICE_DEFAULT_ROOT_DIR, AIRBYTE_SERVICE_TEMPLATE_ROOT_DIRECTORIES, createAirbyteServiceTerraformPayload } from './terraform.js'; class AirbyteService extends ServiceLifecycle { constructor() { super(new ServiceDescriptor({ capabilities: { failureDiagnostics: true, runtimeInputs: true, terraformImports: true }, defaultModuleSource: AIRBYTE_SERVICE_DEFAULT_MODULE_SOURCE, defaultRootDir: AIRBYTE_SERVICE_DEFAULT_ROOT_DIR, description: 'Deploy self-managed Airbyte onto a configured GKE cluster.', displayName: 'Airbyte', id: 'airbyte', moduleRelativePath: 'airbyte/gke', templateRootDirectories: AIRBYTE_SERVICE_TEMPLATE_ROOT_DIRECTORIES })); } createDefaultConfigSection() { return createDefaultAirbyteServiceConfigSection(); } validateConfigSection(configSection) { return validateAirbyteServiceConfigSection(configSection); } createTerraformPayload(context, serviceConfig, dependencies = {}) { return createAirbyteServiceTerraformPayload(context, serviceConfig, dependencies); } async createSecretPayload(outputs, serviceConfig = {}, dependencies = {}) { return await createAirbyteServiceSecretPayload(outputs, serviceConfig, dependencies); } resolveDeployHints(cwd = process.cwd(), dependencies = {}) { const searchRuntimeHints = loadSearchRuntimeHints(cwd, { readJsonFile: dependencies.readJsonFile }); const isGkeSearchRuntime = searchRuntimeHints.platform === 'gke'; return { ...searchRuntimeHints, clusterLocation: isGkeSearchRuntime ? searchRuntimeHints.clusterLocation : null, clusterName: isGkeSearchRuntime ? searchRuntimeHints.clusterName : null, source: isGkeSearchRuntime ? 'search-runtime' : null }; } resolveManagedPlatformClusterConfig(context, serviceConfig, deployHints = {}) { return createDefaultServicePlatformClusterConfig(context, serviceConfig, deployHints); } async resolveSelection(currentConfig = {}, options = {}, dependencies = {}) { return resolveAirbyteServiceSelection(currentConfig, options, dependencies); } getTerraformImportTargets(context, serviceConfig, terraformConnection, dependencies = {}) { return getAirbyteTerraformImportTargets(context, serviceConfig, terraformConnection, dependencies); } async doesTerraformImportTargetExist(target, dependencies = {}) { return doesAirbyteTerraformImportTargetExist(target, dependencies); } async resolveRuntimeInputs(context, serviceConfig, terraformConnection, dependencies = {}) { return resolveAirbyteRuntimeInputs(context, serviceConfig, terraformConnection, dependencies); } async logTerraformApplyFailureDetails(serviceConfig, loggerImpl, dependencies = {}) { return logAirbyteTerraformApplyFailureDetails(serviceConfig, loggerImpl, dependencies); } async validateDeployment(context, serviceConfig, terraformConnection, dependencies = {}) { return validateAirbyteDeployment(context, serviceConfig, terraformConnection, dependencies); } } const airbyteService = new AirbyteService(); export default airbyteService;