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_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_dev
Docker image. The default isFalse
. However, this value is overridden if the name of a Docker image is specified for thedocker_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
.- timeout
float
,optional
Number of seconds to try a gRPC connection before giving up. This parameter is defined on the parent
Launcher
class, 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
Launcher
class, 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
Launcher
class, 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.
- data_directory
Examples
>>> from ansys.pyensight.core import DockerLauncher >>> launcher = DockerLauncher(data_directory="D:\data") >>> launcher.pull() >>> session = launcher.start() >>> session.close()
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
Session
instance 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.