Search in sources :

Example 1 with FeatureFlagModule

use of com.netflix.titus.runtime.FeatureFlagModule in project titus-control-plane by Netflix.

the class TitusMasterModule method configure.

@Override
protected void configure() {
    // Configuration
    bind(CellInfoResolver.class).to(ConfigurableCellInfoResolver.class);
    // Titus supervisor
    install(new SupervisorServiceModule());
    install(new SupervisorEndpointModule());
    install(new TitusEntitySanitizerModule());
    // Feature flags
    install(new FeatureFlagModule());
    // Kubernetes
    Preconditions.checkNotNull(mode, "Kube mode not set");
    if (mode == Mode.KUBE) {
        install(new KubeModule());
    } else if (mode == Mode.EMBEDDED_KUBE) {
        install(new KubeControllerModule());
        install(new KubePodModule());
    }
    // Storage
    install(new StoreModule());
    // Service
    install(new AuditModule());
    install(new SchedulerModule());
    install(new V3JobManagerModule());
    install(new ContainerHealthServiceModule());
    Multibinder.newSetBinder(binder(), ContainerHealthService.class).addBinding().to(AlwaysHealthyContainerHealthService.class);
    install(new ManagementModule());
    // REST/GRPC
    bind(V3EndpointModule.V3_LOG_STORAGE_INFO).toInstance(EmptyLogStorageInfo.INSTANCE);
    bind(ContextResolver.class).toInstance(EmptyContextResolver.INSTANCE);
    if (enableREST) {
        install(new GovernatorJerseySupportModule());
        // This should be in JerseyModule, but overrides get broken if we do that (possibly Governator bug).
        bind(HttpCallerIdResolver.class).to(ByRemoteAddressHttpCallerIdResolver.class);
        bind(HostCallerIdResolver.class).to(NoOpHostCallerIdResolver.class);
        install(new JerseyModule());
    }
    install(new JobCoordinatorAdmissionModule());
    install(new MasterEndpointModule());
    install(new HealthModule());
    install(new V3EndpointModule());
    install(new AutoScalingModule());
    install(new LoadBalancerModule());
    install(new EvictionServiceModule());
    install(new EvictionEndpointModule());
}
Also used : CellInfoResolver(com.netflix.titus.master.config.CellInfoResolver) ConfigurableCellInfoResolver(com.netflix.titus.master.config.ConfigurableCellInfoResolver) JerseyModule(com.netflix.titus.master.endpoint.v2.rest.JerseyModule) SupervisorServiceModule(com.netflix.titus.master.supervisor.service.SupervisorServiceModule) EvictionServiceModule(com.netflix.titus.master.eviction.service.EvictionServiceModule) GovernatorJerseySupportModule(com.netflix.governator.guice.jersey.GovernatorJerseySupportModule) V3JobManagerModule(com.netflix.titus.master.jobmanager.service.V3JobManagerModule) EvictionEndpointModule(com.netflix.titus.master.eviction.endpoint.grpc.EvictionEndpointModule) KubeControllerModule(com.netflix.titus.master.kubernetes.controller.KubeControllerModule) FeatureFlagModule(com.netflix.titus.runtime.FeatureFlagModule) ByRemoteAddressHttpCallerIdResolver(com.netflix.titus.runtime.endpoint.resolver.ByRemoteAddressHttpCallerIdResolver) HttpCallerIdResolver(com.netflix.titus.runtime.endpoint.resolver.HttpCallerIdResolver) KubeModule(com.netflix.titus.master.kubernetes.KubeModule) ManagementModule(com.netflix.titus.master.service.management.ManagementModule) AutoScalingModule(com.netflix.titus.master.appscale.endpoint.v3.AutoScalingModule) ContainerHealthServiceModule(com.netflix.titus.runtime.containerhealth.service.ContainerHealthServiceModule) SupervisorEndpointModule(com.netflix.titus.master.supervisor.endpoint.SupervisorEndpointModule) StoreModule(com.netflix.titus.master.store.StoreModule) SchedulerModule(com.netflix.titus.master.scheduler.SchedulerModule) HealthModule(com.netflix.titus.master.health.HealthModule) JobCoordinatorAdmissionModule(com.netflix.titus.master.endpoint.admission.JobCoordinatorAdmissionModule) V3EndpointModule(com.netflix.titus.master.jobmanager.endpoint.v3.V3EndpointModule) MasterEndpointModule(com.netflix.titus.master.endpoint.MasterEndpointModule) LoadBalancerModule(com.netflix.titus.master.loadbalancer.LoadBalancerModule) KubePodModule(com.netflix.titus.master.kubernetes.pod.KubePodModule) AuditModule(com.netflix.titus.master.audit.service.AuditModule) EmptyContextResolver(com.netflix.titus.master.endpoint.common.EmptyContextResolver) ContextResolver(com.netflix.titus.master.endpoint.common.ContextResolver) TitusEntitySanitizerModule(com.netflix.titus.runtime.TitusEntitySanitizerModule) NoOpHostCallerIdResolver(com.netflix.titus.runtime.endpoint.resolver.NoOpHostCallerIdResolver) HostCallerIdResolver(com.netflix.titus.runtime.endpoint.resolver.HostCallerIdResolver)

Example 2 with FeatureFlagModule

use of com.netflix.titus.runtime.FeatureFlagModule in project titus-control-plane by Netflix.

the class TitusGatewayModule method configure.

@Override
protected void configure() {
    bind(Archaius2ConfigurationLogger.class).asEagerSingleton();
    bind(Registry.class).toInstance(new DefaultRegistry());
    bind(SystemLogService.class).to(LoggingSystemLogService.class);
    bind(SystemAbortListener.class).to(LoggingSystemAbortListener.class);
    bind(Fabric8IOConnector.class).to(DefaultFabric8IOConnector.class).asEagerSingleton();
    install(new ContainerEventBusModule());
    install(new TitusContainerRegistryModule());
    install(new TitusEntitySanitizerModule());
    install(new TitusAdmissionModule());
    install(new JobSecurityValidatorModule());
    // Feature flags
    install(new FeatureFlagModule());
    install(new GatewayEndpointModule(enableREST));
    install(new TitusMasterConnectorModule());
    install(new JobManagerConnectorModule(JobEventPropagationUtil.CHECKPOINT_GATEWAY_CLIENT));
    install(new JobManagerDataReplicationModule());
    install(new EvictionConnectorModule());
    install(new RelocationClientConnectorModule());
    install(new RelocationDataReplicationModule());
    bind(V3_LOG_STORAGE_INFO).toInstance(EmptyLogStorageInfo.INSTANCE);
    install(new V3ServiceModule());
    install(new StoreModule());
}
Also used : Archaius2ConfigurationLogger(com.netflix.titus.common.util.archaius2.Archaius2ConfigurationLogger) SystemAbortListener(com.netflix.titus.common.runtime.SystemAbortListener) LoggingSystemAbortListener(com.netflix.titus.common.runtime.internal.LoggingSystemAbortListener) JobManagerConnectorModule(com.netflix.titus.runtime.connector.jobmanager.JobManagerConnectorModule) GatewayEndpointModule(com.netflix.titus.gateway.endpoint.GatewayEndpointModule) TitusMasterConnectorModule(com.netflix.titus.runtime.connector.titusmaster.TitusMasterConnectorModule) SystemLogService(com.netflix.titus.common.runtime.SystemLogService) LoggingSystemLogService(com.netflix.titus.common.runtime.internal.LoggingSystemLogService) TitusContainerRegistryModule(com.netflix.titus.runtime.connector.registry.TitusContainerRegistryModule) RelocationClientConnectorModule(com.netflix.titus.runtime.connector.relocation.RelocationClientConnectorModule) DefaultFabric8IOConnector(com.netflix.titus.runtime.connector.kubernetes.fabric8io.DefaultFabric8IOConnector) StoreModule(com.netflix.titus.gateway.store.StoreModule) DefaultRegistry(com.netflix.spectator.api.DefaultRegistry) Registry(com.netflix.spectator.api.Registry) ContainerEventBusModule(com.netflix.titus.common.util.guice.ContainerEventBusModule) TitusAdmissionModule(com.netflix.titus.runtime.endpoint.admission.TitusAdmissionModule) EvictionConnectorModule(com.netflix.titus.runtime.connector.eviction.EvictionConnectorModule) V3ServiceModule(com.netflix.titus.gateway.service.v3.V3ServiceModule) JobSecurityValidatorModule(com.netflix.titus.runtime.endpoint.admission.JobSecurityValidatorModule) DefaultRegistry(com.netflix.spectator.api.DefaultRegistry) JobManagerDataReplicationModule(com.netflix.titus.runtime.connector.jobmanager.JobManagerDataReplicationModule) FeatureFlagModule(com.netflix.titus.runtime.FeatureFlagModule) RelocationDataReplicationModule(com.netflix.titus.runtime.connector.relocation.RelocationDataReplicationModule) TitusEntitySanitizerModule(com.netflix.titus.runtime.TitusEntitySanitizerModule)

Aggregations

FeatureFlagModule (com.netflix.titus.runtime.FeatureFlagModule)2 TitusEntitySanitizerModule (com.netflix.titus.runtime.TitusEntitySanitizerModule)2 GovernatorJerseySupportModule (com.netflix.governator.guice.jersey.GovernatorJerseySupportModule)1 DefaultRegistry (com.netflix.spectator.api.DefaultRegistry)1 Registry (com.netflix.spectator.api.Registry)1 SystemAbortListener (com.netflix.titus.common.runtime.SystemAbortListener)1 SystemLogService (com.netflix.titus.common.runtime.SystemLogService)1 LoggingSystemAbortListener (com.netflix.titus.common.runtime.internal.LoggingSystemAbortListener)1 LoggingSystemLogService (com.netflix.titus.common.runtime.internal.LoggingSystemLogService)1 Archaius2ConfigurationLogger (com.netflix.titus.common.util.archaius2.Archaius2ConfigurationLogger)1 ContainerEventBusModule (com.netflix.titus.common.util.guice.ContainerEventBusModule)1 GatewayEndpointModule (com.netflix.titus.gateway.endpoint.GatewayEndpointModule)1 V3ServiceModule (com.netflix.titus.gateway.service.v3.V3ServiceModule)1 StoreModule (com.netflix.titus.gateway.store.StoreModule)1 AutoScalingModule (com.netflix.titus.master.appscale.endpoint.v3.AutoScalingModule)1 AuditModule (com.netflix.titus.master.audit.service.AuditModule)1 CellInfoResolver (com.netflix.titus.master.config.CellInfoResolver)1 ConfigurableCellInfoResolver (com.netflix.titus.master.config.ConfigurableCellInfoResolver)1 MasterEndpointModule (com.netflix.titus.master.endpoint.MasterEndpointModule)1 JobCoordinatorAdmissionModule (com.netflix.titus.master.endpoint.admission.JobCoordinatorAdmissionModule)1