Fluent container launcher#
Provides a module for launching and configuring local Fluent Docker container runs.
Notes#
For configuration details, see configure_container_dict()
, and for a list of additional Docker container run
configuration options that can also be specified through the
container_dict
argument for launch_fluent()
,
see Docker run documentation.
Examples#
Launching a Fluent Docker container with system default configuration:
>>> import ansys.fluent.core as pyfluent
>>> session = pyfluent.launch_fluent(start_container=True)
Launching with custom configuration:
>>> import ansys.fluent.core as pyfluent
>>> custom_config = {}
>>> custom_config.update(fluent_image='custom_fluent:v23.1.0', host_mount_path='/testing', auto_remove=False)
>>> session = pyfluent.launch_fluent(container_dict=custom_config)
Getting default Fluent Docker container configuration, then launching with customized configuration:
>>> import ansys.fluent.core as pyfluent
>>> config_dict = pyfluent.launch_fluent(start_container=True, dry_run=True)
Container run configuration information:
image_name = 'ghcr.io/ansys/pyfluent:v23.1.0'
>>> config_dict
{'auto_remove': True,
'command': ['-gu',
'-sifile=/home/user/.local/share/ansys_fluent_core/examples/serverinfo-reh96tuo.txt',
'3ddp'],
'detach': True,
'environment': {'ANSYSLMD_LICENSE_FILE': '1450@license_server.com',
'REMOTING_PORTS': '57193/portspan=2'},
'labels': {'test_name': 'none'},
'ports': {'57193': 57193},
'volumes': ['/home/user/.local/share/ansys_fluent_core/examples:/home/user/.local/share/ansys_fluent_core/examples'],
'working_dir': '/home/user/.local/share/ansys_fluent_core/examples'}
>>> config_dict.update(image_name='custom_fluent', image_tag='v23.1.0', mem_limit='1g')
>>> session = pyfluent.launch_fluent(container_dict=config_dict)
Functions:
|
Parses the parameters listed below, and sets up the container configuration file. |
|
Start a Fluent container. |
- ansys.fluent.core.launcher.fluent_container.configure_container_dict(args, host_mount_path=None, container_mount_path=None, timeout=30, port=None, license_server=None, container_server_info_file=None, remove_server_info_file=True, fluent_image=None, image_name=None, image_tag=None, **container_dict)#
Parses the parameters listed below, and sets up the container configuration file.
- Parameters:
- args
List
[str
] List of Fluent launch arguments.
- host_mount_path
Union
[str
,Path
],optional
Existing path in the host operating system that will be available inside the container.
- container_mount_path
Union
[str
,Path
],optional
Path inside the container where host mount path will be mounted to.
- timeout
int
,optional
Time limit for the Fluent container to start, in seconds. By default, 30 seconds.
- port
int
,optional
Port for Fluent container to use.
- license_server
str
,optional
License server for Ansys Fluent to use.
- container_server_info_file
Union
[str
,Path
],optional
Name of the server information file for Fluent to write on the
host_mount_path
.- remove_server_info_filebool,
optional
Defaults to True, and automatically deletes the server information file after PyFluent has finished using it.
- fluent_image
str
,optional
Specifies full image name for Docker container run, with the format
"image_name:image_tag"
.image_tag
andimage_name
are ignored iffluent_image
has been specified.- image_name
str
,optional
Ignored if
fluent_image
has been specified.- image_tag
str
,optional
Ignored if
fluent_image
has been specified.- **container_dict
Additional keyword arguments can be specified, they will be treated as Docker container run options to be passed directly to the Docker run execution. See examples below and Docker run documentation.
- args
- Returns:
Notes
This function should usually not be called directly, it will be automatically used by
launch_fluent()
instead.For a list of additional Docker container run configuration options that can also be specified using
container_dict
, see Docker run documentation.
- ansys.fluent.core.launcher.fluent_container.start_fluent_container(args, container_dict=None)#
Start a Fluent container.
- Parameters:
- Returns:
Notes
See also
configure_container_dict()
.