neural_compressor.ux.utils.proc

Execution common proc module.

Module Contents

Classes

Proc

Process class that runs commands from shell.

class neural_compressor.ux.utils.proc.Proc(output_dir: str = '.', pid: str | None = None, request_id: str | None = None, filename: str | List[str] | None = None, additional_log_names: List[str] = [])

Bases: object

Process class that runs commands from shell.

property output: Iterator[str]

Property returns lines form execution.

Returns:

Iterator with output lines from process execution

property info: Dict[str, Any]

Info contains information about process arguments start and stop time.

Example

“cmd”: [

“docker”, “pull”, “hub.docker.intel.com/aibt_tensorflow/centos-7_3_mkldnn_tensorflow:latest”

], “output_path”: “111224/stages/pull_image/0c750a01-90e0-4aa8-99fe-a194d55a2046.txt”, “time_start”: “2018-05-17T14:47:22.352502”, “time_stop”: “2018-05-17T14:47:25.110410”

Returns:

Process information

property info_path: str

Process .proc file with runtime process information.

Returns:

absolute path to process .proc file

property output_path: str

Process .txt file with process logs.

Returns:

absolute path to process .txt file

property tail: list

Property returns lines form execution along open file.

Returns:

Lines from process execution

property is_ok: bool

Check if process execute as expected.

Returns:

bool if return code from cmd is in ignore_exit_codes return True, False if not

run(args: List[Any], executable: Any | None = None, shell: bool = False, cwd: str | None = None, env: dict | None = None, universal_newlines: bool = False, startupinfo: Any | None = None, creationflags: int = 0, ignore_exit_codes: list | Any = None) subprocess.Popen

Execute call for process.

Parameters:
  • args

  • executable

  • shell

  • cwd

  • env

  • universal_newlines

  • startupinfo

  • creationflags

  • ignore_exit_codes

Returns:

Popen

remove_logs() None

Remove logs generated by process.

Returns:

Nothing