Skip to content

Load platform config from different files inside a directory

Marcos Huck requested to merge feature/load_multiple_config_files into develop

Related tasks

Context

Cloudsim supports loading a single config file usually called config.yaml that determines each platform's configuration with their respective components settings. This worked great until we decided to implement yamlpatch as a tool to automate config patches.

When a developer needs to patch a config file (example: needs to add a new config to the machines component), the developer will create a new file containing the path to the specific object that needs patching and under that path the developer should include the specific config that needs to be changed or added, it will look like this:

platforms:
  us_east_1:
    type: "platform"
    config:
      components:
        machines:
          config:
            workerGroupName: "us-east-2"

The problem with this approach is that each platform is defined in the same file and it's identified by a key in the platforms map (i.e. us_east_1), forcing us to create a new file for each patch that needs to be applied. To perform this very same change to 4 regions, it will require to create 4 patching files.

image

Change

In order to solve the problem described above, we decided that the best approach would be splitting platform files into individual files.

This MR implements a discovery function that loads all .yaml files on a specific folder and attempts to create a new platform out of each file it has found. This will allow us to have a base template file that could be modified without depending region keys.

Here is an example with the worker group name to illustrate the situation a little bit better:

image

Other information

Additional documentation

Edited by Alejo Carballude

Merge request reports