m-lab / murakami

Run automated internet measurement tests in a Docker container.
Apache License 2.0
41 stars 11 forks source link

Enable selection of servers within ndt[5|7]custom runners from JSON config file #83

Closed critzo closed 3 years ago

critzo commented 4 years ago

The current ndt5 and ndt7 runners, as well as the interim ndt5custom and ndt7custom test runners in the internet-resilience branch enable testing to a single self-provisioned ndt-server, when the _HOST environment variable is set for the runner. Using both the current and custom runners, one NDT test can use to a custom server and another test can use an M-Lab server, if all are enabled.

This issue is to extend the custom ndt runners in the internet-resilience branch, to provide two selection strategies and custom-defined groups of servers defined in a JSON configuration file. This would enable more flexibility in which tests should run to individual servers, or multiple tests to multiple servers, defined within different groups.

The final configuration format is TBD, but might be something like:

config1.json

{
  “serverGroups”: {
    “groupA”: {
        “selectionAlgorithm”: “random”,
        "servers": [ "10.10.10.1", "196.49.19.37" , "ndt-mlab1-iad05.mlab-oti.measurement-lab.org" ],
    },
    “groupB”: {
        “selectionAlgorithm”: “all”,
        "servers": [ "10.10.10.1", "196.49.19.37" , "ndt-mlab1-iad05.mlab-oti.measurement-lab.org" ],
    }
 }
}

In the example above, the "random" strategy would select one random server from groupA and would run one ndt test to that server. The "all" strategy would conduct one ndt test to each server in groupB during each scheduled run.

The configuration file would be saved on disk and bundled in the built Docker image, whether that is built locally for a standalone installation or pushed to a Balena managed Murakami beacon device/project.

Accompanying the JSON configuration file, one or more environment variables would be defined containing the path to the file within the Murakami container. For example: MURAKAMI_TESTS_NDT7CUSTOM_CONFIG=/murakami/configs/config1.json

critzo commented 3 years ago

Completed