Skip to content

Commit 7ee6b4f

Browse files
mkundu1pyansys-ci-botprmukherjCopilot
authored
fix: Cherry-picked changes to include in version 0.37.1 (#4716)
Cherry-picked changes from the following PRs to include in version 0.37.1: #4660 (Support `PYFLUENT_CONTAINER_INSECURE_MODE` environment variable) #4689 (Fix `from_install` method) #4712 (Always show the insecure gRPC warning) #4670 (Don't allow pop up terminal windows during launch_fluent) --------- Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: Prithwish Mukherjee <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 21e0689 commit 7ee6b4f

File tree

18 files changed

+76
-36
lines changed

18 files changed

+76
-36
lines changed

.github/workflows/doc-build-dev-nightly.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,30 +73,35 @@ jobs:
7373
python examples/00-fluent/exhaust_system_settings_api.py
7474
env:
7575
FLUENT_IMAGE_TAG: ${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}
76+
PYFLUENT_CONTAINER_INSECURE_MODE: 1
7677

7778
- name: Execute external_compressible_flow.py
7879
run: |
7980
python examples/00-fluent/external_compressible_flow.py
8081
env:
8182
FLUENT_IMAGE_TAG: ${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}
83+
PYFLUENT_CONTAINER_INSECURE_MODE: 1
8284

8385
- name: Execute mixing_elbow_settings_api.py
8486
run: |
8587
python examples/00-fluent/mixing_elbow_settings_api.py
8688
env:
8789
FLUENT_IMAGE_TAG: ${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}
90+
PYFLUENT_CONTAINER_INSECURE_MODE: 1
8891

8992
- name: Execute modeling_cavitation.py
9093
run: |
9194
python examples/00-fluent/modeling_cavitation.py
9295
env:
9396
FLUENT_IMAGE_TAG: ${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}
97+
PYFLUENT_CONTAINER_INSECURE_MODE: 1
9498

9599
- name: Execute species_transport.py
96100
run: |
97101
python examples/00-fluent/species_transport.py
98102
env:
99103
FLUENT_IMAGE_TAG: ${{ env.DOC_DEPLOYMENT_IMAGE_TAG }}
104+
PYFLUENT_CONTAINER_INSECURE_MODE: 1
100105

101106
- name: Build All Documentation
102107
run: |
@@ -129,9 +134,12 @@ jobs:
129134

130135
deploy_dev_docs:
131136
name: "Deploy Documentation"
132-
runs-on: ubuntu-latest
137+
runs-on: public-ubuntu-latest-8-cores
133138
needs: [build_dev_docs]
134139
if: github.ref == 'refs/heads/main'
140+
permissions:
141+
contents: write
142+
pull-requests: write
135143
steps:
136144
- name: "Deploy development documentation"
137145
uses: ansys/actions/[email protected]

doc/changelog.d/4660.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Minor improvements of the gRPC feature

doc/changelog.d/4670.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Pop up window for launch fluent.

doc/changelog.d/4689.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
From_install

doc/changelog.d/4712.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Always show the gRPC warning

doc/changelog.d/4716.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cherry-picked changes to include in version 0.37.1

doc/source/contributing/environment_variables.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,6 @@ control the behavior of PyFluent within the same Python process. Please see the
7777
* - REMOTING_SERVER_ADDRESS
7878
- Specifies the IP address of the Fluent server while launching Fluent in :func:`launch_fluent() <ansys.fluent.core.launcher.launcher.launch_fluent>`.
7979
* - SERVER_INFO_DIR
80-
- Specifies the directory where the server-info file is created while launching Fluent in :func:`launch_fluent() <ansys.fluent.core.launcher.launcher.launch_fluent>`.
80+
- Specifies the directory where the server-info file is created while launching Fluent in :func:`launch_fluent() <ansys.fluent.core.launcher.launcher.launch_fluent>`.
81+
* - PYFLUENT_CONTAINER_INSECURE_MODE
82+
- Uses insecure mode when launching Fluent in a container or connecting to a Fluent container.

src/ansys/fluent/core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
from ansys.fluent.core.utils.fluent_version import FluentVersion # noqa: F401
8282
from ansys.fluent.core.utils.setup_for_fluent import setup_for_fluent # noqa: F401
8383

84-
__version__ = "0.37.0"
84+
__version__ = "0.37.1"
8585

8686
_VERSION_INFO = None
8787
"""

src/ansys/fluent/core/docker/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ def _is_grpc_patched(image_tag: str):
3232
"""
3333
Check if the image tag corresponds to a version that patches gRPC.
3434
"""
35+
if image_tag.startswith("sha256:"):
36+
return True
37+
3538
min_patched_versions = {
3639
"v25.2": 3,
3740
"v25.1": 4,

src/ansys/fluent/core/fluent_connection.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
import ansys.fluent.core as pyfluent
4747
from ansys.fluent.core.launcher.launcher_utils import ComposeConfig
48+
from ansys.fluent.core.pyfluent_warnings import InsecureGrpcWarning
4849
from ansys.fluent.core.services import service_creator
4950
from ansys.fluent.core.services.app_utilities import (
5051
AppUtilitiesOld,
@@ -327,7 +328,7 @@ def _get_channel(
327328
"The Fluent session will be connected in insecure gRPC mode. "
328329
"This mode is not recommended. For more details on the implications "
329330
"and usage of insecure mode, refer to the Fluent documentation.",
330-
UserWarning,
331+
InsecureGrpcWarning,
331332
)
332333
return grpc.insecure_channel(address, options=options)
333334
else:
@@ -337,7 +338,8 @@ def _get_channel(
337338
)
338339
return _get_tls_channel(address, certificates_folder, options=options)
339340
else:
340-
if not _is_localhost(address):
341+
insecure_mode_env = os.getenv("PYFLUENT_CONTAINER_INSECURE_MODE") == "1"
342+
if not (_is_localhost(address) or (inside_container and insecure_mode_env)):
341343
raise ValueError(
342344
"Connecting to remote Fluent instances is not allowed. "
343345
"Set 'allow_remote_host=True' to connect to remote hosts."

0 commit comments

Comments
 (0)