From af14415b8fb3b3ce6e3a4846b1f4fe8c7f99b02f Mon Sep 17 00:00:00 2001 From: Mark Zhang Date: Sat, 28 Oct 2023 15:26:21 -0500 Subject: [PATCH 1/3] Fix reproduce command exception on missing acto namespace --- acto/reproduce.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/acto/reproduce.py b/acto/reproduce.py index a633b673da..13c1bbd231 100644 --- a/acto/reproduce.py +++ b/acto/reproduce.py @@ -138,7 +138,7 @@ def repro_setup(v): return None -def reproduce(workdir_path: str, reproduce_dir: str, operator_config: OperatorConfig, acto_namespace: int, **kwargs) -> List[RunResult]: +def reproduce(workdir_path: str, reproduce_dir: str, operator_config: OperatorConfig, **kwargs) -> List[RunResult]: os.makedirs(workdir_path, exist_ok=True) # Setting up log infra logging.basicConfig( @@ -169,8 +169,7 @@ def reproduce(workdir_path: str, reproduce_dir: str, operator_config: OperatorCo is_reproduce=True, input_model=input_model, apply_testcase_f=apply_testcase_f, - reproduce_dir=reproduce_dir, - acto_namespace=acto_namespace) + reproduce_dir=reproduce_dir) errors = acto.run(modes=['normal']) return [error for error in errors if error is not None] @@ -216,4 +215,5 @@ def reproduce_postdiff(workdir_path: str, operator_config: OperatorConfig, acto_ reproduce_dir=args.reproduce_dir, operator_config=args.config, cluster_runtime=args.cluster_runtime) - end_time = datetime.now() \ No newline at end of file + end_time = datetime.now() + From 878a01080fc5d9332d2905c796bb137528446a04 Mon Sep 17 00:00:00 2001 From: Mark Zhang Date: Sat, 28 Oct 2023 16:08:13 -0500 Subject: [PATCH 2/3] Revert "Fix reproduce command exception on missing acto namespace" This reverts commit af14415b8fb3b3ce6e3a4846b1f4fe8c7f99b02f. --- acto/reproduce.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/acto/reproduce.py b/acto/reproduce.py index 13c1bbd231..a633b673da 100644 --- a/acto/reproduce.py +++ b/acto/reproduce.py @@ -138,7 +138,7 @@ def repro_setup(v): return None -def reproduce(workdir_path: str, reproduce_dir: str, operator_config: OperatorConfig, **kwargs) -> List[RunResult]: +def reproduce(workdir_path: str, reproduce_dir: str, operator_config: OperatorConfig, acto_namespace: int, **kwargs) -> List[RunResult]: os.makedirs(workdir_path, exist_ok=True) # Setting up log infra logging.basicConfig( @@ -169,7 +169,8 @@ def reproduce(workdir_path: str, reproduce_dir: str, operator_config: OperatorCo is_reproduce=True, input_model=input_model, apply_testcase_f=apply_testcase_f, - reproduce_dir=reproduce_dir) + reproduce_dir=reproduce_dir, + acto_namespace=acto_namespace) errors = acto.run(modes=['normal']) return [error for error in errors if error is not None] @@ -215,5 +216,4 @@ def reproduce_postdiff(workdir_path: str, operator_config: OperatorConfig, acto_ reproduce_dir=args.reproduce_dir, operator_config=args.config, cluster_runtime=args.cluster_runtime) - end_time = datetime.now() - + end_time = datetime.now() \ No newline at end of file From 342ee414e09a9fd517a7b8a6b80ae0c19dd165ae Mon Sep 17 00:00:00 2001 From: Mark Zhang Date: Sat, 28 Oct 2023 16:17:24 -0500 Subject: [PATCH 3/3] Add acto namespace args to reproduce module --- acto/reproduce.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/acto/reproduce.py b/acto/reproduce.py index a633b673da..5793947435 100644 --- a/acto/reproduce.py +++ b/acto/reproduce.py @@ -205,6 +205,11 @@ def reproduce_postdiff(workdir_path: str, operator_config: OperatorConfig, acto_ dest='cluster_runtime', default="KIND", help='Cluster runtime for kubernetes, can be KIND (Default), K3D or MINIKUBE') + parser.add_argument( + '--acto-namespace', + dest='acto_namespace', + default=0, + help='Kubernetes namespace for acto') parser.add_argument('--context', dest='context', help='Cached context data') args = parser.parse_args() @@ -215,5 +220,6 @@ def reproduce_postdiff(workdir_path: str, operator_config: OperatorConfig, acto_ reproduce(workdir_path=workdir_path, reproduce_dir=args.reproduce_dir, operator_config=args.config, + acto_namespace=args.acto_namespace, cluster_runtime=args.cluster_runtime) - end_time = datetime.now() \ No newline at end of file + end_time = datetime.now()