Search in sources :

Example 1 with DeployBroker

use of org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.DeployBroker in project che-server by eclipse-che.

the class PluginBrokerManager method getTooling.

/**
 * Deploys Che plugin brokers in a workspace, receives result of theirs execution and returns
 * resolved workspace tooling or error of plugins brokering execution.
 *
 * <p>This API is in <b>Beta</b> and is subject to changes or removal.
 */
@Beta
@Traced
public List<ChePlugin> getTooling(RuntimeIdentity identity, StartSynchronizer startSynchronizer, Collection<PluginFQN> pluginFQNs, boolean isEphemeral, boolean mergePlugins, Map<String, String> startOptions) throws InfrastructureException {
    String workspaceId = identity.getWorkspaceId();
    KubernetesNamespace kubernetesNamespace = factory.getOrCreate(identity);
    BrokersResult brokersResult = new BrokersResult();
    E brokerEnvironment = brokerEnvironmentFactory.createForMetadataBroker(pluginFQNs, identity, mergePlugins);
    if (isEphemeral) {
        EphemeralWorkspaceUtility.makeEphemeral(brokerEnvironment.getAttributes());
    }
    environmentProvisioner.provision(brokerEnvironment, identity);
    ListenBrokerEvents listenBrokerEvents = getListenEventPhase(workspaceId, brokersResult);
    PrepareStorage prepareStorage = getPrepareStoragePhase(identity, startSynchronizer, brokerEnvironment, startOptions);
    WaitBrokerResult waitBrokerResult = getWaitBrokerPhase(workspaceId, brokersResult);
    DeployBroker deployBroker = getDeployBrokerPhase(identity, kubernetesNamespace, brokerEnvironment, brokersResult, startOptions);
    LOG.debug("Entering plugin brokers deployment chain workspace '{}'", workspaceId);
    listenBrokerEvents.then(prepareStorage).then(deployBroker).then(waitBrokerResult);
    return listenBrokerEvents.execute();
}
Also used : ListenBrokerEvents(org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.ListenBrokerEvents) WaitBrokerResult(org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.WaitBrokerResult) DeployBroker(org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.DeployBroker) PrepareStorage(org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.PrepareStorage) KubernetesNamespace(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesNamespace) Traced(org.eclipse.che.commons.annotation.Traced) Beta(com.google.common.annotations.Beta)

Example 2 with DeployBroker

use of org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.DeployBroker in project devspaces-images by redhat-developer.

the class PluginBrokerManager method getTooling.

/**
 * Deploys Che plugin brokers in a workspace, receives result of theirs execution and returns
 * resolved workspace tooling or error of plugins brokering execution.
 *
 * <p>This API is in <b>Beta</b> and is subject to changes or removal.
 */
@Beta
@Traced
public List<ChePlugin> getTooling(RuntimeIdentity identity, StartSynchronizer startSynchronizer, Collection<PluginFQN> pluginFQNs, boolean isEphemeral, boolean mergePlugins, Map<String, String> startOptions) throws InfrastructureException {
    String workspaceId = identity.getWorkspaceId();
    KubernetesNamespace kubernetesNamespace = factory.getOrCreate(identity);
    BrokersResult brokersResult = new BrokersResult();
    E brokerEnvironment = brokerEnvironmentFactory.createForMetadataBroker(pluginFQNs, identity, mergePlugins);
    if (isEphemeral) {
        EphemeralWorkspaceUtility.makeEphemeral(brokerEnvironment.getAttributes());
    }
    environmentProvisioner.provision(brokerEnvironment, identity);
    ListenBrokerEvents listenBrokerEvents = getListenEventPhase(workspaceId, brokersResult);
    PrepareStorage prepareStorage = getPrepareStoragePhase(identity, startSynchronizer, brokerEnvironment, startOptions);
    WaitBrokerResult waitBrokerResult = getWaitBrokerPhase(workspaceId, brokersResult);
    DeployBroker deployBroker = getDeployBrokerPhase(identity, kubernetesNamespace, brokerEnvironment, brokersResult, startOptions);
    LOG.debug("Entering plugin brokers deployment chain workspace '{}'", workspaceId);
    listenBrokerEvents.then(prepareStorage).then(deployBroker).then(waitBrokerResult);
    return listenBrokerEvents.execute();
}
Also used : ListenBrokerEvents(org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.ListenBrokerEvents) WaitBrokerResult(org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.WaitBrokerResult) DeployBroker(org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.DeployBroker) PrepareStorage(org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.PrepareStorage) KubernetesNamespace(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesNamespace) Traced(org.eclipse.che.commons.annotation.Traced) Beta(com.google.common.annotations.Beta)

Aggregations

Beta (com.google.common.annotations.Beta)2 Traced (org.eclipse.che.commons.annotation.Traced)2 KubernetesNamespace (org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesNamespace)2 DeployBroker (org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.DeployBroker)2 ListenBrokerEvents (org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.ListenBrokerEvents)2 PrepareStorage (org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.PrepareStorage)2 WaitBrokerResult (org.eclipse.che.workspace.infrastructure.kubernetes.wsplugins.brokerphases.WaitBrokerResult)2