Giter Club home page Giter Club logo

Comments (7)

prlanzarin avatar prlanzarin commented on July 18, 2024

cc @schrd

from bbb-webrtc-sfu.

prlanzarin avatar prlanzarin commented on July 18, 2024

@schrd

Doing some digging now.
Turns out there's an easy way to use override files with node-config in its latest version. I've updated the development branch with the latest node-config version (see #84).

The approach is as follows:

  • Set the $NODE_CONFIG_DIR environment variable for the service to point to all directories you wish to use as configuration directories. e.g.: $NODE_CONFIG_DIR="/etc/bigbluebutton/bbb-webrtc-sfu/:/usr/local/bigbluebutton/bbb-webrtc-sfu/config/";
  • Add an override file in /etc/bigbluebutton/bbb-webrtc-sfu/ respecting node-config's file precedence (see https://github.com/lorenwest/node-config/wiki/Configuration-Files#file-load-order). Our current /usr/local/.../config/default.yml is the lowest precedence order, so anything that goes above it should work. I recommend using production.yml as the override file since it is the run environment the package uses AFAIK. So e.g.: /etc/bigbluebutton/bbb-webrtc-sfu/production.yml
  • When those are properly set, config merging is automagical.

Does that work for you?

from bbb-webrtc-sfu.

schrd avatar schrd commented on July 18, 2024

@prlanzarin

This would work. I'd prefer to have all config files in /etc/bigbluebutton but this is a minor issue if bbb-webrtc-sfu has its own directory. I wonder if the fact that arrays are not merged but replaced might break this override mechanisms for setups with multiple kurentos (see https://github.com/lorenwest/node-config/wiki/Configuration-Files#arrays-are-merged-by-replacement).

The goal is to allow operators to change some configuration values and not having to copy all of the settings, so that developers could add new configuration options and ship defaults which then would be applied automatically. With the way array replacement works, this would IMHO not possible. A workaround would be to change the arrays into objects. One config setting that comes into my mind is the multiplekurentos option.

from bbb-webrtc-sfu.

prlanzarin avatar prlanzarin commented on July 18, 2024

@schrd

The goal is to allow operators to change some configuration values and not having to copy all of the settings, so that developers could add new configuration options and ship defaults which then would be applied automatically. With the way array replacement works, this would IMHO not possible. A workaround would be to change the arrays into objects. One config setting that comes into my mind is the multiplekurentos option.

My 2cts is that's not really a problem, but a good thing. IMHO the fact that arrays are merged by replacement is safer than arbitrarily merging them according to a logic which might or might not be clear to the operator.

The operator will not need to copy all of the settings. The operator will need to use a named setting in the override as they would with any other setting. The array configs webrtc-sfu has are named at their root (eg modules:, kurento:). Member of the arrays are of the same object type, but unnamed. The arrays are not sorted, so fully merging (instead of replacing) would need to be positionally aware which would need the operator to keep track to any "ordering" changes to upstream configuration arrays, which is weird.

I have the same rationale about the HTML5 settings. Arrays should be replaced, not merged.

The example you give about spinning up multiple KMSs is a good one. A thought experiment:

Scenario 1:

  • Upstream ships with default single KMS: kurento: [ kms-entry1 ]
  • Operator overrides it with three KMSs: kurento: [ kms-entry1, kms-entry2, kms-entry3 ]. This array will be put in place of the default entirely, either with replacement or merging. Both work.

Scenario 2:

  • Upstream turns its default to 3 KMS: kurento: [ kms-entry1, kms-entry2, kms-entry3 ]
  • Operator wants one of the following (which are all possible)
    • Roll back to single Kurento:
      • with replacement, kurento: [ kms-entry1 ] works (and makes sense)
      • with merging, how do we roll back to a single one?
    • Add a 4th Kurento instance to also handle mediaType: main (cameras) and split camera load in 2. This works (and I know for a fact it's a valid use case)
      • with replacement, kurento: [ kms-entry1, kms-entry2, kms-entry3, kms-entry4 ] works (and makes sense)
      • with merging: what does the operator need to do to add a fourth entry? If they put a single instance which is not in the original config (ie, kurento: [ kms-entry4 ], with the URL different than 1-3 and mediaType: main), the merging will not add a new one, but instead merge entry4 with entry1. The operator will end up having to do as they would with replacement.

from bbb-webrtc-sfu.

prlanzarin avatar prlanzarin commented on July 18, 2024

@schrd ping. Is this good or do you think I need to adjust something/find something else?

from bbb-webrtc-sfu.

schrd avatar schrd commented on July 18, 2024

@prlanzarin I think this works. You are right regarding the array configuration, replacing is better than merging.

from bbb-webrtc-sfu.

prlanzarin avatar prlanzarin commented on July 18, 2024

Ok, cool. I'll close this then. Anything else, just ping me.

from bbb-webrtc-sfu.

Related Issues (17)

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.