DockerLauncher#
- class ansys.pyensight.core.DockerLauncher(data_directory: str | None = None, docker_image_name: str | None = None, use_dev: bool = False, channel: Channel | None = None, pim_instance: Any | None = None, grpc_use_tcp_sockets: bool | None = False, grpc_allow_network_connections: bool | None = False, grpc_disable_tls: bool | None = False, grpc_uds_pathname: str | None = None, **kwargs)#
Creates a
Sessioninstance using a copy of EnSight hosted in a Docker container.This class allows you to either attach to a PIM-launched Docker container hosting EnSight or launch a local Docker container hosting EnSight. gRPC connections to EnShell and EnSight are established. A PyEnSight
Sessioninstance is returned upon successful launch and connection.- Parameters:
- data_directory
str,optional Host directory to make into the container at
/data. The default isNone.- docker_image_name
str,optional Name of the Docker image to use. The default is
None.- use_devbool,
optional Whether to use the latest
ensight_devDocker image. The default isFalse. However, this value is overridden if the name of a Docker image is specified for thedocker_image_nameparameter.- channel
Existing gRPC channel to a running
EnShellinstance provided by PIM.- pim_instance
PyPIM instance if using PIM (internal). The default is
None.- timeout
float,optional Number of seconds to try a gRPC connection before giving up. This parameter is defined on the parent
Launcherclass, where the default is120.- use_eglbool,
optional Whether to use EGL hardware for accelerated graphics. The platform must be able to support this hardware. This parameter is defined on the parent
Launcherclass, where the default isFalse.- use_sos
int,optional Number of EnSight servers to use for SOS (Server of Server) mode. This parameter is defined on the parent
Launcherclass, where the default isNone, in which case SOS mode is not used.- additional_command_line_options: list, optional
Additional command line options to be used to launch EnSight. Arguments that contain spaces are not supported.
- grpc_use_tcp_sockets
If using gRPC, and if True, then allow TCP Socket based connections instead of only local connections.
- grpc_allow_network_connections
If using gRPC and using TCP Socket based connections, listen on all networks.
- grpc_disable_tls
If using gRPC and using TCP Socket based connections, disable TLS.
- grpc_uds_pathname
If using gRPC and using Unix Domain Socket based connections, explicitly set the pathname to the shared UDS file instead of using the default.
- data_directory
Examples
>>> from ansys.pyensight.core import DockerLauncher >>> launcher = DockerLauncher(data_directory="D:\data") >>> launcher.pull() >>> session = launcher.start() >>> session.close()
WARNING: Overriding the default values for these options: grpc_use_tcp_sockets, grpc_allow_network_connections, and grpc_disable_tls can possibly permit control of this computer and any data which resides on it. Modification of this configuration is not recommended. Please see the documentation for your installed product for additional information.
Methods
Get the Ansys version (three-digit string) found in the Docker container.
DockerLauncher.close(session)Shut down the launched EnSight session.
Create and bind a
Sessioninstance to the created EnSight gRPC connection started by EnShell.Get the contents of the EnShell log if possible.
Get the PIM file service object if available.
DockerLauncher.launch_webui(container_env_str)Pull the Docker image.
Start EnShell by running a local Docker EnSight image.
Release any additional resources allocated during launching.
Attributes
Root directory for HTML files.