use of org.eclipse.che.commons.annotation.Traced in project che-server by eclipse-che.
the class ServersConverter method provision.
@Override
@Traced
public void provision(T k8sEnv, RuntimeIdentity identity) throws InfrastructureException {
TracingTags.WORKSPACE_ID.set(identity::getWorkspaceId);
SecureServerExposer<T> secureServerExposer = secureServerExposerFactoryProvider.get(k8sEnv).create(identity);
for (PodData podConfig : k8sEnv.getPodsData().values()) {
final PodSpec podSpec = podConfig.getSpec();
for (Container containerConfig : podSpec.getContainers()) {
String machineName = Names.machineName(podConfig, containerConfig);
InternalMachineConfig machineConfig = k8sEnv.getMachines().get(machineName);
if (!machineConfig.getServers().isEmpty()) {
KubernetesServerExposer kubernetesServerExposer = new KubernetesServerExposer<>(externalServerExposer, secureServerExposer, machineName, podConfig, containerConfig, k8sEnv);
kubernetesServerExposer.expose(machineConfig.getServers());
}
}
}
}
use of org.eclipse.che.commons.annotation.Traced in project che-server by eclipse-che.
the class KubernetesInternalRuntime method startMachines.
/**
* Create all machine related objects and start machines.
*
* @throws InfrastructureException when any error occurs while creating Kubernetes objects
*/
@Traced
protected void startMachines() throws InfrastructureException {
KubernetesEnvironment k8sEnv = getContext().getEnvironment();
String workspaceId = getContext().getIdentity().getWorkspaceId();
createSecrets(k8sEnv, workspaceId);
List<ConfigMap> createdConfigMaps = createConfigMaps(k8sEnv, getContext().getIdentity());
List<Service> createdServices = createServices(k8sEnv, workspaceId);
// needed for resolution later on, even though n routes are actually created by ingress
// /workspace{wsid}/server-{port} => service({wsid}):server-port => pod({wsid}):{port}
List<Ingress> readyIngresses = createIngresses(k8sEnv, workspaceId);
listenEvents();
doStartMachine(serverResolverFactory.create(createdServices, readyIngresses, createdConfigMaps));
}
use of org.eclipse.che.commons.annotation.Traced in project che-server by eclipse-che.
the class KubernetesInternalRuntime method createServices.
@Traced
// package-private so that interception is possible
@SuppressWarnings("WeakerAccess")
List<Service> createServices(KubernetesEnvironment env, String workspaceId) throws InfrastructureException {
TracingTags.WORKSPACE_ID.set(workspaceId);
Collection<Service> servicesToCreate = env.getServices().values();
List<Service> createdServices = new ArrayList<>(servicesToCreate.size());
for (Service service : servicesToCreate) {
createdServices.add(namespace.services().create(service));
}
return createdServices;
}
use of org.eclipse.che.commons.annotation.Traced in project che-server by eclipse-che.
the class LimitsCheckingWorkspaceManager method createWorkspace.
@Override
@Traced
public WorkspaceImpl createWorkspace(WorkspaceConfig config, String namespace, @Nullable Map<String, String> attributes) throws ServerException, ConflictException, NotFoundException, ValidationException {
checkMaxEnvironmentRam(config);
String accountId = accountManager.getByName(namespace).getId();
try (Unlocker ignored = resourcesLocks.lock(accountId)) {
checkWorkspaceResourceAvailability(accountId);
return super.createWorkspace(config, namespace, attributes);
}
}
use of org.eclipse.che.commons.annotation.Traced in project che-server by eclipse-che.
the class SidecarToolingProvisioner method provision.
@Traced
@Beta
public void provision(RuntimeIdentity identity, StartSynchronizer startSynchronizer, E environment, Map<String, String> startOptions) throws InfrastructureException {
Collection<PluginFQN> pluginFQNs = pluginFQNParser.parsePlugins(environment.getAttributes());
if (pluginFQNs.isEmpty()) {
return;
}
LOG.debug("Started sidecar tooling provisioning workspace '{}'", identity.getWorkspaceId());
String recipeType = environment.getType();
ChePluginsApplier pluginsApplier = workspaceNextAppliers.get(recipeType);
if (pluginsApplier == null) {
throw new InfrastructureException("Sidecar tooling configuration is not supported with environment type " + recipeType);
}
boolean isEphemeral = EphemeralWorkspaceUtility.isEphemeral(environment.getAttributes());
boolean mergePlugins = shouldMergePlugins(environment.getAttributes());
List<ChePlugin> chePlugins = pluginBrokerManager.getTooling(identity, startSynchronizer, pluginFQNs, isEphemeral, mergePlugins, startOptions);
pluginsApplier.apply(identity, environment, chePlugins);
artifactsBrokerApplier.apply(environment, identity, pluginFQNs, mergePlugins);
LOG.debug("Finished sidecar tooling provisioning workspace '{}'", identity.getWorkspaceId());
}
Aggregations