Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions doc/changelog.d/1841.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
change Core Service path to executable/DLL after renaming
4 changes: 1 addition & 3 deletions doc/source/getting_started/docker/common_docker.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ The Geometry service requires this mandatory environment variable for its use:

You can also specify other optional environment variables:

* ``ENABLE_TRACE``: Whether to set up the trace level for debugging purposes. The default
is ``0``, in which case the trace level is not set up. Options are ``1`` and ``0``.
* ``LOG_LEVEL``: Sets the Geometry service logging level. The default is ``2``, in which case
the logging level is ``INFO``.
the logging level is ``WARNING``.

Here are some terms to keep in mind:

Expand Down
5 changes: 2 additions & 3 deletions docker/linux/coreservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ ENV LD_LIBRARY_PATH=/app:/app/CADIntegration/bin:/app/Native/Linux
ENV ANS_DSCO_REMOTE_PORT=50051
ENV ANS_DSCO_REMOTE_IP="0.0.0.0"
ENV LOG_LEVEL=2
ENV ENABLE_TRACE=0
ENV ANSYSLMD_LICENSE_FILE=""
ENV ANS_DSCO_REMOTE_LOGS_CONFIG="linux"
ENV ANSYS_CI_INSTALL=/app/CADIntegration
ENV P_SCHEMA=/app/Schema/
ENV ANSYSCL251_DIR=/app/licensingclient/
ENV ANSYSCL252_DIR=/app/licensingclient/

# Add container labels
LABEL org.opencontainers.image.authors="ANSYS Inc."
Expand All @@ -44,4 +43,4 @@ LABEL org.opencontainers.image.vendor="ANSYS Inc."
EXPOSE 50051

# Define the entrypoint for the Geometry service
ENTRYPOINT ["dotnet", "/app/Presentation.ApiServerLinux.dll"]
ENTRYPOINT ["dotnet", "/app/Presentation.ApiServerCoreService.dll"]
4 changes: 1 addition & 3 deletions docker/windows/coreservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ RUN setx Path "%Path%;C:\app;C:\app\Native\Windows;C:\app\CADIntegration\bin"
ENV ANS_DSCO_REMOTE_PORT=50051
ENV ANS_DSCO_REMOTE_IP="0.0.0.0"
ENV LOG_LEVEL=2
ENV ENABLE_TRACE=0
ENV ANSYSLMD_LICENSE_FILE=""
ENV ANSYS_CI_INSTALL=C:/app/CADIntegration
ENV P_SCHEMA=C:/app/Schema
ENV ANS_DSCO_REMOTE_LOGS_CONFIG="linux"
ENV ANSYSCL251_DIR=C:/app/licensingclient
ENV ANSYSCL252_DIR=C:/app/licensingclient

Expand All @@ -48,4 +46,4 @@ EXPOSE 50051

# Define the entrypoint for the Geometry service
# hadolint ignore=DL3025
ENTRYPOINT dotnet C:\app\Presentation.ApiServerLinux.dll
ENTRYPOINT dotnet C:\app\Presentation.ApiServerCoreService.dll
44 changes: 38 additions & 6 deletions src/ansys/geometry/core/connection/product_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
GEOMETRY_SERVICE_EXE = "Presentation.ApiServerDMS.exe"
"""The Windows Geometry Service's filename (DMS)."""

CORE_GEOMETRY_SERVICE_EXE = "Presentation.ApiServerLinux.exe"
CORE_GEOMETRY_SERVICE_EXE = "Presentation.ApiServerCoreService.exe"
"""The Windows Geometry Service's filename (Core Service)."""

DISCOVERY_EXE = "Discovery.exe"
Expand Down Expand Up @@ -316,6 +316,15 @@ def prepare_and_start_backend(
# Verify that the minimum version is installed.
_check_minimal_versions(product_version, specific_minimum_version)

# If Windows Service is requested, BUT version is not 2025R1 or earlier, we will have
# to change the backend type to CORE_WINDOWS and throw a warning.
if backend_type == BackendType.WINDOWS_SERVICE and product_version > 251:
LOG.warning(
"DMS Windows Service is not available for Ansys versions 2025R2 and later. "
"Switching to Core Windows Service."
)
backend_type = BackendType.CORE_WINDOWS

if server_logs_folder is not None:
# Verify that the user has write permissions to the folder and that it exists.
try:
Expand Down Expand Up @@ -399,12 +408,29 @@ def prepare_and_start_backend(
# ANS_DSCO_REMOTE_IP should be variable "host" directly, but not working...
env_copy["ANS_DSCO_REMOTE_IP"] = "127.0.0.1" if host == "localhost" else host
env_copy["ANS_DSCO_REMOTE_PORT"] = str(port)
env_copy["ANS_DSCO_REMOTE_LOGS_CONFIG"] = "linux"
env_copy["P_SCHEMA"] = schema_folder.as_posix()
env_copy["ANSYS_CI_INSTALL"] = cad_integration_folder.as_posix()
env_copy[f"ANSYSCL{product_version}_DIR"] = (
root_service_folder / "licensingclient"
).as_posix()
if product_version:
env_copy[f"ANSYSCL{product_version}_DIR"] = (
root_service_folder / "licensingclient"
).as_posix()
else:
# Env var is passed... but no product version is defined. We define all of them.
# Starting on 251... We can use the values in the enum ApiVersions.
for version in ApiVersions:
if version.value < 251:
continue
env_copy[f"ANSYSCL{version.value}_DIR"] = (
root_service_folder / "licensingclient"
).as_posix()

# License server - for Core Geometry Service. If not defined, it will use the default one.
if "LICENSE_SERVER" in os.environ:
pass # Do nothing... the user has defined the license server.
elif "ANSRV_GEO_LICENSE_SERVER" in os.environ:
env_copy["LICENSE_SERVER"] = os.getenv("ANSRV_GEO_LICENSE_SERVER")
else:
env_copy["LICENSE_SERVER"] = os.getenv("ANSYSLMD_LICENSE_FILE", "1055@localhost")

if os.name == "nt":
# Modify the PATH variable to include the path to the Ansys Geometry Core Service
Expand Down Expand Up @@ -662,9 +688,15 @@ def _get_common_env(

env_copy[BACKEND_HOST_VARIABLE] = host
env_copy[BACKEND_PORT_VARIABLE] = f"{port}"
env_copy[BACKEND_TRACE_VARIABLE] = f"{enable_trace:d}"
env_copy[BACKEND_LOG_LEVEL_VARIABLE] = f"{server_log_level}"

if server_logs_folder is not None:
env_copy[BACKEND_LOGS_FOLDER_VARIABLE] = f"{server_logs_folder}"

if enable_trace:
env_copy[BACKEND_TRACE_VARIABLE] = "1" # for backward compatibility
if server_log_level > 0:
LOG.warning("Enabling trace mode will override the log level to 0 (Chatterbox).")
env_copy[BACKEND_LOG_LEVEL_VARIABLE] = "0"

return env_copy
Loading