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
31 changes: 26 additions & 5 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: GitHub CI
on:
workflow_dispatch:
inputs:
hps-version:
description: HPS version to test against
default: '1.0.2'
type: string

pull_request:
push:
tags:
Expand Down Expand Up @@ -61,6 +67,7 @@ jobs:
python-version: ${{ matrix.cfg.python-version }}
toxenv: ${{ matrix.cfg.toxenv }}
runner: ${{ matrix.os }}
hps-version: v${{ inputs.hps-version || '1.0.2' }}

docs:
name: Documentation
Expand Down Expand Up @@ -100,19 +107,33 @@ jobs:
retention-days: 7

smoke-tests:
if: ${{ !(github.event_name == 'push' && contains(github.ref, 'refs/tags')) }}
name: Build and Smoke tests
runs-on: ${{ matrix.os }}
needs: [style]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.10']
steps:
- name: Build wheelhouse and perform smoke test
uses: ansys/actions/build-wheelhouse@v5
with:
library-name: ${{ env.PACKAGE_NAME }}
operating-system: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}

smoke-tests-release:
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
name: Build and Smoke tests for release
runs-on: ${{ matrix.os }}
needs: [style]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
should-release:
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
exclude:
- should-release: false
os: macos-latest
steps:
- name: Build wheelhouse and perform smoke test
uses: ansys/actions/build-wheelhouse@v5
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ on:
runner:
description: Where to run
type: string
required: true
default: 'ubuntu-latest'
hps-version:
description: HPS version to test against
type: string
default: 'v1.0.2'

jobs:

Expand All @@ -37,10 +40,10 @@ jobs:
- uses: dsaltares/fetch-gh-release-asset@master
name: Download Services Artifact
with:
file: 'docker-compose-internal.tar.gz'
target: 'docker-compose-artifact/docker-compose-internal.tar.gz'
file: 'docker-compose-customer.tar.gz'
target: 'docker-compose-artifact/docker-compose-customer.tar.gz'
repo: ansys-internal/rep-deployments
version: 'tags/v1.0.2'
version: tags/${{ inputs.hps-version }}
token: ${{secrets.PYANSYS_CI_BOT_TOKEN}}

- uses: KengoTODA/actions-setup-docker-compose@main
Expand All @@ -57,19 +60,18 @@ jobs:
- name: Start services
run: |
ls -la
tar -xvzf docker-compose-internal.tar.gz
cd docker-compose
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev docker-compose pull
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev LOCALHOST_ADDR=localhost docker-compose up -d keycloak
tar -xvzf docker-compose-customer.tar.gz
cd docker-compose-customer
docker-compose build
docker-compose up -d
echo "Waiting a few sec ..."
sleep 5
FSGATEWAY_TAG=latest-dev JMS_TAG=latest-dev LOCALHOST_ADDR=localhost docker-compose up -d
working-directory: ./docker-compose-artifact

- name: Test with tox
run: tox -e ${{ inputs.toxenv }}-coverage
env:
HPS_TEST_URL: https://localhost:8443/rep
HPS_TEST_URL: https://localhost:8443/hps
HPS_TEST_USERNAME: repadmin
HPS_TEST_PASSWORD: repadmin

Expand All @@ -89,9 +91,13 @@ jobs:
check_name: Test Report ${{ inputs.runner }}:${{ inputs.python-version }}
detailed_summary: true
include_passed: true

- name: Publish services info to summary
if: success() || failure()
run: cat build_info.md >> $GITHUB_STEP_SUMMARY

- name: Stop services
if: always()
run: |
docker-compose down -v
working-directory: ./docker-compose-artifact/docker-compose
working-directory: ./docker-compose-artifact/docker-compose-customer
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,5 @@ cython_debug/
doc/source/api/schemas
test_results*.xml
mapdl_motorbike_frame.zip
examples/mapdl_motorbike_frame/task_input_file*
examples/mapdl_motorbike_frame/task_input_file*
build_info.*
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Documentation and issues
------------------------

Documentation for the latest stable release of PyHPS is hosted at
`PyHPS documentation <https://rep.docs.pyansys.com/dev/>`_.
`PyHPS documentation <https://hps.docs.pyansys.com/version/dev/>`_.

In the upper right corner of the documentation's title bar, there is an option
for switching from viewing the documentation for the latest stable release
Expand All @@ -56,16 +56,16 @@ released versions.

The PyHPS documentation contains these sections:

- `Getting started <https://rep.docs.pyansys.com/dev/getting_started/index.html>`_: Explains
- `Getting started <https://hps.docs.pyansys.com/version/dev/getting_started/index.html>`_: Explains
how to install PyHPS in user mode.
- `User guide <https://rep.docs.pyansys.com/dev/user_guide/index.html>`_: Describes the basics
- `User guide <https://hps.docs.pyansys.com/version/dev/user_guide/index.html>`_: Describes the basics
of how to use PyHPS to interact with Ansys HPS.
- `Examples <https://rep.docs.pyansys.com/dev/examples/index.html>`_: Provides examples of how
- `Examples <https://hps.docs.pyansys.com/version/dev/examples/index.html>`_: Provides examples of how
to interact with a Remote Execution Platform (REP) server in Python using PyHPS.
- `API reference <https://rep.docs.pyansys.com/dev/api/index.html>`_: Describes PyHPS functions,
- `API reference <https://hps.docs.pyansys.com/version/dev/api/index.html>`_: Describes PyHPS functions,
classes, methods, and their parameters and return values so that you can understand how to
interact with them programmatically
- `Contribute <https://rep.docs.pyansys.com/dev/contribute.html>_`: Provides information on
- `Contribute <https://hps.docs.pyansys.com/version/dev/contribute.html>_`: Provides information on
how to install PyHPS in developer mode and make contributions to the codebase.

On the `PyHPS Issues <https://github.com/ansys-internal/pyhps/issues>`_ page, you can
Expand Down
22 changes: 11 additions & 11 deletions doc/source/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Examples
========

The examples in this section show how to interact with a REP server in Python using
The examples in this section show how to interact with an HPS server in Python using
PyHPS. Each example consists of a Python script plus a data file, such as a solver input file.
You can execute many Python scripts with these command-line arguments:

* ``-n``, ``--name``: Name of the REP project
* ``-U``, ``--url``: URL or the REP server (default: https://localhost:8443/rep)
* ``-u``, ``--username``: REP username (default: repadmin)
* ``-p``, ``--password``: REP password (default: repadmin)
* ``-n``, ``--name``: Name of the HPS project
* ``-U``, ``--url``: URL or the HPS server (default: https://localhost:8443/hps)
* ``-u``, ``--username``: HPS username (default: repuser)
* ``-p``, ``--password``: HPS password (default: repuser)
* ``-v``, ``--ansys-version``: Ansys version (default: |ansys_version|)

A link to download the required resources is available on each example page. If
Expand All @@ -37,20 +37,20 @@ one :download:`ZIP file <../../../build/pyhps_examples.zip>`.
* - Name
- Description
* - :ref:`example_mapdl_motorbike_frame`
- Create from scratch a REP project consisting of an Ansys APDL beam model of a tubular steel trellis motorbike frame. This example shows how to create a parameter study and submit design points.
- Create from scratch an HPS project consisting of an Ansys APDL beam model of a tubular steel trellis motorbike frame. This example shows how to create a parameter study and submit design points.
* - :ref:`example_mapdl_motorbike_frame_query`
- Query an existing project and download output files.
* - :ref:`example_mapdl_tire_performance`
- Submit an MAPDL analysis as a single job. Solution convergence and contact tracking files are periodically collected.
* - :ref:`example_mapdl_linked_analyses`
- Submit an MAPDL linked analysis workflow as a multi-task job to the REP server.
- Submit an MAPDL linked analysis workflow as a multi-task job to the HPS server.
* - :ref:`example_lsdyna_job`
- Submit, monitor, and download results of an LS-DYNA job.
* - :ref:`example_fluent_2d_heat_exchanger`
- Submit a Fluent solve job to the REP server.
- Submit a Fluent solve job to the HPS server.
* - :ref:`example_fluent_nozzle`
- Submit a Fluent solve job to the REP server using an execution script.
- Submit a Fluent solve job to the HPS server using an execution script.
* - :ref:`example_cfx_static_mixer`
- Submit a CFX solve job to the REP server using an execution script.
- Submit a CFX solve job to the HPS server using an execution script.
* - :ref:`example_python_two_bar`
- Create a REP project that solves a two-bar truss problem with Python.
- Create an HPS project that solves a two-bar truss problem with Python.
6 changes: 3 additions & 3 deletions examples/cfx_static_mixer/project_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ def create_project(client, name, num_jobs=20, version=__ansys_apps_version__):
parser.add_argument("-n", "--name", type=str, default="cfx_static_mixer")
parser.add_argument("-j", "--num-jobs", type=int, default=1)
parser.add_argument("-U", "--url", default="https://127.0.0.1:8443/rep")
parser.add_argument("-u", "--username", default="repadmin")
parser.add_argument("-p", "--password", default="repadmin")
parser.add_argument("-u", "--username", default="repuser")
parser.add_argument("-p", "--password", default="repuser")
parser.add_argument("-v", "--ansys-version", default=__ansys_apps_version__)
args = parser.parse_args()

Expand All @@ -186,7 +186,7 @@ def create_project(client, name, num_jobs=20, version=__ansys_apps_version__):
try:
log.info("Connect to HPC Platform Services")
client = Client(url=args.url, username=args.username, password=args.password)
log.info(f"HPS URL: {client.rep_url}")
log.info(f"HPS URL: {client.url}")
proj = create_project(
client=client, name=args.name, num_jobs=args.num_jobs, version=args.ansys_version
)
Expand Down
8 changes: 4 additions & 4 deletions examples/fluent_2d_heat_exchanger/project_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def create_project(
log.info(f"Created project '{proj.name}', ID='{proj.id}'")
log.info(
f"You can monitor the job status at "
f"{project_api.client.rep_url}/jms/#/projects/{project_api.project_id}/jobs/{job.id}"
f"{project_api.client.url}/jms/#/projects/{project_api.project_id}/jobs/{job.id}"
)

return proj
Expand All @@ -151,8 +151,8 @@ def create_project(
parser.add_argument("-n", "--name", type=str, default="Fluent 2D Heat Exchanger")
parser.add_argument("-es", "--use-exec-script", default=False, type=bool)
parser.add_argument("-U", "--url", default="https://localhost:8443/rep")
parser.add_argument("-u", "--username", default="repadmin")
parser.add_argument("-p", "--password", default="repadmin")
parser.add_argument("-u", "--username", default="repuser")
parser.add_argument("-p", "--password", default="repuser")
parser.add_argument("-v", "--ansys-version", default=__ansys_apps_version__)

args = parser.parse_args()
Expand All @@ -164,7 +164,7 @@ def create_project(
client = Client(url=args.url, username=args.username, password=args.password)

try:
log.info(f"HPS URL: {client.rep_url}")
log.info(f"HPS URL: {client.url}")
proj = create_project(
client=client,
name=args.name,
Expand Down
6 changes: 3 additions & 3 deletions examples/fluent_nozzle/project_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ def create_project(client, name, num_jobs=20, version=__ansys_apps_version__):
parser.add_argument("-j", "--num-jobs", type=int, default=1)
parser.add_argument("-es", "--use-exec-script", default=True, action="store_true")
parser.add_argument("-U", "--url", default="https://127.0.0.1:8443/rep")
parser.add_argument("-u", "--username", default="repadmin")
parser.add_argument("-p", "--password", default="repadmin")
parser.add_argument("-u", "--username", default="repuser")
parser.add_argument("-p", "--password", default="repuser")
parser.add_argument("-v", "--ansys-version", default=__ansys_apps_version__)
args = parser.parse_args()

Expand All @@ -218,7 +218,7 @@ def create_project(client, name, num_jobs=20, version=__ansys_apps_version__):
try:
log.info("Connect to HPC Platform Services")
client = Client(url=args.url, username=args.username, password=args.password)
log.info(f"HPS URL: {client.rep_url}")
log.info(f"HPS URL: {client.url}")
proj = create_project(
client=client, name=args.name, num_jobs=args.num_jobs, version=args.ansys_version
)
Expand Down
4 changes: 2 additions & 2 deletions examples/lsdyna_cylinder_plate/lsdyna_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def submit_job(use_exec_script=False) -> REPJob:
app_job.project_id = proj.id
app_job.job_definition_id = job_def.id
app_job.job_id = job.id
app_job.rep_url = client.rep_url
app_job.rep_url = client.url
app_job.auth_token = client.refresh_token

tasks = project_api.get_tasks(job_id=job.id)
Expand All @@ -306,7 +306,7 @@ def monitor_job(app_job: REPJob):
time.sleep(2)
log.info(
f"Waiting for job {job.name} to complete "
f"[{client.rep_url}/jms/#/projects/{app_job.project_id}/jobs/{job.id}] ... "
f"[{client.url}/jms/#/projects/{app_job.project_id}/jobs/{job.id}] ... "
)
job = project_api.get_jobs(id=job.id)[0]

Expand Down
6 changes: 3 additions & 3 deletions examples/mapdl_linked_analyses/project_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def create_project(
) -> Project:

log.info("=== HPS connection")
log.info(f"Client connected at {client.rep_url}")
log.info(f"Client connected at {client.url}")

log.info("=== Create new Project")
if incremental:
Expand Down Expand Up @@ -386,8 +386,8 @@ def create_project(
parser.add_argument("-n", "--name", type=str, default="MAPDL Prestress-Modal-Harmonic")
parser.add_argument("-es", "--use-exec-script", default=False, type=bool)
parser.add_argument("-U", "--url", default="https://localhost:8443/rep")
parser.add_argument("-u", "--username", default="repadmin")
parser.add_argument("-p", "--password", default="repadmin")
parser.add_argument("-u", "--username", default="repuser")
parser.add_argument("-p", "--password", default="repuser")
parser.add_argument("--incremental", action="store_true")
parser.add_argument("-v", "--ansys-version", default=__ansys_apps_version__)

Expand Down
6 changes: 3 additions & 3 deletions examples/mapdl_motorbike_frame/project_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ def download_files(client, project_name):
parser.add_argument("-n", "--name", type=str, default="Mapdl Motorbike Frame")
parser.add_argument("-j", "--num-jobs", type=int, default=500)
parser.add_argument("-U", "--url", default="https://127.0.0.1:8443/rep")
parser.add_argument("-u", "--username", default="repadmin")
parser.add_argument("-p", "--password", default="repadmin")
parser.add_argument("-u", "--username", default="repuser")
parser.add_argument("-p", "--password", default="repuser")
args = parser.parse_args()

logger = logging.getLogger()
Expand All @@ -148,7 +148,7 @@ def download_files(client, project_name):
try:
log.info("Connect to HPC Platform Services")
client = Client(url=args.url, username=args.username, password=args.password)
log.info(f"HPS URL: {client.rep_url}")
log.info(f"HPS URL: {client.url}")

query_stats(client=client, project_name=args.name)
download_files(client=client, project_name=args.name)
Expand Down
6 changes: 3 additions & 3 deletions examples/mapdl_motorbike_frame/project_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ def create_project(
parser.add_argument("-j", "--num-jobs", type=int, default=50)
parser.add_argument("-es", "--use-exec-script", default=False, action="store_true")
parser.add_argument("-U", "--url", default="https://127.0.0.1:8443/rep")
parser.add_argument("-u", "--username", default="repadmin")
parser.add_argument("-p", "--password", default="repadmin")
parser.add_argument("-u", "--username", default="repuser")
parser.add_argument("-p", "--password", default="repuser")
parser.add_argument("-v", "--ansys-version", default=__ansys_apps_version__)
args = parser.parse_args()

Expand All @@ -364,7 +364,7 @@ def create_project(
try:
log.info("Connect to HPC Platform Services")
client = Client(url=args.url, username=args.username, password=args.password)
log.info(f"HPS URL: {client.rep_url}")
log.info(f"HPS URL: {client.url}")
proj = create_project(
client=client,
name=args.name,
Expand Down
6 changes: 3 additions & 3 deletions examples/mapdl_motorbike_frame/task_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ def modify_task_files(client, project_name):
parser.add_argument("-n", "--name", type=str, default="mapdl_motorbike_frame")
parser.add_argument("-j", "--num-jobs", type=int, default=500)
parser.add_argument("-U", "--url", default="https://127.0.0.1:8443/rep")
parser.add_argument("-u", "--username", default="repadmin")
parser.add_argument("-p", "--password", default="repadmin")
parser.add_argument("-u", "--username", default="repuser")
parser.add_argument("-p", "--password", default="repuser")
args = parser.parse_args()

logger = logging.getLogger()
Expand All @@ -153,7 +153,7 @@ def modify_task_files(client, project_name):
try:
log.info("Connect to HPC Platform Services")
client = Client(url=args.url, username=args.username, password=args.password)
log.info(f"HPS URL: {client.rep_url}")
log.info(f"HPS URL: {client.url}")

modify_task_files(client=client, project_name=args.name)
except HPSError as e:
Expand Down
Loading