Search in sources :

Example 1 with GovernatorJerseySupportModule

use of com.netflix.governator.guice.jersey.GovernatorJerseySupportModule in project titus-control-plane by Netflix.

the class TitusFederationModule 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);
    install(new GovernatorJerseySupportModule());
    install(new ContainerEventBusModule());
    install(new TitusEntitySanitizerModule());
    bind(HostCallerIdResolver.class).to(NoOpHostCallerIdResolver.class);
    bind(CellConnector.class).to(DefaultCellConnector.class);
    bind(RemoteFederationConnector.class).to(DefaultRemoteFederationConnector.class);
    bind(CellWebClientConnector.class).to(DefaultCellWebClientConnector.class);
    bind(WebClientFactory.class).toInstance(SimpleWebClientFactory.getInstance());
    bind(CellInfoResolver.class).to(DefaultCellInfoResolver.class);
    bind(RemoteFederationInfoResolver.class).to(DefaultRemoteFederationInfoResolver.class);
    install(new FederationEndpointModule());
    install(new ServiceModule());
}
Also used : Archaius2ConfigurationLogger(com.netflix.titus.common.util.archaius2.Archaius2ConfigurationLogger) LoggingSystemAbortListener(com.netflix.titus.common.runtime.internal.LoggingSystemAbortListener) SystemAbortListener(com.netflix.titus.common.runtime.SystemAbortListener) CellInfoResolver(com.netflix.titus.federation.service.CellInfoResolver) DefaultCellInfoResolver(com.netflix.titus.federation.service.DefaultCellInfoResolver) LoggingSystemLogService(com.netflix.titus.common.runtime.internal.LoggingSystemLogService) SystemLogService(com.netflix.titus.common.runtime.SystemLogService) RemoteFederationConnector(com.netflix.titus.federation.service.RemoteFederationConnector) DefaultRemoteFederationConnector(com.netflix.titus.federation.service.DefaultRemoteFederationConnector) GovernatorJerseySupportModule(com.netflix.governator.guice.jersey.GovernatorJerseySupportModule) DefaultCellWebClientConnector(com.netflix.titus.federation.service.DefaultCellWebClientConnector) CellWebClientConnector(com.netflix.titus.federation.service.CellWebClientConnector) SimpleWebClientFactory(com.netflix.titus.federation.service.SimpleWebClientFactory) WebClientFactory(com.netflix.titus.federation.service.WebClientFactory) DefaultRegistry(com.netflix.spectator.api.DefaultRegistry) Registry(com.netflix.spectator.api.Registry) CellConnector(com.netflix.titus.federation.service.CellConnector) DefaultCellConnector(com.netflix.titus.federation.service.DefaultCellConnector) ServiceModule(com.netflix.titus.federation.service.ServiceModule) ContainerEventBusModule(com.netflix.titus.common.util.guice.ContainerEventBusModule) FederationEndpointModule(com.netflix.titus.federation.endpoint.FederationEndpointModule) RemoteFederationInfoResolver(com.netflix.titus.federation.service.RemoteFederationInfoResolver) DefaultRemoteFederationInfoResolver(com.netflix.titus.federation.service.DefaultRemoteFederationInfoResolver) DefaultRegistry(com.netflix.spectator.api.DefaultRegistry) 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 GovernatorJerseySupportModule

use of com.netflix.governator.guice.jersey.GovernatorJerseySupportModule 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 3 with GovernatorJerseySupportModule

use of com.netflix.governator.guice.jersey.GovernatorJerseySupportModule in project titus-control-plane by Netflix.

the class GatewayEndpointModule method configure.

@Override
protected void configure() {
    bind(HostCallerIdResolver.class).to(NoOpHostCallerIdResolver.class);
    install(new CallMetadataResolveModule());
    if (enableREST) {
        install(new GovernatorJerseySupportModule());
        install(new GatewayJerseyModule());
    }
    install(new GatewayGrpcModule());
}
Also used : GovernatorJerseySupportModule(com.netflix.governator.guice.jersey.GovernatorJerseySupportModule) CallMetadataResolveModule(com.netflix.titus.runtime.endpoint.metadata.CallMetadataResolveModule) NoOpHostCallerIdResolver(com.netflix.titus.runtime.endpoint.resolver.NoOpHostCallerIdResolver) HostCallerIdResolver(com.netflix.titus.runtime.endpoint.resolver.HostCallerIdResolver)

Aggregations

GovernatorJerseySupportModule (com.netflix.governator.guice.jersey.GovernatorJerseySupportModule)3 HostCallerIdResolver (com.netflix.titus.runtime.endpoint.resolver.HostCallerIdResolver)3 NoOpHostCallerIdResolver (com.netflix.titus.runtime.endpoint.resolver.NoOpHostCallerIdResolver)3 TitusEntitySanitizerModule (com.netflix.titus.runtime.TitusEntitySanitizerModule)2 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 FederationEndpointModule (com.netflix.titus.federation.endpoint.FederationEndpointModule)1 CellConnector (com.netflix.titus.federation.service.CellConnector)1 CellInfoResolver (com.netflix.titus.federation.service.CellInfoResolver)1 CellWebClientConnector (com.netflix.titus.federation.service.CellWebClientConnector)1 DefaultCellConnector (com.netflix.titus.federation.service.DefaultCellConnector)1 DefaultCellInfoResolver (com.netflix.titus.federation.service.DefaultCellInfoResolver)1 DefaultCellWebClientConnector (com.netflix.titus.federation.service.DefaultCellWebClientConnector)1 DefaultRemoteFederationConnector (com.netflix.titus.federation.service.DefaultRemoteFederationConnector)1