diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml
index d802ce232..008c42026 100644
--- a/.github/workflows/ci_cd.yml
+++ b/.github/workflows/ci_cd.yml
@@ -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:
@@ -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
@@ -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
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index f617ab3fc..7eb58db9a 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -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:
@@ -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
@@ -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
@@ -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
diff --git a/.gitignore b/.gitignore
index c0ba8cc93..958366d9a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -162,4 +162,5 @@ cython_debug/
doc/source/api/schemas
test_results*.xml
mapdl_motorbike_frame.zip
-examples/mapdl_motorbike_frame/task_input_file*
\ No newline at end of file
+examples/mapdl_motorbike_frame/task_input_file*
+build_info.*
\ No newline at end of file
diff --git a/README.rst b/README.rst
index e77ac214f..967b9122d 100644
--- a/README.rst
+++ b/README.rst
@@ -47,7 +47,7 @@ Documentation and issues
------------------------
Documentation for the latest stable release of PyHPS is hosted at
-`PyHPS documentation `_.
+`PyHPS documentation `_.
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
@@ -56,16 +56,16 @@ released versions.
The PyHPS documentation contains these sections:
-- `Getting started `_: Explains
+- `Getting started `_: Explains
how to install PyHPS in user mode.
-- `User guide `_: Describes the basics
+- `User guide `_: Describes the basics
of how to use PyHPS to interact with Ansys HPS.
-- `Examples `_: Provides examples of how
+- `Examples `_: Provides examples of how
to interact with a Remote Execution Platform (REP) server in Python using PyHPS.
-- `API reference `_: Describes PyHPS functions,
+- `API reference `_: Describes PyHPS functions,
classes, methods, and their parameters and return values so that you can understand how to
interact with them programmatically
-- `Contribute _`: Provides information on
+- `Contribute _`: Provides information on
how to install PyHPS in developer mode and make contributions to the codebase.
On the `PyHPS Issues `_ page, you can
diff --git a/doc/source/examples/index.rst b/doc/source/examples/index.rst
index 1a17be605..9a33aecdc 100644
--- a/doc/source/examples/index.rst
+++ b/doc/source/examples/index.rst
@@ -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
@@ -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.
diff --git a/examples/cfx_static_mixer/project_setup.py b/examples/cfx_static_mixer/project_setup.py
index d87e91db8..56a145dbe 100644
--- a/examples/cfx_static_mixer/project_setup.py
+++ b/examples/cfx_static_mixer/project_setup.py
@@ -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()
@@ -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
)
diff --git a/examples/fluent_2d_heat_exchanger/project_setup.py b/examples/fluent_2d_heat_exchanger/project_setup.py
index 71ca335fd..78827930e 100644
--- a/examples/fluent_2d_heat_exchanger/project_setup.py
+++ b/examples/fluent_2d_heat_exchanger/project_setup.py
@@ -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
@@ -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()
@@ -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,
diff --git a/examples/fluent_nozzle/project_setup.py b/examples/fluent_nozzle/project_setup.py
index fd20cbc03..00e6116a2 100644
--- a/examples/fluent_nozzle/project_setup.py
+++ b/examples/fluent_nozzle/project_setup.py
@@ -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()
@@ -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
)
diff --git a/examples/lsdyna_cylinder_plate/lsdyna_job.py b/examples/lsdyna_cylinder_plate/lsdyna_job.py
index 1526ab859..af193b918 100644
--- a/examples/lsdyna_cylinder_plate/lsdyna_job.py
+++ b/examples/lsdyna_cylinder_plate/lsdyna_job.py
@@ -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)
@@ -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]
diff --git a/examples/mapdl_linked_analyses/project_setup.py b/examples/mapdl_linked_analyses/project_setup.py
index 4d14f60bd..53d6c2fdc 100644
--- a/examples/mapdl_linked_analyses/project_setup.py
+++ b/examples/mapdl_linked_analyses/project_setup.py
@@ -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:
@@ -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__)
diff --git a/examples/mapdl_motorbike_frame/project_query.py b/examples/mapdl_motorbike_frame/project_query.py
index 78bc33356..bd7690e85 100644
--- a/examples/mapdl_motorbike_frame/project_query.py
+++ b/examples/mapdl_motorbike_frame/project_query.py
@@ -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()
@@ -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)
diff --git a/examples/mapdl_motorbike_frame/project_setup.py b/examples/mapdl_motorbike_frame/project_setup.py
index dac5de66c..d9306ef09 100644
--- a/examples/mapdl_motorbike_frame/project_setup.py
+++ b/examples/mapdl_motorbike_frame/project_setup.py
@@ -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()
@@ -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,
diff --git a/examples/mapdl_motorbike_frame/task_files.py b/examples/mapdl_motorbike_frame/task_files.py
index 9215d3fa9..d2b7b5277 100644
--- a/examples/mapdl_motorbike_frame/task_files.py
+++ b/examples/mapdl_motorbike_frame/task_files.py
@@ -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()
@@ -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:
diff --git a/examples/mapdl_tyre_performance/project_setup.py b/examples/mapdl_tyre_performance/project_setup.py
index 61f1b16aa..cfd231ba8 100644
--- a/examples/mapdl_tyre_performance/project_setup.py
+++ b/examples/mapdl_tyre_performance/project_setup.py
@@ -264,8 +264,8 @@ def create_project(
parser.add_argument("-j", "--num-jobs", type=int, default=10)
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()
@@ -277,7 +277,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,
diff --git a/examples/python_linked_multi_process_step/project_setup.py b/examples/python_linked_multi_process_step/project_setup.py
index 1c958bd14..582a8eb85 100644
--- a/examples/python_linked_multi_process_step/project_setup.py
+++ b/examples/python_linked_multi_process_step/project_setup.py
@@ -203,8 +203,8 @@ def main(client, num_task_definitions, num_jobs, start, inactive):
parser = argparse.ArgumentParser()
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("-j", "--num-jobs", type=int, default=10)
parser.add_argument("-t", "--num-task-definitions", type=int, default=3)
parser.add_argument("-f", "--start", type=float, default=10.0)
diff --git a/examples/python_multi_process_step/project_setup.py b/examples/python_multi_process_step/project_setup.py
index 5d5f14c59..864d1f726 100644
--- a/examples/python_multi_process_step/project_setup.py
+++ b/examples/python_multi_process_step/project_setup.py
@@ -289,8 +289,8 @@ def main(
parser = argparse.ArgumentParser()
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("-n", "--num-jobs", type=int, default=10)
parser.add_argument("-t", "--num-task-definitions", type=int, default=3)
parser.add_argument("-d", "--duration", type=int, default=10)
diff --git a/examples/python_two_bar_truss_problem/project_setup.py b/examples/python_two_bar_truss_problem/project_setup.py
index 05088c0e6..e15c2ec7a 100644
--- a/examples/python_two_bar_truss_problem/project_setup.py
+++ b/examples/python_two_bar_truss_problem/project_setup.py
@@ -286,8 +286,8 @@ def main(client, num_jobs, use_exec_script) -> Project:
if __name__ == "__main__":
parser = argparse.ArgumentParser()
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("-n", "--num-jobs", type=int, default=50)
parser.add_argument("-es", "--use-exec-script", default=False, action="store_true")
diff --git a/generate_resources.py b/generate_resources.py
index 75ca5bdd8..2ec98575a 100644
--- a/generate_resources.py
+++ b/generate_resources.py
@@ -46,22 +46,6 @@
"class": "Algorithm",
"resource_filename": "algorithm",
},
- {
- "schema": "EvaluatorConfigurationUpdateSchema",
- "schema_filename": "evaluator",
- "rest_name": None,
- "additional_fields": [],
- "class": "EvaluatorConfigurationUpdate",
- "resource_filename": "evaluator",
- },
- {
- "schema": "EvaluatorSchema",
- "schema_filename": "evaluator",
- "rest_name": "evaluators",
- "additional_fields": [],
- "class": "Evaluator",
- "resource_filename": "evaluator",
- },
{
"schema": "FileSchema",
"schema_filename": "file",
diff --git a/src/ansys/hps/client/auth/api/auth_api.py b/src/ansys/hps/client/auth/api/auth_api.py
index 81c027c76..59d3ce537 100644
--- a/src/ansys/hps/client/auth/api/auth_api.py
+++ b/src/ansys/hps/client/auth/api/auth_api.py
@@ -49,7 +49,7 @@ class AuthApi:
>>> from ansys.hps.client import Client
>>> from ansys.hps.client.auth import AuthApi, User
>>> cl = Client(
- ... url="https://127.0.0.1:8443/rep/", username="repadmin", password="repadmin"
+ ... url="https://127.0.0.1:8443/hps", username="repuser", password="repuser"
... )
>>> auth_api = AuthApi(cl)
>>> users = auth_api.get_users(firstName="john", exact=False)
diff --git a/src/ansys/hps/client/exceptions.py b/src/ansys/hps/client/exceptions.py
index 5a274e09e..b099ce652 100644
--- a/src/ansys/hps/client/exceptions.py
+++ b/src/ansys/hps/client/exceptions.py
@@ -26,7 +26,7 @@
class HPSError(RequestException):
def __init__(self, *args, **kwargs):
- """Provides the base class for all REP-related errors.
+ """Provides the base class for all HPS-related errors.
This class derives from the :class:`requests.exceptions.RequestException`
base class.
@@ -35,12 +35,12 @@ def __init__(self, *args, **kwargs):
>>> from ansys.hps.client import HPSError
>>> from ansys.hps.client.jms import Client
>>> try:
- >>> client = Client(url="https://127.0.0.1:8443/rep/",
- username="repadmin",
+ >>> client = Client(url="https://127.0.0.1:8443/hps/",
+ username="repuser",
password="wrong_psw")
>>> except HPSError as e:
>>> print(e)
- 401 Client Error: invalid_grant for: POST https://127.0.0.1:8443/rep/auth...
+ 401 Client Error: invalid_grant for: POST https://127.0.0.1:8443/hps/auth...
Invalid user credentials
"""
self.reason = kwargs.pop("reason", None)
diff --git a/src/ansys/hps/client/jms/__init__.py b/src/ansys/hps/client/jms/__init__.py
index 384214900..49461279a 100644
--- a/src/ansys/hps/client/jms/__init__.py
+++ b/src/ansys/hps/client/jms/__init__.py
@@ -25,8 +25,6 @@
from .resource import (
Algorithm,
BoolParameterDefinition,
- Evaluator,
- EvaluatorConfigurationUpdate,
File,
FitnessDefinition,
FitnessTermDefinition,
diff --git a/src/ansys/hps/client/jms/api/jms_api.py b/src/ansys/hps/client/jms/api/jms_api.py
index c97218f31..f64073802 100644
--- a/src/ansys/hps/client/jms/api/jms_api.py
+++ b/src/ansys/hps/client/jms/api/jms_api.py
@@ -57,7 +57,7 @@ class JmsApi(object):
>>> from ansys.hps.client import Client
>>> from ansys.hps.client.jms import JmsApi, Project
>>> cl = Client(
- ... url="https://127.0.0.1:8443/rep", username="repadmin", password="repadmin"
+ ... url="https://127.0.0.1:8443/hps", username="repuser", password="repuser"
... )
>>> jms_api = JmsApi(cl)
>>> project = jms_api.create_project(Project(name="Example Project"))
diff --git a/src/ansys/hps/client/jms/api/project_api.py b/src/ansys/hps/client/jms/api/project_api.py
index 229396dc1..718088541 100644
--- a/src/ansys/hps/client/jms/api/project_api.py
+++ b/src/ansys/hps/client/jms/api/project_api.py
@@ -69,7 +69,7 @@ class ProjectApi:
>>> from ansys.hps.client import Client
>>> from ansys.hps.client.jms import JmsApi, Project, ProjectApi
>>> cl = Client(
- ... url="https://127.0.0.1:8443/rep", username="repadmin", password="repadmin"
+ ... url="https://127.0.0.1:8443/hps", username="repuser", password="repuser"
... )
>>> project = Project(name="Example Project")
>>> print(project)
@@ -89,7 +89,7 @@ class ProjectApi:
}
>>> project_api = ProjectApi(cl, project.id)
>>> print(project_api)
- 'https://127.0.0.1:8443/rep/jms/api/v1/projects/02qtyJfpfAQ0fr3zkoIAfC'
+ 'https://127.0.0.1:8443/hps/jms/api/v1/projects/02qtyJfpfAQ0fr3zkoIAfC'
>>> jobs = project_api.get_jobs()
"""
diff --git a/src/ansys/hps/client/jms/resource/__init__.py b/src/ansys/hps/client/jms/resource/__init__.py
index 80c7c525d..0c0a57368 100644
--- a/src/ansys/hps/client/jms/resource/__init__.py
+++ b/src/ansys/hps/client/jms/resource/__init__.py
@@ -21,7 +21,6 @@
# SOFTWARE.
"""PyHPS JMS resource subpackage."""
from .algorithm import Algorithm
-from .evaluator import Evaluator, EvaluatorConfigurationUpdate
from .file import File
from .fitness_definition import FitnessDefinition, FitnessTermDefinition
from .job import Job
diff --git a/src/ansys/hps/client/jms/resource/evaluator.py b/src/ansys/hps/client/jms/resource/evaluator.py
deleted file mode 100644
index c45f44ecd..000000000
--- a/src/ansys/hps/client/jms/resource/evaluator.py
+++ /dev/null
@@ -1,171 +0,0 @@
-# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
-# SPDX-License-Identifier: MIT
-#
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-# autogenerated code
-from marshmallow.utils import missing
-
-from ansys.hps.client.common import Object
-
-from ..schema.evaluator import EvaluatorConfigurationUpdateSchema, EvaluatorSchema
-
-
-class EvaluatorConfigurationUpdate(Object):
- """Provides for updating an evaluator configuration resource.
-
- Parameters
- ----------
- id : str, optional
- Unique ID to access the resource, generated internally by the server on creation.
- name : str, optional
- Name of the evaluator.
- applications : list, optional
- max_num_parallel_tasks : int, optional
- loop_interval : float, optional
- working_directory : str, optional
- local_file_cache : bool, optional
- local_file_cache_max_size : int, optional
- task_directory_cleanup : str, optional
- custom_resource_properties : dict, optional
-
- """
-
- class Meta:
- schema = EvaluatorConfigurationUpdateSchema
- rest_name = "None"
-
- def __init__(
- self,
- id=missing,
- name=missing,
- applications=missing,
- max_num_parallel_tasks=missing,
- loop_interval=missing,
- working_directory=missing,
- local_file_cache=missing,
- local_file_cache_max_size=missing,
- task_directory_cleanup=missing,
- custom_resource_properties=missing,
- **kwargs
- ):
- self.id = id
- self.name = name
- self.applications = applications
- self.max_num_parallel_tasks = max_num_parallel_tasks
- self.loop_interval = loop_interval
- self.working_directory = working_directory
- self.local_file_cache = local_file_cache
- self.local_file_cache_max_size = local_file_cache_max_size
- self.task_directory_cleanup = task_directory_cleanup
- self.custom_resource_properties = custom_resource_properties
-
- self.obj_type = self.__class__.__name__
-
-
-EvaluatorConfigurationUpdateSchema.Meta.object_class = EvaluatorConfigurationUpdate
-
-
-class Evaluator(Object):
- """Provides the evaluator resource.
-
- Parameters
- ----------
- id : str, optional
- Unique ID to access the resource, generated internally by the server on creation.
- host_id : str
- Unique ID built from hardware information and the selected configuration information of the
- evaluator.
- name : str, optional
- Name of the evaluator.
- hostname : str, optional
- Name of the host that the evaluator is running on.
- username : str, optional
- HPS user that the evaluator is connected to JMS as.
- platform : str, optional
- Operating system that the evaluator is running on.
- task_manager_type : str, optional
- Type of the task manager used by the evaluator.
- project_server_select : bool, optional
- Whether the evaluator allows server-driven assignment of projects or uses its own
- local settings.
- alive_update_interval : int, optional
- Minimal time in seconds between evaluator registration updates.
- update_time : datetime, optional
- Last time the evaluator updated its registration information. This parameter is used
- to check which evaluators are alive.
- external_access_port : int, optional
- Port number for external access to the evaluator.
- project_assignment_mode : str, optional
- Strategy to use for selecting projects to work on.
- project_list : list
- List of projects that this evaluator should be working on.
- configuration : object, optional
- Evaluator configuration information, including hardware and available applications.
- configuration_updates : EvaluatorConfigurationUpdate, optional
- Changes to the evaluator configurations.
- build_info : dict, optional
- Evaluator's build information.
- """
-
- class Meta:
- schema = EvaluatorSchema
- rest_name = "evaluators"
-
- def __init__(
- self,
- id=missing,
- host_id=missing,
- name=missing,
- hostname=missing,
- username=missing,
- platform=missing,
- task_manager_type=missing,
- project_server_select=missing,
- alive_update_interval=missing,
- update_time=missing,
- external_access_port=missing,
- project_assignment_mode=missing,
- project_list=missing,
- configuration=missing,
- configuration_updates=missing,
- build_info=missing,
- **kwargs
- ):
- self.id = id
- self.host_id = host_id
- self.name = name
- self.hostname = hostname
- self.username = username
- self.platform = platform
- self.task_manager_type = task_manager_type
- self.project_server_select = project_server_select
- self.alive_update_interval = alive_update_interval
- self.update_time = update_time
- self.external_access_port = external_access_port
- self.project_assignment_mode = project_assignment_mode
- self.project_list = project_list
- self.configuration = configuration
- self.configuration_updates = configuration_updates
- self.build_info = build_info
-
- self.obj_type = self.__class__.__name__
-
-
-EvaluatorSchema.Meta.object_class = Evaluator
diff --git a/src/ansys/hps/client/jms/schema/evaluator.py b/src/ansys/hps/client/jms/schema/evaluator.py
deleted file mode 100644
index 87ca2507b..000000000
--- a/src/ansys/hps/client/jms/schema/evaluator.py
+++ /dev/null
@@ -1,149 +0,0 @@
-# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
-# SPDX-License-Identifier: MIT
-#
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
-"""Module providing evaluator configuration update schema."""
-
-import marshmallow
-from marshmallow import fields
-from marshmallow.validate import OneOf
-
-from ansys.hps.client.common import ObjectSchema, RestrictedValue
-
-project_assignment_modes = ["disabled", "all_active", "project_list"]
-
-
-class EvaluatorConfigurationUpdateSchema(ObjectSchema):
- class Meta:
- ordered = True
-
- name = fields.String(allow_none=True)
- applications = fields.List(fields.Dict(), allow_none=True)
- max_num_parallel_tasks = fields.Integer(allow_none=True)
- loop_interval = fields.Float(allow_none=True)
- working_directory = fields.String(allow_none=True)
- local_file_cache = fields.Boolean(allow_none=True)
- local_file_cache_max_size = fields.Integer(allow_none=True)
- task_directory_cleanup = fields.String(
- validate=OneOf(["always", "on_success", "never"]), allow_none=True
- )
- custom_resource_properties = fields.Dict(allow_none=True)
-
-
-class EvaluatorRegistrationConfigurationContextSchema(marshmallow.Schema):
- class Meta:
- unknown = marshmallow.INCLUDE
-
- custom = fields.Dict(allow_none=True, keys=fields.Str(), values=RestrictedValue())
-
-
-class EvaluatorRegistrationConfigurationResourcesSchema(marshmallow.Schema):
- class Meta:
- unknown = marshmallow.INCLUDE
-
- custom = fields.Dict(allow_none=True, keys=fields.Str(), values=RestrictedValue())
-
-
-class EvaluatorRegistrationConfigurationSchema(marshmallow.Schema):
- class Meta:
- unknown = marshmallow.INCLUDE
-
- context = fields.Nested(EvaluatorRegistrationConfigurationContextSchema, allow_none=True)
- resources = fields.Nested(EvaluatorRegistrationConfigurationResourcesSchema, allow_none=True)
-
-
-class EvaluatorSchema(ObjectSchema):
- class Meta:
- ordered = True
-
- host_id = fields.String(
- metadata={
- "description": "Unique identifier built from hardware information and "
- "selected configuration details of an evaluator."
- }
- )
- name = fields.String(allow_none=True, metadata={"description": "Name of the evaluator."})
- hostname = fields.String(
- allow_none=True,
- metadata={"description": "Name of the host on which the evaluator is running."},
- )
- username = fields.String(
- allow_none=True,
- metadata={"description": "HPS user that the evaluator is connected to JMS as."},
- )
- platform = fields.String(
- allow_none=True,
- metadata={"description": "Operating system on which the evaluator is running."},
- )
- task_manager_type = fields.String(
- allow_none=True, metadata={"description": "Type of the task manager used by the evaluator."}
- )
- project_server_select = fields.Bool(
- allow_none=True,
- metadata={
- "description": "Whether the evaluator allows "
- "server-driven assignment of projects or uses "
- "it's own local settings."
- },
- )
- alive_update_interval = fields.Int(
- allow_none=True,
- metadata={
- "description": "Minimal time (in seconds) between evaluator registration updates."
- },
- )
- update_time = fields.DateTime(
- allow_none=True,
- load_only=True,
- metadata={
- "description": "Last time the evaluator updated it's registration details. "
- "Used to check which evaluators are alive."
- },
- )
- external_access_port = fields.Integer(
- allow_none=True,
- metadata={"description": "Port number for external access to the evaluator."},
- )
- project_assignment_mode = fields.String(
- validate=OneOf(project_assignment_modes),
- allow_none=True,
- metadata={"description": "Which strategy to use for selecting projects to work on."},
- )
- project_list = fields.List(
- fields.String,
- metadata={"description": "List of projects on which this evaluator should be working."},
- )
- configuration = fields.Nested(
- EvaluatorRegistrationConfigurationSchema,
- allow_none=True,
- metadata={
- "description": "Details of the evaluator configuration, "
- "including hardware info and available applications."
- },
- )
- configuration_updates = fields.Nested(
- EvaluatorConfigurationUpdateSchema,
- allow_none=True,
- metadata={"description": "Changes to the evaluator configurations."},
- )
- build_info = fields.Dict(
- allow_none=True,
- metadata={"description": "Evaluator's build information."},
- )
diff --git a/tests/conftest.py b/tests/conftest.py
index 1b6c9acbf..7f3f97e07 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -98,3 +98,8 @@ def run_id():
agent_id = os.environ.get("HOSTNAME", "localhost")
build_id = os.environ.get("Build.BuildId", "1")
return f"{agent_id}_{build_id}".lower()
+
+
+@pytest.fixture
+def build_info_path():
+ return os.path.join(os.getcwd(), "build_info.json")
diff --git a/tests/jms/test_project_permissions.py b/tests/jms/test_project_permissions.py
index f32f0a366..42569a29a 100644
--- a/tests/jms/test_project_permissions.py
+++ b/tests/jms/test_project_permissions.py
@@ -127,7 +127,7 @@ def test_modify_project_permissions(client, keycloak_client):
username=user1.username,
password=user_credentials["user1"]["password"],
)
- log.info(f"Client connected at {client1.rep_url} with user {user1.username}")
+ log.info(f"Client connected at {client1.url} with user {user1.username}")
root_api1 = JmsApi(client1)
proj = Project(name=proj_name, priority=1, active=True)
diff --git a/tests/test_services.py b/tests/test_services.py
new file mode 100644
index 000000000..603dd92ca
--- /dev/null
+++ b/tests/test_services.py
@@ -0,0 +1,71 @@
+# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
+# SPDX-License-Identifier: MIT
+#
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+import json
+import logging
+
+import pytest
+
+from ansys.hps.client import Client
+from ansys.hps.client.jms import JmsApi
+from ansys.hps.client.rms import RmsApi
+
+log = logging.getLogger(__name__)
+
+
+@pytest.mark.order(1)
+def test_services(client: Client, build_info_path: str):
+ # make sure services are up and running, print info
+
+ # check jms api
+ jms_api = JmsApi(client)
+ jms_info = jms_api.get_api_info()
+ log.info(f"JMS api info\n{json.dumps(jms_info, indent=2)}")
+ assert "build" in jms_info
+ assert "services" in jms_info
+ assert "auth_url" in jms_info["services"]
+ assert "settings" in jms_info
+ assert "execution_script_bucket" in jms_info["settings"]
+ assert "execution_script_default_bucket" in jms_info["settings"]
+
+ # check file storage api
+ r = client.session.get(f"{client.rep_url}/fs/api/v1")
+ fs_info = r.json()
+ log.info(f"FS api info\n{json.dumps(fs_info, indent=2)}")
+ assert "build" in fs_info
+
+ # check rms api
+ rms_api = RmsApi(client)
+ rms_info = rms_api.get_api_info()
+ log.info(f"RMS api info\n{json.dumps(rms_info, indent=2)}")
+ assert "build" in rms_info
+ assert "version" in rms_info["build"]
+
+ info = {"jms": jms_info, "fs": fs_info, "rms": rms_info}
+ with open(build_info_path, "w") as f:
+ f.write(json.dumps(info, indent=2))
+
+ with open(build_info_path.replace(".json", ".md"), "w") as f:
+ f.write(f"### Build info")
+ f.write(f"\n```json\n")
+ f.write(json.dumps(info, indent=2))
+ f.write(f"\n```")