Giter Club home page Giter Club logo

titus-control-plane's Introduction

Titus Control Plane (ARCHIVED)

This repo has been archived and is no longer in active development.

Apache 2.0

Overview

Titus is the Netflix Container Management Platform that manages containers and provides integrations to the infrastructure ecosystem. This repository contains the control plane components which are responsible for accepting job requests and scheduling containers on agents.

Documentation & Getting Started

netflix.github.io/titus

Building and Testing

For reference, check some of the scripts commonly used by committers in the scripts/dev/ folder.

Building

./gradlew build

Run Tests

./gradlew test

Run All Tests (including integration)

./gradlew testAll

Test databases

By default, the database tests are executed with an embedded Postgres service. This can be modified by setting database profiles in ~/.titus-jooq.yaml file:

profiles:
  relocation:
    name: relocation
    databaseUrl: jdbc:postgresql://localhost:5432/postgres
    user: titus
    password: 123
  jobactivity:
    name: jobActivityJooqContext
    databaseUrl: jdbc:postgresql://localhost:5432/jobactivity
    user: postgres
    password: postgres
  activity:
    name: producerJooqContext
    databaseUrl: jdbc:postgresql://localhost:5432/jobactivity
    user: postgres
    password: postgres

Extensions

There are several extensions in the titus-ext folder for integrations with various systems. In order to use these extensions, a wrapper project that reconfigures the guice bindings is needed. A tutorial project for binding the different implementations is coming soon.

LICENSE

Copyright (c) 2018 Netflix, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

titus-control-plane's People

Contributors

alekar avatar aloktiagi avatar amit-git avatar amitaekbote avatar andrew-leung avatar corindwyer avatar dan-at-teza avatar dtrebbien avatar fabiokung avatar gabrielhartmann avatar jason-cooke avatar joshi-keyur avatar myummagumma avatar okigan avatar rgulewich avatar rpalcolea avatar rspieldenner avatar solarkennedy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

titus-control-plane's Issues

Could not find a suitable constructor in com.netflix.titus.gateway.endpoint.v3.SupplementaryServiceLocationConfiguration

When running the current master branch, this error occurs in the gateway service:

Could not find a suitable constructor in com.netflix.titus.gateway.endpoint.v3.SupplementaryServiceLocationConfiguration. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
gateway_1       |   at com.netflix.titus.gateway.endpoint.v3.SupplementaryServiceLocationConfiguration.class(SupplementaryServiceLocationConfiguration.java:17)
gateway_1       |   while locating com.netflix.titus.gateway.endpoint.v3.SupplementaryServiceLocationConfiguration
gateway_1       |     for the 1st parameter of com.netflix.titus.gateway.endpoint.v3.ConfigurableReactorHttpClientFactory.<init>(ConfigurableReactorHttpClientFactory.java:18)
gateway_1       |   at com.netflix.titus.gateway.endpoint.GatewayEndpointModule.configure(GatewayEndpointModule.java:26) (via modules: com.google.inject.util.Modules$CombinedModule -> com.netflix.titus.gateway.startup.TitusGatewayModule -> com.netflix.titus.gateway.endpoint.GatewayEndpointModule)
gateway_1       | 
gateway_1       | 1 error
gateway_1       | 	at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470)
gateway_1       | 	at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
gateway_1       | 	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
gateway_1       | 	at com.google.inject.Guice.createInjector(Guice.java:99)
gateway_1       | 	at com.google.inject.Guice.createInjector(Guice.java:84)
gateway_1       | 	at com.netflix.governator.LifecycleInjectorCreator.createInjector(LifecycleInjectorCreator.java:100)
gateway_1       | 	at com.netflix.governator.LifecycleInjectorCreator.createInjector(LifecycleInjectorCreator.java:38)
gateway_1       | 	at com.netflix.governator.InjectorBuilder.createInjector(InjectorBuilder.java:209)
gateway_1       | 	at com.netflix.governator.InjectorBuilder.createInjector(InjectorBuilder.java:230)
gateway_1       | 	at com.netflix.titus.gateway.startup.TitusGateway.main(TitusGateway.java:60)

It is probably due to the inject of SupplementaryServiceLocationConfiguration in class ConfigurableReactorHttpClientFactory while SupplementaryServiceLocationConfiguration has a constructor with a Config parameter but without an inject

ConfigurableReactorHttpClientFactory >

public ConfigurableReactorHttpClientFactory(SupplementaryServiceLocationConfiguration configuration) {

SupplementaryServiceLocationConfiguration.java >

Double-Checked Locking

if (client == null) {
synchronized (this) {
client = loadBalancerClients.get(accountId);

if (credentialsProvider == null) {
synchronized (this) {
credentialsProvider = awsCredentialsByAccountId.get(accountId);
if (credentialsProvider == null) {

double-Checked Locking is widely cited and used as an efficient method for implementing lazy initialization in a multithreaded environment.
Unfortunately, it will not work reliably in a platform independent way when implemented in Java, without additional synchronization.

ZookeeperMasterMonitorTest > testLocalMasterInstanceUpdates FAILED

I can't get this particular test to pass. I'm running it on a Mac, if that makes any difference. Test output is below.

From what I can tell, it looks like that state changes from

ZookeeperMasterMonitor.UNKNOWN_MASTER_INSTANCE

to

MasterInstance{instanceId='', ipAddress='', status=MasterStatus{state=Starting, reasonCode='', reasonMessage='', timestamp=0}

to

MasterInstance{instanceId='selfId', ipAddress='1.2.3.4', status=MasterStatus{state=Inactive, reasonCode='test', reasonMessage='Initial MasterInstance version', timestamp=0}

For whatever reason, the test is picking up the middle state. I can't tell from examination whether it's the test that should be more resilient, or if the middle empty state itself is the bug.

com.netflix.titus.ext.zookeeper.supervisor.ZookeeperMasterMonitorTest.testLocalMasterInstanceUpdates failed, output:
2018-10-25 12:59:39 INFO ZookeeperMasterMonitor:161 - The ZK master monitor is started
2018-10-25 12:59:39 INFO ZookeeperMasterMonitor:226 - New master retrieved: MasterDescription{hostname=grixis, hostIP=127.0.0.1, apiPort=0, apiStatusUri=http://myFakeStatusURI, createTime=1540497579627}
2018-10-25 12:59:39 INFO PrepRequestProcessor:645 - Got user-level KeeperException when processing sessionid:0x166accf9e120001 type:create cxid:0x21 zxid:0x8 txntype:-1 reqpath:n/a Error Path:/master/allMasters Error:KeeperErrorCode = NoNode for /master/allMasters
2018-10-25 12:59:39 INFO ZookeeperMasterMonitor:265 - Detected change in TitusMaster state and/or topology: [MasterInstance{instanceId='', ipAddress='', status=MasterStatus{state=Starting, reasonCode='', reasonMessage='', timestamp=0}, statusHistory=[]}]
2018-10-25 12:59:39 INFO ZookeeperMasterMonitor:196 - Updated own MasterInstance state to: MasterInstance{instanceId='selfId', ipAddress='1.2.3.4', status=MasterStatus{state=Inactive, reasonCode='test', reasonMessage='Initial MasterInstance version', timestamp=0}, statusHistory=[]}
2018-10-25 12:59:39 INFO ZookeeperMasterMonitor:265 - Detected change in TitusMaster state and/or topology: [MasterInstance{instanceId='selfId', ipAddress='1.2.3.4', status=MasterStatus{state=Inactive, reasonCode='test', reasonMessage='Initial MasterInstance version', timestamp=0}, statusHistory=[]}]
2018-10-25 12:59:39 INFO ZookeeperMasterMonitor:171 - ZK master monitor is shut down

com.netflix.titus.ext.zookeeper.supervisor.ZookeeperMasterMonitorTest > testLocalMasterInstanceUpdates FAILED
java.lang.AssertionError:
Expecting:
<[MasterInstance{instanceId='', ipAddress='', status=MasterStatus{state=Starting, reasonCode='', reasonMessage='', timestamp=0}, statusHistory=[]}]>
to contain:
<[MasterInstance{instanceId='selfId', ipAddress='1.2.3.4', status=MasterStatus{state=Inactive, reasonCode='test', reasonMessage='Initial MasterInstance version', timestamp=0}, statusHistory=[]}]>
but could not find:
<[MasterInstance{instanceId='selfId', ipAddress='1.2.3.4', status=MasterStatus{state=Inactive, reasonCode='test', reasonMessage='Initial MasterInstance version', timestamp=0}, statusHistory=[]}]>
at com.netflix.titus.ext.zookeeper.supervisor.ZookeeperMasterMonitorTest.testLocalMasterInstanceUpdates(ZookeeperMasterMonitorTest.java:120)

com.netflix.titus.ext.zookeeper.supervisor.ZookeeperMasterMonitorTest STANDARD_OUT
2018-10-25 12:59:39 INFO CuratorFrameworkImpl:821 - backgroundOperationsLoop exiting
2018-10-25 12:59:39 INFO PrepRequestProcessor:494 - Processed session termination for sessionid: 0x166accf9e120001
2018-10-25 12:59:39 INFO ClientCnxn:512 - EventThread shut down
2018-10-25 12:59:39 INFO ZooKeeper:684 - Session: 0x166accf9e120001 closed
2018-10-25 12:59:39 INFO NIOServerCnxn:1007 - Closed socket connection for client /127.0.0.1:59580 which had sessionid 0x166accf9e120001
2018-10-25 12:59:39 INFO ZookeeperServer:158 - Shutting down ZkServer...
2018-10-25 12:59:39 INFO ZkEventThread:82 - Terminate ZkClient event thread.
2018-10-25 12:59:39 INFO PrepRequestProcessor:494 - Processed session termination for sessionid: 0x166accf9e120000
2018-10-25 12:59:39 INFO ClientCnxn:512 - EventThread shut down
2018-10-25 12:59:39 INFO NIOServerCnxn:1007 - Closed socket connection for client /127.0.0.1:59579 which had sessionid 0x166accf9e120000
2018-10-25 12:59:39 INFO ZooKeeper:684 - Session: 0x166accf9e120000 closed
2018-10-25 12:59:39 INFO NIOServerCnxnFactory:224 - NIOServerCnxn factory exited run method
2018-10-25 12:59:39 INFO ZooKeeperServer:441 - shutting down
2018-10-25 12:59:39 INFO SessionTrackerImpl:225 - Shutting down
2018-10-25 12:59:39 INFO PrepRequestProcessor:761 - Shutting down
2018-10-25 12:59:39 INFO SyncRequestProcessor:209 - Shutting down
2018-10-25 12:59:39 INFO PrepRequestProcessor:143 - PrepRequestProcessor exited loop!
2018-10-25 12:59:39 INFO SyncRequestProcessor:187 - SyncRequestProcessor exited!
2018-10-25 12:59:39 INFO FinalRequestProcessor:415 - shutdown of request processor complete
2018-10-25 12:59:39 INFO ZooKeeperServer:441 - shutting down
2018-10-25 12:59:39 INFO SessionTrackerImpl:225 - Shutting down
2018-10-25 12:59:39 INFO PrepRequestProcessor:761 - Shutting down
2018-10-25 12:59:39 INFO SyncRequestProcessor:209 - Shutting down
2018-10-25 12:59:39 INFO FinalRequestProcessor:415 - shutdown of request processor complete
2018-10-25 12:59:39 INFO ZookeeperServer:177 - Shutting down ZkServer...done

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.