Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit check for minimum ACP version #377

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/ansys/acp/core/_server/launch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

from packaging import version

from ansys.tools.local_product_launcher.config import get_launch_mode_for
from ansys.tools.local_product_launcher.interface import FALLBACK_LAUNCH_MODE_NAME
from ansys.tools.local_product_launcher.launch import launch_product
Expand Down Expand Up @@ -71,4 +73,12 @@ def launch_acp(
)
if timeout is not None:
acp._server.wait(timeout=timeout)
# We can only check the server version after the server has started;
# if the timeout is set to 'None', we skip this check.
MIN_VERSION = "24.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really the point of this PR but TBD: Do we use the ansys installer versions for the pyACP server? Wouldn't it make more sense to have independent versioning that starts at 0 to support continous releases? If I remember correctly this is also the suggested strategy for pyAnsys modules?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the PyAnsys modules should use independent versioning.

For the ACP gRPC server, IMO it makes sense to use the Ansys installer version plus a suffix for continuous release, similar to e.g. the DPF customer portal versions. In that way, the relationship between the versions from continuous release and the version from the unified install is made clear.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greschd Note that the DPF server has a version that is independent of the installer version: https://dpf.docs.pyansys.com/version/stable/getting_started/compatibility.html I have no strong opinions on this topic, but maybe we can quickly discuss in our next scrum.

if version.parse(acp.server_version) < version.parse(MIN_VERSION):
raise RuntimeError(
f"ACP version {acp.server_version} is not supported. "
f"Please use ACP version {MIN_VERSION} or later."
)
return acp
Loading