From 5e0387a7560e10e0a2d26c7b087c802607f30742 Mon Sep 17 00:00:00 2001 From: German Date: Fri, 10 May 2024 11:28:03 +0200 Subject: [PATCH 01/27] Update ansys-dpf-core --- .devcontainer/codespaces-dev/requirements.txt | 2 +- .devcontainer/codespaces-docs/requirements.txt | 2 +- .devcontainer/devcontainer-local/requirements.txt | 2 +- pyproject.toml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.devcontainer/codespaces-dev/requirements.txt b/.devcontainer/codespaces-dev/requirements.txt index d4351baf78..7c6626487a 100644 --- a/.devcontainer/codespaces-dev/requirements.txt +++ b/.devcontainer/codespaces-dev/requirements.txt @@ -1,4 +1,4 @@ -ansys-dpf-core==0.10.1 +ansys-dpf-core==0.12.1 autopep8==2.1.0 matplotlib==3.8.4 scipy==1.13.0 diff --git a/.devcontainer/codespaces-docs/requirements.txt b/.devcontainer/codespaces-docs/requirements.txt index bffda2453b..9f229fd365 100644 --- a/.devcontainer/codespaces-docs/requirements.txt +++ b/.devcontainer/codespaces-docs/requirements.txt @@ -1,5 +1,5 @@ sphinx==7.3.7 -ansys-dpf-core==0.10.1 +ansys-dpf-core==0.12.1 ansys-mapdl-reader==0.53.0 ansys-sphinx-theme==0.15.2 grpcio==1.63.0 diff --git a/.devcontainer/devcontainer-local/requirements.txt b/.devcontainer/devcontainer-local/requirements.txt index d4351baf78..7c6626487a 100644 --- a/.devcontainer/devcontainer-local/requirements.txt +++ b/.devcontainer/devcontainer-local/requirements.txt @@ -1,4 +1,4 @@ -ansys-dpf-core==0.10.1 +ansys-dpf-core==0.12.1 autopep8==2.1.0 matplotlib==3.8.4 scipy==1.13.0 diff --git a/pyproject.toml b/pyproject.toml index 41b3a750be..55dcf1ed25 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,7 +62,7 @@ jupyter = [ ] tests = [ - "ansys-dpf-core==0.10.1", + "ansys-dpf-core==0.12.1", "autopep8==2.1.0", "matplotlib==3.8.4", "scipy==1.13.0", @@ -79,7 +79,7 @@ tests = [ ] doc = [ "sphinx==7.3.7", - "ansys-dpf-core==0.10.1", + "ansys-dpf-core==0.12.1", "ansys-mapdl-reader==0.53.0", "ansys-sphinx-theme==0.15.2", "grpcio==1.63.0", From 0bfc6b6f3b179d494a3acf337fbfa8b32c66e084 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:12:42 +0000 Subject: [PATCH 02/27] chore: adding changelog file 3082.dependencies.md --- doc/changelog.d/3082.dependencies.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/3082.dependencies.md diff --git a/doc/changelog.d/3082.dependencies.md b/doc/changelog.d/3082.dependencies.md new file mode 100644 index 0000000000..1d1e3fa0f0 --- /dev/null +++ b/doc/changelog.d/3082.dependencies.md @@ -0,0 +1 @@ +Update ansys-dpf-core \ No newline at end of file From a075b7164530a3abb4bfd901edee72175ab6b057 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 25 Nov 2024 20:43:43 +0100 Subject: [PATCH 03/27] feat: using dpf action and latest version --- .devcontainer/codespaces-dev/requirements.txt | 2 +- .devcontainer/codespaces-docs/requirements.txt | 2 +- .../devcontainer-local/requirements.txt | 2 +- .github/workflows/ci.yml | 16 ++++++++++------ .github/workflows/linkchecker.yml | 8 +++++--- pyproject.toml | 4 ++-- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.devcontainer/codespaces-dev/requirements.txt b/.devcontainer/codespaces-dev/requirements.txt index 6fa6a461c4..06cfbd7a31 100644 --- a/.devcontainer/codespaces-dev/requirements.txt +++ b/.devcontainer/codespaces-dev/requirements.txt @@ -1,4 +1,4 @@ -ansys-dpf-core==0.12.1 +ansys-dpf-core==0.13.2 ansys-tools-visualization-interface==0.2.6 autopep8==2.3.1 matplotlib==3.9.0 diff --git a/.devcontainer/codespaces-docs/requirements.txt b/.devcontainer/codespaces-docs/requirements.txt index 94cbfa6012..50280a5ad3 100644 --- a/.devcontainer/codespaces-docs/requirements.txt +++ b/.devcontainer/codespaces-docs/requirements.txt @@ -1,4 +1,4 @@ -ansys-dpf-core==0.12.1 +ansys-dpf-core==0.13.2 ansys-mapdl-reader==0.53.0 ansys-sphinx-theme==0.16.6 ansys-tools-visualization-interface==0.2.6 diff --git a/.devcontainer/devcontainer-local/requirements.txt b/.devcontainer/devcontainer-local/requirements.txt index 905b27cfb8..d8610c191f 100644 --- a/.devcontainer/devcontainer-local/requirements.txt +++ b/.devcontainer/devcontainer-local/requirements.txt @@ -1,4 +1,4 @@ -ansys-dpf-core==0.12.1 +ansys-dpf-core==0.13.2 ansys-mapdl-reader==0.53.0 ansys-sphinx-theme==0.16.6 ansys-tools-visualization-interface==0.2.6 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 888deef9e0..131e8281de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -186,9 +186,11 @@ jobs: echo "Launching MAPDL service at PID: $DOCKER_PID" echo "DOCKER_PID=$(echo $DOCKER_PID)" >> $GITHUB_OUTPUT - - name: "DPF server activation" - run: | - $(docker pull ghcr.io/ansys/dpf-core:22.2dev && docker run -d --name dpfserver -p ${{ env.DPF_PORT }}:50052 ghcr.io/ansys/dpf-core:22.2dev && echo "DPF Server active on port ${{ env.DPF_PORT }}.") & + - name: "Install DPF" + id: set-server-path + uses: ansys/pydpf-actions/install-dpf-docker@v2.3 + with: + dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} - name: "Getting files change filters" uses: dorny/paths-filter@v3 @@ -481,9 +483,11 @@ jobs: echo "DOCKER_PID_0=$(echo $DOCKER_PID_0)" >> $GITHUB_OUTPUT echo "DOCKER_PID_1=$(echo $DOCKER_PID_1)" >> $GITHUB_OUTPUT - - name: "DPF server activation" - run: | - $(docker pull ghcr.io/ansys/dpf-core:22.2dev && docker run -d --name dpfserver -p ${{ env.DPF_PORT }}:50052 ghcr.io/ansys/dpf-core:22.2dev && echo "DPF Server active on port ${{ env.DPF_PORT }}.") & + - name: "Install DPF" + id: set-server-path + uses: ansys/pydpf-actions/install-dpf-docker@v2.3 + with: + dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} - name: "Getting files change filters" uses: dorny/paths-filter@v3 diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml index bbe761fd11..bfb50b2418 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/linkchecker.yml @@ -40,9 +40,11 @@ jobs: username: ${{ secrets.GH_USERNAME }} password: ${{ secrets.GITHUB_TOKEN }} - - name: "DPF server activation" - run: | - $(docker pull ghcr.io/ansys/dpf-core:22.2dev && docker run -d --name dpfserver -p ${{ env.DPF_PORT }}:50052 ghcr.io/ansys/dpf-core:22.2dev && echo "DPF Server active on port ${{ env.DPF_PORT }}.") & + - name: "Install DPF" + id: set-server-path + uses: ansys/pydpf-actions/install-dpf-docker@v2.3 + with: + dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} - name: "Pull, launch, and validate MAPDL service" id: start_mapdl diff --git a/pyproject.toml b/pyproject.toml index ce1cfd8dee..80cb4e6daa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ jupyter = [ ] tests = [ - "ansys-dpf-core==0.12.1", + "ansys-dpf-core==0.13.2", "ansys-tools-visualization-interface==0.5.0", "autopep8==2.3.1", "matplotlib==3.9.2", @@ -74,7 +74,7 @@ tests = [ "vtk==9.3.1", ] doc = [ - "ansys-dpf-core==0.12.1", + "ansys-dpf-core==0.13.2", "ansys-mapdl-reader==0.54.2", "ansys-sphinx-theme==1.2.2", "ansys-tools-visualization-interface==0.5.0", From ba0970631c4e792b2eb3a9238f30a88362abaa06 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 25 Nov 2024 22:24:11 +0100 Subject: [PATCH 04/27] fix: using server installation --- .github/workflows/ci.yml | 4 ++-- .github/workflows/linkchecker.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 131e8281de..fee4dc4b9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,7 +188,7 @@ jobs: - name: "Install DPF" id: set-server-path - uses: ansys/pydpf-actions/install-dpf-docker@v2.3 + uses: ansys/pydpf-actions/install-dpf-server@v2.3 with: dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} @@ -485,7 +485,7 @@ jobs: - name: "Install DPF" id: set-server-path - uses: ansys/pydpf-actions/install-dpf-docker@v2.3 + uses: ansys/pydpf-actions/install-dpf-server@v2.3 with: dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml index bfb50b2418..da8d2ea78b 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/linkchecker.yml @@ -42,7 +42,7 @@ jobs: - name: "Install DPF" id: set-server-path - uses: ansys/pydpf-actions/install-dpf-docker@v2.3 + uses: ansys/pydpf-actions/install-dpf-server@v2.3 with: dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} From a648a2410ed14ce0cfe240624068afd55e52fcfc Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 25 Nov 2024 22:25:34 +0100 Subject: [PATCH 05/27] fix: running dpf tests in local --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fee4dc4b9a..d9f1890d99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -698,6 +698,12 @@ jobs: python -m build python -m pip install dist/*.whl xvfb-run python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())" + + - name: "Install DPF" + id: set-server-path + uses: ansys/pydpf-actions/install-dpf-server@v2.3 + with: + dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} - name: "Unit testing requirements installation" run: | @@ -712,7 +718,7 @@ jobs: echo "ON_STUDENT: $ON_STUDENT" unset PYMAPDL_PORT unset PYMAPDL_START_INSTANCE - xvfb-run pytest -k "not test_dpf" \ + xvfb-run pytest \ ${{ env.PYTEST_ARGUMENTS }} \ --reset_only_failed --add_missing_images \ --cov-report=xml:${{ matrix.mapdl-version }}-local.xml From 63ffb7c1ff78d49b71ce242f0b23cb651323f8bc Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 25 Nov 2024 22:26:51 +0100 Subject: [PATCH 06/27] fix: adding dpf env var --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9f1890d99..efb6730697 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ env: MAPDL_PACKAGE: ghcr.io/ansys/mapdl ON_CI: True PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=10 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html' - + ANSYS_DPF_ACCEPT_LA: "Y" BUILD_CHEATSHEET: True # Following env vars when changed will "reset" the mentioned cache, From a282e9d5b45d6d11e54db36c60525a537c10a579 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 25 Nov 2024 22:27:53 +0100 Subject: [PATCH 07/27] fix: removing dpf unused env vars --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efb6730697..0e6e5f8ecb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,8 +29,6 @@ env: MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} PYANSYS_OFF_SCREEN: True - DPF_START_SERVER: False - DPF_PORT: 21004 MAPDL_PACKAGE: ghcr.io/ansys/mapdl ON_CI: True PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=10 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html' From e6bee75f4e504be77a9e18fd7e67dbd8fd0c8617 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:46:20 +0100 Subject: [PATCH 08/27] ci: removing check DPF port --- .ci/waiting_services.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.ci/waiting_services.sh b/.ci/waiting_services.sh index b2050ef89d..5dbb241d88 100755 --- a/.ci/waiting_services.sh +++ b/.ci/waiting_services.sh @@ -10,10 +10,3 @@ sleep 0.1 done echo "::endgroup::" echo "MAPDL service is up!" - -echo "::group:: Waiting for the DPF port to be open..." -while ! nc -z localhost "$DPF_PORT"; do - sleep 0.1 -done -echo "::endgroup::" -echo "DPF service is up!" \ No newline at end of file From 05950e69149be41e3ea000043b6e5292279be55b Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:59:59 +0000 Subject: [PATCH 09/27] chore: adding changelog file 3082.dependencies.md [dependabot-skip] --- doc/changelog.d/3082.dependencies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/3082.dependencies.md b/doc/changelog.d/3082.dependencies.md index 1d1e3fa0f0..3ec6ead92c 100644 --- a/doc/changelog.d/3082.dependencies.md +++ b/doc/changelog.d/3082.dependencies.md @@ -1 +1 @@ -Update ansys-dpf-core \ No newline at end of file +build: update ansys-dpf-core \ No newline at end of file From 74bfb7d8b127f7887dae40cb123e98a4000985be Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 10 Feb 2025 18:53:23 +0100 Subject: [PATCH 10/27] ci: fixing workflow --- .github/workflows/ci.yml | 2 ++ tests/common.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 461106fa74..413c7e9f61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -416,6 +416,7 @@ jobs: PYMAPDL_START_INSTANCE: FALSE ON_LOCAL: FALSE ON_UBUNTU: FALSE + HAS_DPF: true outputs: DISTRIBUTED_MODE: ${{ steps.distributed_mode.outputs.distributed_mode }} @@ -652,6 +653,7 @@ jobs: ON_UBUNTU: true P_SCHEMA: "/ansys_inc/v241/ansys/ac4/schema" PYTEST_TIMEOUT: 120 # seconds. Limit the duration for each unit test + HAS_DPF: true steps: - name: "Install Git and checkout project" diff --git a/tests/common.py b/tests/common.py index 9a7581f843..c375f9cb47 100644 --- a/tests/common.py +++ b/tests/common.py @@ -125,7 +125,9 @@ def has_grpc(): def has_dpf(): - return bool(os.environ.get("DPF_PORT")) + return (os.environ.get("HAS_DPF").lower().strip() in ["true", "yes"]) or bool( + os.environ.get("DPF_PORT") + ) def is_smp(): From 3ad2a87f6e509f2c10b3b8db79e0fcc6449f9464 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Mon, 10 Feb 2025 19:00:47 +0100 Subject: [PATCH 11/27] feat: adding powershell to CICD --- .github/workflows/ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 413c7e9f61..86c1e2afec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -703,7 +703,16 @@ jobs: python -m build python -m pip install dist/*.whl xvfb-run python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())" - + + - name: "Install powershell (for DPF)" + run: | + sudo apt-get update + sudo apt-get install -y wget + wget https://github.com/PowerShell/PowerShell/releases/download/v7.5.0/powershell_7.5.0-1.deb_amd64.deb + sudo dpkg -i powershell_7.5.0-1.deb_amd64.deb + sudo apt-get install -f + rm powershell_7.5.0-1.deb_amd64.deb + - name: "Install DPF" id: set-server-path uses: ansys/pydpf-actions/install-dpf-server@v2.3 From 9196c0da87d687608c8eaf1502f1b6225b859aa2 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:09:41 +0100 Subject: [PATCH 12/27] test: dpf server connection --- tests/test_dpf.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/test_dpf.py b/tests/test_dpf.py index 4d83004ad2..11d6a2d5fc 100644 --- a/tests/test_dpf.py +++ b/tests/test_dpf.py @@ -21,8 +21,6 @@ # SOFTWARE. """Test the DPF implementation""" -import os - import pytest from conftest import HAS_DPF, ON_CI, has_dependency, requires @@ -31,9 +29,7 @@ pytest.skip(allow_module_level=True) from ansys.dpf import core as dpf -from ansys.dpf.core.server_types import DPF_DEFAULT_PORT - -DPF_PORT = os.environ.get("DPF_PORT", DPF_DEFAULT_PORT) # Set in ci.yaml +from ansys.dpf.core import server_module @pytest.fixture() @@ -52,7 +48,7 @@ def skip_dpf(mapdl): def test_dpf_connection(skip_dpf): # uses 127.0.0.1 and port 50054 by default try: - grpc_con = dpf.connect_to_server(port=DPF_PORT) + grpc_con = dpf.connect_to_server() assert grpc_con.live assert True except OSError: @@ -66,7 +62,13 @@ def test_upload(skip_dpf, mapdl, solved_box, tmpdir): rst_path = mapdl.download_result(str(tmpdir.mkdir("tmpdir"))) # Establishing connection - grpc_con = dpf.connect_to_server(port=DPF_PORT) + grpc_con = dpf.connect_to_server() + + server = server.DPFServer() + server = server_module.get_or_create_server(server) + if not server.local_server and not server.docker_config.use_docker: + return upload_file_in_tmp_folder(local_path, server=server) + assert grpc_con.live # Upload RST From 4096786cf4ab0364d5455a46099c57875682d93c Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:36:07 +0100 Subject: [PATCH 13/27] ci: speed testing. temporary. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86c1e2afec..d64d9991ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ env: PYANSYS_OFF_SCREEN: True MAPDL_PACKAGE: ghcr.io/ansys/mapdl ON_CI: True - PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile' + PYTEST_ARGUMENTS: '-vvv -k "dpf" -rxXsa --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile' ANSYS_DPF_ACCEPT_LA: "Y" BUILD_CHEATSHEET: True @@ -402,7 +402,7 @@ jobs: build-test-remote: name: "Remote: ${{ matrix.mapdl-version }}" runs-on: ubuntu-22.04 - needs: [smoke-tests, build-test-remote-matrix] + needs: [build-test-remote-matrix] timeout-minutes: 35 strategy: fail-fast: false @@ -636,7 +636,7 @@ jobs: name: "Local: ${{ matrix.mapdl-version }}" runs-on: ubuntu-22.04 if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - needs: [smoke-tests, build-test-local-minimal-matrix] + needs: [build-test-local-minimal-matrix] timeout-minutes: 75 strategy: fail-fast: false From 1be8e5e1c86ba0410a09631305483e4b7ecfdd34 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:37:13 +0100 Subject: [PATCH 14/27] fix: import --- tests/test_dpf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_dpf.py b/tests/test_dpf.py index 11d6a2d5fc..2022b8f5c2 100644 --- a/tests/test_dpf.py +++ b/tests/test_dpf.py @@ -29,7 +29,7 @@ pytest.skip(allow_module_level=True) from ansys.dpf import core as dpf -from ansys.dpf.core import server_module +from ansys.dpf.core import server as server_module @pytest.fixture() From 53bae0150730e894593565f5a6d2c2b0c9211360 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:57:06 +0100 Subject: [PATCH 15/27] feat: adding version --- .ci/build_matrix.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.ci/build_matrix.sh b/.ci/build_matrix.sh index 67189fda44..9ad3558494 100755 --- a/.ci/build_matrix.sh +++ b/.ci/build_matrix.sh @@ -137,8 +137,14 @@ for version in "${versions[@]}"; do fi # Add line to json + if [[ "$version" == *"latest-ubuntu"* ]] ; then + version_num=$(echo $LATEST_VERSION) + else + version_num=$(echo "$version" | head -c 5 | tail -c 4 | tr -d '.') + fi; + if [[ "$add_line" == "true" ]]; then - JSONline="{\"mapdl-version\": \"$version\"}," + JSONline="{\"mapdl-version\": \"$version\", \"number\": \"$version_num\" }," echo "ADDED line: $JSONline" From 40eb4dfd50f3fcdbe7d814d9e47d7bf7d3e0e86f Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 12:58:27 +0100 Subject: [PATCH 16/27] ci: adding ansys number to action --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d64d9991ab..a1fcff6f08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -492,6 +492,7 @@ jobs: uses: ansys/pydpf-actions/install-dpf-server@v2.3 with: dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} + ANSYS_VERSION: ${{ matrix.number }} - name: "Getting files change filters" uses: dorny/paths-filter@v3 @@ -718,6 +719,7 @@ jobs: uses: ansys/pydpf-actions/install-dpf-server@v2.3 with: dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} + ANSYS_VERSION: ${{ matrix.number }} - name: "Unit testing requirements installation" run: | From 7ee9fd25b9085dce81e70c4b82b946c92cce2352 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 13:46:18 +0100 Subject: [PATCH 17/27] feat: using custom branch --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1fcff6f08..cb39befb45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -190,7 +190,7 @@ jobs: - name: "Install DPF" id: set-server-path - uses: ansys/pydpf-actions/install-dpf-server@v2.3 + uses: ansys/pydpf-actions/install-dpf-server@feat/allow-running-from-custom-location with: dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} @@ -489,7 +489,7 @@ jobs: - name: "Install DPF" id: set-server-path - uses: ansys/pydpf-actions/install-dpf-server@v2.3 + uses: ansys/pydpf-actions/install-dpf-server@feat/allow-running-from-custom-location with: dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} ANSYS_VERSION: ${{ matrix.number }} @@ -545,6 +545,7 @@ jobs: DISTRIBUTED_MODE: ${{ steps.distributed_mode.outputs.distributed_mode }} ON_UBUNTU: ${{ steps.ubuntu_check.outputs.ON_UBUNTU }} ON_STUDENT: ${{ steps.student_check.outputs.ON_STUDENT }} + DPF_SERVER_PATH: ${{ steps.set-server-path.outputs.SERVER }} run: | echo "ON_UBUNTU: $ON_UBUNTU" echo "ON_STUDENT: $ON_STUDENT" @@ -716,7 +717,7 @@ jobs: - name: "Install DPF" id: set-server-path - uses: ansys/pydpf-actions/install-dpf-server@v2.3 + uses: ansys/pydpf-actions/install-dpf-server@feat/allow-running-from-custom-location with: dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} ANSYS_VERSION: ${{ matrix.number }} @@ -729,6 +730,7 @@ jobs: env: ANSYSLMD_LICENSE_FILE: "1055@${{ secrets.LICENSE_SERVER }}" ON_STUDENT: ${{ steps.student_check.outputs.ON_STUDENT }} + DPF_SERVER_PATH: ${{ steps.set-server-path.outputs.SERVER }} run: | echo "ON_UBUNTU: $ON_UBUNTU" echo "ON_STUDENT: $ON_STUDENT" From 6dde2224487e540b2e7801224a71e960a70b9a6f Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 18:43:04 +0100 Subject: [PATCH 18/27] feat: using script instead of action --- .ci/install_dpf_server.sh | 57 +++++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 47 ++++++++++++++------------------ 2 files changed, 77 insertions(+), 27 deletions(-) create mode 100644 .ci/install_dpf_server.sh diff --git a/.ci/install_dpf_server.sh b/.ci/install_dpf_server.sh new file mode 100644 index 0000000000..802a12e5f1 --- /dev/null +++ b/.ci/install_dpf_server.sh @@ -0,0 +1,57 @@ +# Inputs +# - ANSYS_VERSION +# - OS + +OS="${OS:-Linux}" +ANSYS_VERSION="${ANSYS_VERSION:-221}" +ANSYS_VERSION_WITH_POINT="${ANSYS_VERSION:0:2}.${ANSYS_VERSION:2}" +GITHUB_TOKEN="${GITHUB_TOKEN:?Error: MY_VAR is not set or empty}" + +echo "OS: $OS" +echo "Ansys version: $ANSYS_VERSION" +echo "Ansys version (number): $ANSYS_VERSION_WITH_POINT" + +if [[ "$OS" == "Linux" ]]; then + BranchName="linux_release-$ANSYS_VERSION_WITH_POINT" + DIRECTORY=$(echo pwd) + SERVER=$DIRECTORY/dpf-standalone + DIR="/aisol/bin/linx64" + executable="./Ans.Dpf.Grpc.sh" + +else # Windows + BranchName="win_release-$ANSYS_VERSION_WITH_POINT" + DIRECTORY=$(echo pwd) + SERVER=$DIRECTORY/dpf-standalone + DIR="\aisol\bin\winx64" + executable="./Ans.Dpf.Grpc.bat" + +fi + +echo "SERVER: $SERVER" +echo "BranchName: $BranchName" + +git clone --branch $BranchName --single-branch https://$GITHUB_TOKEN@github.com/ansys-dpf/dpf-standalone +echo "AWP_ROOT$ANSYS_VERSION=$SERVER" >> $GITHUB_OUTPUT + +# Setting up the files +cd $SERVER +cd */*/* +echo "Current directory: $(pwd)" +echo "Files in the directory: $(ls)" + +cd $DIR +echo "Current directory: $(pwd)" +echo "Files in the directory: $(ls)" + +if [[ "$OS" == "Linux" ]]; then + echo "Setting files permissions" + chmod 755 Ans.Dpf.Grpc.sh + chmod 755 Ans.Dpf.Grpc.exe +fi + +echo "Starting server" +$executable --address 127.0.0.1 > logdpf.txt & + +echo "Server started" +sleep 2 +echo "File output: $(cat logdpf.txt)" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb39befb45..92ecafd7b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,11 +188,11 @@ jobs: echo "Launching MAPDL service at PID: $DOCKER_PID" echo "DOCKER_PID=$(echo $DOCKER_PID)" >> $GITHUB_OUTPUT - - name: "Install DPF" - id: set-server-path - uses: ansys/pydpf-actions/install-dpf-server@feat/allow-running-from-custom-location - with: - dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} + # - name: "Install DPF" + # id: set-server-path + # uses: ansys/pydpf-actions/install-dpf-server@feat/allow-running-from-custom-location + # with: + # dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} - name: "Getting files change filters" uses: dorny/paths-filter@v3 @@ -487,12 +487,12 @@ jobs: echo "DOCKER_PID_0=$(echo $DOCKER_PID_0)" >> $GITHUB_OUTPUT echo "DOCKER_PID_1=$(echo $DOCKER_PID_1)" >> $GITHUB_OUTPUT - - name: "Install DPF" - id: set-server-path - uses: ansys/pydpf-actions/install-dpf-server@feat/allow-running-from-custom-location - with: - dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} - ANSYS_VERSION: ${{ matrix.number }} + # - name: "Install DPF" + # id: set-server-path + # uses: ansys/pydpf-actions/install-dpf-server@feat/allow-running-from-custom-location + # with: + # dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} + # ANSYS_VERSION: ${{ matrix.number }} - name: "Getting files change filters" uses: dorny/paths-filter@v3 @@ -689,6 +689,15 @@ jobs: python -m venv ./.venv source ./.venv/bin/activate + - name: "Install DPF" + id: set-server-path + env: + OS: ${{ runner.os }} + ANSYS_VERSION: ${{ matrix.number }} + GITHUB_TOKEN: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + run: | + .ci/install_dpf_server.sh + - name: "Install OS packages" run: | apt update @@ -706,22 +715,6 @@ jobs: python -m pip install dist/*.whl xvfb-run python -c "from ansys.mapdl import core as pymapdl; print(pymapdl.Report())" - - name: "Install powershell (for DPF)" - run: | - sudo apt-get update - sudo apt-get install -y wget - wget https://github.com/PowerShell/PowerShell/releases/download/v7.5.0/powershell_7.5.0-1.deb_amd64.deb - sudo dpkg -i powershell_7.5.0-1.deb_amd64.deb - sudo apt-get install -f - rm powershell_7.5.0-1.deb_amd64.deb - - - name: "Install DPF" - id: set-server-path - uses: ansys/pydpf-actions/install-dpf-server@feat/allow-running-from-custom-location - with: - dpf-standalone-TOKEN: ${{secrets.PYANSYS_CI_BOT_TOKEN}} - ANSYS_VERSION: ${{ matrix.number }} - - name: "Unit testing requirements installation" run: | python -m pip install .[tests] From 55ef8192667be4ef348c5c8df0d54bd6e8d3038c Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 18:45:47 +0100 Subject: [PATCH 19/27] fix: make executable --- .ci/install_dpf_server.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .ci/install_dpf_server.sh diff --git a/.ci/install_dpf_server.sh b/.ci/install_dpf_server.sh old mode 100644 new mode 100755 From 777c7c73f0bbb4c40e9373360693c99aebcfcd85 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 18:49:17 +0100 Subject: [PATCH 20/27] fix: server env var --- .ci/install_dpf_server.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/install_dpf_server.sh b/.ci/install_dpf_server.sh index 802a12e5f1..10f9791b4c 100755 --- a/.ci/install_dpf_server.sh +++ b/.ci/install_dpf_server.sh @@ -13,14 +13,14 @@ echo "Ansys version (number): $ANSYS_VERSION_WITH_POINT" if [[ "$OS" == "Linux" ]]; then BranchName="linux_release-$ANSYS_VERSION_WITH_POINT" - DIRECTORY=$(echo pwd) + DIRECTORY="$(pwd)" SERVER=$DIRECTORY/dpf-standalone DIR="/aisol/bin/linx64" executable="./Ans.Dpf.Grpc.sh" else # Windows BranchName="win_release-$ANSYS_VERSION_WITH_POINT" - DIRECTORY=$(echo pwd) + DIRECTORY="$(pwd)" SERVER=$DIRECTORY/dpf-standalone DIR="\aisol\bin\winx64" executable="./Ans.Dpf.Grpc.bat" From 32635bd216e1af2c7469646e6c829ac5b1634555 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 19:02:19 +0100 Subject: [PATCH 21/27] fix: moving down --- .ci/install_dpf_server.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.ci/install_dpf_server.sh b/.ci/install_dpf_server.sh index 10f9791b4c..4ebec96980 100755 --- a/.ci/install_dpf_server.sh +++ b/.ci/install_dpf_server.sh @@ -36,12 +36,18 @@ echo "AWP_ROOT$ANSYS_VERSION=$SERVER" >> $GITHUB_OUTPUT # Setting up the files cd $SERVER cd */*/* -echo "Current directory: $(pwd)" -echo "Files in the directory: $(ls)" +echo "Current directory:" +echo "$(pwd)" -cd $DIR -echo "Current directory: $(pwd)" -echo "Files in the directory: $(ls)" +echo "Files in the directory:" +echo "$(ls)" + +cd ".$DIR" +echo "Current directory:" +echo "$(pwd)" + +echo "Files in the directory:" +echo "$(ls)" if [[ "$OS" == "Linux" ]]; then echo "Setting files permissions" From 04f86dee3a1b99394c55475739e9e451e4f95092 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 19:03:58 +0100 Subject: [PATCH 22/27] feat: adding more info in case of failure. --- .ci/install_dpf_server.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/install_dpf_server.sh b/.ci/install_dpf_server.sh index 4ebec96980..cf74eb7980 100755 --- a/.ci/install_dpf_server.sh +++ b/.ci/install_dpf_server.sh @@ -51,8 +51,8 @@ echo "$(ls)" if [[ "$OS" == "Linux" ]]; then echo "Setting files permissions" - chmod 755 Ans.Dpf.Grpc.sh - chmod 755 Ans.Dpf.Grpc.exe + chmod 755 Ans.Dpf.Grpc.sh || echo "Failed to set permissions in 'Ans.Dpf.Grpc.sh' file." && exit 1 + chmod 755 Ans.Dpf.Grpc.exe || echo "Failed to set permissions in 'Ans.Dpf.Grpc.exe' file." && exit 1 fi echo "Starting server" From e1fc04356a536bf6931816bd32117941ca2e3d84 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 19:10:09 +0100 Subject: [PATCH 23/27] feat: retrieving dpf server log file --- .ci/collect_mapdl_logs_locals.sh | 2 ++ .ci/install_dpf_server.sh | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.ci/collect_mapdl_logs_locals.sh b/.ci/collect_mapdl_logs_locals.sh index b6082b4f18..e8af6644a0 100755 --- a/.ci/collect_mapdl_logs_locals.sh +++ b/.ci/collect_mapdl_logs_locals.sh @@ -9,6 +9,8 @@ cp *pymapdl.apdl ./"$LOG_NAMES"/ || echo "No PYMAPDL APDL log files could be fou echo "Copying the profiling files..." cp -r prof ./"$LOG_NAMES"/prof || echo "No profile files could be found" +echo "Copying DPF server files..." +cp dpf_server.log ./"$LOG_NAMES"/dpf-standalone || echo "No DPF server files could be found" ls -la ./"$LOG_NAMES" diff --git a/.ci/install_dpf_server.sh b/.ci/install_dpf_server.sh index cf74eb7980..a3894397b7 100755 --- a/.ci/install_dpf_server.sh +++ b/.ci/install_dpf_server.sh @@ -7,6 +7,7 @@ ANSYS_VERSION="${ANSYS_VERSION:-221}" ANSYS_VERSION_WITH_POINT="${ANSYS_VERSION:0:2}.${ANSYS_VERSION:2}" GITHUB_TOKEN="${GITHUB_TOKEN:?Error: MY_VAR is not set or empty}" +OLD_PATH=$(pwd) echo "OS: $OS" echo "Ansys version: $ANSYS_VERSION" echo "Ansys version (number): $ANSYS_VERSION_WITH_POINT" @@ -56,7 +57,10 @@ if [[ "$OS" == "Linux" ]]; then fi echo "Starting server" -$executable --address 127.0.0.1 > logdpf.txt & +full_executable_path="$(pwd)/$executable" + +cd $OLD_PATH +$full_executable_path --address 127.0.0.1 > dpf_server.log & echo "Server started" sleep 2 From 42182b693d3c7b9697ab3b919f2e5220891002ad Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 19:10:34 +0100 Subject: [PATCH 24/27] feat: increasing timeout --- .ci/install_dpf_server.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/install_dpf_server.sh b/.ci/install_dpf_server.sh index a3894397b7..55a4a549ec 100755 --- a/.ci/install_dpf_server.sh +++ b/.ci/install_dpf_server.sh @@ -63,5 +63,5 @@ cd $OLD_PATH $full_executable_path --address 127.0.0.1 > dpf_server.log & echo "Server started" -sleep 2 -echo "File output: $(cat logdpf.txt)" +sleep 4 +echo "File output: $(cat dpf_server.log)" From 9e773fc7b97e72328656bdc1b57f8571317a987c Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 19:10:46 +0100 Subject: [PATCH 25/27] feat: increasing timeout --- .ci/install_dpf_server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/install_dpf_server.sh b/.ci/install_dpf_server.sh index 55a4a549ec..da3a19295f 100755 --- a/.ci/install_dpf_server.sh +++ b/.ci/install_dpf_server.sh @@ -63,5 +63,5 @@ cd $OLD_PATH $full_executable_path --address 127.0.0.1 > dpf_server.log & echo "Server started" -sleep 4 +sleep 10 echo "File output: $(cat dpf_server.log)" From 89d91d495dad8b14063f547bb340e67415bc7711 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 19:18:33 +0100 Subject: [PATCH 26/27] tests: test --- .ci/install_dpf_server.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/install_dpf_server.sh b/.ci/install_dpf_server.sh index da3a19295f..ebf0bca646 100755 --- a/.ci/install_dpf_server.sh +++ b/.ci/install_dpf_server.sh @@ -52,12 +52,13 @@ echo "$(ls)" if [[ "$OS" == "Linux" ]]; then echo "Setting files permissions" - chmod 755 Ans.Dpf.Grpc.sh || echo "Failed to set permissions in 'Ans.Dpf.Grpc.sh' file." && exit 1 - chmod 755 Ans.Dpf.Grpc.exe || echo "Failed to set permissions in 'Ans.Dpf.Grpc.exe' file." && exit 1 + chmod 755 Ans.Dpf.Grpc.sh #|| echo "Failed to set permissions in 'Ans.Dpf.Grpc.sh' file." && exit 1 + chmod 755 Ans.Dpf.Grpc.exe #|| echo "Failed to set permissions in 'Ans.Dpf.Grpc.exe' file." && exit 1 fi echo "Starting server" full_executable_path="$(pwd)/$executable" +echo "Full executable path: $full_executable_path" cd $OLD_PATH $full_executable_path --address 127.0.0.1 > dpf_server.log & From 1c8e7171b9a2cfef5f4d966818b9e7fcb4e41529 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Tue, 11 Feb 2025 19:28:57 +0100 Subject: [PATCH 27/27] test: again --- .ci/install_dpf_server.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.ci/install_dpf_server.sh b/.ci/install_dpf_server.sh index ebf0bca646..614f087459 100755 --- a/.ci/install_dpf_server.sh +++ b/.ci/install_dpf_server.sh @@ -52,8 +52,10 @@ echo "$(ls)" if [[ "$OS" == "Linux" ]]; then echo "Setting files permissions" - chmod 755 Ans.Dpf.Grpc.sh #|| echo "Failed to set permissions in 'Ans.Dpf.Grpc.sh' file." && exit 1 - chmod 755 Ans.Dpf.Grpc.exe #|| echo "Failed to set permissions in 'Ans.Dpf.Grpc.exe' file." && exit 1 + chmod 755 Ans.Dpf.Grpc.sh || echo "Failed to set permissions in 'Ans.Dpf.Grpc.sh' file." + #|| echo "Failed to set permissions in 'Ans.Dpf.Grpc.sh' file." && exit 1 + chmod 755 Ans.Dpf.Grpc.exe || echo "Failed to set permissions in 'Ans.Dpf.Grpc.sh' file." + #|| echo "Failed to set permissions in 'Ans.Dpf.Grpc.exe' file." && exit 1 fi echo "Starting server"