Skip to content
This repository has been archived by the owner on Oct 5, 2020. It is now read-only.

Config: Need a modular config system. THIS IS READY. See PR LINK in this issue #620

Open
joe-getcouragenow opened this issue Sep 21, 2020 · 2 comments
Assignees

Comments

@joe-getcouragenow
Copy link
Contributor

sys-core boost it up and hands the pointer to each Module so they can access theie data.

The model that describes each Modules server config needs to be in each Module.
The on disk JSON or YAML needs to live at maintemplate level of course because that is where the server boots up from.

SO he JSON file will look a bit like this semantically.

sys-core
- name x, value x
mod-main
- name x, value x
mod-foo
@joe-getcouragenow joe-getcouragenow self-assigned this Sep 21, 2020
@joe-getcouragenow
Copy link
Contributor Author

joe-getcouragenow commented Sep 21, 2020

https://pkg.go.dev/go.uber.org/config

They use this in their m3 project: https://github.com/m3db/m3

It allows you to have the config split into many files at design time, which we need because of the Modules needing only the config for them and so they can run example. Then at build time it compacts them into one config file. So it seems perfect for us as its designed for a Modular decoupled architecture like ours is.

At build time,

We can suck up all the separate configs of each module into one config.
They use it for the m3 calling its tooling : https://github.com/m3db/m3/blob/master/Makefile#L271
We want to do this for maintemplate, so that it has a single config file to load.
It can suck them up from each Module.
Later, For each customer, we might have different settings at the Module level and so we can create them in the maintemplate folder, and have a slightly different make call.

At runtime

We need maintemplate to load the config and hand the config data to sys-core don't forget.
Now each mod can get access to the config from sys-core, because all Modules import sys-core.

I think this is good enough. I did not have time to try this out though.

Joe, if you get time make an example for the devs !!

@joe-getcouragenow joe-getcouragenow changed the title Need to find a golang lib for the server config system Config: Need a config system that can do multi level. I think this is not READY Sep 21, 2020
joe-getcouragenow pushed a commit to joe-getcouragenow/packages that referenced this issue Sep 21, 2020
joe-getcouragenow added a commit that referenced this issue Sep 21, 2020
sys-config: working makefile added #620
@joe-getcouragenow
Copy link
Contributor Author

Hey @cloudwebrtc and @WinWisely268

The PR above solves: here it is: #623

You can run the make file to see how it works

and in the PR i explain how we apple it to maintemplate2 and sys-core and any modules we use it with.
sys-accounts will be the first i expect
then mod-main

@joe-getcouragenow joe-getcouragenow changed the title Config: Need a config system that can do multi level. I think this is not READY Config: Need a config system that can do multi level. THIS IS READY. See PR LINK Sep 21, 2020
@joe-getcouragenow joe-getcouragenow changed the title Config: Need a config system that can do multi level. THIS IS READY. See PR LINK Config: Need a modular config system. THIS IS READY. See PR LINK in this issue Sep 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant