Skip to content

Commit

Permalink
plugin wip
Browse files Browse the repository at this point in the history
Signed-off-by: Tullio Sebastiani <[email protected]>
  • Loading branch information
tsebastiani committed Jul 11, 2024
1 parent 4914160 commit 736137b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions kraken/syn_flood/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .syn_flood import *
26 changes: 26 additions & 0 deletions kraken/syn_flood/syn_flood.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import time
from typing import List

from krkn_lib.models.telemetry import ScenarioTelemetry
from krkn_lib.telemetry.k8s import KrknTelemetryKubernetes


def run(scenarios_list: list[str], kubeconfig_path: str, telemetry: KrknTelemetryKubernetes) -> (list[str], list[ScenarioTelemetry]):
scenario_telemetries: list[ScenarioTelemetry] = []
failed_post_scenarios = []
for scenario in scenarios_list:
scenario_telemetry = ScenarioTelemetry()
scenario_telemetry.scenario = scenario
scenario_telemetry.start_timestamp = time.time()
telemetry.set_parameters_base64(scenario_telemetry, scenario)

engine_args = build_args(scenario)
status_code = run_workflow(engine_args, kubeconfig_path)


scenario_telemetry.end_timestamp = time.time()
scenario_telemetry.exit_status = status_code
scenario_telemetries.append(scenario_telemetry)
if status_code != 0:
failed_post_scenarios.append(scenario)
return failed_post_scenarios, scenario_telemetries
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ google-api-python-client==2.116.0
ibm_cloud_sdk_core==3.18.0
ibm_vpc==0.20.0
jinja2==3.1.4
krkn-lib==2.1.4
krkn-lib@git+https://https://github.com/krkn-chaos/krkn-lib.git@syn_flood
lxml==5.1.0
kubernetes==28.1.0
oauth2client==4.1.3
Expand Down

0 comments on commit 736137b

Please sign in to comment.