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
7 changes: 7 additions & 0 deletions .github/actions/generate-api/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ inputs:
runs:
using: "composite"
steps:
- name: Free up disk space
run: |
echo "Cleaning up disk space"
sudo apt-get clean
docker system prune --all --volumes --force
shell: bash

- name: Pull docker image
run: make docker-pull
shell: bash
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
DOCUMENTATION_CNAME: "systemcoupling.docs.pyansys.com"
DOC_BUILD_SYC_VERSION: 25_2
FLUENT_IMAGE_VERSION: "v25.2.0"
SYC_IMAGE_VERSION: "v25.2.0"
SYC_IMAGE_VERSION: "v25.2.0-sp03"
MAPDL_IMAGE_VERSION: "v25.2-ubuntu-cicd"

permissions: {} # Zero permissions can be granted at the workflow level if not all jobs require permissions.
Expand Down Expand Up @@ -131,20 +131,20 @@ jobs:
with:
image-tag: v24.1.0

- name: Generate API for v242
- name: Generate API for v242 (SP5)
uses: ./.github/actions/generate-api
with:
image-tag: v24.2.0
image-tag: v24.2.0-sp05

- name: Generate API for v251
- name: Generate API for v251 (SP4)
uses: ./.github/actions/generate-api
with:
image-tag: v25.1.0
image-tag: v25.1.0-sp04

- name: Generate API for v252
- name: Generate API for v252 (SP3)
uses: ./.github/actions/generate-api
with:
image-tag: v25.2.0
image-tag: v25.2.0-sp03

#- name: Generate API for latest
# uses: ./.github/actions/generate-api
Expand Down Expand Up @@ -216,24 +216,24 @@ jobs:
image-tag: v24.1.0
upload-coverage: false

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

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

- name: Unit Test v25.2.0
- name: Unit Test v25.2.0 (SP3)
uses: ./.github/actions/unit-test
with:
image-tag: v25.2.0
image-tag: v25.2.0-sp03
upload-coverage: true
env:
ANSYSLMD_LICENSE_FILE: "1055@${{ secrets.LICENSE_SERVER }}"
Expand Down
10 changes: 9 additions & 1 deletion doc/source/api/core/launching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@ of System Coupling.
:toctree: _autosummary

launch
connect
connect

Connection types
================

.. autosummary::
:toctree: _autosummary

ConnectionType
30 changes: 25 additions & 5 deletions src/ansys/systemcoupling/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

import appdirs

from ansys.systemcoupling.core.client.grpc_client import SycGrpc
from ansys.systemcoupling.core.client.grpc_client import SycGrpc, ConnectionType
from ansys.systemcoupling.core.session import Session
from ansys.systemcoupling.core.util.logging import LOG

Expand All @@ -41,6 +41,7 @@

def launch(
*,
connection_type: ConnectionType = ConnectionType.SECURE_LOCAL,
port: int = None,
working_dir: str = None,
nprocs: int = None,
Expand All @@ -53,6 +54,12 @@ def launch(

Parameters
----------
connection_type: ConnectionType, optional
Specifies the type of connection to make with the launched server.
See :class:`ConnectionType` for available options.
Not all options are currently supported. The default is a secure
local connection. This will not work with some older versions or
older versions that have not been updated with service pack releases.
port : int, optional
Port on which to connect to System Coupling. The default is
``None``, in which case an available port is found and used.
Expand All @@ -73,8 +80,10 @@ def launch(
The version will be sought in the standard installation location. The
default is ``None``, which is equivalent to specifying
``"252"`` ("2025 R2" release), unless either of the environment
variables ``SYSC_ROOT`` or ``AWP_ROOT`` has been set. It is considered
to be an error if either these is set *and* ``version`` is provided.
variables ``SYSC_ROOT`` or ``AWP_ROOT`` has been set. In that case,
the environment variable will be used to locate System Coupling.
If ``version`` is also provided, it will not be used to locate System
Coupling but it might still be used to infer some information about it.
start_output: bool, optional
Boolean to specify if the user wants to stream system coupling output.
The default is ``False``, in which case the output stream is kept hidden.
Expand Down Expand Up @@ -102,6 +111,7 @@ def launch(
rpc.start_pim_and_connect(version, start_output)
else:
rpc.start_and_connect(
connection_type=connection_type,
port=port,
working_dir=working_dir,
nprocs=nprocs,
Expand Down Expand Up @@ -163,7 +173,9 @@ def launch_remote(
return Session(rpc)


def connect(host: str, port: int) -> Session: # pragma: no cover
def connect(
host: str, port: int, connection_type: ConnectionType = ConnectionType.SECURE_LOCAL
) -> Session: # pragma: no cover
"""Connect to an instance of System Coupling already running in server mode.

Parameters
Expand All @@ -172,6 +184,14 @@ def connect(host: str, port: int) -> Session: # pragma: no cover
IP address of the system running the System Coupling instance.
port : int
Port on which to connect to System Coupling.
connection_type: ConnectionType, optional
Specifies the type of connection to make with System Coupling.
See :class:`ConnectionType` for available options.
This must be compatible with the mode in which the server was
started. The default is a secure local connection. This will
not work with some older versions of System Coupling or versions
that have not been updated with service pack releases. In these
cases, an insecure connection type must be specified.

Returns
-------
Expand All @@ -180,7 +200,7 @@ def connect(host: str, port: int) -> Session: # pragma: no cover
remote System Coupling instance.
"""
rpc = SycGrpc()
rpc.connect(host, port)
rpc.connect(host, port, connection_type)
syc = Session(rpc)
return syc

Expand Down
Loading