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, **kwargs)#

Creates a Session instance 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 Session instance is returned upon successful launch and connection.

Parameters:
data_directorystr, optional

Host directory to make into the container at /data. The default is None.

docker_image_namestr, optional

Name of the Docker image to use. The default is None.

use_devbool, optional

Whether to use the latest ensight_dev Docker image. The default is False. However, this value is overridden if the name of a Docker image is specified for the docker_image_name parameter.

channel

Existing gRPC channel to a running EnShell instance provided by PIM.

pim_instance

PyPIM instance if using PIM (internal). The default is None.

timeoutfloat, optional

Number of seconds to try a gRPC connection before giving up. This parameter is defined on the parent Launcher class, where the default is 120.

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 Launcher class, where the default is False.

use_sosint, optional

Number of EnSight servers to use for SOS (Server of Server) mode. This parameter is defined on the parent Launcher class, where the default is None, in which case SOS mode is not used.

Examples

>>> from ansys.pyensight.core import DockerLauncher
>>> launcher = DockerLauncher(data_directory="D:\data")
>>> launcher.pull()
>>> session = launcher.start()
>>> session.close()

Methods

DockerLauncher.ansys_version()

Get the Ansys version (three-digit string) found in the Docker container.

DockerLauncher.close(session)

Shut down the launched EnSight session.

DockerLauncher.connect()

Create and bind a Session instance to the created EnSight gRPC connection started by EnShell.

DockerLauncher.enshell_log_contents()

Get the contents of the EnShell log if possible.

DockerLauncher.file_service()

Get the PIM file service object if available.

DockerLauncher.pull()

Pull the Docker image.

DockerLauncher.start()

Start EnShell by running a local Docker EnSight image.

DockerLauncher.stop()

Release any additional resources allocated during launching.

Attributes

DockerLauncher.session_directory

Root directory for HTML files.