Skip to content

Commit 2fd67a8

Browse files
committed
Merge branch 'main' into release/0.4
2 parents 9d68fb7 + e994751 commit 2fd67a8

File tree

13 files changed

+234
-105
lines changed

13 files changed

+234
-105
lines changed

.github/workflows/ci_cd.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- main
1010

1111
env:
12-
MAIN_PYTHON_VERSION: '3.9'
12+
MAIN_PYTHON_VERSION: '3.10'
1313
PACKAGE_NAME: 'ansys-dyna-core'
1414
PACKAGE_NAMESPACE: 'ansys.dyna.core'
1515
DOCUMENTATION_CNAME: "dyna.docs.pyansys.com"
@@ -24,7 +24,7 @@ jobs:
2424
name: "Code style"
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: ansys/actions/code-style@v4
27+
- uses: ansys/actions/code-style@v5
2828
with:
2929
python-version: ${{ env.MAIN_PYTHON_VERSION }}
3030

@@ -33,7 +33,7 @@ jobs:
3333
runs-on: ubuntu-latest
3434
steps:
3535
- name: PyAnsys documentation style checks
36-
uses: ansys/actions/doc-style@v4
36+
uses: ansys/actions/doc-style@v5
3737
with:
3838
token: ${{ secrets.GITHUB_TOKEN }}
3939

@@ -87,14 +87,14 @@ jobs:
8787
make -C doc pdf
8888
8989
- name: "Upload html documentation"
90-
uses: actions/upload-artifact@v3
90+
uses: actions/upload-artifact@v4
9191
with:
9292
name: documentation-html
9393
path: doc/_build/html
9494
retention-days: 7
9595

9696
- name: "Upload pdf documentation"
97-
uses: actions/upload-artifact@v3
97+
uses: actions/upload-artifact@v4
9898
with:
9999
name: documentation-pdf
100100
path: doc/_build/latex/*.pdf
@@ -107,9 +107,9 @@ jobs:
107107
108108
- name: "Upload the server logs"
109109
if: always()
110-
uses: actions/upload-artifact@v3
110+
uses: actions/upload-artifact@v4
111111
with:
112-
name: server_output.txt
112+
name: server_output_docs.txt
113113
path: server_output.txt
114114

115115
- name: DPF Logs (on screen)
@@ -126,12 +126,11 @@ jobs:
126126
fail-fast: false
127127
matrix:
128128
os: [windows-latest, ubuntu-latest]
129-
python-version: ['3.8', '3.9', '3.10', '3.11']
129+
python-version: ['3.9', '3.10', '3.11', '3.12']
130130
steps:
131-
- uses: ansys/actions/build-wheelhouse@v4
131+
- uses: ansys/actions/build-wheelhouse@v5
132132
with:
133133
library-name: ${{ env.PACKAGE_NAME }}
134-
library-namespace: ${{ env.PACKAGE_NAMESPACE }}
135134
operating-system: ${{ matrix.os }}
136135
python-version: ${{ matrix.python-version }}
137136

@@ -177,13 +176,13 @@ jobs:
177176
178177
- name: "Upload the server logs"
179178
if: always()
180-
uses: actions/upload-artifact@v3
179+
uses: actions/upload-artifact@v4
181180
with:
182-
name: server_output.txt
181+
name: server_output_tests.txt
183182
path: server_output.txt
184183

185184
- name: "Upload coverage results"
186-
uses: actions/upload-artifact@v3
185+
uses: actions/upload-artifact@v4
187186
with:
188187
name: coverage-html
189188
path: .cov/html
@@ -194,7 +193,7 @@ jobs:
194193
needs: [doc, tests]
195194
runs-on: ubuntu-latest
196195
steps:
197-
- uses: ansys/actions/build-library@v4
196+
- uses: ansys/actions/build-library@v5
198197
with:
199198
library-name: ${{ env.PACKAGE_NAME }}
200199
python-version: ${{ env.MAIN_PYTHON_VERSION }}
@@ -206,14 +205,14 @@ jobs:
206205
runs-on: ubuntu-latest
207206
steps:
208207
- name: "Release to the public PyPI repository"
209-
uses: ansys/actions/release-pypi-public@v4
208+
uses: ansys/actions/release-pypi-public@v5
210209
with:
211210
library-name: ${{ env.PACKAGE_NAME }}
212211
twine-username: "__token__"
213212
twine-token: ${{ secrets.PYPI_TOKEN }}
214213

215214
- name: "Release to GitHub"
216-
uses: ansys/actions/release-github@v4
215+
uses: ansys/actions/release-github@v5
217216
with:
218217
library-name: ${{ env.PACKAGE_NAME }}
219218

@@ -223,7 +222,7 @@ jobs:
223222
runs-on: ubuntu-latest
224223
needs: [build-library]
225224
steps:
226-
- uses: ansys/actions/doc-deploy-dev@v4
225+
- uses: ansys/actions/doc-deploy-dev@v5
227226
with:
228227
cname: ${{ env.DOCUMENTATION_CNAME }}
229228
token: ${{ secrets.GITHUB_TOKEN }}
@@ -234,8 +233,7 @@ jobs:
234233
runs-on: ubuntu-latest
235234
needs: [release]
236235
steps:
237-
- uses: ansys/actions/doc-deploy-stable@v4
236+
- uses: ansys/actions/doc-deploy-stable@v5
238237
with:
239238
cname: ${{ env.DOCUMENTATION_CNAME }}
240239
token: ${{ secrets.GITHUB_TOKEN }}
241-
python-version: ${{ env.MAIN_PYTHON_VERSION }}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Start PyDYNA preprocessing server locally
2+
=========================================
3+
4+
There are two ways to start the PyDYNA preprocessing server
5+
6+
1.Start server manually
7+
-----------------------
8+
9+
* Run this command in the current folder:
10+
11+
.. code:: console
12+
13+
python kwserver.py
14+
15+
2.Start server automatically
16+
----------------------------
17+
18+
Start server on Windows
19+
~~~~~~~~~~~~~~~~~~~~~~~
20+
21+
#. Set environment variable:
22+
23+
.. code:: bash
24+
25+
Variable name: ANSYS_PYDYNA_PRE_SERVER_PATH
26+
variable value: <The file path of this package>
27+
28+
example of variable value: C:\pydyna\ansys-pydyna-pre-server
29+
30+
Start server on Linux
31+
~~~~~~~~~~~~~~~~~~~~~
32+
33+
#. Set environment variable:
34+
35+
.. code:: bash
36+
37+
ANSYS_PYDYNA_PRE_SERVER_PATH=<The file path of this package>
38+
39+
example of variable value: /home/lstc/ansys-pydyna-pre-server
40+
41+
Run an example on the client side
42+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43+
44+
.. code:: bash
45+
46+
hostname = "localhost"
47+
if len(sys.argv) > 1:
48+
hostname = sys.argv[1]
49+
solution = DynaSolution(hostname)
50+
......
51+
52+
#. The function of DynaSolution() can start the preprocessing server automatically.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Start PyDYNA solver server locally
2+
==================================
3+
4+
Prerequisites
5+
-------------
6+
7+
Start server on Windows
8+
~~~~~~~~~~~~~~~~~~~~~~~
9+
10+
#. If you want to start the server on Windows,please ensure that you have installed the ANSYS locally.
11+
12+
Start server on Linux(Centos7)
13+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14+
15+
#. If you want to start the server on Linux,please ensure that you have installed the Open MPI package.
16+
17+
.. code:: bash
18+
19+
yum install openmpi3 openmpi3-dev
20+
21+
#. set environment variable for Open MPI
22+
23+
.. code:: bash
24+
25+
export LD_LIBRARY_PATH=/usr/lib64/openmpi3/lib:$LD_LIBRARY_PATH
26+
export PATH=/usr/lib64/openmpi3/bin:$PATH
27+
28+
29+
There are two ways to start the PyDYNA solver server
30+
====================================================
31+
32+
1.Start server manually
33+
-----------------------
34+
35+
* Run this command in the current folder:
36+
37+
.. code:: console
38+
39+
python server.py
40+
41+
2.Start Server Automatically
42+
----------------------------
43+
44+
Start Server On Windows
45+
~~~~~~~~~~~~~~~~~~~~~~~
46+
47+
#. Set environment variable:
48+
49+
.. code:: bash
50+
51+
Variable name: ANSYS_PYDYNA_SOLVER_SERVER_PATH
52+
variable value: <The file path of this package>
53+
54+
example of variable value: C:\pydyna\ansys-pydyna-solver-server
55+
56+
Start Server on Linux(Centos7)
57+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58+
59+
#. Set environment variable:
60+
61+
.. code:: bash
62+
63+
ANSYS_PYDYNA_SOLVER_SERVER_PATH=<The file path of this package>
64+
65+
example of variable value: /home/lstc/ansys-pydyna-solver-server
66+
67+
Run an example on the client side
68+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69+
70+
.. code:: bash
71+
72+
import ansys.dyna.core.solver as solver
73+
74+
hostname = "localhost"
75+
port = "5000"
76+
dyna=solver.DynaSolver(hostname,port) # connect to the server
77+
dyna.push("./output/ball_plate.k") # push an input file
78+
dyna.start_locally(input = "ball_plate.k",nproc=1)
79+
80+
#. The function of DynaSolver() can start the solver server automatically.

doc/source/getting-started/index.rst

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Both these modules are gRPC enabled and hence need to be run using server-client
1414

1515
Install the client
1616
------------------
17-
The ``ansys.dyna.core`` package supports Python 3.8 through
18-
Python 3.11 on Windows, Linux, and MacOS.
17+
The ``ansys.dyna.core`` package supports Python 3.9 through
18+
Python 3.12 on Windows, Linux, and MacOS.
1919

2020
You should consider installing PyDYNA in a virtual environment.
2121
For more information, see Python's
@@ -66,29 +66,37 @@ PyDYNA by downloading the wheelhouse archive for your corresponding machine
6666
architecture from the `Releases Page <https://github.com/pyansys/pydyna/releases>`_.
6767

6868
Each wheelhouse archive contains all the Python wheels necessary to install
69-
PyDYNA from scratch on Windows and Linux for Python 3.8 through 3.11. You can install
69+
PyDYNA from scratch on Windows and Linux for Python 3.9 through 3.12. You can install
7070
PyDYNA on an isolated system with a fresh Python installation or on a virtual environment.
7171

72-
For example, on Linux with Python 3.8, unzip the wheelhouse archive and install PyDYNA
72+
For example, on Linux with Python 3.9, unzip the wheelhouse archive and install PyDYNA
7373
with these commands:
7474

7575
.. code:: bash
7676
77-
unzip ansys-dyna-core-v0.3.dev0-wheelhouse-Linux-3.8.zip -d wheelhouse
77+
unzip ansys-dyna-core-v0.3.dev0-wheelhouse-Linux-3.9.zip -d wheelhouse
7878
pip install ansys-dyna-core -f wheelhouse --no-index --upgrade --ignore-installed
7979
80-
If you're on Windows with Python 3.8, unzip the wheelhouse archive to a ``wheelhouse``
80+
If you're on Windows with Python 3.9, unzip the wheelhouse archive to a ``wheelhouse``
8181
directory and install PyDYNA using the preceding command.
8282

83-
Install the server
84-
------------------
85-
Currently, PyDYNA server is only supported withing a Docker container.
86-
Future releases support launching the servers directly on local machines as well.
83+
Run PyDYNA Server locally
84+
-------------------------
85+
Launching the servers directly on local machines.
86+
87+
.. include:: ./SERVER_PRE_README.rst
88+
89+
.. include:: ./SERVER_SOLVER_README.rst
90+
91+
Run PyDYNA Server in a Docker container
92+
---------------------------------------
93+
PyDYNA server can be run in a Docker container.
8794

8895
.. include:: ../../../docker/pre/README.rst
8996

9097
.. include:: ../../../docker/solver/README.rst
9198

99+
92100
.. LINKS
93101
.. _pydyna_pypi: https://pypi.org/projects/ansys-dyna-core/
94102
.. _pydyna_repo: https://github.com/ansys/pydyna/

docker/pre/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pydyna-pre service Linux-based Dockerfile
22

3-
FROM python:3.8-slim-buster
3+
FROM python:3.9-slim-buster
44

55
# Define the working directory
66
WORKDIR /server

docker/solver/Dockerfile

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ RUN yum -y install openssh-clients openssh-server bind-utils sudo python3
1717
RUN python3 -m pip install --upgrade pip
1818
RUN python3 -m pip install grpcio
1919
RUN python3 -m pip install grpcio-tools
20+
RUN python3 -m pip install protobuf==4.21.0
2021
#
2122
ENV USER mpirun
2223
ENV HOME /home/mpirun
2324
ENV LD_LIBRARY_PATH /ansys_inc/lib
2425
ENV LSTC_LICENSE network
2526
ENV LSTC_LICENSE_SERVER license
26-
ENV SSHDIR ${HOME}/.ssh/
27+
ENV SSHDIR ${HOME}/.ssh
2728

2829

2930
RUN groupadd ${USER}
@@ -65,10 +66,18 @@ CMD ["/usr/sbin/sshd", "-D"]
6566
ENV PATH /opt/openmpi/bin:${PATH}
6667
RUN echo "export PATH=/opt/openmpi/bin:\${PATH}" >> ${HOME}/.bashrc
6768

68-
ADD ssh/config ${SSHDIR}/config
69-
ADD ssh/id_rsa ${SSHDIR}/id_rsa
70-
ADD ssh/id_rsa.pub ${SSHDIR}/id_rsa.pub
71-
ADD ssh/id_rsa.pub ${SSHDIR}/authorized_keys
69+
#ADD ssh/config ${SSHDIR}/config
70+
#ADD ssh/id_rsa ${SSHDIR}/id_rsa
71+
#ADD ssh/id_rsa.pub ${SSHDIR}/id_rsa.pub
72+
#ADD ssh/id_rsa.pub ${SSHDIR}/authorized_keys
73+
#RUN ssh-keygen -A
74+
75+
76+
RUN ssh-keygen -q -b 2048 -f ${SSHDIR}/id_rsa -N ""
77+
RUN chmod 700 ${SSHDIR} && chmod -R 600 ${SSHDIR}/id_rsa
78+
RUN echo "Host *" > ${SSHDIR}/config
79+
RUN echo " StrictHostKeyChecking no" >> ${SSHDIR}/config
80+
RUN cp ${SSHDIR}/id_rsa.pub ${SSHDIR}/authorized_keys
7281
RUN ssh-keygen -A
7382

7483
RUN chmod -R 600 ${SSHDIR}* && \
@@ -78,11 +87,15 @@ RUN chown -R ${USER}:${USER} ${HOME}
7887

7988
# Copy the openmpi libraries
8089

81-
RUN mkdir -p /opt
82-
COPY mpi /opt/openmpi
90+
RUN yum install -y unzip
91+
COPY mppdyna_docker_centos7.zip .
92+
RUN unzip -qu mppdyna_docker_centos7.zip && rm mppdyna_docker_centos7.zip
93+
RUN mkdir -p /opt/openmpi
94+
RUN cp -r mpi/* /opt/openmpi
95+
RUN chmod -R 777 /opt/openmpi
8396

8497
# The executable will go in /ansys_inc, and the
8598
# ifort runtime libraries in /ansys_inc/lib
8699

87-
COPY docker_dir /ansys_inc
88-
RUN chmod 755 /ansys_inc/server.py
100+
RUN cp -rpu docker_dir/* /ansys_inc/
101+
RUN chmod -R 777 /ansys_inc/

0 commit comments

Comments
 (0)