Search in sources :

Example 1 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class BlueprintTemplateProcessorTest method testMustacheGeneratorWithSimpleUseCase.

@Test
public void testMustacheGeneratorWithSimpleUseCase() throws Exception {
    String testBlueprint = FileReaderUtils.readFileFromClasspath("blueprints-jackson/bp-mustache-test.bp");
    Cluster cluster = cluster();
    BlueprintStackInfo blueprintStackInfo = new BlueprintStackInfo("hdp", "2.4");
    GeneralClusterConfigs generalClusterConfigs = generalClusterConfigs();
    generalClusterConfigs.setClusterName("dummyCluster");
    generalClusterConfigs.setStackName("dummyCluster");
    Map<String, Object> properties = new HashMap<>();
    properties.put("S3_BUCKET", "testbucket");
    BlueprintPreparationObject blueprintPreparationObject = BlueprintPreparationObject.Builder.builder().withRdsConfigs(cluster.getRdsConfigs()).withGateway(cluster.getGateway()).withLdapConfig(cluster.getLdapConfig()).withGeneralClusterConfigs(generalClusterConfigs).withBlueprintView(new BlueprintView(testBlueprint, new Json(properties), blueprintStackInfo.getVersion(), blueprintStackInfo.getType())).build();
    String result = underTest.process(testBlueprint, blueprintPreparationObject, Maps.newHashMap());
    assertTrue(result.contains("testbucket"));
    assertTrue(result.contains("{{ zookeeper_quorum }}"));
    assertTrue(result.contains("{{default('/configurations/hadoop-env/hdfs_log_dir_prefix', '/var/log/hadoop')}}"));
    assertTrue(result.contains(cluster.getName()));
    assertTrue(result.contains("jdbc:postgresql://10.1.1.1:5432/ranger"));
    assertTrue(result.contains("cn=users,dc=example,dc=org"));
    assertTrue(result.contains("ldap://localhost:389"));
}
Also used : BlueprintStackInfo(com.sequenceiq.cloudbreak.blueprint.templates.BlueprintStackInfo) GeneralClusterConfigs(com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs) HashMap(java.util.HashMap) BlueprintView(com.sequenceiq.cloudbreak.blueprint.template.views.BlueprintView) Cluster(com.sequenceiq.cloudbreak.domain.Cluster) BlueprintPreparationObject(com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject) BlueprintPreparationObject(com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject) Json(com.sequenceiq.cloudbreak.domain.json.Json) Test(org.junit.Test)

Example 2 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class BlueprintTestUtil method generalClusterConfigs.

public static GeneralClusterConfigs generalClusterConfigs(Cluster cluster) {
    GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
    generalClusterConfigs.setAmbariIp(cluster.getAmbariIp());
    generalClusterConfigs.setInstanceGroupsPresented(true);
    generalClusterConfigs.setGatewayInstanceMetadataPresented(true);
    generalClusterConfigs.setClusterName(cluster.getName());
    generalClusterConfigs.setExecutorType(cluster.getExecutorType());
    generalClusterConfigs.setStackName(cluster.getName());
    generalClusterConfigs.setUuid("111-222-333-444");
    generalClusterConfigs.setUserName(cluster.getUserName());
    generalClusterConfigs.setPassword(cluster.getPassword());
    generalClusterConfigs.setNodeCount(1);
    generalClusterConfigs.setIdentityUserEmail(IDENTITY_USER_EMAIL);
    generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.ofNullable("fqdn.loal.com"));
    return generalClusterConfigs;
}
Also used : GeneralClusterConfigs(com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs)

Example 3 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class BlueprintTestUtil method generalClusterConfigs.

public static GeneralClusterConfigs generalClusterConfigs() {
    GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
    generalClusterConfigs.setAmbariIp("10.1.1.1");
    generalClusterConfigs.setInstanceGroupsPresented(true);
    generalClusterConfigs.setGatewayInstanceMetadataPresented(true);
    generalClusterConfigs.setClusterName("clustername");
    generalClusterConfigs.setExecutorType(ExecutorType.DEFAULT);
    generalClusterConfigs.setStackName("clustername");
    generalClusterConfigs.setUuid("111-222-333-444");
    generalClusterConfigs.setUserName("username");
    generalClusterConfigs.setPassword("Passw0rd");
    generalClusterConfigs.setNodeCount(1);
    generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.ofNullable("fqdn.loal.com"));
    generalClusterConfigs.setIdentityUserEmail(IDENTITY_USER_EMAIL);
    return generalClusterConfigs;
}
Also used : GeneralClusterConfigs(com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs)

Example 4 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class BlueprintModelProvider method blueprintObjectWhenHiveInteractivePresentedTheLlapShouldConfigured.

static BlueprintPreparationObject blueprintObjectWhenHiveInteractivePresentedTheLlapShouldConfigured() throws JsonProcessingException {
    GeneralClusterConfigs conf = BlueprintTestUtil.generalClusterConfigs();
    conf.setNodeCount(5);
    return BlueprintPreparationObject.Builder.builder().withGeneralClusterConfigs(conf).withBlueprintView(BlueprintTestUtil.generalBlueprintView("", "2.6", "HDP")).withHostgroups(getHostGroups("master", "slave_1")).withGateway(TestUtil.gateway()).build();
}
Also used : GeneralClusterConfigs(com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs)

Example 5 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class BlueprintModelProvider method blueprintObjectWhereExecutioTypeHasConfiguredAsContainer.

static BlueprintPreparationObject blueprintObjectWhereExecutioTypeHasConfiguredAsContainer() throws JsonProcessingException {
    GeneralClusterConfigs configs = BlueprintTestUtil.generalClusterConfigs();
    configs.setExecutorType(ExecutorType.CONTAINER);
    return BlueprintPreparationObject.Builder.builder().withBlueprintView(BlueprintTestUtil.generalBlueprintView("", "2.6", "HDP")).withHostgroups(getHostGroups("master", "slave_1")).withGeneralClusterConfigs(configs).withGateway(TestUtil.gateway()).build();
}
Also used : GeneralClusterConfigs(com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs)

Aggregations

GeneralClusterConfigs (com.sequenceiq.cloudbreak.blueprint.templates.GeneralClusterConfigs)12 BlueprintPreparationObject (com.sequenceiq.cloudbreak.blueprint.BlueprintPreparationObject)4 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)4 Test (org.junit.Test)4 BlueprintView (com.sequenceiq.cloudbreak.blueprint.template.views.BlueprintView)3 BlueprintStackInfo (com.sequenceiq.cloudbreak.blueprint.templates.BlueprintStackInfo)3 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)3 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 BlueprintTextProcessor (com.sequenceiq.cloudbreak.blueprint.BlueprintTextProcessor)2 KerberosConfig (com.sequenceiq.cloudbreak.domain.KerberosConfig)2 Stack (com.sequenceiq.cloudbreak.domain.Stack)2 Json (com.sequenceiq.cloudbreak.domain.json.Json)2 HashMap (java.util.HashMap)2 InstanceGroupV2Request (com.sequenceiq.cloudbreak.api.model.v2.InstanceGroupV2Request)1 BlueprintProcessingException (com.sequenceiq.cloudbreak.blueprint.BlueprintProcessingException)1 HdfConfigs (com.sequenceiq.cloudbreak.blueprint.nifi.HdfConfigs)1 FileSystemConfigurationView (com.sequenceiq.cloudbreak.blueprint.template.views.FileSystemConfigurationView)1 HostgroupView (com.sequenceiq.cloudbreak.blueprint.template.views.HostgroupView)1 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)1 FlexSubscription (com.sequenceiq.cloudbreak.domain.FlexSubscription)1