From 4ac0e4e6b7abc4a0549b4c5d67839fb7ddd49a89 Mon Sep 17 00:00:00 2001 From: Josh McVey Date: Tue, 8 Oct 2024 10:17:24 -0500 Subject: [PATCH] no cleanup and more containers --- .../citools/generate_analyses.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/analyses-snapshot-testing/citools/generate_analyses.py b/analyses-snapshot-testing/citools/generate_analyses.py index a6ce27c399d..1b240f6fc00 100644 --- a/analyses-snapshot-testing/citools/generate_analyses.py +++ b/analyses-snapshot-testing/citools/generate_analyses.py @@ -24,11 +24,15 @@ HOST_RESULTS: Path = Path(Path(__file__).parent.parent, "analysis_results") ANALYSIS_SUFFIX: str = "analysis.json" ANALYSIS_TIMEOUT_SECONDS: int = 30 -ANALYSIS_CONTAINER_INSTANCES: int = 6 +ANALYSIS_CONTAINER_INSTANCES: int = 10 console = Console() +def is_running_in_github_actions() -> bool: + return os.getenv("GITHUB_ACTIONS") == "true" + + class ProtocolType(Enum): PROTOCOL_DESIGNER = auto() PYTHON = auto() @@ -229,7 +233,10 @@ def analyze_against_image(tag: str, protocols: List[TargetProtocol], num_contain containers = start_containers(image_name, num_containers) analyze_many(protocols, containers) finally: - stop_and_remove_containers(image_name) + if is_running_in_github_actions(): + pass # We don't need to stop and remove containers in CI + else: + stop_and_remove_containers(image_name) return protocols