Skip to content

Commit f2e63dd

Browse files
committed
Merge branch 'main' into release/0.4
2 parents 2993e5d + 7d9eebb commit f2e63dd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2509
-447
lines changed

.github/workflows/label.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
runs-on: ubuntu-latest
7676
steps:
7777
- name: Suggest to add labels
78-
uses: peter-evans/create-or-update-comment@v3
78+
uses: peter-evans/create-or-update-comment@v4
7979
# Execute only when no labels have been applied to the pull request
8080
if: toJSON(github.event.pull_request.labels.*.name) == '{}'
8181
with:

doc/source/getting-started/SERVER_PRE_README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Run an example on the client side
99
hostname = "localhost"
1010
if len(sys.argv) > 1:
1111
hostname = sys.argv[1]
12-
solution = DynaSolution(hostname)
12+
solution = launch_dynapre(ip = hostname)
1313
......
1414
15-
#. The function of DynaSolution() can download and start the preprocessing server automatically.
15+
#. The function of launch_dynapre() can download and start the preprocessing server automatically.

doc/source/getting-started/SERVER_SOLVER_README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Run an example on the client side
3434
3535
hostname = "localhost"
3636
port = "5000"
37-
dyna=solver.DynaSolver(hostname,port) # connect to the server
37+
dyna=launch_dyna(ip = hostname,port = port) # connect to the server
3838
dyna.push("./output/ball_plate.k") # push an input file
3939
dyna.start_locally(input = "ball_plate.k",nproc=1)
4040

doc/source/getting-started/example.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ the Python file from ``examples/Explicit/ball_plate.py``.
1010
1111
import os
1212
import sys
13-
from ansys.dyna.core.pre.dynasolution import DynaSolution
13+
from ansys.dyna.core.pre import launch_dynapre
1414
from ansys.dyna.core.pre.dynamech import (
1515
DynaMech,
1616
Velocity,
@@ -34,7 +34,7 @@ the Python file from ``examples/Explicit/ball_plate.py``.
3434
hostname = "localhost"
3535
if len(sys.argv) > 1:
3636
hostname = sys.argv[1]
37-
solution = DynaSolution(hostname)
37+
solution = launch_dynapre(ip = hostname)
3838
3939
fns = []
4040
path = examples.ball_plate + os.sep
@@ -98,7 +98,7 @@ you can get the Python file from ``examples/solver/ball_plate_solver.py``.
9898
9999
hostname = "localhost"
100100
port = "5000"
101-
dyna=solver.DynaSolver(hostname,port) # connect to the container
101+
dyna=launch_dyna(ip = hostname,port = port) # connect to the container
102102
dyna.push("./output/ball_plate.k") # push an input file
103103
dyna.start(4) # start 4 ranks of mppdyna
104104
dyna.run("i=ball_plate.k memory=10m ncycle=20000") # begin execution

docker/pre/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Prerequisites
2525
instructions from `this page <https://docs.docker.com/engine/install/>`_.
2626

2727
* Download the latest Linux release artifacts for the ``pre`` Docker container:
28-
`linux-binaries.zip <https://github.com/ansys/pydyna/releases/download/v0.4.3/linux-binaries.zip>`_.
28+
`linux-binaries.zip <https://github.com/ansys/pydyna/releases/download/v0.4.6/linux-binaries.zip>`_.
2929

3030
* Move this ZIP file to the ``docker/pre`` directory.
3131

docker/solver/Dockerfile

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ LABEL "com.ansys.description"="Ansys MPPDYNA with gRPC server"
1313

1414
# install some missing stuff we want/need
1515

16-
RUN yum -y install openssh-clients openssh-server bind-utils sudo python3
17-
RUN python3 -m pip install --upgrade pip
18-
RUN python3 -m pip install grpcio
19-
RUN python3 -m pip install grpcio-tools
20-
RUN python3 -m pip install protobuf==4.21.0
16+
RUN yum -y install openssh-clients openssh-server bind-utils sudo python3 unzip &>/dev/null && yum clean all
17+
RUN python3 -m pip install --upgrade pip && \
18+
python3 -m pip install grpcio && \
19+
python3 -m pip install grpcio-tools && \
20+
python3 -m pip install protobuf==4.21.0
2121
#
2222
ENV USER mpirun
2323
ENV HOME /home/mpirun
@@ -27,16 +27,15 @@ ENV LSTC_LICENSE_SERVER license
2727
ENV SSHDIR ${HOME}/.ssh
2828

2929

30-
RUN groupadd ${USER}
31-
RUN useradd -g ${USER} -d ${HOME} ${USER} && \
30+
RUN groupadd ${USER} && useradd -g ${USER} -d ${HOME} ${USER} && \
3231
echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
3332
#
34-
RUN mkdir -p /ansys_inc/lib
35-
RUN mkdir -p /rundir
36-
RUN mkdir /var/run/sshd
37-
RUN mkdir -p ${SSHDIR}
38-
RUN chown -R ${USER}:${USER} /rundir
39-
RUN chmod -R 755 /rundir
33+
RUN mkdir -p /ansys_inc/lib && \
34+
mkdir -p /rundir && \
35+
mkdir /var/run/sshd && \
36+
mkdir -p ${SSHDIR} && \
37+
chown -R ${USER}:${USER} /rundir && \
38+
chmod -R 755 /rundir
4039
WORKDIR /rundir
4140

4241
# set up the runtime environment variables for
@@ -73,29 +72,28 @@ RUN echo "export PATH=/opt/openmpi/bin:\${PATH}" >> ${HOME}/.bashrc
7372
#RUN ssh-keygen -A
7473

7574

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
81-
RUN ssh-keygen -A
75+
RUN ssh-keygen -q -b 2048 -f ${SSHDIR}/id_rsa -N "" && \
76+
chmod 700 ${SSHDIR} && chmod -R 600 ${SSHDIR}/id_rsa && \
77+
echo "Host *" > ${SSHDIR}/config && \
78+
echo " StrictHostKeyChecking no" >> ${SSHDIR}/config && \
79+
cp ${SSHDIR}/id_rsa.pub ${SSHDIR}/authorized_keys && \
80+
ssh-keygen -A
8281

8382
RUN chmod -R 600 ${SSHDIR}* && \
84-
chown -R ${USER}:${USER} ${SSHDIR}
85-
86-
RUN chown -R ${USER}:${USER} ${HOME}
83+
chown -R ${USER}:${USER} ${SSHDIR} && \
84+
chown -R ${USER}:${USER} ${HOME}
8785

8886
# Copy the openmpi libraries
8987

90-
RUN yum install -y unzip
9188
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
89+
RUN unzip -qu mppdyna_docker_centos7.zip && \
90+
rm mppdyna_docker_centos7.zip && \
91+
mkdir -p /opt/openmpi && \
92+
cp -r mpi/* /opt/openmpi && \
93+
chmod -R 777 /opt/openmpi && \
9694

9795
# The executable will go in /ansys_inc, and the
9896
# ifort runtime libraries in /ansys_inc/lib
9997

100-
RUN cp -rpu docker_dir/* /ansys_inc/
101-
RUN chmod -R 777 /ansys_inc/
98+
cp -rpu docker_dir/* /ansys_inc/ && \
99+
chmod -R 777 /ansys_inc/

docker/solver/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Prerequisites
2525
instructions from `this page <https://docs.docker.com/engine/install/>`_.
2626

2727
* Download the latest Linux release artifacts for the ``solver`` Docker container:
28-
`mppdyna_docker_centos7.zip <https://github.com/ansys/pydyna/releases/download/v0.4.3/mppdyna_docker_centos7.zip>`_.
28+
`mppdyna_docker_centos7.zip <https://github.com/ansys/pydyna/releases/download/v0.4.6/mppdyna_docker_centos7.zip>`_.
2929

3030
* Move this ZIP file to the ``docker/solver`` directory.
3131

examples/Airbag/airbag_deploy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import sys
1515

1616

17-
from ansys.dyna.core.pre.dynasolution import DynaSolution
17+
from ansys.dyna.core.pre import launch_dynapre
1818
from ansys.dyna.core.pre.dynamech import (
1919
DynaMech,
2020
Airbag,
@@ -58,7 +58,7 @@
5858
# The ``DynaSolution`` class is like a workflow orchestrator.
5959
# It inherits methods from other classes and helps create a complete workflow.
6060
#
61-
airbag_solution = DynaSolution(hostname)
61+
airbag_solution = launch_dynapre(ip = hostname)
6262
fns = []
6363
# path = sys.path[0] + os.sep + "input" + os.sep + "airbag_deploy" + os.sep
6464
path = examples.airbag_deploy + os.sep

examples/EM/em_resistive_heating.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import os
1111
import sys
1212

13-
from ansys.dyna.core.pre.dynasolution import DynaSolution
13+
from ansys.dyna.core.pre import launch_dynapre
1414
from ansys.dyna.core.pre.dynaem import (
1515
DynaEM,
1616
NodeSet,
@@ -31,7 +31,7 @@
3131
if len(sys.argv) > 1:
3232
hostname = sys.argv[1]
3333

34-
solution = DynaSolution(hostname)
34+
solution = launch_dynapre(ip = hostname)
3535
fns = []
3636
path = examples.em_resistive_heating + os.sep
3737
fns.append(path + "em_resistive_heating.k")

examples/EM/em_resistive_heating_2d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import os
1010
import sys
1111

12-
from ansys.dyna.core.pre.dynasolution import DynaSolution
12+
from ansys.dyna.core.pre import launch_dynapre
1313
from ansys.dyna.core.pre.dynaem import (
1414
DynaEM,
1515
PartSet,
@@ -32,7 +32,7 @@
3232
if len(sys.argv) > 1:
3333
hostname = sys.argv[1]
3434

35-
solution = DynaSolution(hostname)
35+
solution = launch_dynapre(ip = hostname)
3636
fns = []
3737
path = examples.em_resistive_heating_2d + os.sep
3838
fns.append(path + "em_resistive_heating_2d.k")

0 commit comments

Comments
 (0)