client.binary#
This module provides utilities for managing binary files and processes related to the Ansys HPS Data Transfer Client.
Attributes#
Classes#
Context manager to disable vfork and posix_spawn in subprocess. |
|
Configure worker binary connection to HPS data transfer client. |
|
Start, stop and monitor worker binary. |
Module Contents#
- client.binary.log#
- client.binary.level_map#
- class client.binary.PrepareSubprocess#
Context manager to disable vfork and posix_spawn in subprocess.
- __enter__()#
- __exit__(exc_type, exc_val, exc_tb)#
- class client.binary.BinaryConfig(data_transfer_url: str = 'https://localhost:8443/hps/dt/api/v1', log: bool = True, log_to_file: bool = False, monitor_interval: float = 0.5, path=None, token: str = None, host: str = '127.0.0.1', port: int = None, verbosity: int = 1, insecure: bool = False, debug: bool = False)#
Configure worker binary connection to HPS data transfer client.
- Parameters:
- data_transfer_url: str
data transfer url. Default is https://localhost:8443/hps/dt/api/v1
- log: bool
Process related setting to enable logging. Default is True
- log_to_file: bool
To enable logging to a file. Default is False
- monitor_interval: float
duration for waiting before the next monitor check on the binary. Default is 0.5
- token: str
A worker config setting of access token credential.
- host: str
Host IP to talk to data tarsnfer service. Default is 127.0.0.1
- port: int
Host port to talk to data tarsnfer service
- verbosity: int
Default is 1
- insecure: bool
Default is False
- debug: bool
Default is False
- data_transfer_url = 'https://localhost:8443/hps/dt/api/v1'#
- log = True#
- log_to_file = False#
- monitor_interval = 0.5#
- path = None#
- debug = False#
- verbosity = 1#
- host = '127.0.0.1'#
- _selected_port = None#
- _detected_port = None#
- _token = None#
- insecure = False#
- _on_token_update = None#
- _on_process_died = None#
- _on_port_changed = None#
- update(**kwargs)#
- property port#
Return port.
- property token#
Return token.
- property url#
Return url.
- class client.binary.Binary(config: BinaryConfig = BinaryConfig())#
Start, stop and monitor worker binary.
- Parameters:
- config: BinaryConfig
BinaryConfig object.
- _config#
- _base_args = []#
- _args = []#
- _stop = None#
- _prepared = None#
- _process = None#
- __getstate__()#
- property config#
Return config.
- property is_started#
Return true if binary is up and running.
- start()#
Start the worker binary. check for binary in a set path, marks the binary as an executable and then start the executable.
- stop(wait=5.0)#
Stop worker binary.
- _log_output()#
- _log_line(line)#
- _monitor()#
- _prepare()#
- _get_open_port()#
- _build_base_args()#
- _build_args()#