diff --git a/doc/changelog.d/4656.fixed.md b/doc/changelog.d/4656.fixed.md new file mode 100644 index 000000000000..45725ec145e6 --- /dev/null +++ b/doc/changelog.d/4656.fixed.md @@ -0,0 +1 @@ +Arguments in standalone launcher. diff --git a/src/ansys/fluent/core/launcher/fluent_launcher_options.json b/src/ansys/fluent/core/launcher/fluent_launcher_options.json index 5b059f75a797..cf403b077304 100644 --- a/src/ansys/fluent/core/launcher/fluent_launcher_options.json +++ b/src/ansys/fluent/core/launcher/fluent_launcher_options.json @@ -32,5 +32,9 @@ "scheduler_account": { "type": "str", "fluent_format": " -scheduler_account={}" - } + }, + "insecure_mode": { + "type": "bool", + "fluent_format": " -grpc-allow-remote-host -grpc-insecure-mode" + }, } \ No newline at end of file diff --git a/src/ansys/fluent/core/launcher/standalone_launcher.py b/src/ansys/fluent/core/launcher/standalone_launcher.py index ba845dbf6b9a..ae76dca2a01e 100644 --- a/src/ansys/fluent/core/launcher/standalone_launcher.py +++ b/src/ansys/fluent/core/launcher/standalone_launcher.py @@ -105,6 +105,8 @@ def __init__( topy: str | list | None = None, start_watchdog: bool | None = None, file_transfer_service: Any | None = None, + certificates_folder: str | None = None, + insecure_mode: bool = False, ): """ Launch a Fluent session in standalone mode. @@ -174,6 +176,12 @@ def __init__( GUI-less Fluent sessions started by PyFluent are properly closed when the current Python process ends. file_transfer_service : Any Service for uploading/downloading files to/from the server. + certificates_folder : str, optional + Path to the folder containing TLS certificates for Fluent's gRPC server. + insecure_mode : bool, optional + If True, Fluent's gRPC server will be started in insecure mode without TLS. + This mode is not recommended. For more details on the implications + and usage of insecure mode, refer to the Fluent documentation. Raises ------ @@ -187,6 +195,18 @@ def __init__( """ import ansys.fluent.core as pyfluent + if certificates_folder is None and not insecure_mode: + raise ValueError( + "To launch Fluent in Slurm environment, set `certificates_folder`." + ) + if certificates_folder is not None and insecure_mode: + raise ValueError( + "`certificates_folder` and `insecure_mode` cannot be set at the same time." + ) + + self.certificates_folder = certificates_folder + self.insecure_mode = insecure_mode + locals_ = locals().copy() argvals = { arg: locals_.get(arg) diff --git a/src/ansys/fluent/core/session_utilities.py b/src/ansys/fluent/core/session_utilities.py index d73e9298602f..3ad0573b84b3 100644 --- a/src/ansys/fluent/core/session_utilities.py +++ b/src/ansys/fluent/core/session_utilities.py @@ -85,6 +85,8 @@ def from_install( topy: str | list | None = None, start_watchdog: bool | None = None, file_transfer_service: Any | None = None, + certificates_folder: str | None = None, + insecure_mode: bool = False, ): """ Launch a Fluent session in standalone mode. @@ -152,6 +154,12 @@ def from_install( GUI-less Fluent sessions started by PyFluent are properly closed when the current Python process ends. file_transfer_service : Any Service for uploading/downloading files to/from the server. + certificates_folder : str, optional + Path to the folder containing TLS certificates for Fluent's gRPC server. + insecure_mode : bool, optional + If True, Fluent's gRPC server will be started in insecure mode without TLS. + This mode is not recommended. For more details on the implications + and usage of insecure mode, refer to the Fluent documentation. Raises ------