fm_weck.grpc_service package

Subpackages

Submodules

fm_weck.grpc_service.fm_weck_client module

fm_weck.grpc_service.fm_weck_client.cancel_run(stub, run_id, confirmed=True)[source]
fm_weck.grpc_service.fm_weck_client.client_expert_run(tool: Tuple[Path, str], host: str, command: list[str], timelimit: int)[source]
fm_weck.grpc_service.fm_weck_client.client_get_run(host: str, run_id: str, timelimit: int)[source]
fm_weck.grpc_service.fm_weck_client.client_run(tool: Tuple[Path, str], host: str, prop: Path, files: list[Path], timelimit: int)[source]
fm_weck.grpc_service.fm_weck_client.query_files(host: str, run_id: str, file_names: str, timelimit: int, output_path: Path)[source]
fm_weck.grpc_service.fm_weck_client.start_expert_run(stub, tool, command)[source]
fm_weck.grpc_service.fm_weck_client.start_run(stub, tool, prop, c_program)[source]
fm_weck.grpc_service.fm_weck_client.wait_on_run(stub, run_id, timelimit)[source]

fm_weck.grpc_service.fm_weck_server module

class fm_weck.grpc_service.fm_weck_server.FmWeckRemote[source]

Bases: FmWeckRemoteServicer

cancelRun(request: CancelRunRequest, context) CancelRunResult[source]

Cancels a previously started run.

cleanupRun(request: RunID, context)[source]

Cleans up files of a finished run.

queryFiles(query: FileQuery, context) Generator[File, None, None][source]

Query for a number of result files.

startExpertRun(request: ExpertRunRequest, context) RunID[source]

Runs a tool in expert mode

startRun(request: RunRequest, context) RunID[source]

Runs a verification task for a given C program.

waitOnRun(request: WaitParameters, context) WaitRunResult[source]

Gets the result of a previously started run using its unique ID.

fm_weck.grpc_service.fm_weck_server.serve(ipaddr: str, port: str)[source]

fm_weck.grpc_service.request_handling module

class fm_weck.grpc_service.request_handling.RunHandler(request: RunRequest)[source]

Bases: object

cancel_run()[source]
cleanup()[source]
close()[source]

Close the process and the result listener. It is a StillRunningError to call this method if the process is still running.

failed() bool[source]
failure()[source]

Return the error object/text when failed, else None.

get_c_program(request) Path[source]
get_custom_property(property_file: File) Path[source]
get_custom_tool(data: File) Path[source]
get_file(file_name: str) Path[source]

Finds the file with the given name in the output directory of the run. :param file_name: The name of the file. :return: The path to the file. :raises FileNotFoundError: If the file does not exist.

get_property(request: RunRequest) Path[source]
get_tool(request: RunRequest) Path[source]
glob(name_pattern: str) Generator[Path, None, None][source]

Finds all files in the output directory of the run that match the given pattern. :param name_pattern: The pattern to match. :return: The paths to the files.

is_canceled()[source]

Returns True if the run was really canceled, i.e. the underlying process terminated, False otherwise. Since cancelling a finished run has no effect, calling cancel_run will not necessarily result in is_canceled() returning True.

is_running()[source]

A run handler is running, if it has been started and is not finished yet.

join(timeout=None)[source]
mp = <multiprocessing.context.SpawnContext object>
property output: str
property output_files: Generator[str, None, None]

Names of the files produced by the run.

ready() bool[source]
start()[source]
start_expert(command: str)[source]
successful() bool[source]

Returns True if the run was successful, False otherwise.

Raises:
  • StillRunningError – If the run is still running.

  • ValueError – If the run has not been started yet.

exception fm_weck.grpc_service.request_handling.StillRunningError[source]

Bases: Exception

fm_weck.grpc_service.request_handling.worker(setup_complete_flag, queue: SimpleQueue, initializer, initargs, target, args, kwargs)[source]

fm_weck.grpc_service.run_store module

fm_weck.grpc_service.run_store.active_runs() frozenset[source]
fm_weck.grpc_service.run_store.add_run(run_handler: RunHandler) str[source]
fm_weck.grpc_service.run_store.get_run(run_id: str) RunHandler[source]
fm_weck.grpc_service.run_store.remove_run(run_id: str) None[source]

fm_weck.grpc_service.server_utils module

fm_weck.grpc_service.server_utils.read_file(file_path: Path) bytes[source]

Returns the content of a file as bytes.

Parameters:

file_path – The path to the file.

Returns:

The content of the file as bytes.

Module contents