Search in sources :

Example 71 with ClouderaManagerProduct

use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.

the class ClouderaManagerModificationService method activateParcels.

private void activateParcels(ClustersResourceApi clustersResourceApi) throws ApiException, CloudbreakException {
    LOGGER.debug("Deploying client configurations on upscaled hosts.");
    BigDecimal deployCommandId = deployClientConfig(clustersResourceApi, stack);
    List<ClouderaManagerProduct> products = clusterComponentConfigProvider.getClouderaManagerProductDetails(stack.getCluster().getId());
    ExtendedPollingResult pollingResult = clouderaManagerPollingServiceProvider.startPollingCmParcelActivation(stack, apiClient, deployCommandId, products);
    handlePollingResult(pollingResult, "Cluster was terminated while waiting for parcels activation", "Timeout while Cloudera Manager activate parcels.");
    LOGGER.debug("Parcels are activated on upscaled hosts.");
}
Also used : ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct) ExtendedPollingResult(com.sequenceiq.cloudbreak.polling.ExtendedPollingResult) BigDecimal(java.math.BigDecimal)

Example 72 with ClouderaManagerProduct

use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.

the class ClouderaManagerModificationService method upgradeClusterRuntime.

@Override
public void upgradeClusterRuntime(Set<ClusterComponent> components, boolean patchUpgrade, Optional<String> remoteDataContext) throws CloudbreakException {
    try {
        LOGGER.info("Starting to upgrade cluster runtimes. Patch upgrade: {}", patchUpgrade);
        ClustersResourceApi clustersResourceApi = clouderaManagerApiFactory.getClustersResourceApi(apiClient);
        ParcelResourceApi parcelResourceApi = clouderaManagerApiFactory.getParcelResourceApi(apiClient);
        ClouderaManagerResourceApi clouderaManagerResourceApi = clouderaManagerApiFactory.getClouderaManagerResourceApi(apiClient);
        startClouderaManager();
        startAgents();
        tagHostsWithHostTemplateName();
        checkParcelApiAvailability();
        refreshRemoteDataContextFromDatalakeInCaseOfDatahub(remoteDataContext);
        Set<ClouderaManagerProduct> products = getProducts(components);
        setParcelRepo(products, clouderaManagerResourceApi);
        refreshParcelRepos(clouderaManagerResourceApi);
        restartMgmtServices();
        if (patchUpgrade) {
            downloadAndActivateParcels(products, parcelResourceApi, true);
            startServices();
            callPostClouderaRuntimeUpgradeCommandIfCMIsNewerThan751(clustersResourceApi);
            restartServices(clustersResourceApi);
        } else {
            ClouderaManagerProduct cdhProduct = clouderaManagerProductsProvider.getCdhProducts(products);
            upgradeNonCdhProducts(products, cdhProduct.getName(), parcelResourceApi, true);
            upgradeCdh(clustersResourceApi, parcelResourceApi, cdhProduct);
            startServices();
            deployConfigAndRefreshCMStaleServices(clustersResourceApi, false);
        }
        removeUnusedParcelVersions(parcelResourceApi, products);
        configService.enableKnoxAutorestartIfCmVersionAtLeast(CLOUDERAMANAGER_VERSION_7_1_0, apiClient, stack.getName());
        LOGGER.info("Cluster runtime upgrade finished");
    } catch (ApiException e) {
        LOGGER.info("Could not upgrade Cloudera Runtime services", e);
        throw new ClouderaManagerOperationFailedException(e.getMessage(), e);
    }
}
Also used : ParcelResourceApi(com.cloudera.api.swagger.ParcelResourceApi) ClouderaManagerResourceApi(com.cloudera.api.swagger.ClouderaManagerResourceApi) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct) ClustersResourceApi(com.cloudera.api.swagger.ClustersResourceApi) ApiException(com.cloudera.api.swagger.client.ApiException)

Example 73 with ClouderaManagerProduct

use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.

the class ClouderaManagerParcelManagementService method activateParcels.

public void activateParcels(Set<ClouderaManagerProduct> products, ParcelResourceApi parcelResourceApi, Stack stack, ApiClient apiClient) throws ApiException, CloudbreakException {
    for (ClouderaManagerProduct product : products) {
        String productName = product.getName();
        LOGGER.info("Activating {} parcel", productName);
        ApiCommand apiCommand = parcelResourceApi.activateCommand(stack.getName(), productName, product.getVersion());
        ExtendedPollingResult result = clouderaManagerPollingServiceProvider.startPollingCmSingleParcelActivation(stack, apiClient, apiCommand.getId(), product);
        handlePollingResult(result.getPollingResult(), "Cluster was terminated while waiting for CDP Runtime Parcel to be activated", "Timeout during the updated CDP Runtime Parcel activation.");
    }
}
Also used : ApiCommand(com.cloudera.api.swagger.model.ApiCommand) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct) ExtendedPollingResult(com.sequenceiq.cloudbreak.polling.ExtendedPollingResult)

Example 74 with ClouderaManagerProduct

use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.

the class ClouderaManagerParcelManagementService method distributeParcels.

public void distributeParcels(Set<ClouderaManagerProduct> products, ParcelResourceApi parcelResourceApi, Stack stack, ApiClient apiClient) throws ApiException, CloudbreakException {
    for (ClouderaManagerProduct product : products) {
        LOGGER.info("Distributing downloaded {} parcel", product.getName());
        ApiCommand apiCommand = parcelResourceApi.startDistributionCommand(stack.getName(), product.getName(), product.getVersion());
        ExtendedPollingResult pollingResult = clouderaManagerPollingServiceProvider.startPollingCdpRuntimeParcelDistribute(stack, apiClient, apiCommand.getId(), new ParcelResource(stack.getName(), product.getName(), product.getVersion()));
        handlePollingResult(pollingResult.getPollingResult(), "Cluster was terminated while waiting for CDP Runtime Parcel to be distributed", "Timeout during the updated CDP Runtime Parcel distribution.");
    }
}
Also used : ApiCommand(com.cloudera.api.swagger.model.ApiCommand) ParcelResource(com.sequenceiq.cloudbreak.cm.model.ParcelResource) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct) ExtendedPollingResult(com.sequenceiq.cloudbreak.polling.ExtendedPollingResult)

Example 75 with ClouderaManagerProduct

use of com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct in project cloudbreak by hortonworks.

the class InTestCdhParcelProvider method getParcels.

public Map<String, DefaultCDHInfo> getParcels(String runtimeVersion) {
    Map<String, DefaultCDHInfo> cdhParcels = new HashMap<>();
    DefaultCDHInfo defaultCDHInfo = new DefaultCDHInfo();
    ClouderaManagerProduct schemaRegistry = new ClouderaManagerProduct();
    schemaRegistry.setParcel("http://s3.amazonaws.com/dev.hortonworks.com/CSP/centos7/3.x/BUILDS/3.0.0.0-123/tars/parcel");
    schemaRegistry.setName("SCHEMAREGISTRY");
    schemaRegistry.setVersion("0.8.1.3.0.0.0-123");
    schemaRegistry.setCsd(Lists.newArrayList("http://s3.amazonaws.com/dev.hortonworks.com/CSP/centos7/3.x/BUILDS/" + "3.0.0.0-123/tars/parcel/SCHEMAREGISTRY-0.8.1.jar"));
    ClouderaManagerProduct streamsMessagingManager = new ClouderaManagerProduct();
    streamsMessagingManager.setParcel("http://s3.amazonaws.com/dev.hortonworks.com/CSP/centos7/3.x/BUILDS/3.0.0.0-123/tars/parcel");
    streamsMessagingManager.setName("STREAMS_MESSAGING_MANAGER");
    streamsMessagingManager.setVersion("2.1.0.3.0.0.0-123");
    streamsMessagingManager.setCsd(Lists.newArrayList("http://s3.amazonaws.com/dev.hortonworks.com/CSP/centos7/3.x/BUILDS/" + "3.0.0.0-123/tars/parcel/STREAMS_MESSAGING_MANAGER-2.1.0.jar"));
    ClouderaManagerProduct cfm = new ClouderaManagerProduct();
    cfm.setParcel("http://s3.amazonaws.com/dev.hortonworks.com/CFM/centos7/2.x/BUILDS/2.0.0.0-213/tars/parcel");
    cfm.setName("CFM");
    cfm.setVersion("2.0.0.0");
    cfm.setCsd(Lists.newArrayList("http://s3.amazonaws.com/dev.hortonworks.com/CFM/centos7/2.x/BUILDS/2.0.0.0-213/" + "tars/parcel/NIFI-1.11.4.2.0.0.0-213.jar"));
    ClouderaManagerDefaultStackRepoDetails cm = new ClouderaManagerDefaultStackRepoDetails();
    cm.setCdhVersion("CDH-" + runtimeVersion);
    Map<String, String> stack = new HashMap<>();
    stack.put("redhat7", "http://cloudera-build-us-west-1.vpc.cloudera.com/s3/build/1423385/cdh/7.x/parcels/");
    stack.put("centos7", "http://cloudera-build-us-west-1.vpc.cloudera.com/s3/build/1423385/cdh/7.x/parcels/");
    cm.setStack(stack);
    defaultCDHInfo.setParcels(Lists.newArrayList(schemaRegistry, streamsMessagingManager, cfm));
    defaultCDHInfo.setVersion(runtimeVersion);
    defaultCDHInfo.setRepo(cm);
    cdhParcels.put(runtimeVersion, defaultCDHInfo);
    return cdhParcels;
}
Also used : ClouderaManagerDefaultStackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.component.ClouderaManagerDefaultStackRepoDetails) DefaultCDHInfo(com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo) HashMap(java.util.HashMap) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)

Aggregations

ClouderaManagerProduct (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)91 Test (org.junit.Test)34 Test (org.junit.jupiter.api.Test)23 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)23 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)20 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)14 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)10 Image (com.sequenceiq.cloudbreak.cloud.model.catalog.Image)9 ClusterComponent (com.sequenceiq.cloudbreak.domain.stack.cluster.ClusterComponent)9 ParcelInfo (com.sequenceiq.cloudbreak.service.upgrade.sync.common.ParcelInfo)9 HashSet (java.util.HashSet)8 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)8 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)7 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)7 VirtualGroupRequest (com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest)6 IdBroker (com.sequenceiq.cloudbreak.domain.stack.cluster.IdBroker)6 ExtendedPollingResult (com.sequenceiq.cloudbreak.polling.ExtendedPollingResult)6 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)6 BlueprintTextProcessor (com.sequenceiq.cloudbreak.template.processor.BlueprintTextProcessor)6 Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)5