Git Product home page Git Product logo

iep's Introduction

Insight Engineering Platform

Set of base libraries used primarily by the Insight Engineering team at Netflix to support applications that need to run internally and externally.

Overview

The internal platform libraries used at Netflix, provide many useful capabilities that help make the applications more consistent, easier to debug, and generally integrate well into the internal environment. For example it is straightforward to:

  • Examine the properties and jars being used on running instance.
  • Get consistent logging and ability to adjust log levels dynamically for debugging.
  • Configuring JMX so common JVM tooling can be used through the firewall.
  • Register with Eureka and use it to communicate with other services.

Over time some of this functionality was extracted into standalone libraries, many of which have been open sourced as NetflixOSS Common Runtime Services and Libraries. Examples are Archaius (configuration), Eureka (discovery service), Karyon (base server), Ribbon (Eureka aware HTTP client), Governator (dependency injection), and blitz4j (logging).

However, there are still some gaps and for many of the libraries mentioned above an internal wrapper library needs to be used to work well internally. Originally the intent was for the internal wrappers to get deprecated and phased out, but that turned out to be harder than expected and never actually happened. Further some of these libraries like Ribbon and blitz4j are no longer receiving much investment. The IEP libraries were created as part of the work to open source Atlas to allow us to:

  • Have our open source applications be able to work the same way internally and externally.
  • Ensure that the core debugging capabilities and key internal integrations work.
  • Opt-in instead of opt-out. The internal platform provides a lot by default and you typically have to explicitly opt-out to turn off stuff you do not need. To make our apps lighter weight we wanted to explicitly opt-in instead. This has improved with some of the newer internal libraries, but is not available as part of NetflixOSS and thus doesn't satisfy our goal of consistency.

Modules

Libraries named with a prefix of iep-spring- are Spring configurations that can be pulled in. All Insight libraries should work using plain Spring, we do not rely on Governator extensions.

You can pick and choose just the set of modules you need. If one module requires another, then it will install that module explicitly so you do not need to worry about the transitive dependencies.

Module Description
iep-spring-admin Setup admin service for debugging the application.
iep-spring-atlas Configure Spectator to use AtlasRegistry.
iep-spring-aws2 Setting up and injecting AWS clients.
iep-spring-leader Default bindings for the simple leader election API.
[iep-spring-leader-dynamodb] DynamoDB bindings for the simple leader election API.
iep-spring-userservice User service for validating known email addresses.

Libraries

These are standalone libraries used in various Insight products.

Module Description
iep-admin Simple admin service to aid in debugging.
iep-leader-api Simple leader election API with a default implementation.
iep-nflxenv Configuration for accessing context from the environment.
iep-service Simple abstraction for a service that is part of an application.
iep-ses Helper for sending HTML emails with SES.

Compatibility

The IEP libraries follow a semantic versioning scheme. Backwards incompatible changes should be marked with an incremented major version number. Forwards compatibility may work, but is in not required or guaranteed. It is highly recommended that all iep-* versions in the classpath are the same.

Prior to 1.0, it was mostly backwards compatible with major changes resulting in the minor version being incremented.

Common Runtime Libraries Comparison

Where possible we will use the other NetflixOSS Common Runtime Libraries, but as the support for some of those libraries has waned the usage of several have been dropped. This section will provide a quick summary of which parts we use and the differences.

Archaius

Archaius is the primary configuration library used at Netflix. The primary feature over other alternatives is that it can communicate with a property service to allow for properties that can be changed at runtime. This can be used for things like feature flags to enable or quickly disable functionality. Insight no longer uses Archaius 2.

It should be noted that as deployment automation and velocity has increased our (Insight team) interest in runtime properties has waned. Changing runtime properties can be just as risky as a deployment and adding proper checks such as canary analysis, staggered rollout, etc to the property path means there is little advantage to using properties over just doing a new deployment. The base layer for our configuration is using the Typesafe Config library and many new uses inject that directly rather than injecting the Archaius2 Config object.

Blitz4j

Logging library providing performance improvements on top of log4j 1.x and making the logging levels configurable via properties. Most code should be using the slf4j interfaces so the logging framework is pluggable, so this decision should only matter when selecting a binding for running the application. For Insight apps we bind slf4j to vanilla log4j2 when running internally. The logging configuration is mapped to a file that is monitored by log4j2 so we can tune log levels on an instance.

Eureka

Eureka is the Netflix service discovery system. All of the Insight apps should register with Eureka to integrate well with internal systems that check this as part of ensuring the service is healthy. Insight apps will map the healthcheck endpoint to the service state so that healthcheck polling used to populate the Eureka state will accurately reflect the service state.

For client side uses, see section discussing Ribbon.

Governator

IEP is compatible with, but does not directly use or require Governator. All Insight libraries should work using plain Spring, we do not rely on Governator.

Karyon

Karyon provides the server framework and admin for internal applications. Internally it is wrapped by the base-server library, though newer applications can use Karyon 2 directly. For a long time we have only used the admin aspect of Karyon. The IEP admin is much lighter weight and was originally developed as part of Karyon 3. The Runtime team decided to go a different direction so we simplified and inlined the aspects we care about as iep-admin.

Ribbon

Ribbon is the Eureka aware HTTP client layer used heavily at Netflix. Internally it is often wrapped by the platform-ipc library and often referred to as NIWS (Netflix Integrated Web Services). Similar to the story with Karyon, Insight was an early adopter of RxNetty that was intended to become the underlying library powering Ribbon. Insight developed the [iep-rxhttp] library to guinea pig RxNetty internally. It is still heavily used by the Insight team for interacting with services that require middle tier load balancing. However, the Runtime team has since de-prioritized RxNetty and is focusing on gRPC for new use-cases. Ribbon is not used by Insight and we'll likely phase out [iep-rxhttp] over time.

Another trend is that since all Netflix services are now in the VPC, the AWS ELBs can have proper security groups. That was not true in classic and was a big reason for initially building out Eureka. Using ELBs and standard DNS means the selection of client library is less important. The main add-on we want is consistent metrics and access logs which we achieve by using the Spectator HTTP log util.

Related Projects

Open source projects maintained by the Netflix Insight team are:

  • Apps
    • Atlas: in-memory dimensional time series database.
    • Edda: read-only cache of AWS resources.
    • IEP Apps: small example apps using Insight libraries.
  • Libraries
    • AWSObjectMapper: provides mappings for Jackson 2 to allow the AWS Java SDK model objects to easily be converted to/from JSON.
    • Spectator: client library for instrumenting an application to report data into Atlas or similar data stores.
  • Legacy Libraries
    • Edda Client: client library to access Edda via the AWS Java SDK interfaces.
    • Rx AWS Java SDK: experimental implementation of an AWS Java SDK that uses RxNetty internally and automatically handles pagination via RxJava Observables.
    • Servo: legacy library for instrumenting code. Use Spectator for new projects.

iep's People

Contributors

bpitman avatar brharrington avatar copperlight avatar diptanu avatar dmuino avatar jkschneider avatar lavanyachennupati avatar manolama avatar zimmermatt 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

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

iep's Issues

snapshot publication is broken

sbt plugin updates in #319 broke the snapshot publication.

java.io.IOException: PUT operation to URL https://oss.jfrog.org/oss-snapshot-local;build.timestamp=1501800103487/com/netflix/iep/iep-admin/1.0.3-SNAPSHOT/iep-admin-1.0.3-SNAPSHOT.pom failed with status code 409: Conflict

Refactor iep-lwcapi to use more standard Observable methods

e.g., Observable.interval rather than Thread.sleep() and an internal thread, and to subclass Observables more appropriately rather than having magic methods like start().

Also, use iep-rxhttp rather than blocking calls made from inside a thread.

Initialize Archaius outside Governator

The Governator module contains some code around loading application.properties. I think we should move this out of there, currently I am not using Governator anymore[moved to Guice 4] and hence I was not using that module but I have to copy over the initArchiaus method out of there to my main method.

Can this be moved to any of the other modules? This doesn't seem to be related to Governator anyways.

https://github.com/Netflix/iep/blob/master/iep-governator/src/main/java/com/netflix/iep/gov/Governator.java#L135

eureka module is not compatible with 1.6.0

iep-module-eureka doesn't work with eureka-client 1.6.0:

[error] Test com.netflix.iep.rxnetty.RxNettyModuleTest.module failed: com.google.inject.CreationException: Unable to create injector, see the following errors:
[error] 
[error] 1) No implementation for com.netflix.discovery.AbstractDiscoveryClientOptionalArgs was bound.
[error]   while locating com.netflix.discovery.AbstractDiscoveryClientOptionalArgs
[error]     for the 3rd parameter of com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:299)
[error]   at com.netflix.iep.eureka.EurekaModule.configure(EurekaModule.java:78)
[error] 
[error] 1 error, took 0.742 sec
[error]     at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470)
[error]     at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
[error]     at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
[error]     at com.google.inject.Guice.createInjector(Guice.java:99)
[error]     at com.google.inject.Guice.createInjector(Guice.java:73)
[error]     at com.google.inject.Guice.createInjector(Guice.java:62)
[error]     at com.netflix.iep.rxnetty.RxNettyModuleTest.module(RxNettyModuleTest.java:32)
[error]     ...

same package in multiple jar files

There are a number of sub-projects that have the same package name used in multiple jar files. This will not work well for jdk9. The most common example is the library and module jars such as iep-admin and iep-module-admin.

Allow setting custom email headers

After enabling AWS SES Config sets we noticed the headers are included in the message:

{
  "name": "MIME-Version",
  "value": "1.0"
},
{
  "name": "Content-Type",
  "value": "multipart/mixed; boundary=\"a85b0f9e-88b9-4aa5-a893-886d7ed163e4\""
},
{
  "name": "From",
  "value": "[email protected]"
},
{
  "name": "To",
  "value": "[email protected]"
},
{
  "name": "Subject",
  "value": "hello word"
},
{
  "name": "X-SES-CONFIGURATION-SET",
  "value": "myConfigSet"
},
{
  "name": "Message-ID",
  "value": "null"
}

We would like to add more metadata by setting custom headers.
Besides the motivation from config sets use case, in general it would be beneficial to be able to pass custom headers of the form X-*.
Note that we are aware of https://tools.ietf.org/html/rfc6648 but it should still be allowed to use them.

error with newer versions of sbt

[error] iep/project/Bintray.scala:30:19: The evaluation of `in` happens always inside a regular task.
[error] 
[error] Problem: `in` is inside the if expression of a regular task.
[error]   Regular tasks always evaluate task inside the bodies of if expressions.
[error] 
[error] Solution:
[error]   1. If you only want to evaluate it when the if predicate is true or false, use a dynamic task.
[error]   2. Otherwise, make the static evaluation explicit by evaluating `in` outside the if expression.
[error]     
[error]         publishTo in bintray value
[error]                   ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed

planning for 3.0

Mostly removing deprecated modules. The following sub-projects should get removed:

  • iep-config
  • iep-eureka-testconfig
  • iep-module-archaius1
  • iep-module-archaius2
  • iep-module-aws
  • iep-module-awsmetrics
  • iep-module-eureka
  • iep-module-rxnetty
  • iep-platformservice
  • iep-rxhttp

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.