question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add one global provider type

See original GitHub issue

experiment-type: a global JSON experiment key to assign to all providers type key. Add a feature that can handle the “experiment-type” key in an experiment JSON file.

usage:

    "version": "1.0.0",
    "title": "a dummy test",
    "description": "N/A",
    "tags": [],
    "experiment-type": "python", <- this is the additional key
    "steady-state-hypothesis": {
        "title": "a steady state hypo",
        "probes": [
            {
                "type": "probe",
                "name": "all_microservices_healthy",
                "provider": {  <- no need for type key
                    "module": "chaosk8s.probes",
                    "func": "all_microservices_healthy",
                    "arguments": {
                        "ns": "default"
                    }
                },
                "tolerance": "true"
            }
        ]
    },
    "method": [
        {
            "type": "action",
            "name": "kill_microservice",
            "provider": { <- no need for type key
                "module": "chaosk8s.actions",
                "func": "kill_microservice",
                "arguments": {
                    "name": "true",
                    "ns": "default",
                    "label_selector": "N"
                }
            }
        }
    ]
}

Handling: After loading the experiment JSON file, a recursive function will run all over the keys of the experiment object (to ensure all providers will be assigned no matter what object holds it). Finding all the “provider” dictionaries and add them to the type value from the “experiment-type”. If a type already exists in the provider no assignment will occur (that you will be able to add a different type then the global). If some exception will happen (can’t see any now, but just in case), the function will return the original untouched experiment preserving the original missing type validation error. If an unsupported provider type will be passed, the validation will return the usual error message.

Note

This implementation probably should not be in chaostoolkit.cli, just a demo to show the concept. guess somewhere in chaostoolkit-lib before the validation is happening.

This is the link to my fork with the changes I did. https://github.com/michael-gehtman-wix/chaostoolkit/pull/1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Lawouachcommented, Jul 15, 2020

Hey folks, not a bad idea.

This would also require a change on the spec as I believe the type is mandatory.

That said, your function could actually be a controller that is globally enabled so you wouldn’t even need to change the spec. Just make sure people use the bundle of controls you guys come up with.

0reactions
alexander-gorelikcommented, Aug 12, 2020

That’s reasonable

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding an API as a type provider - Google Cloud
This page describes how to add an API to Google Cloud Deployment Manager as a type provider. To learn more about types and...
Read more >
provider type code - ND Gov
PROVIDER TYPE CODE. PROVIDER SPECIALTY CODE. TAXONOMY CODE. 074-Clinical Neuropsychologist. 103G00000X. 152-Counselor. 101Y00000X. 155-Counselor, Addiction.
Read more >
Providers - Riverpod
A provider is an object that encapsulates a piece of state and allows listening to that state. ... Do not be frightened by...
Read more >
Global Messages - Oklahoma.gov
Provider Types : 010, 014, 329, 347. Effective September 1, 2022, OHCA added coverage for: CPT 55874 - Transperineal placement of biodegradable material, ......
Read more >
AWS::DynamoDB::Table - AWS CloudFormation
Type : AWS::DynamoDB::Table Properties: AttributeDefinitions: ... You can delete or add one global secondary index without interruption.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found