fm_weck package¶
Subpackages¶
- fm_weck.grpc_service package
- Subpackages
- Submodules
- fm_weck.grpc_service.fm_weck_client module
- fm_weck.grpc_service.fm_weck_server module
- fm_weck.grpc_service.request_handling module
RunHandlerRunHandler.cancel_run()RunHandler.cleanup()RunHandler.close()RunHandler.failed()RunHandler.failure()RunHandler.get_c_program()RunHandler.get_custom_property()RunHandler.get_custom_tool()RunHandler.get_file()RunHandler.get_property()RunHandler.get_tool()RunHandler.glob()RunHandler.is_canceled()RunHandler.is_running()RunHandler.join()RunHandler.mpRunHandler.outputRunHandler.output_filesRunHandler.ready()RunHandler.start()RunHandler.start_expert()RunHandler.successful()
StillRunningErrorworker()
- fm_weck.grpc_service.run_store module
- fm_weck.grpc_service.server_utils module
- Module contents
- fm_weck.resources package
Submodules¶
fm_weck.cache_mgr module¶
fm_weck.capture module¶
fm_weck.cli module¶
- class fm_weck.cli.ToolQualifier(qualifier: str)[source]¶
Bases:
object- tool: str | Path¶
- version: str | None¶
- fm_weck.cli.get_version_for_competition_year(tool_path: Path, year: int) str | None[source]¶
Find the tool version used in a competition for the given year. Searches for SV-COMP or Test-Comp participation entries.
- Parameters:
tool_path – Path to the tool’s YAML file
year – Competition year (e.g., 2025)
- Returns:
Version string if found, None otherwise
- fm_weck.cli.resolve_tool(tool: ToolQualifier) Path[source]¶
fm_weck.config module¶
- class fm_weck.config.Config[source]¶
Bases:
objectThe config singleton holds the configuration for the weck tool.
- as_absolute_path(*args, **kwargs) Path[source]¶
Makes sure relative Paths in the config are relative to the config file.
- property cache_location: Path¶
Makes sure relative Paths in the config are relative to the config file.
fm_weck.engine module¶
- class fm_weck.engine.Docker(image: str | FmImageConfig)[source]¶
Bases:
Engine- class DockerBuildCommand(containerfile: Path, needs_sudo: bool = False)[source]¶
Bases:
BuildCommand
- class fm_weck.engine.Engine(image: str | FmImageConfig)[source]¶
Bases:
ABC- class BuildCommand(containerfile: Path, **kwargs)[source]¶
Bases:
ABC- build_args: List[str] = []¶
- containerfile: Path¶
- add_benchexec_capabilities: bool = False¶
- add_container_long_opt(arg: list[str])[source]¶
Add a long option to the container command. If the first element of the list does not start with “–”, it will be prepended. Example: add_container_long_opt([”–option”, “value”]) -> –option value add_container_long_opt([“option”, “value”]) -> –option value
- add_mounting_capabilities: bool = True¶
- dry_run: bool = False¶
- from_config() Engine[source]¶
- from_config(fm: Path, version: str, config: Config)
- from_config(fm: str, version: str, config: Config)
- from_config(fm: FmToolVersion, config: Config)
- handle_io: bool = True¶
- image: str | None = None¶
- abstractmethod image_from(containerfile: Path) BuildCommand[source]¶
- interactive: bool = False¶
- overlay_tool_dir: str | None = None¶
- print_output_to_stdout: bool = True¶
- work_dir: Path = PosixPath('/home/cwd')¶
fm_weck.exceptions module¶
- class fm_weck.exceptions.Failure(kind: str, message: str, detail: str | None = None)[source]¶
Bases:
object- detail: str | None = None¶
- kind: str¶
- message: str¶
fm_weck.file_util module¶
fm_weck.image_mgr module¶
- class fm_weck.image_mgr.ImageMgr[source]¶
Bases:
objectThe image manager singleton is responsible for preparing the images for the container.
- check_if_doi_exists_locally(engine: Engine, doi: str) str[source]¶
Check if an image tagged with the given DOI already exists locally.
- Returns:
The DOI if it does not exist locally, otherwise empty string.
fm_weck.run_result module¶
fm_weck.runexec_mode module¶
fm_weck.runexec_util module¶
fm_weck.serve module¶
- fm_weck.serve.install_fm_tool(fm_tool: Path | FmToolVersion, version: str | None, configuration: Config, install_path: Path) None[source]¶
- fm_weck.serve.run_guided(fm_tool: Path | FmToolVersion, version: str | None, configuration: Config, prop: Path | None, program_files: list[Path], additional_args: list[str], witness: Path | None = None, data_model: DataModel | None = None, offline_mode: bool = False, log_output_to: Path | None = None, output_files_to: Path | None = None, timeout_sec: float | None = None, print_tool_output_to_console: bool = True) RunResult[source]¶
- fm_weck.serve.run_manual(fm_tool: Path | FmToolVersion, version: str | None, configuration: Config, command: list[str], offline_mode: bool = False, use_overlay: bool = False, log_output_to: Path | None = None, output_files_to: Path | None = None, timeout_sec: float | None = None, print_tool_output_to_console: bool = True) RunResult[source]¶
fm_weck.smoke_test_mode module¶
- exception fm_weck.smoke_test_mode.NoSmokeTestFileError[source]¶
Bases:
SmokeTestErrorException raised when no smoke test file is found.
- exception fm_weck.smoke_test_mode.SmokeTestError[source]¶
Bases:
ExceptionCustom exception for smoke test errors.
- exception fm_weck.smoke_test_mode.SmokeTestFileIsEmptyError[source]¶
Bases:
SmokeTestErrorException raised when the smoke test file is empty.
- exception fm_weck.smoke_test_mode.SmokeTestFileIsNotExecutableError(smoke_test_file: Path)[source]¶
Bases:
SmokeTestErrorException raised when the smoke test file is not executable.
- smoke_test_file: Path¶
- fm_weck.smoke_test_mode.locate_and_check_smoke_test_file(shelve_space: Path) str[source]¶
Check if the smoke test file exists, is executable, and is not empty.
- Parameters:
shelve_space – Path to the shelve space directory.
- Returns:
The relative path to the smoke test file as a string.
- Raises:
NoSmokeTestFileError – If the smoke test file does not exist.
SmokeTestFileIsEmptyError – If the smoke test file is empty.
SmokeTestFileIsNotExecutableError – If the smoke test file is not executable.
- fm_weck.smoke_test_mode.run_smoke_test_gitlab_ci(fm_data: FmToolVersion, tool_dir: Path)[source]¶
Run smoke test in GitLab CI mode. This mode directly installs required packages using apt instead of building/pulling images.
- Parameters:
fm_data – The FmToolVersion object containing tool information
tool_dir – The directory containing the tool’s smoketest.sh script
fm_weck.tmp_file module¶
- class fm_weck.tmp_file.NTempFile(name, mode='wb')[source]¶
Bases:
objectCustom temporary file context manager. It creates a temporary file and deletes it after the context manager is closed. The file is not kept open in order to achieve compatibility with Windows.
Inspired by https://stackoverflow.com/a/63173312
fm_weck.version_listing module¶
fm_weck.zenodo module¶
- class fm_weck.zenodo.TokenAuth(token: str)[source]¶
Bases:
Auth- auth_flow(request)[source]¶
Execute the authentication flow.
To dispatch a request, yield it:
` yield request `The client will .send() the response back into the flow generator. You can access it like so:
` response = yield request `A return (or reaching the end of the generator) will result in the client returning the last response obtained from the server.
You can dispatch as many requests as is necessary.
- class fm_weck.zenodo.ZenodoMgr(engine, access_token: str | None, image: str | None, doi: str | None, is_sandbox: bool = False, config: Config | None = None)[source]¶
Bases:
objectZenodo API manager.
- Parameters:
engine (object) – The fm-weck engine object.
access_token (str, optional) – The access token for authentication with the API. Defaults to None.
image (str, optional) – The image to be published. Required if no doi is given. Defaults to None.
doi (str, optional) – The DOI of the image to be pulled. Required if no image is given. Defaults to None.
- Raises:
ValueError – If a chosen image is invalid or does not exist.
- static load_zenodo_token(config)[source]¶
Load the Zenodo token from the Zenodo config file.
- Raises:
ZenodoError – If no Zenodo token is found.
- publish()[source]¶
Publish an image on Zenodo.
- Raises:
ZenodoError – If Zenodo API returns an error.
- pull(download_path: str | None, force_pull: bool = False)[source]¶
Download an image from Zenodo using its DOI.
- Raises:
ValueError – If no DOI is provided.
ZenodoError – If Zenodo API returns an error.
- push()[source]¶
Upload an image to Zenodo and leave it in draft mode (unpublished).
- Raises:
ZenodoError – If Zenodo API returns an error.
- class fm_weck.zenodo.ZenodoSession(access_token: str | None = None, is_sandbox: bool = False)[source]¶
Bases:
object- check_existing_records(metadata: dict)[source]¶
Check if a record with the same name already exists in the depositions. If it exists, prompt whether the image should be uploaded as a new version.
- Returns:
The deposition ID in case of a positive prompt response, or an empty string.
- download(doi: str, download_path: str | None, no_progress_bar: bool = False) Path[source]¶
Download an image from Zenodo using its DOI.
- prepare_new_version_upload(metadata: dict, deposition_id: str) None[source]¶
Set up the metadata for the new version and delete the old versions’ files from that version.
- resolve_download_info(doi: str) str[source]¶
Extract the download URL from the deposition metadata.
- Returns:
The download URL of the image.