Skip to content

Commit e9621b2

Browse files
authored
Merge pull request #885 from ansys/fix/adapt_to_service_pack
Release 0.1.1 - Backport #808, #880, #884 to the `0.1` release. - Update the poetry lockfile.
2 parents b4e0bd1 + fb6ab17 commit e9621b2

File tree

8 files changed

+784
-357
lines changed

8 files changed

+784
-357
lines changed

.github/workflows/ci_cd.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
os: macos-latest
101101
steps:
102102
- name: "Build wheelhouse and perform smoke test"
103-
uses: ansys/actions/build-wheelhouse@v8
103+
uses: ansys/actions/build-wheelhouse@v10
104104
with:
105105
library-name: ${{ env.PACKAGE_NAME }}
106106
operating-system: ${{ matrix.os }}
@@ -242,11 +242,11 @@ jobs:
242242
server-version: ["latest"]
243243
include:
244244
- python-version: "3.12"
245-
server-version: "2024R2"
245+
server-version: "2024R2SP5"
246246
- python-version: "3.12"
247-
server-version: "2025R1"
247+
server-version: "2025R1SP4"
248248
- python-version: "3.12"
249-
server-version: "2025R2"
249+
server-version: "2025R2SP2"
250250

251251
steps:
252252
- uses: actions/checkout@v4

docker-compose/docker-compose-benchmark.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ services:
99
[
1010
"${PYACP_DELAY:-100ms}",
1111
"${PYACP_RATE:-1mbit}",
12-
"--server-address=0.0.0.0:50051"
12+
"--server-address=0.0.0.0:50051",
13+
"--allow-remote-access" # Access to the server is limited to '127.0.0.1' by the 'port' option below
1314
]
1415
environment:
1516
- ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE}
1617
ports:
17-
- "${PORT_ACP:-50555}:50051"
18+
- "127.0.0.1:${PORT_ACP:-50555}:50051"
1819
working_dir: /home/container/workdir
1920
volumes:
2021
- "acp_data:/home/container/workdir/"
@@ -25,7 +26,7 @@ services:
2526
restart: unless-stopped
2627
image: ${IMAGE_NAME_FILETRANSFER:-ghcr.io/ansys/tools-filetransfer:latest}
2728
ports:
28-
- "${PORT_FILETRANSFER:-50556}:50000"
29+
- "127.0.0.1:${PORT_FILETRANSFER:-50556}:50000"
2930
working_dir: /home/container/workdir
3031
volumes:
3132
- "acp_data:/home/container/workdir/"

docker-compose/docker-compose-extras.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ services:
88
command: ${MAPDL_CMD:--smp -np 1}
99
shm_size: '4gb'
1010
ports:
11-
- "${PYMAPDL_PORT:-50557}:50052"
11+
- "127.0.0.1:${PYMAPDL_PORT:-50557}:50052"
1212
environment:
1313
- ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE}
1414
- ANSYS_LOCK="OFF"
1515
pydpf-composites-server:
1616
restart: unless-stopped
1717
image: ${IMAGE_NAME_DPF_COMPOSITES:-ghcr.io/ansys/pydpf-composites:2023r2_pre1}
1818
ports:
19-
- "${PYDPF_COMPOSITES_DOCKER_CONTAINER_PORT:-50558}:50052"
19+
- "127.0.0.1:${PYDPF_COMPOSITES_DOCKER_CONTAINER_PORT:-50558}:50052"
2020
environment:
2121
- ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE}
2222
- ANSYS_DPF_ACCEPT_LA=${ANSYS_DPF_ACCEPT_LA}

poetry.lock

Lines changed: 746 additions & 339 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "ansys-acp-core"
7-
version = "0.1.0"
7+
version = "0.1.1"
88

99
description = "Python library for ACP - Ansys Composite PrepPost"
1010
readme = "README.rst"
@@ -47,7 +47,7 @@ networkx = ">=3.0.0"
4747
# Optional dependencies which are included in the 'extras' section.
4848
# Update also the 'dev' group when these are updated.
4949
pyvista = { version = ">=0.42.0", optional = true, extras = ["jupyter", "trame"] }
50-
ansys-mapdl-core = { version = ">=0.68.3", optional = true }
50+
ansys-mapdl-core = { version = ">=0.68.3", optional = true, extras = ["graphics"] }
5151
ansys-dpf-composites = { version = ">=0.6", optional = true }
5252
ansys-dpf-core = { version = ">=0.13", optional = true}
5353
ansys-mechanical-core = { version = ">=0.10.0", optional = true }

src/ansys/acp/core/_server/direct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def start(self) -> None:
9898
self._process = subprocess.Popen( # nosec B603: documented in 'security_considerations.rst'
9999
[
100100
self._config.binary_path,
101-
f"--server-address=0.0.0.0:{port}",
101+
f"--server-address=localhost:{port}",
102102
],
103103
stdout=self._stdout,
104104
stderr=self._stderr,

src/ansys/acp/core/_server/docker-compose.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ services:
44
image: ${IMAGE_NAME_ACP:-ghcr.io/ansys/acp:latest}
55
environment:
66
- ANSYSLMD_LICENSE_FILE=${ANSYSLMD_LICENSE_FILE}
7+
command:
8+
- "--server-address=0.0.0.0:50051"
9+
- "--allow-remote-access" # Access to the server is limited to '127.0.0.1' by the 'port' option below
710
ports:
8-
- "${PORT_ACP:-50555}:50051"
11+
- "127.0.0.1:${PORT_ACP:-50555}:50051"
912
working_dir: /home/container/workdir
1013
volumes:
1114
- "acp_data:/home/container/workdir/"
@@ -14,7 +17,7 @@ services:
1417
restart: unless-stopped
1518
image: ${IMAGE_NAME_FILETRANSFER:-ghcr.io/ansys/tools-filetransfer:latest}
1619
ports:
17-
- "${PORT_FILETRANSFER:-50556}:50000"
20+
- "127.0.0.1:${PORT_FILETRANSFER:-50556}:50000"
1821
working_dir: /home/container/workdir
1922
volumes:
2023
- "acp_data:/home/container/workdir/"

src/ansys/acp/core/_tree_objects/_grpc_helpers/mapping.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import inspect
2727
from typing import Any, Concatenate, Generic, TypeVar
2828

29+
import grpc
2930
from grpc import Channel
3031
from packaging.version import parse as parse_version
3132
from typing_extensions import ParamSpec, Self
@@ -225,11 +226,26 @@ def clear(self) -> None:
225226
"""Remove all items from the mapping."""
226227
for obj_info in self._get_objectinfo_list():
227228
with wrap_grpc_errors():
228-
self._stub.Delete(
229-
DeleteRequest(
230-
resource_path=obj_info.info.resource_path, version=obj_info.info.version
229+
try:
230+
self._stub.Delete(
231+
DeleteRequest(
232+
resource_path=obj_info.info.resource_path, version=obj_info.info.version
233+
)
231234
)
232-
)
235+
except grpc.RpcError as e:
236+
# The object version may have changed since the 'List' call,
237+
# since the object may become outdated when other objects are deleted.
238+
# In this case, we need to get the object info again and delete it.
239+
if e.code() == grpc.StatusCode.FAILED_PRECONDITION:
240+
obj_info = self._get_objectinfo_by_id(obj_info.info.id)
241+
self._stub.Delete(
242+
DeleteRequest(
243+
resource_path=obj_info.info.resource_path,
244+
version=obj_info.info.version,
245+
)
246+
)
247+
else:
248+
raise e
233249

234250
def pop(self, key: str) -> CreatableValueT:
235251
"""Remove and return the value for key."""

0 commit comments

Comments
 (0)