chaostoolkit-incubator / chaostoolkit-azure

Chaos Toolkit Extension for Azure
https://chaostoolkit.org/
Apache License 2.0
22 stars 28 forks source link

Interrupt experiment execution when secrets are missing #94

Closed bugra-derre closed 4 years ago

bugra-derre commented 4 years ago

This commit will interrupt the experiment execution, when

Besides that this commit introduces some refactoring:

Resolves: #84

Signed-off-by: Bugra Derre bugra.derre@gmail.com

bugra-derre commented 4 years ago

@mkaszub Can you have a look at this PR? I did some refactorings as well.

@Lawouach Is the usage of the InterruptExecution-Exception the right exception to use to interrupt the experiment execution when e.g. credentials are missing?

Lawouach commented 4 years ago

Hello @bugra-derre, I think that is the right approach yes.This is what we used in the AWS extension as well.

https://github.com/chaostoolkit-incubator/chaostoolkit-aws/blob/master/chaosaws/__init__.py#L71

bugra-derre commented 4 years ago

@mkaszub Haha. I did already. And it works (on my machine :D) @Lawouach This commit has a lot of new features. Could you do a release of it? I will leave the merge up to you.

Lawouach commented 4 years ago

Hey folks.

Thanks for the PR. It's a bit massive and does a lot of things. So it's hard for me to judge of its value, I trust you do the right thing here.

One thing that matters is that we don't break extensions by moving things around. Remember that the Chaos Toolkit looks for full package.module.function path.

Is that a preserved invariant in this PR?

bugra-derre commented 4 years ago

@Lawouach Yes. It's preserved. The experiment will still run the old way.

This is for example my part of the experiment that works

...
method:
  - type: action
    name: Stress CPU of a random machine from the cluster
    provider:
      type: python
      module: chaosazure.vmss.actions
      func: stress_vmss_instance_cpu
      arguments:
        filter: "where name=='aks-nodepool1-24353756-vmss' | where location=='westeurope' | where resourceGroup=='mc_aks-rg_aks-rg-cluster_westeurope' | sample 1"
        duration: 360
      secrets:
      - azure
      config:
      - azure_subscription_id
rollbacks: []
...