Search in sources :

Example 21 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class RecipeTestUtil method generalClusterConfigs.

public static GeneralClusterConfigs generalClusterConfigs() {
    GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
    generalClusterConfigs.setClusterManagerIp("10.1.1.1");
    generalClusterConfigs.setInstanceGroupsPresented(true);
    generalClusterConfigs.setGatewayInstanceMetadataPresented(false);
    generalClusterConfigs.setClusterName("clustername");
    generalClusterConfigs.setStackName("clustername");
    generalClusterConfigs.setUuid("111-222-333-444");
    generalClusterConfigs.setUserName("username");
    generalClusterConfigs.setPassword("Passw0rd");
    generalClusterConfigs.setNodeCount(1);
    generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.of("fqdn.loal.com"));
    generalClusterConfigs.setIdentityUserEmail(IDENTITY_USER_EMAIL);
    return generalClusterConfigs;
}
Also used : GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)

Example 22 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class RecipeTestUtil method generalClusterConfigs.

public static GeneralClusterConfigs generalClusterConfigs(Cluster cluster) {
    GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
    generalClusterConfigs.setClusterManagerIp(cluster.getClusterManagerIp());
    generalClusterConfigs.setInstanceGroupsPresented(true);
    generalClusterConfigs.setGatewayInstanceMetadataPresented(true);
    generalClusterConfigs.setClusterName(cluster.getName());
    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.of("fqdn.loal.com"));
    return generalClusterConfigs;
}
Also used : GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)

Example 23 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class CmTemplateProcessorTest method testAddInstantiatorWithBaseRoles.

@Test
public void testAddInstantiatorWithBaseRoles() {
    underTest = new CmTemplateProcessor(getBlueprintText("input/clouderamanager.bp"));
    ClouderaManagerRepo clouderaManagerRepoDetails = new ClouderaManagerRepo();
    clouderaManagerRepoDetails.setVersion(CMRepositoryVersionUtil.CLOUDERAMANAGER_VERSION_6_3_0.getVersion());
    GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
    generalClusterConfigs.setClusterName("cluster");
    TemplatePreparationObject.Builder tpoBuilder = new TemplatePreparationObject.Builder().withGeneralClusterConfigs(generalClusterConfigs);
    TemplatePreparationObject templatePreparationObject = tpoBuilder.build();
    underTest.addInstantiator(clouderaManagerRepoDetails, templatePreparationObject, "dszabo-sdx");
    ApiClusterTemplateInstantiator instantiator = underTest.getTemplate().getInstantiator();
    List<ApiClusterTemplateRoleConfigGroupInfo> roleConfigGroups = instantiator.getRoleConfigGroups();
    List<String> refNames = roleConfigGroups.stream().map(ApiClusterTemplateRoleConfigGroupInfo::getRcgRefName).collect(Collectors.toList());
    assertEquals(2, refNames.size());
    assertTrue(refNames.containsAll(List.of("yarn-NODEMANAGER-BASE", "hdfs-DATANODE-BASE")));
    assertEquals("cluster", instantiator.getClusterName());
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) ClouderaManagerRepo(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo) GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs) ApiClusterTemplateInstantiator(com.cloudera.api.swagger.model.ApiClusterTemplateInstantiator) ApiClusterTemplateRoleConfigGroupInfo(com.cloudera.api.swagger.model.ApiClusterTemplateRoleConfigGroupInfo) Test(org.junit.jupiter.api.Test)

Example 24 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class CmTemplateProcessorTest method addInstantiatorKeepsCustomClusterName.

@Test
public void addInstantiatorKeepsCustomClusterName() {
    underTest = new CmTemplateProcessor(getBlueprintText("input/clouderamanager-custom_cluster_name.bp"));
    GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
    generalClusterConfigs.setClusterName("cluster");
    TemplatePreparationObject templatePreparationObject = new TemplatePreparationObject.Builder().withGeneralClusterConfigs(generalClusterConfigs).build();
    underTest.addInstantiator(null, templatePreparationObject, null);
    ApiClusterTemplateInstantiator instantiator = underTest.getTemplate().getInstantiator();
    assertEquals("kusztom", instantiator.getClusterName());
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs) ApiClusterTemplateInstantiator(com.cloudera.api.swagger.model.ApiClusterTemplateInstantiator) Test(org.junit.jupiter.api.Test)

Example 25 with GeneralClusterConfigs

use of com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs in project cloudbreak by hortonworks.

the class HiveServer2ConfigProviderTest method getTemplatePreparationObject.

private TemplatePreparationObject getTemplatePreparationObject() {
    HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1);
    HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
    GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
    generalClusterConfigs.setUuid("uuid");
    return Builder.builder().withGeneralClusterConfigs(generalClusterConfigs).withHostgroupViews(Set.of(master, worker)).build();
}
Also used : GeneralClusterConfigs(com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView)

Aggregations

GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)67 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)52 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)28 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)21 Test (org.junit.jupiter.api.Test)20 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)19 Test (org.junit.Test)18 ApiClusterTemplateService (com.cloudera.api.swagger.model.ApiClusterTemplateService)16 DisplayName (org.junit.jupiter.api.DisplayName)16 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)16 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)15 MethodSource (org.junit.jupiter.params.provider.MethodSource)13 DatalakeView (com.sequenceiq.cloudbreak.template.views.DatalakeView)12 BlueprintTextProcessor (com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor)11 Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)10 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)10 HashSet (java.util.HashSet)8 VirtualGroupRequest (com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest)7 ArrayList (java.util.ArrayList)7 HostsResourceApi (com.cloudera.api.swagger.HostsResourceApi)6