mirror of
https://github.com/FuzzingLabs/fuzzforge_ai.git
synced 2026-07-06 19:38:01 +02:00
refactor: remove dead code from OSS (fuzzforge-types and unused fuzzforge-common modules)
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
"""FuzzForge Runner constants."""
|
||||
|
||||
from pydantic import UUID7
|
||||
|
||||
#: Type alias for execution identifiers.
|
||||
type FuzzForgeExecutionIdentifier = UUID7
|
||||
|
||||
#: Default directory name for module input inside sandbox.
|
||||
SANDBOX_INPUT_DIRECTORY: str = "/data/input"
|
||||
SANDBOX_INPUT_DIRECTORY: str = "/fuzzforge/input"
|
||||
|
||||
#: Default directory name for module output inside sandbox.
|
||||
SANDBOX_OUTPUT_DIRECTORY: str = "/data/output"
|
||||
SANDBOX_OUTPUT_DIRECTORY: str = "/fuzzforge/output"
|
||||
|
||||
#: Default archive filename for results.
|
||||
RESULTS_ARCHIVE_FILENAME: str = "results.tar.gz"
|
||||
|
||||
@@ -18,13 +18,13 @@ from typing import TYPE_CHECKING, Any, cast
|
||||
|
||||
from fuzzforge_common.sandboxes.engines.docker.configuration import DockerConfiguration
|
||||
from fuzzforge_common.sandboxes.engines.podman.configuration import PodmanConfiguration
|
||||
from fuzzforge_types.executions import FuzzForgeExecutionIdentifier
|
||||
|
||||
from fuzzforge_runner.constants import (
|
||||
MODULE_ENTRYPOINT,
|
||||
RESULTS_ARCHIVE_FILENAME,
|
||||
SANDBOX_INPUT_DIRECTORY,
|
||||
SANDBOX_OUTPUT_DIRECTORY,
|
||||
FuzzForgeExecutionIdentifier,
|
||||
)
|
||||
from fuzzforge_runner.exceptions import ModuleExecutionError, SandboxError
|
||||
|
||||
@@ -284,7 +284,7 @@ class ModuleExecutor:
|
||||
Automatically pulls the module image from registry if it doesn't exist locally.
|
||||
|
||||
:param module_identifier: Name/identifier of the module image.
|
||||
:param input_volume: Optional path to mount as /data/input in the container.
|
||||
:param input_volume: Optional path to mount as /fuzzforge/input in the container.
|
||||
:returns: The sandbox container identifier.
|
||||
:raises SandboxError: If sandbox creation fails.
|
||||
|
||||
@@ -362,7 +362,7 @@ class ModuleExecutor:
|
||||
"name": item.stem,
|
||||
"description": f"Input file: {item.name}",
|
||||
"kind": "unknown",
|
||||
"path": f"/data/input/{item.name}",
|
||||
"path": f"{SANDBOX_INPUT_DIRECTORY}/{item.name}",
|
||||
}
|
||||
)
|
||||
elif item.is_dir():
|
||||
@@ -371,7 +371,7 @@ class ModuleExecutor:
|
||||
"name": item.name,
|
||||
"description": f"Input directory: {item.name}",
|
||||
"kind": "unknown",
|
||||
"path": f"/data/input/{item.name}",
|
||||
"path": f"{SANDBOX_INPUT_DIRECTORY}/{item.name}",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -441,7 +441,7 @@ class ModuleExecutor:
|
||||
"name": item.stem,
|
||||
"description": f"Input file: {item.name}",
|
||||
"kind": "unknown",
|
||||
"path": f"/data/input/{item.name}",
|
||||
"path": f"{SANDBOX_INPUT_DIRECTORY}/{item.name}",
|
||||
}
|
||||
)
|
||||
elif item.is_dir():
|
||||
@@ -450,7 +450,7 @@ class ModuleExecutor:
|
||||
"name": item.name,
|
||||
"description": f"Input directory: {item.name}",
|
||||
"kind": "unknown",
|
||||
"path": f"/data/input/{item.name}",
|
||||
"path": f"{SANDBOX_INPUT_DIRECTORY}/{item.name}",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -730,7 +730,7 @@ class ModuleExecutor:
|
||||
"module": module_identifier,
|
||||
}
|
||||
|
||||
def read_module_output(self, container_id: str, output_file: str = "/data/output/stream.jsonl") -> str:
|
||||
def read_module_output(self, container_id: str, output_file: str = f"{SANDBOX_OUTPUT_DIRECTORY}/stream.jsonl") -> str:
|
||||
"""Read output file from a running module container.
|
||||
|
||||
:param container_id: The container identifier.
|
||||
|
||||
@@ -13,8 +13,7 @@ from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any, cast
|
||||
from uuid import uuid4
|
||||
|
||||
from fuzzforge_types.executions import FuzzForgeExecutionIdentifier
|
||||
|
||||
from fuzzforge_runner.constants import FuzzForgeExecutionIdentifier
|
||||
from fuzzforge_runner.exceptions import WorkflowExecutionError
|
||||
from fuzzforge_runner.executor import ModuleExecutor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user