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

Enable global controls from the settings #99

Closed
Lawouach opened this issue Apr 7, 2019 · 8 comments · Fixed by #109
Closed

Enable global controls from the settings #99

Lawouach opened this issue Apr 7, 2019 · 8 comments · Fixed by #109

Comments

@Lawouach
Copy link
Contributor

Lawouach commented Apr 7, 2019

It would be valuable to allow controls to be declared and defined in the settings and applied globally no matter the experiment.

Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit that referenced this issue Apr 17, 2019
* Make settings globally available
* Load global controls from settings

Contributes to #99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
Lawouach added a commit to chaostoolkit/chaostoolkit that referenced this issue Apr 17, 2019
Contributes to chaostoolkit/chaostoolkit-lib#99

Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
@dimzak
Copy link

dimzak commented Apr 29, 2019

Was really looking forward to this issue so gave it a try with chaostoolkit==1.1.0, chaostoolkit-lib==1.2.0 and chaostoolkit-opentracing.

Unfortunately seems that experiment.configuration is not loaded at all for controls declared in settings.yaml (https://github.com/chaostoolkit/chaostoolkit-lib/blob/master/chaoslib/control/__init__.py#L126).

Is this the expected behaviour and if it is, is there a possible workaround like adding some of the experiment.configuration props in settings.yaml?

Documentation should mention this imho as configuration is also an arg for multiple control methods and now it will be None

@russmiles
Copy link
Contributor

For secrets, this sounds like somewhat sensible behaviour as registering a global control means selecting the right secrets block could be tricky. For configuration it seems that it should be passed automatically around.

@Lawouach
Copy link
Contributor Author

Hello,

The trick is that the configuration/secrets targets the experiment. The whole point of declaring controls outside of the experiment means the experiment isn't aware of them. For progressing this question, I'd like examples of scenarios where you declare them globally but configure them locally.

Technically speaking global controls are loaded before the experiment and therefore before secrets and configs have been resolved. The idea is that global controls have access to the settings entirely (unlike experiments).

Agreed on better docs.

@dimzak
Copy link

dimzak commented Apr 29, 2019

Sure let's take 2 different scenarios that we currently have:

  1. chaostoolkit-opentracing requires this piece of configuration per experiment:
"configuration": {
  "tracing_provider": "jaeger",
  "tracing_host": "jaeger",
  "tracing_port": 6831
}

Is this configuration specific to an experiment? Not really it's not! yet every experiment requires it to run this control.

  1. We have another control, let's name it generic_control that requires this piece of configuration per experiment:
"configuration": {
  "project": "projectA",
  "region": "us-east-1"
}

while this piece of configuration is per experiment, all of our experiments require it so by having generic_control in settings.yaml reading this block will mean a cleaner experiment for our users

@Lawouach
Copy link
Contributor Author

Thanks. The first example isn't too much of an issue I believe. If i recall well, you can set args on the control itself. Even on the global one. To be verified.

The other one makes more sense indeed. I need to figure out how work around this elegantly.

@Lawouach
Copy link
Contributor Author

Lawouach commented May 1, 2019

Hi @dimzak, I've pushed some code in #116 to support this.

If you feel like trying before it's released, you'll need to update chaostoolkit-lib and chaostoolkit to the latest HEAD of each repo's PR branch.

@dimzak
Copy link

dimzak commented May 8, 2019

Hi @Lawouach !
Sorry for the late response, finally got time to test latest versions of chaostoolkit and chaostoolkit-lib (saw that you already merged open prs and released new versions).

Controls work like a charm!
Experiments now do not have a controls: [] section at all as controls are loaded from settings.yaml.

Thank you very much!

@Lawouach
Copy link
Contributor Author

Lawouach commented May 8, 2019

Awesome. Glad to hear this works fine. Hope this will be useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants