Skip to content
Closed
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
97 changes: 49 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
DOC_BUILD_SYC_VERSION: 25_2
FLUENT_IMAGE_VERSION: "v25.2.0"
SYC_IMAGE_VERSION: "v25.2.0"
MAPDL_IMAGE_VERSION: "v25.1-ubuntu"
MAPDL_IMAGE_VERSION: "v25.1-ubuntu-cicd"

permissions: {} # Zero permissions can be granted at the workflow level if not all jobs require permissions.
# As a good rule of thumb, this normally includes jobs that don't use secrets.
Expand Down Expand Up @@ -116,25 +116,25 @@ jobs:
username: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
password: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}

- name: Generate API for v231
uses: ./.github/actions/generate-api
with:
image-tag: v23.1.0
# - name: Generate API for v231
# uses: ./.github/actions/generate-api
# with:
# image-tag: v23.1.0

- name: Generate API for v232
uses: ./.github/actions/generate-api
with:
image-tag: v23.2.0
# - name: Generate API for v232
# uses: ./.github/actions/generate-api
# with:
# image-tag: v23.2.0

- name: Generate API for v241
uses: ./.github/actions/generate-api
with:
image-tag: v24.1.0
# - name: Generate API for v241
# uses: ./.github/actions/generate-api
# with:
# image-tag: v24.1.0

- name: Generate API for v242
uses: ./.github/actions/generate-api
with:
image-tag: v24.2.0
# - name: Generate API for v242
# uses: ./.github/actions/generate-api
# with:
# image-tag: v24.2.0

- name: Generate API for v251
uses: ./.github/actions/generate-api
Expand Down Expand Up @@ -198,37 +198,37 @@ jobs:
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}

- name: Unit Test v23.1.0
uses: ./.github/actions/unit-test
with:
image-tag: v23.1.0
upload-coverage: false

- name: Unit Test v23.2.0
uses: ./.github/actions/unit-test
with:
image-tag: v23.2.0
upload-coverage: false

- name: Unit Test v24.1.0
uses: ./.github/actions/unit-test
with:
image-tag: v24.1.0
upload-coverage: false

- name: Unit Test v24.2.0
uses: ./.github/actions/unit-test
with:
image-tag: v24.2.0
upload-coverage: false

- name: Unit Test v25.1.0
uses: ./.github/actions/unit-test
with:
image-tag: v25.1.0
upload-coverage: false
env:
ANSYSLMD_LICENSE_FILE: "1055@${{ secrets.LICENSE_SERVER }}"
# - name: Unit Test v23.1.0
# uses: ./.github/actions/unit-test
# with:
# image-tag: v23.1.0
# upload-coverage: false

# - name: Unit Test v23.2.0
# uses: ./.github/actions/unit-test
# with:
# image-tag: v23.2.0
# upload-coverage: false

# - name: Unit Test v24.1.0
# uses: ./.github/actions/unit-test
# with:
# image-tag: v24.1.0
# upload-coverage: false

# - name: Unit Test v24.2.0
# uses: ./.github/actions/unit-test
# with:
# image-tag: v24.2.0
# upload-coverage: false

# - name: Unit Test v25.1.0
# uses: ./.github/actions/unit-test
# with:
# image-tag: v25.1.0
# upload-coverage: false
# env:
# ANSYSLMD_LICENSE_FILE: "1055@${{ secrets.LICENSE_SERVER }}"

- name: Unit Test v25.2.0
uses: ./.github/actions/unit-test
Expand All @@ -250,6 +250,7 @@ jobs:
name: Build Documentation
needs: [doc-style, build]
runs-on: public-ubuntu-latest-8-cores
#if: false #temp disable docs build
permissions:
contents: write
packages: read
Expand Down
23 changes: 23 additions & 0 deletions src/ansys/systemcoupling/core/client/grpc_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,17 +387,40 @@ def execute_command(self, cmd_name, **kwargs):

See also ``__getattr__``.
"""
print(f"about to execute command {cmd_name} with args {kwargs}")

def make_arg(name, val):
arg = command_pb2.CommandRequest.Argument()
arg.name = name
to_variant(val, arg.val)
return arg

def print_license_debug_files():
import glob

# Look in current directory for files named licdebug.* and ansyscl*
licdebug_files = glob.glob("licdebug.*")
ansyscl_files = glob.glob("ansyscl*")
if licdebug_files or ansyscl_files:
msg = "\n\nLicense debug files found in current directory:\n"
for f in licdebug_files + ansyscl_files:
# Print file contents to the console
msg += f"\nContents of {f}:\n"
with open(f, "r") as file:
msg += file.read()
else:
msg = "\n\nNo license debug files found in current directory."

print(msg)

request = command_pb2.CommandRequest(command=cmd_name)
request.args.extend([make_arg(name, val) for name, val in kwargs.items()])
response, meta = self.__command_service.execute_command(request)

if cmd_name == "Solve":
print("After successful Solve command")
print_license_debug_files()

# The second element of the above tuple (which is actually gRPC
# trailing metadata) is currently unused, but it comprises a 1-tuple
# containing a pair value, ('nosync', 'True'|'False').
Expand Down
17 changes: 17 additions & 0 deletions src/ansys/systemcoupling/core/client/services/command_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,25 @@ def __init__(self, channel):

def execute_command(self, request):
try:
print("about to call execute_command in CommandQueryService")
response, call = self.__stub.InvokeCommand.with_call(request)
return response, call.trailing_metadata()
except grpc.RpcError as rpc_error:
print("caught rpc error")
msg = handle_rpc_error(rpc_error)
if "License check" in msg:
import glob

# Look in current directory for files named licdebug.* and ansyscl*
licdebug_files = glob.glob("licdebug.*")
ansyscl_files = glob.glob("ansyscl*")
if licdebug_files or ansyscl_files:
msg += "\n\nLicense debug files found in current directory:\n"
for f in licdebug_files + ansyscl_files:
# Print file contents to the console
msg += f"\nContents of {f}:\n"
with open(f, "r") as file:
msg += file.read()
else:
msg += "\n\nNo license debug files found in current directory."
raise RuntimeError(msg) from None
20 changes: 20 additions & 0 deletions src/ansys/systemcoupling/core/client/services/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,29 @@ def __init__(self, channel):
def solve(self):
request = solution_pb2.SolveRequest()
try:
print("about to call solve")
self.__stub.Solve(request)
except grpc.RpcError as rpc_error:
print("caught rpc error")
msg = handle_rpc_error(rpc_error)

if "License check" in msg:
import glob

# Look in current directory for files named licdebug.* and ansyscl*

licdebug_files = glob.glob("licdebug.*")
ansyscl_files = glob.glob("ansyscl*")
if licdebug_files or ansyscl_files:
msg += "\n\nLicense debug files found in current directory:\n"
for f in licdebug_files + ansyscl_files:
# Print file contents to the console
msg += f"\nContents of {f}:\n"
with open(f, "r") as file:
msg += file.read()
else:
msg += "\n\nNo license debug files found in current directory."

raise RuntimeError(msg) from None

def interrupt(self, reason):
Expand Down
16 changes: 13 additions & 3 deletions src/ansys/systemcoupling/core/client/syc_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,23 @@ def start_container(
idx = run_args.index("-p")
run_args.insert(idx, container_user)
run_args.insert(idx, "--user")
# Licensing can't log to default location if user is not the default 'root'
run_args.insert(idx, f"ANSYSLC_APPLOGDIR={mounted_to}")
run_args.insert(idx, "-e")

# This is especially necessary in the SYC_CONTAINER_USER case
# because licensing can't log to default location if user is
# not the default 'root'. However it might also be useful
# in other cases to help diagnose license problems as it makes
# the log files accessible on host.
idx = run_args.index("-p")
run_args.insert(idx, f"ANSYSLC_APPLOGDIR={mounted_to}")
run_args.insert(idx, "-e")

license_server = os.getenv("ANSYSLMD_LICENSE_FILE")
if license_server:
idx = run_args.index("-e")
run_args.insert(idx, "ANSYSCL_TIMEOUT_RESPONSE=300")
run_args.insert(idx, "-e")
run_args.insert(idx, "ANSYSLI_TIMEOUT_FLEXLM=60")
run_args.insert(idx, "-e")
run_args.insert(idx, f"ANSYSLMD_LICENSE_FILE={license_server}")
run_args.insert(idx, "-e")

Expand Down