From e942468d2f8bfcdba14dc7c8e8e5745c8cd62192 Mon Sep 17 00:00:00 2001 From: Mainak Kundu Date: Fri, 2 Jun 2023 09:31:52 -0400 Subject: [PATCH 1/2] Set container mount path from env var --- src/ansys/fluent/core/launcher/launcher.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ansys/fluent/core/launcher/launcher.py b/src/ansys/fluent/core/launcher/launcher.py index c9478488e3f2..a546ac97a23a 100644 --- a/src/ansys/fluent/core/launcher/launcher.py +++ b/src/ansys/fluent/core/launcher/launcher.py @@ -672,15 +672,21 @@ def launch_fluent( if meshing_mode: args.append(" -meshing") - save_path = pyfluent.EXAMPLES_PATH + host_mount_path = pyfluent.EXAMPLES_PATH # Check if save path exists - if not os.path.exists(save_path): - os.makedirs(save_path) + if not os.path.exists(host_mount_path): + os.makedirs(host_mount_path) + + container_mount_path = os.getenv( + "PYFLUENT_CONTAINER_MOUNT_PATH", host_mount_path + ) # Assumes the container OS will be able to create the # EXAMPLES_PATH of host OS. With the Fluent docker # container, the following currently works only in linux. - port, password = start_fluent_container(save_path, save_path, args) + port, password = start_fluent_container( + host_mount_path, container_mount_path, args + ) return new_session( fluent_connection=FluentConnection( start_timeout=start_timeout, From f59d6ae974908fe4e8158b2d6dbfb8854c620bde Mon Sep 17 00:00:00 2001 From: Raphael Luciano Date: Fri, 2 Jun 2023 10:05:32 -0400 Subject: [PATCH 2/2] removing comments that are no longer applicable nor necessary --- src/ansys/fluent/core/launcher/launcher.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/ansys/fluent/core/launcher/launcher.py b/src/ansys/fluent/core/launcher/launcher.py index a546ac97a23a..da189d1a37d6 100644 --- a/src/ansys/fluent/core/launcher/launcher.py +++ b/src/ansys/fluent/core/launcher/launcher.py @@ -673,7 +673,6 @@ def launch_fluent( args.append(" -meshing") host_mount_path = pyfluent.EXAMPLES_PATH - # Check if save path exists if not os.path.exists(host_mount_path): os.makedirs(host_mount_path) @@ -681,9 +680,6 @@ def launch_fluent( "PYFLUENT_CONTAINER_MOUNT_PATH", host_mount_path ) - # Assumes the container OS will be able to create the - # EXAMPLES_PATH of host OS. With the Fluent docker - # container, the following currently works only in linux. port, password = start_fluent_container( host_mount_path, container_mount_path, args )