Project Name: Distributed KV Store for configuration settings

Project description:

Requirements:

  • Currently, the configuration properties are stored in files. Each ONAP project maintains its settings in its own configuration files. Some of the challenges & requirements are :
    • Any update to the configuration settings require restart of the service.  This could lead to ONAP service unavailability for some time.  Requirement is that any configuration update should not lead to restart of ONAP services.
    • There is good amount of duplication information among the files in various ONAP projects.  Due to this, any change in this common information requires updating multiple files, which is error prone.
    • In future releases, ONAP is going to bring up services with multiple instances for high availability.  Any change in the configuration should be reflected in all service instances and also the configuration should be consistent in all instances.
    • Configuration store itself should be distributed for high availability of configuration data.
    • Configuration change should be easier for administrator - GUI facility to update the configuration.
  • When there is a cluster of service instances, there can be a need for one of the instances to become a leader. That is, leader election could be a requirement for services.
  • Yet times, some operations need to be atomically performed and hence there could be a requirement for distributed lock.

Distributed KV Store project is expected to address above requirements. It is expected to provide following functionality

  • Centralization of  configuration
  • Common configuration settings without duplication  
  • Configuration update without the need for  restarting services
  • GUI/CLI to update the configuration settings
  • Auto notification of services when there is a configuration change.
  • Reliable and distributed data storage. 
  • Leadership selection
  • Distributed lock 


Pictorial representation of Distributed KV Store with consuming services:



Scope:

Functionality :

  • Ability to store configuration settings using reliable and distributed KV storage systems.
  • Ability to provide leadership election among micro services.
  • Ability to provide semaphore across service instances of ONAP services.
  • Ability to modify the configuration settings
  • Ability to inform active ONAP services of configuration changes.
  • Ability to read the changed configuration 
  • config-seed micro service to load default values of configuration settings, if settings are not present in the distributed KV storage.
  • Bootstrap phase functionality where each service upon startup reads the configuration settings from distribtued KV storage.

Interface/API:

  • RESTful API to set/read/update the configuration settings,  leadership election and take/release distributed lock.
  • Long poll for near instant configuration notifications.
  • Client packages:
    • For configuration store,  both Java and Python have abstraction alrady over consul and hence there is no special service-level package is required.
    • Python and Java based client package to simplify leadership election and distirbuted locks. This package wraps various operations required to elect the leader. Also, this client package abstracts various operations required to create lock, take and release the lock.


Architecture Alignment:

  • How does this project fit into the rest of the ONAP Architecture?
    • Configuration-seed micro service is expcted to be a common service.
    • consul from MSB can be used as Distributed key store
    • Boot strap phase is expected to be part of each service 
  • What other ONAP projects does this project depend on?
    • It does not depend on any existing ONAP projects.
  • Are there dependencies with other open source projects?
    • Consul (http://consul.io).  Reasons for choosing consule:
      • Well maintained.
      • Used by many projects (e.g EdgexFoundry, vault project)
      • Good support for Java libraries (For Java based services, cfg4j is normally used to read the configuration. cfg4j has consul backend,  python-envconsul package is useful for python based services)
      • It is alredy being used by ONAP (as part of MSB) as service-registry and service-discovery.


Other Information:

Key Project Facts:

Primary contact :  Srinivasa Addepalli,  Shashank Kumar Shankar

Facts

Info

PTL (first and last name)
Jira Project NameMUSIC
Jira KeyMUSIC
Project IDorg.onap.music.distributed-kv-store
Link to Wiki SpaceDistributed KV Store (MUSIC sub-project)

Release Components Name:

Note: refer to existing project for details on how to fill out this table

Components Name

Components Repository name

Maven Group ID

Components Description

distributed-kv-store

music/distributed-kv-store

org.onap.music.distributed-kv-store

Source code to read initial configuration date into KV Store.

Resources committed to the Release:

Note 1: No more than 5 committers per project. Balance the committers list and avoid members representing only one company.

Note 2: It is critical to complete all the information requested, that will help to fast forward the onboarding process.

Role

First Name Last Name

Linux Foundation ID

Email Address

Location

PTLShashank Kumar Shankarshashank.kumar.shankarshashank.kumar.shankar@intel.comPortland, OR
CommittersShashank Kumar Shankarshashank.kumar.shankarshashank.kumar.shankar@intel.comPortland, OR





Contributors








Tracking Milestones:

https://wiki.onap.org/display/DW/Tracking+Milestones

API Reference:

https://git.onap.org/music/distributed-kv-store/tree/swagger.yaml

Testing and Integration:

The following type of tests are done in this release:

Example test case: https://git.onap.org/music/distributed-kv-store/tree/src/dkv/api/configHandlers_test.go

Generate Code Coverage Report of source code for Golang applications:

$ go test -coverprofile=coverage.out
$ go tool cover -html=coverage.out


  • No labels

9 Comments

  1. Hi  Srinivasa?thanks for bringing up this proposal, I get a couple of questions:

    1. What're the additional functionalities provided by this project besides a standard Counsl or Zookeeper?
    2. I'm aware that OOM already has a Centralized Configuration Management which has a similar scope of this proposal. OOM Configuration Management .
    3. Does this imply that all the project should store their configuration in the distributed KV Store project?
  2. Thanks Huabing for questions.


    On your question 1:

    Consul satisfies all requirements. As I also indicated, Java and Python has good support for consul.  Example: cfg4j has consul backend. Any java service that use cfg4j today to read configuration files don't require any major changes.  Only thing that we are proposing is to have config-seed micro service (Similar to EdgexFoundry) which adds key value pairs in consul if there is no configuration exists in consul. There would be some guidelines each project needs to follow with respect to key name space. For example, current thought (concept borrowed from EdgexFoundry). 

    ONAP consists of multiple projects. Each project has set of services defined. There could be some configuration which is common across all projects (ONAP wide), some common configuration within a project across its services and some configuration specific to each service.  Also, another thing to keep in mind is that there could be profiles -  development profile, production profile etc..  The key prefix can be device as follows:

    /<type of data>/<Project name>/<Service name>;<Profile name>/<parameter name>

    <Project name> is ONAP, if the parameters are global across all projects.

    In summary:

    • config-seed service
    • Exposing consul for all services.
    • Few guideline documents for service to adopt Distributed KV Store.

    On your question 2:

    OOM Configuration Management :  I just now checked it out.  Looks like it is complementary.  This project addresses requirements such as 'configuration resiliency', 'leadership election' and 'distributed lock' etc..  Also, this project allow dynamic changes to the configuration, notifications and allows auto reload of configuration without restarting the service.  When there are multiple instances of services, configuration consistency is also important.  Having said that, it is possible that this project may be combined with OOM.

    On your question 3: Yes, please see answer to the question 1.



    1. One thought I have is that we could support multiple kinds of storage for the config-seed service like cfg4j, which add more flexibility.

      1. Hi Huabing,  that is the idea.  We expect services to use cfg4j to read the configuration parameters from consul.  Fortunately cfg4J is enhanced with consul backend (http://www.cfg4j.org/).  Shashank Kumar Shankar, once he is done with PoC with Python based services intends to create PoC with one of the java applications leveraging cfg4J to read configuration parameters from consul DB.  We have created a page to provide information about POCs (Distributed KV Store - PoC / Experiements)

        Seed service is expected to put default configuration in consul, if configuration is not present in Consul.


  3. Srini, just one quick comment: The name Distributed KV Store seems a bit generic and could mean even Cassandra or some such tool. I wonder if it would help to call it maybe a Distributed Config Store or something on those lines that make it clear what its functionality is. 

    1. Agree. Will make that change.

  4. Thank you for the proposal.  Configuration management is a key part of our platform maturity requirements.  Could you please provide a readout on how this project could work with OOM &/or MSB, so that we have a cohesive solution across ONAP?  Ideally, I'd like to see this as a subproject under OOM or MSB.

  5. We wanted to discuss with OOM and MSB team.  But we could not get their time to discuss.   Since it is simple module, we also feel that it is best done some part of it as part of OOM and other part of it as part of MSB project.

  6. Some of the activities from this proposal may get added to MSB and MUSIC projects.