Commit 2f6c9b2c authored by luxq's avatar luxq

add replay_project config param

parent ca37ead8
...@@ -125,6 +125,16 @@ def get_config( ...@@ -125,6 +125,16 @@ def get_config(
IMAGE_NAME = bunnyfinder_params.image IMAGE_NAME = bunnyfinder_params.image
cmd=["--config", config_file_path,
"--strategy", bunnyfinder_params.strategy,
"--duration-per-strategy-run", bunnyfinder_params.duration_per_strategy,
"--max-hack-idx", bunnyfinder_params.max_malicious_idx,
"--min-hack-idx", bunnyfinder_params.min_malicious_idx]
# check bunnyfinder_params.replay_project is set an value, if so, add it to the cmd
if bunnyfinder_params.replay_project != "":
cmd.append("--replay")
cmd.append(bunnyfinder_params.replay_project)
return ServiceConfig( return ServiceConfig(
image=IMAGE_NAME, image=IMAGE_NAME,
ports=USED_PORTS, ports=USED_PORTS,
...@@ -132,11 +142,7 @@ def get_config( ...@@ -132,11 +142,7 @@ def get_config(
BUNNYFINDER_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name, BUNNYFINDER_CONFIG_MOUNT_DIRPATH_ON_SERVICE: config_files_artifact_name,
}, },
env_vars={"OPENAI_API_KEY": bunnyfinder_params.openai_key, "OPENAI_BASE_URL": bunnyfinder_params.openai_base_url, "LLM_MODEL": bunnyfinder_params.llm_model}, env_vars={"OPENAI_API_KEY": bunnyfinder_params.openai_key, "OPENAI_BASE_URL": bunnyfinder_params.openai_base_url, "LLM_MODEL": bunnyfinder_params.llm_model},
cmd=["--config", config_file_path, cmd = cmd,
"--strategy", bunnyfinder_params.strategy,
"--duration-per-strategy-run", bunnyfinder_params.duration_per_strategy,
"--max-hack-idx", bunnyfinder_params.max_malicious_idx,
"--min-hack-idx", bunnyfinder_params.min_malicious_idx],
min_cpu=MIN_CPU, min_cpu=MIN_CPU,
max_cpu=MAX_CPU, max_cpu=MAX_CPU,
min_memory=MIN_MEMORY, min_memory=MIN_MEMORY,
......
...@@ -473,6 +473,7 @@ def input_parser(plan, input_args): ...@@ -473,6 +473,7 @@ def input_parser(plan, input_args):
openai_key=result["bunnyfinder_params"]["openai_key"], openai_key=result["bunnyfinder_params"]["openai_key"],
openai_base_url=result["bunnyfinder_params"]["openai_base_url"], openai_base_url=result["bunnyfinder_params"]["openai_base_url"],
llm_model=result["bunnyfinder_params"]["llm_model"], llm_model=result["bunnyfinder_params"]["llm_model"],
replay_project=result["bunnyfinder_params"]["replay_project"],
), ),
additional_services=result["additional_services"], additional_services=result["additional_services"],
wait_for_finalization=result["wait_for_finalization"], wait_for_finalization=result["wait_for_finalization"],
...@@ -1221,6 +1222,7 @@ def get_default_bunnyfinder_params(): ...@@ -1221,6 +1222,7 @@ def get_default_bunnyfinder_params():
"openai_key": "", "openai_key": "",
"openai_base_url": "", "openai_base_url": "",
"llm_model": "", "llm_model": "",
"replay_project":"",
} }
......
...@@ -264,6 +264,7 @@ SUBCATEGORY_PARAMS = { ...@@ -264,6 +264,7 @@ SUBCATEGORY_PARAMS = {
"openai_key", "openai_key",
"openai_base_url", "openai_base_url",
"llm_model", "llm_model",
"replay_project"
], ],
"port_publisher": [ "port_publisher": [
"nat_exit_ip", "nat_exit_ip",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment