The binary.py module#

Summary#

PrepareSubprocess

Provides for letting the context manager disable vfork and posix_spawn in the subprocess.

BinaryConfig

Provides for configuring the worker binary connection to the HPS data transfer client.

Binary

Provides for starting, stopping, and monitoring the worker binary.

log

level_map

Description#

Provides utilities for managing binary files.

This module also handles processes related to the Ansys HPS data transfer client.

Module detail#

class binary.PrepareSubprocess#

Provides for letting the context manager disable vfork and posix_spawn in the subprocess.

Overview#

Import detail#

from ansys.hps.data_transfer.client.binary import PrepareSubprocess

Attribute detail#

PrepareSubprocess.disable_vfork#
class PrepareSubprocess.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)#

Provides for configuring the worker binary connection to the HPS data transfer client.

Parameters:
data_transfer_url: str, default: `https://localhost:8443/hps/dt/api/v1`

Data transfer URL.

log: bool, default: True

Whether to enable logging.

log_to_file: bool, default: False

Whether to enable logging to a file.

monitor_interval: float, default: 0.5

Duration for waiting before the next monitor check on the binary.

token: str

Worker configuration setting of the access token credential.

host: str, default: `127.0.0.1`

Host IP to talk to the data transfer service.

port: int

Host port to talk to the data transfer service.

verbosity: int, default: 1

Verbosity level of the worker. The higher the number, the more verbose the logging.

insecure: bool, default: False

Whether to ignore SSL certificate verification.

debug: bool, default: False

Whether to enable debug logging.

Overview#

update

Update worker configuration settings.

port

Port.

token

Token.

url

URL.

Import detail#

from ansys.hps.data_transfer.client.binary import BinaryConfig

Property detail#

property BinaryConfig.port#

Port.

property BinaryConfig.token#

Token.

property BinaryConfig.url#

URL.

Attribute detail#

BinaryConfig.data_transfer_url = 'https://localhost:8443/hps/dt/api/v1'#
BinaryConfig.log = True#
BinaryConfig.log_to_file = False#
BinaryConfig.monitor_interval = 0.5#
BinaryConfig.path = None#
BinaryConfig.debug = False#
BinaryConfig.verbosity = 1#
BinaryConfig.host = '127.0.0.1'#
BinaryConfig.insecure = False#

Method detail#

BinaryConfig.update(**kwargs)#

Update worker configuration settings.

class BinaryConfig.Binary(config: BinaryConfig | None = None)#

Provides for starting, stopping, and monitoring the worker binary.

Parameters:
config: BinaryConfig

Binary configuration.

Overview#

start

Start the worker binary.

stop

Stop the worker binary.

config

Configuration.

is_started

Flag indicating if the binary is up and running.

Import detail#

from ansys.hps.data_transfer.client.binary import Binary

Property detail#

property Binary.config#

Configuration.

property Binary.is_started#

Flag indicating if the binary is up and running.

Method detail#

Binary.start()#

Start the worker binary.

This method checks for the binary in a set path, marks the binary as an executable, and then starts the executable.

Binary.stop(wait=5.0)#

Stop the worker binary.

Binary.log#
Binary.level_map#