Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor application split and with it also config handling #354

Merged
merged 51 commits into from
Apr 12, 2021

Conversation

RoadRunnr
Copy link
Member

@RoadRunnr RoadRunnr commented Mar 30, 2021

STATUS

Passes most tests suites. TODO are in state that the work can distributed across several developers (set TODOs)

CHANGES

  • split ergw into core, cluster and top level application functions
  • core is only configured through API and is intended be used as library
  • top level is responsible for read config and applying it to cluster, core and aaa
  • non core API handlers (mostly HTTP) are moved to top level. This might be revised and the handler might move to extra apps later
  • repository layout is currently using a Erlang multi application approach, this might be revised later

TODOs

  • rework all documentation pieces
  • review changes for consistency
  • check and if needed fix the pgw_dist_SUITE
  • add the missing aaa key to the JSON schema for the config
  • enhance the JSON schema (e.g. add 'required' for mandatory items, add additional range restrictions to integers, ...)
  • (optional) write a config converter

@RoadRunnr RoadRunnr force-pushed the refactor/config branch 4 times, most recently from 2d5bfcc to 3c193a3 Compare April 7, 2021 10:17
@RoadRunnr RoadRunnr force-pushed the refactor/config branch 3 times, most recently from 454cc69 to b0dc6e0 Compare April 7, 2021 14:59
The ultimate goal is not to modify the environment config in any way.
However, converting all test cases from lists to maps would be a large
effort. So, for the moment continue to accept proplists in place of
maps and convert them.
Relex restriction on keys, permit arbitrary, unique keys.
The conversion from list to map takes care of that now.
Instead of converting the resulst to maps, have validation work
on the converted map. Drop all functions that work directly on
lists.

Except the socket list. It will be converted separately.
Proplists are no longer used for config after validation. Support
to return proplists from validation can therefore be removed.
In preparation of a more library like approach, move validation
of the configuration elements into the modules that actually
handle them.
Use ergw_core as API module and begin to move externally visible
methods into it.
Application startup is move out of ergw_core into a new (old) ergw
application.

ergw_core is now only a library that needs to be initialized properly
from the main app.
ergw is responsible for reading and ypplying the configuration to
ergw_core.

This is the first step of untangling the root config from ergw_core. The
test suites are currently broken and will be converted in the next steps.
Fixup remaining problems after refactoring and adjust config tests.
Remove config loader from ergw_core and add API functions
to load the component configuration separately.

Adjust the tests to test and use the new API functions.
@RoadRunnr RoadRunnr marked this pull request as ready for review April 8, 2021 08:26
@RoadRunnr RoadRunnr requested a review from a team as a code owner April 8, 2021 08:26
@RoadRunnr
Copy link
Member Author

test cases are failing in pgw_SUITEs modify_bearer_command_congestion case. That problem is already captured in #346 and unrelated to this PRs.

Instead of killing the runtime system, let the supervisor restart policy
handle that.
Restict type check FOR KEY on config maps when the key is actually
a name (and not an option name).
Note: configuring the meters is still disabled.
ergw is now a starte app, config is read from a config file in
json or yaml format.

For the momement, only ergw_core is configured. ergw_aaa config
will come next.
* restore HTTP API function
* restore HTTP API tests
* change answers config in AAA subsection to proper K/V structure
  and update JSON configurations
* restore sbi API test suite
Run all OTP version test to completion, regardless of other
failures.
@RoadRunnr RoadRunnr merged commit 1b6cc3e into master Apr 12, 2021
@RoadRunnr RoadRunnr deleted the refactor/config branch April 12, 2021 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants