|
67 | 67 | GEOMETRY_SERVICE_EXE = "Presentation.ApiServerDMS.exe"
|
68 | 68 | """The Windows Geometry Service's filename (DMS)."""
|
69 | 69 |
|
70 |
| -CORE_GEOMETRY_SERVICE_EXE = "Presentation.ApiServerLinux.exe" |
| 70 | +CORE_GEOMETRY_SERVICE_EXE = "Presentation.ApiServerCoreService.exe" |
71 | 71 | """The Windows Geometry Service's filename (Core Service)."""
|
72 | 72 |
|
73 | 73 | DISCOVERY_EXE = "Discovery.exe"
|
@@ -316,6 +316,15 @@ def prepare_and_start_backend(
|
316 | 316 | # Verify that the minimum version is installed.
|
317 | 317 | _check_minimal_versions(product_version, specific_minimum_version)
|
318 | 318 |
|
| 319 | + # If Windows Service is requested, BUT version is not 2025R1 or earlier, we will have |
| 320 | + # to change the backend type to CORE_WINDOWS and throw a warning. |
| 321 | + if backend_type == BackendType.WINDOWS_SERVICE and product_version > 251: |
| 322 | + LOG.warning( |
| 323 | + "DMS Windows Service is not available for Ansys versions 2025R2 and later. " |
| 324 | + "Switching to Core Windows Service." |
| 325 | + ) |
| 326 | + backend_type = BackendType.CORE_WINDOWS |
| 327 | + |
319 | 328 | if server_logs_folder is not None:
|
320 | 329 | # Verify that the user has write permissions to the folder and that it exists.
|
321 | 330 | try:
|
@@ -399,12 +408,29 @@ def prepare_and_start_backend(
|
399 | 408 | # ANS_DSCO_REMOTE_IP should be variable "host" directly, but not working...
|
400 | 409 | env_copy["ANS_DSCO_REMOTE_IP"] = "127.0.0.1" if host == "localhost" else host
|
401 | 410 | env_copy["ANS_DSCO_REMOTE_PORT"] = str(port)
|
402 |
| - env_copy["ANS_DSCO_REMOTE_LOGS_CONFIG"] = "linux" |
403 | 411 | env_copy["P_SCHEMA"] = schema_folder.as_posix()
|
404 | 412 | env_copy["ANSYS_CI_INSTALL"] = cad_integration_folder.as_posix()
|
405 |
| - env_copy[f"ANSYSCL{product_version}_DIR"] = ( |
406 |
| - root_service_folder / "licensingclient" |
407 |
| - ).as_posix() |
| 413 | + if product_version: |
| 414 | + env_copy[f"ANSYSCL{product_version}_DIR"] = ( |
| 415 | + root_service_folder / "licensingclient" |
| 416 | + ).as_posix() |
| 417 | + else: |
| 418 | + # Env var is passed... but no product version is defined. We define all of them. |
| 419 | + # Starting on 251... We can use the values in the enum ApiVersions. |
| 420 | + for version in ApiVersions: |
| 421 | + if version.value < 251: |
| 422 | + continue |
| 423 | + env_copy[f"ANSYSCL{version.value}_DIR"] = ( |
| 424 | + root_service_folder / "licensingclient" |
| 425 | + ).as_posix() |
| 426 | + |
| 427 | + # License server - for Core Geometry Service. If not defined, it will use the default one. |
| 428 | + if "LICENSE_SERVER" in os.environ: |
| 429 | + pass # Do nothing... the user has defined the license server. |
| 430 | + elif "ANSRV_GEO_LICENSE_SERVER" in os.environ: |
| 431 | + env_copy["LICENSE_SERVER"] = os.getenv("ANSRV_GEO_LICENSE_SERVER") |
| 432 | + else: |
| 433 | + env_copy["LICENSE_SERVER"] = os.getenv("ANSYSLMD_LICENSE_FILE", "1055@localhost") |
408 | 434 |
|
409 | 435 | if os.name == "nt":
|
410 | 436 | # Modify the PATH variable to include the path to the Ansys Geometry Core Service
|
@@ -662,9 +688,15 @@ def _get_common_env(
|
662 | 688 |
|
663 | 689 | env_copy[BACKEND_HOST_VARIABLE] = host
|
664 | 690 | env_copy[BACKEND_PORT_VARIABLE] = f"{port}"
|
665 |
| - env_copy[BACKEND_TRACE_VARIABLE] = f"{enable_trace:d}" |
666 | 691 | env_copy[BACKEND_LOG_LEVEL_VARIABLE] = f"{server_log_level}"
|
| 692 | + |
667 | 693 | if server_logs_folder is not None:
|
668 | 694 | env_copy[BACKEND_LOGS_FOLDER_VARIABLE] = f"{server_logs_folder}"
|
669 | 695 |
|
| 696 | + if enable_trace: |
| 697 | + env_copy[BACKEND_TRACE_VARIABLE] = "1" # for backward compatibility |
| 698 | + if server_log_level > 0: |
| 699 | + LOG.warning("Enabling trace mode will override the log level to 0 (Chatterbox).") |
| 700 | + env_copy[BACKEND_LOG_LEVEL_VARIABLE] = "0" |
| 701 | + |
670 | 702 | return env_copy
|
0 commit comments