opencb / opencga

An Open Computational Genomics Analysis platform for big data genomics analysis. OpenCGA is maintained and develop by its parent company Zetta Genomics. Please contact support@zettagenomics.com for bug report and feature requests.
Apache License 2.0
166 stars 97 forks source link

Enhance settings.xml to better support remote and clustered MongoDB #977

Open martinpeck opened 5 years ago

martinpeck commented 5 years ago

At present, settings.xml files are used, during build, to supply values that are then injected into files such as configuration.yaml and 'storage-configuration.yaml.

When configuring MongoDB, there are several places where settings need to be defined:

  1. in configuration.yaml in order to define the database settings for the catalog database
  2. in storage-configuration.yaml in order to define the database settings for alignment database
  3. in storage-configuration.yaml in order to define the database settings for the variant database

Across these three locations, where we need to inject details about MongoDB, there is mixed support for injecting values into these locations from settings.xml:

  database:
    hosts:
    - ${OPENCGA.CATALOG.DB.HOSTS}
    user: ${OPENCGA.CATALOG.DB.USER}
    password: ${OPENCGA.CATALOG.DB.PASSWORD}
    options:
      authenticationDatabase: ${OPENCGA.CATALOG.DB.AUTHENTICATION_DATABASE}
      connectionsPerHost: ${OPENCGA.CATALOG.DB.CONNECTIONS_PER_HOST}

... but note that sslEnabled can't be set (understandable, as this is a new option).

database:
      hosts:
      - "${OPENCGA.STORAGE.ALIGNMENT.DB.HOSTS}"
      user: "${OPENCGA.STORAGE.ALIGNMENT.DB.USER}"
      password: "${OPENCGA.STORAGE.ALIGNMENT.DB.PASSWORD}"
      options: {}
      hosts:
      - "${OPENCGA.STORAGE.VARIANT.DB.HOSTS}"
      user: "${OPENCGA.STORAGE.VARIANT.DB.USER}"
      password: "${OPENCGA.STORAGE.VARIANT.DB.PASSWORD}"
      options:    ## This is intended for database specific options such as --authenticationDatabase in MongoDB
        authenticationDatabase: ${OPENCGA.STORAGE.MONGODB.VARIANT.DB.AUTHENTICATION_DATABASE}
        connectionsPerHost: ${OPENCGA.STORAGE.MONGODB.VARIANT.DB.CONNECTIONS_PER_HOST}
        readPreference: "secondaryPreferred"

There should be a consistent set of values, across these three MongoDB databases, that can be defined in settings.xml and injected into the YAML config files. This set should include sslEnabled.

martinpeck commented 5 years ago

@wbari @j-coll

What are your thoughts on this?