use of com.netflix.titus.common.framework.fit.FitFramework in project titus-control-plane by Netflix.
the class TitusRuntimeModule method getTitusRuntime.
@Provides
@Singleton
public TitusRuntime getTitusRuntime(Config config, SystemLogService systemLogService, SystemAbortListener systemAbortListener, Registry registry) {
CodeInvariants codeInvariants = new CompositeCodeInvariants(LoggingCodeInvariants.getDefault(), new SpectatorCodeInvariants(registry.createId("titus.runtime.invariant.violations"), registry));
DefaultTitusRuntime titusRuntime = new DefaultTitusRuntime(MyEnvironments.newArchaius(config), codeInvariants, systemLogService, systemExitOnFailure, systemAbortListener, registry);
// Setup FIT component hierarchy
FitFramework fitFramework = titusRuntime.getFitFramework();
if (fitFramework.isActive()) {
FitComponent root = fitFramework.getRootComponent();
root.createChild(LeaderActivator.COMPONENT);
root.createChild(V3JobOperations.COMPONENT);
root.createChild(DirectKubeApiServerIntegrator.COMPONENT);
// Add custom FIT actions
FitRegistry fitRegistry = fitFramework.getFitRegistry();
fitRegistry.registerActionKind(JobStoreFitAction.DESCRIPTOR, (id, properties) -> injection -> new JobStoreFitAction(id, properties, injection));
fitRegistry.registerActionKind(KubeFitAction.DESCRIPTOR, (id, properties) -> injection -> new KubeFitAction(id, properties, injection));
}
return titusRuntime;
}
use of com.netflix.titus.common.framework.fit.FitFramework in project titus-control-plane by Netflix.
the class RelocationTitusRuntimeComponent method getTitusRuntime.
@Bean
public TitusRuntime getTitusRuntime() {
FitFramework fitFramework = titusRuntime.getFitFramework();
if (fitFramework.isActive()) {
FitComponent root = fitFramework.getRootComponent();
root.createChild(GrpcFitInterceptor.COMPONENT);
}
return titusRuntime;
}
Aggregations