From ea7e899858fb3b29792541bd715a5a8ce770555b Mon Sep 17 00:00:00 2001 From: zhangzhanqun Date: Mon, 18 Dec 2023 08:03:04 +0800 Subject: [PATCH 01/11] fix bug for the docker of dyna-solver server --- src/ansys/dyna/core/solver/dynasolver.py | 29 ++++++++++++------------ 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/ansys/dyna/core/solver/dynasolver.py b/src/ansys/dyna/core/solver/dynasolver.py index 5015283f8..e3d8a2c25 100644 --- a/src/ansys/dyna/core/solver/dynasolver.py +++ b/src/ansys/dyna/core/solver/dynasolver.py @@ -12,7 +12,7 @@ import threading from time import sleep -from ansys.api.dyna.v0 import dynasolver_pb2 +from ansys.api.dyna.v0 import dynasolver_pb2, dynasolver_pb2_grpc import grpc from . import grpc_tags as tag @@ -100,8 +100,8 @@ def __init__(self, hostname, port, server_path=""): logging.critical("Can not connect to Solver Server") sys.exit() logging.info("Connected to Solver Server...") - # self.stub = dynasolver_pb2_grpc.DynaSolverCommStub(self.channel) - self.stub = DynaSolverCommStub(self.channel) + self.stub = dynasolver_pb2_grpc.DynaSolverCommStub(self.channel) + # self.stub = DynaSolverCommStub(self.channel) # if DynaSolver.logger is None: # DynaSolver.logger = logging.getLogger("DynaSolver") # DynaSolver.logger.setLevel(logging.INFO) @@ -304,8 +304,8 @@ def upload(self, fname): def push_packets(fname): nonlocal fsize - # request = dynasolver_pb2.DynaSolverFileData() - request = DynaSolverFileData() + request = dynasolver_pb2.DynaSolverFileData() + # request = DynaSolverFileData() # Only send the base file name, not the whole path! bfname = os.path.split(fname)[1] request.b = bytes(bfname, "utf-8") @@ -314,8 +314,8 @@ def push_packets(fname): blocksize = 1000000 n = blocksize while n == blocksize: - # request = dynasolver_pb2.DynaSolverFileData() - request = DynaSolverFileData() + request = dynasolver_pb2.DynaSolverFileData() + # request = DynaSolverFileData() request.b = fp.read(blocksize) n = len(request.b) fsize = fsize + n @@ -389,8 +389,8 @@ def run(self, args): Command line to pass to LS-DYNA. """ self.logger.debug("run: %s" % args) - # request = dynasolver_pb2.DynaSolverRelay() - request = DynaSolverRelay() + request = dynasolver_pb2.DynaSolverRelay() + # request = DynaSolverRelay() request.tag = tag.RUN request.b = bytes(args, "utf-8") response = self.stub.send_request(request) @@ -424,7 +424,7 @@ def setlc(self, lc, value): self._check_return(response) return - def start(self, nproc, solver_fname=""): + def start(self, nproc): """Start LS-DYNA. The program starts and awaits further input. To begin a @@ -440,10 +440,9 @@ def start(self, nproc, solver_fname=""): Number of cores (MPI ranks) to run. """ self.logger.debug("start: %d" % nproc) - # request = dynasolver_pb2.DynaSolverStart() - request = DynaSolverStart() - # request.exename = b"mppdyna" - request.exename = bytes(solver_fname, "utf-8") + request = dynasolver_pb2.DynaSolverStart() + # request = DynaSolverStart() + request.exename = b"mppdyna" request.nproc = nproc response = self.stub.start_solver(request) if response.status == tag.RUNNING: @@ -460,7 +459,7 @@ def start_locally(self, preset="MPP_DOUBLE", input="", nproc=1, memory=20): """ self.logger.debug("start: %d" % nproc) - request = DynaSolverStartLocal() + request = dynasolver_pb2.DynaSolverStartLocal() request.preset = bytes(preset, "utf-8") request.input = bytes(input, "utf-8") request.nproc = nproc From 7129b806c44b30884871436cbe5b4990de809cc9 Mon Sep 17 00:00:00 2001 From: zhangzhanqun Date: Mon, 18 Dec 2023 08:07:56 +0800 Subject: [PATCH 02/11] update Dockerfile for dyna-solver server --- docker/solver/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/solver/Dockerfile b/docker/solver/Dockerfile index 3e60a31e9..4bdfbb058 100644 --- a/docker/solver/Dockerfile +++ b/docker/solver/Dockerfile @@ -17,6 +17,7 @@ RUN yum -y install openssh-clients openssh-server bind-utils sudo python3 RUN python3 -m pip install --upgrade pip RUN python3 -m pip install grpcio RUN python3 -m pip install grpcio-tools +RUN python3 -m pip install protobuf==4.21.0 # ENV USER mpirun ENV HOME /home/mpirun @@ -85,4 +86,4 @@ COPY mpi /opt/openmpi # ifort runtime libraries in /ansys_inc/lib COPY docker_dir /ansys_inc -RUN chmod 755 /ansys_inc/server.py \ No newline at end of file +RUN chmod 755 /ansys_inc/ \ No newline at end of file From 576a9f657a1d6aa9c523da54ffb95ff96f8d7539 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 09:15:18 +0100 Subject: [PATCH 03/11] build(deps): bump actions/upload-artifact from 3 to 4 (#342) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> --- .github/workflows/ci_cd.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index ea96e9265..4f329bcc8 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -87,14 +87,14 @@ jobs: make -C doc pdf - name: "Upload html documentation" - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: documentation-html path: doc/_build/html retention-days: 7 - name: "Upload pdf documentation" - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: documentation-pdf path: doc/_build/latex/*.pdf @@ -107,9 +107,9 @@ jobs: - name: "Upload the server logs" if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: server_output.txt + name: server_output_docs.txt path: server_output.txt - name: DPF Logs (on screen) @@ -177,13 +177,13 @@ jobs: - name: "Upload the server logs" if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: server_output.txt + name: server_output_tests.txt path: server_output.txt - name: "Upload coverage results" - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-html path: .cov/html From 7050badf739faac7b29b33e4329c69b74dcad04c Mon Sep 17 00:00:00 2001 From: zhangzhanqun <99698565+zhangzhanqun@users.noreply.github.com> Date: Mon, 25 Dec 2023 07:48:46 +0800 Subject: [PATCH 04/11] update solver docker (#344) --- .../getting-started/SERVER_PRE_README.rst | 52 ++++++++++++ .../getting-started/SERVER_SOLVER_README.rst | 80 +++++++++++++++++++ doc/source/getting-started/index.rst | 16 +++- docker/solver/Dockerfile | 30 ++++--- docker/solver/README.rst | 22 ++--- docker/solver/do_build | 15 ---- docker/solver/docker-compose.yml | 5 +- 7 files changed, 180 insertions(+), 40 deletions(-) create mode 100644 doc/source/getting-started/SERVER_PRE_README.rst create mode 100644 doc/source/getting-started/SERVER_SOLVER_README.rst delete mode 100644 docker/solver/do_build diff --git a/doc/source/getting-started/SERVER_PRE_README.rst b/doc/source/getting-started/SERVER_PRE_README.rst new file mode 100644 index 000000000..1731fcc8b --- /dev/null +++ b/doc/source/getting-started/SERVER_PRE_README.rst @@ -0,0 +1,52 @@ +Start PyDYNA preprocessing server locally +========================================= + +There are two ways to start the PyDYNA preprocessing server + +1.Start server manually +----------------------- + +* Run this command in the current folder: + + .. code:: console + + python kwserver.py + +2.Start server automatically +---------------------------- + +Start server on Windows +~~~~~~~~~~~~~~~~~~~~~~~ + +#. Set environment variable: + + .. code:: bash + + Variable name: ANSYS_PYDYNA_PRE_SERVER_PATH + variable value: + + example of variable value: C:\pydyna\ansys-pydyna-pre-server + +Start server on Linux +~~~~~~~~~~~~~~~~~~~~~ + +#. Set environment variable: + + .. code:: bash + + ANSYS_PYDYNA_PRE_SERVER_PATH= + + example of variable value: /home/lstc/ansys-pydyna-pre-server + +Run an example on the client side +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. code:: bash + + hostname = "localhost" + if len(sys.argv) > 1: + hostname = sys.argv[1] + solution = DynaSolution(hostname) + ...... + +#. The function of DynaSolution() can start the preprocessing server automatically. diff --git a/doc/source/getting-started/SERVER_SOLVER_README.rst b/doc/source/getting-started/SERVER_SOLVER_README.rst new file mode 100644 index 000000000..7c2a7ba70 --- /dev/null +++ b/doc/source/getting-started/SERVER_SOLVER_README.rst @@ -0,0 +1,80 @@ +Start PyDYNA solver server locally +================================== + +Prerequisites +------------- + +Start server on Windows +~~~~~~~~~~~~~~~~~~~~~~~ + +#. If you want to start the server on Windows,please ensure that you have installed the ANSYS locally. + +Start server on Linux(Centos7) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +#. If you want to start the server on Linux,please ensure that you have installed the Open MPI package. + + .. code:: bash + + yum install openmpi3 openmpi3-dev + +#. set environment variable for Open MPI + + .. code:: bash + + export LD_LIBRARY_PATH=/usr/lib64/openmpi3/lib:$LD_LIBRARY_PATH + export PATH=/usr/lib64/openmpi3/bin:$PATH + + +There are two ways to start the PyDYNA solver server +==================================================== + +1.Start server manually +----------------------- + +* Run this command in the current folder: + + .. code:: console + + python server.py + +2.Start Server Automatically +---------------------------- + +Start Server On Windows +~~~~~~~~~~~~~~~~~~~~~~~ + +#. Set environment variable: + + .. code:: bash + + Variable name: ANSYS_PYDYNA_SOLVER_SERVER_PATH + variable value: + + example of variable value: C:\pydyna\ansys-pydyna-solver-server + +Start Server on Linux(Centos7) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +#. Set environment variable: + + .. code:: bash + + ANSYS_PYDYNA_SOLVER_SERVER_PATH= + + example of variable value: /home/lstc/ansys-pydyna-solver-server + +Run an example on the client side +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + .. code:: bash + + import ansys.dyna.core.solver as solver + + hostname = "localhost" + port = "5000" + dyna=solver.DynaSolver(hostname,port) # connect to the server + dyna.push("./output/ball_plate.k") # push an input file + dyna.start_locally(input = "ball_plate.k",nproc=1) + +#. The function of DynaSolver() can start the solver server automatically. diff --git a/doc/source/getting-started/index.rst b/doc/source/getting-started/index.rst index dbaa2069c..98f9e43a8 100644 --- a/doc/source/getting-started/index.rst +++ b/doc/source/getting-started/index.rst @@ -80,15 +80,23 @@ with these commands: If you're on Windows with Python 3.8, unzip the wheelhouse archive to a ``wheelhouse`` directory and install PyDYNA using the preceding command. -Install the server ------------------- -Currently, PyDYNA server is only supported withing a Docker container. -Future releases support launching the servers directly on local machines as well. +Run PyDYNA Server locally +------------------------- +Launching the servers directly on local machines. + +.. include:: ./SERVER_PRE_README.rst + +.. include:: ./SERVER_SOLVER_README.rst + +Run PyDYNA Server in a Docker container +--------------------------------------- +PyDYNA server can be run in a Docker container. .. include:: ../../../docker/pre/README.rst .. include:: ../../../docker/solver/README.rst + .. LINKS .. _pydyna_pypi: https://pypi.org/projects/ansys-dyna-core/ .. _pydyna_repo: https://github.com/ansys/pydyna/ diff --git a/docker/solver/Dockerfile b/docker/solver/Dockerfile index 4bdfbb058..41f4228c3 100644 --- a/docker/solver/Dockerfile +++ b/docker/solver/Dockerfile @@ -24,7 +24,7 @@ ENV HOME /home/mpirun ENV LD_LIBRARY_PATH /ansys_inc/lib ENV LSTC_LICENSE network ENV LSTC_LICENSE_SERVER license -ENV SSHDIR ${HOME}/.ssh/ +ENV SSHDIR ${HOME}/.ssh RUN groupadd ${USER} @@ -66,10 +66,18 @@ CMD ["/usr/sbin/sshd", "-D"] ENV PATH /opt/openmpi/bin:${PATH} RUN echo "export PATH=/opt/openmpi/bin:\${PATH}" >> ${HOME}/.bashrc -ADD ssh/config ${SSHDIR}/config -ADD ssh/id_rsa ${SSHDIR}/id_rsa -ADD ssh/id_rsa.pub ${SSHDIR}/id_rsa.pub -ADD ssh/id_rsa.pub ${SSHDIR}/authorized_keys +#ADD ssh/config ${SSHDIR}/config +#ADD ssh/id_rsa ${SSHDIR}/id_rsa +#ADD ssh/id_rsa.pub ${SSHDIR}/id_rsa.pub +#ADD ssh/id_rsa.pub ${SSHDIR}/authorized_keys +#RUN ssh-keygen -A + + +RUN ssh-keygen -q -b 2048 -f ${SSHDIR}/id_rsa -N "" +RUN chmod 700 ${SSHDIR} && chmod -R 600 ${SSHDIR}/id_rsa +RUN echo "Host *" > ${SSHDIR}/config +RUN echo " StrictHostKeyChecking no" >> ${SSHDIR}/config +RUN cp ${SSHDIR}/id_rsa.pub ${SSHDIR}/authorized_keys RUN ssh-keygen -A RUN chmod -R 600 ${SSHDIR}* && \ @@ -79,11 +87,15 @@ RUN chown -R ${USER}:${USER} ${HOME} # Copy the openmpi libraries -RUN mkdir -p /opt -COPY mpi /opt/openmpi +RUN yum install -y unzip +COPY mppdyna_docker_centos7.zip . +RUN unzip -qu mppdyna_docker_centos7.zip && rm mppdyna_docker_centos7.zip +RUN mkdir -p /opt/openmpi +RUN cp -r mpi/* /opt/openmpi +RUN chmod -R 777 /opt/openmpi # The executable will go in /ansys_inc, and the # ifort runtime libraries in /ansys_inc/lib -COPY docker_dir /ansys_inc -RUN chmod 755 /ansys_inc/ \ No newline at end of file +RUN cp -rpu docker_dir/* /ansys_inc/ +RUN chmod -R 777 /ansys_inc/ diff --git a/docker/solver/README.rst b/docker/solver/README.rst index 165593308..94c018088 100644 --- a/docker/solver/README.rst +++ b/docker/solver/README.rst @@ -27,17 +27,14 @@ Prerequisites * Download the latest Linux release artifacts for the ``solver`` Docker container: `mppdyna_docker_centos7.zip `_. -* Move this ZIP file to the ``docker/solver`` directory and unzip it in the same directory. +* Move this ZIP file to the ``docker/solver`` directory. The files in this folder should look similar to this: .. code:: bash - >>> Dockerfile README.rst do_build docker-compose.yml docker_dir mpi mppdyna_docker_centos7.zip + >>> Dockerfile README.rst docker-compose.yml mppdyna_docker_centos7.zip -* Within docker_dir, there is a file called mppdyna. This file is the executable to run. It can be - any executable (SMP, MPP) or revision and branch. To run a given file, the name shall be changed to - mppdyna and copied inside docker_dir. Once all prerequisites are met, you can build the Docker image for the ``solver`` service. @@ -52,7 +49,7 @@ To build the Docker image for the ``solver`` service, perform these steps: .. code:: bash - ./do_build + docker build -t dyna_solver_v04 . #. Check that the image has been built successfully by running this command: @@ -70,15 +67,20 @@ To build the Docker image for the ``solver`` service, perform these steps: >>> ...... ...... ............ .............. ...... -Run the image as a container -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Start the container from a ``docker-compose.yml`` file +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Perform these steps to run the image for the ``solver`` service as a container: +Alternatively, you can start the container for the ``pre`` service from a +``docker-compose.yml`` file. + +#. Ensure that Docker Compose has been installed on your computer. If Docker Compose is not + installed, see `Overview of installing Docker Compose `_ + in the Docker documentation. #. In the ``docker-compose.yml`` file, replace ```` with the correct license server hosting the LS-DYNA license. -#. Run this Docker command: +#. In your terminal, go to the ``docker/solver`` directory and run this Docker command: .. code:: bash diff --git a/docker/solver/do_build b/docker/solver/do_build deleted file mode 100644 index adfa4078a..000000000 --- a/docker/solver/do_build +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# Do some basic ssh setup -# -rm -rf ssh -mkdir ssh -ssh-keygen -q -b 2048 -f ssh/id_rsa -N "" -echo "Host *" > ssh/config -echo " StrictHostKeyChecking no" >> ssh/config -# -chmod -R 755 * -# -# Build container -# -docker build -t dyna_solver_v04 . diff --git a/docker/solver/docker-compose.yml b/docker/solver/docker-compose.yml index 0eef2a2fa..6c651b7cd 100644 --- a/docker/solver/docker-compose.yml +++ b/docker/solver/docker-compose.yml @@ -1,7 +1,8 @@ version: "3.3" +name: "dyna" services: dyna: - image: dyna_solver_v04 + build: ./ networks: - dyna_internal volumes: @@ -14,7 +15,7 @@ services: mode: ingress user: mpirun environment: - - LSTC_LICENSE_SERVER= + - LSTC_LICENSE_SERVER=lvrpanda.ansys.com entrypoint: ["/ansys_inc/server.py","dyna"] networks: dyna_internal: \ No newline at end of file From 99bf6697cdbf9817f12cd0cdece8c4867c728609 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 08:38:37 +0100 Subject: [PATCH 05/11] build(deps): bump ansys/actions from 4 to 5 (#345) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci_cd.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 4f329bcc8..085028aaf 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -24,7 +24,7 @@ jobs: name: "Code style" runs-on: ubuntu-latest steps: - - uses: ansys/actions/code-style@v4 + - uses: ansys/actions/code-style@v5 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - name: PyAnsys documentation style checks - uses: ansys/actions/doc-style@v4 + uses: ansys/actions/doc-style@v5 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -128,7 +128,7 @@ jobs: os: [windows-latest, ubuntu-latest] python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - - uses: ansys/actions/build-wheelhouse@v4 + - uses: ansys/actions/build-wheelhouse@v5 with: library-name: ${{ env.PACKAGE_NAME }} library-namespace: ${{ env.PACKAGE_NAMESPACE }} @@ -194,7 +194,7 @@ jobs: needs: [doc, tests] runs-on: ubuntu-latest steps: - - uses: ansys/actions/build-library@v4 + - uses: ansys/actions/build-library@v5 with: library-name: ${{ env.PACKAGE_NAME }} python-version: ${{ env.MAIN_PYTHON_VERSION }} @@ -206,14 +206,14 @@ jobs: runs-on: ubuntu-latest steps: - name: "Release to the public PyPI repository" - uses: ansys/actions/release-pypi-public@v4 + uses: ansys/actions/release-pypi-public@v5 with: library-name: ${{ env.PACKAGE_NAME }} twine-username: "__token__" twine-token: ${{ secrets.PYPI_TOKEN }} - name: "Release to GitHub" - uses: ansys/actions/release-github@v4 + uses: ansys/actions/release-github@v5 with: library-name: ${{ env.PACKAGE_NAME }} @@ -223,7 +223,7 @@ jobs: runs-on: ubuntu-latest needs: [build-library] steps: - - uses: ansys/actions/doc-deploy-dev@v4 + - uses: ansys/actions/doc-deploy-dev@v5 with: cname: ${{ env.DOCUMENTATION_CNAME }} token: ${{ secrets.GITHUB_TOKEN }} @@ -234,7 +234,7 @@ jobs: runs-on: ubuntu-latest needs: [release] steps: - - uses: ansys/actions/doc-deploy-stable@v4 + - uses: ansys/actions/doc-deploy-stable@v5 with: cname: ${{ env.DOCUMENTATION_CNAME }} token: ${{ secrets.GITHUB_TOKEN }} From e44307b5ad4911dca3dcbd789f111ec4999b9340 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 08:38:49 +0100 Subject: [PATCH 06/11] build(deps-dev): bump pyvista from 0.43.0 to 0.43.1 (#343) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 21b5ef891..39c6037d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ dependencies = [ [project.optional-dependencies] tests = [ - "pyvista==0.43.0", + "pyvista==0.43.1", "matplotlib==3.8.2", "numpy==1.26.2", "pytest==7.4.3", @@ -49,7 +49,7 @@ doc = [ "matplotlib==3.8.2", "imageio==2.33.1", "imageio-ffmpeg==0.4.9", - "pyvista==0.43.0", + "pyvista==0.43.1", "numpydoc==1.6.0", "Sphinx==7.2.6", "sphinx-autobuild==2021.3.14", From 975775d59f7af0e0f5642b04648d2fef6eabe8c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 08:39:07 +0100 Subject: [PATCH 07/11] build(deps-dev): bump pytest from 7.4.3 to 7.4.4 (#348) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 39c6037d8..3076154a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ tests = [ "pyvista==0.43.1", "matplotlib==3.8.2", "numpy==1.26.2", - "pytest==7.4.3", + "pytest==7.4.4", "pytest-cov==4.1.0", "joblib==1.3.2", "pandas==2.1.4", From 2a3324f1eb4b69d8be620973e8a6dee3ee571cc0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 07:46:23 +0000 Subject: [PATCH 08/11] build(deps-dev): bump jupyterlab from 4.0.9 to 4.0.10 (#347) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3076154a2..613f7adce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,7 +66,7 @@ doc = [ "joblib==1.3.2", "scikit-learn==1.3.2", "ipython==8.18.1", - "jupyterlab==4.0.9", + "jupyterlab==4.0.10", "sphinx-jinja==2.0.2", "sphinx-autoapi==3.0.0", ] From 00ce7aaad93174721c70c4dddaadcc1036b37654 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Tue, 2 Jan 2024 08:56:54 +0100 Subject: [PATCH 09/11] maint: update main Python version (#349) --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 085028aaf..519e3775d 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -9,7 +9,7 @@ on: - main env: - MAIN_PYTHON_VERSION: '3.9' + MAIN_PYTHON_VERSION: '3.10' PACKAGE_NAME: 'ansys-dyna-core' PACKAGE_NAMESPACE: 'ansys.dyna.core' DOCUMENTATION_CNAME: "dyna.docs.pyansys.com" From 9ce566bb0804bb4b4f8eebd5bb977cfcd4a60d34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 08:03:47 +0000 Subject: [PATCH 10/11] build(deps-dev): bump ipython from 8.18.1 to 8.19.0 (#346) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 613f7adce..fa1f96c26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ tests = [ "openpyxl==3.1.2", "scikit-learn==1.3.2", "pytest-xdist==3.5.0", - "ipython==8.18.1", + "ipython==8.19.0", ] doc = [ "recommonmark==0.7.1", @@ -65,7 +65,7 @@ doc = [ "ipywidgets==8.1.1", "joblib==1.3.2", "scikit-learn==1.3.2", - "ipython==8.18.1", + "ipython==8.19.0", "jupyterlab==4.0.10", "sphinx-jinja==2.0.2", "sphinx-autoapi==3.0.0", From e994751ed2a70bd2978e8ea1406f348806e5ae62 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Thu, 4 Jan 2024 03:10:50 -0500 Subject: [PATCH 11/11] feat: remove Python 3.8 support and add Python 3.12 (#351) --- .github/workflows/ci_cd.yml | 4 +--- doc/source/getting-started/index.rst | 12 ++++++------ docker/pre/Dockerfile | 2 +- pyproject.toml | 19 +++++++------------ src/ansys/dyna/core/pre/dynalogging.py | 6 +----- tox.ini | 2 +- 6 files changed, 17 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 519e3775d..67f5f6ff8 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -126,12 +126,11 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - uses: ansys/actions/build-wheelhouse@v5 with: library-name: ${{ env.PACKAGE_NAME }} - library-namespace: ${{ env.PACKAGE_NAMESPACE }} operating-system: ${{ matrix.os }} python-version: ${{ matrix.python-version }} @@ -238,4 +237,3 @@ jobs: with: cname: ${{ env.DOCUMENTATION_CNAME }} token: ${{ secrets.GITHUB_TOKEN }} - python-version: ${{ env.MAIN_PYTHON_VERSION }} diff --git a/doc/source/getting-started/index.rst b/doc/source/getting-started/index.rst index 98f9e43a8..8f7835dd8 100644 --- a/doc/source/getting-started/index.rst +++ b/doc/source/getting-started/index.rst @@ -14,8 +14,8 @@ Both these modules are gRPC enabled and hence need to be run using server-client Install the client ------------------ -The ``ansys.dyna.core`` package supports Python 3.8 through -Python 3.11 on Windows, Linux, and MacOS. +The ``ansys.dyna.core`` package supports Python 3.9 through +Python 3.12 on Windows, Linux, and MacOS. You should consider installing PyDYNA in a virtual environment. For more information, see Python's @@ -66,18 +66,18 @@ PyDYNA by downloading the wheelhouse archive for your corresponding machine architecture from the `Releases Page `_. Each wheelhouse archive contains all the Python wheels necessary to install -PyDYNA from scratch on Windows and Linux for Python 3.8 through 3.11. You can install +PyDYNA from scratch on Windows and Linux for Python 3.9 through 3.12. You can install PyDYNA on an isolated system with a fresh Python installation or on a virtual environment. -For example, on Linux with Python 3.8, unzip the wheelhouse archive and install PyDYNA +For example, on Linux with Python 3.9, unzip the wheelhouse archive and install PyDYNA with these commands: .. code:: bash - unzip ansys-dyna-core-v0.3.dev0-wheelhouse-Linux-3.8.zip -d wheelhouse + unzip ansys-dyna-core-v0.3.dev0-wheelhouse-Linux-3.9.zip -d wheelhouse pip install ansys-dyna-core -f wheelhouse --no-index --upgrade --ignore-installed -If you're on Windows with Python 3.8, unzip the wheelhouse archive to a ``wheelhouse`` +If you're on Windows with Python 3.9, unzip the wheelhouse archive to a ``wheelhouse`` directory and install PyDYNA using the preceding command. Run PyDYNA Server locally diff --git a/docker/pre/Dockerfile b/docker/pre/Dockerfile index 799b84744..274d204d3 100644 --- a/docker/pre/Dockerfile +++ b/docker/pre/Dockerfile @@ -1,6 +1,6 @@ # Pydyna-pre service Linux-based Dockerfile -FROM python:3.8-slim-buster +FROM python:3.9-slim-buster # Define the working directory WORKDIR /server diff --git a/pyproject.toml b/pyproject.toml index fa1f96c26..db8ace8ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,10 +7,10 @@ name = "ansys-dyna-core" version = "0.4.dev0" description = "Python interface to LS-DYNA Service" readme = "README.rst" -requires-python = ">=3.8,<4" -license = {file = "LICENSE"} -authors = [{name = "ANSYS, Inc.", email = "pyansys.core@ansys.com"}] -maintainers = [{name = "ANSYS, Inc.", email = "pyansys.core@ansys.com"}] +requires-python = ">=3.9,<4" +license = { file = "LICENSE" } +authors = [{ name = "ANSYS, Inc.", email = "pyansys.core@ansys.com" }] +maintainers = [{ name = "ANSYS, Inc.", email = "pyansys.core@ansys.com" }] keywords = ["Ansys", "LS-DYNA", "gRPC"] classifiers = [ "Development Status :: 4 - Beta", @@ -19,16 +19,13 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] -dependencies = [ - "ansys-dpf-core>=0.7.2", - "ansys-api-dyna==0.3.5", -] +dependencies = ["ansys-dpf-core>=0.7.2", "ansys-api-dyna==0.3.5"] [project.optional-dependencies] tests = [ @@ -99,6 +96,4 @@ show_missing = true [tool.pytest.ini_options] minversion = "7.1" addopts = "-ra --cov=ansys.dyna.core --cov-report html:.cov/html --cov-report xml:.cov/xml --cov-report term -vv" -testpaths = [ - "tests", -] +testpaths = ["tests"] diff --git a/src/ansys/dyna/core/pre/dynalogging.py b/src/ansys/dyna/core/pre/dynalogging.py index 95df65a6b..6cf67e4fb 100644 --- a/src/ansys/dyna/core/pre/dynalogging.py +++ b/src/ansys/dyna/core/pre/dynalogging.py @@ -241,11 +241,7 @@ def __init__( validate=True, defaults=None, ): - if sys.version_info[1] < 8: - super().__init__(fmt, datefmt, style) - else: - # 3.8: The validate parameter was added - super().__init__(fmt, datefmt, style, validate) + super().__init__(fmt, datefmt, style, validate) self._style = PymapdlPercentStyle(fmt, defaults=defaults) # overwriting diff --git a/tox.ini b/tox.ini index c4bd7b0db..9a92146f1 100644 --- a/tox.ini +++ b/tox.ini @@ -9,10 +9,10 @@ isolated_build_env = build [testenv] description = Checks for project testing with desired extras basepython = - tests38: python3.8 tests39: python3.9 test310: python3.10 test311: python3.11 + test312: python3.12 {style,tests,doc}: python3 passenv = * setenv =