diff --git a/.ci/collect_mapdl_logs_remote.sh b/.ci/collect_mapdl_logs_remote.sh index 238ce78ea7..66ff7d4ab6 100755 --- a/.ci/collect_mapdl_logs_remote.sh +++ b/.ci/collect_mapdl_logs_remote.sh @@ -27,6 +27,7 @@ echo "Collecting local build logs..." echo "Collecting docker run log..." mv log.txt ./"$LOG_NAMES"/log.txt || echo "MAPDL run docker log not found." +mv log_dpf.txt ./"$LOG_NAMES"/log_dpf.txt || echo "DPF run docker log not found." echo "Moving docker launch log..." mv mapdl_launch_0.log ./"$LOG_NAMES"/mapdl_launch_0.log || echo "MAPDL launch docker log not found." diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 6ed0048aa9..7d8973c365 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -72,6 +72,7 @@ jobs: PYANSYS_OFF_SCREEN: True BUILD_CHEATSHEET: '${{ inputs.build_cheatsheet }}' MAPDL_IMAGE_VERSION_DOCS_BUILD: v24.2-ubuntu-student + DPF_DOCKER_IMAGE: ghcr.io/ansys/mapdl:v25.2-rocky-dpf-standalone MAPDL_PACKAGE: ghcr.io/ansys/mapdl PYMAPDL_START_INSTANCE: FALSE PYMAPDL_PORT: 21000 # default won't work on GitHub runners @@ -110,7 +111,7 @@ jobs: - name: "DPF server activation" shell: bash 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 }}.") & + $(docker pull $DPF_DOCKER_IMAGE && docker run -d --name dpfserver --env ANSYS_DPF_ACCEPT_LA=Y -p ${{ env.DPF_PORT }}:50052 $DPF_DOCKER_IMAGE && echo "DPF Server active on port ${{ env.DPF_PORT }}.") & - name: "Getting files change filters" uses: dorny/paths-filter@v3 diff --git a/.github/workflows/test-remote.yml b/.github/workflows/test-remote.yml index cfe8e10efc..499847e690 100644 --- a/.github/workflows/test-remote.yml +++ b/.github/workflows/test-remote.yml @@ -61,8 +61,10 @@ jobs: PYMAPDL_PORT2: 21001 # for the pool testing and default won't work on GitHub runners PYMAPDL_DB_PORT: 21002 # default won't work on GitHub runners PYMAPDL_DB_PORT2: 21003 # default won't work on GitHub runners + DPF_DOCKER_IMAGE: ghcr.io/ansys/mapdl:v25.2-rocky-dpf-standalone DPF_PORT: 21004 DPF_START_SERVER: False + HAS_DPF: 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 --report-log-exclude-logs-on-passed-tests' MAPDL_PACKAGE: ghcr.io/ansys/mapdl @@ -142,14 +144,16 @@ jobs: export INSTANCE_NAME=MAPDL_1 .ci/start_mapdl.sh &> mapdl_launch_1.log & export DOCKER_PID_1=$! echo "Launching MAPDL service 0 at PID: $DOCKER_PID_0" - echo "Launching MAPDL service 1 at PID: $DOCKER_PID_2" + echo "Launching MAPDL service 1 at PID: $DOCKER_PID_1" echo "DOCKER_PID_0=$(echo $DOCKER_PID_0)" >> $GITHUB_OUTPUT echo "DOCKER_PID_1=$(echo $DOCKER_PID_1)" >> $GITHUB_OUTPUT - name: "DPF server activation" shell: bash + env: + ANSYS_DPF_ACCEPT_LA: Y 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 }}.") & + docker pull $DPF_DOCKER_IMAGE && docker run -d --name dpfserver --env ANSYS_DPF_ACCEPT_LA=Y -p ${{ env.DPF_PORT }}:50052 $DPF_DOCKER_IMAGE && echo "DPF Server active on port ${{ env.DPF_PORT }}." > log_dpf.txt & - name: "Getting files change filters" uses: dorny/paths-filter@v3 diff --git a/doc/changelog.d/3882.dependencies.md b/doc/changelog.d/3882.dependencies.md new file mode 100644 index 0000000000..95c3e2fe06 --- /dev/null +++ b/doc/changelog.d/3882.dependencies.md @@ -0,0 +1 @@ +ci: use own DPF standalone Docker image reference in workflows \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index ca373d90eb..32d59b4da6 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -97,6 +97,7 @@ services: - '50052:50052' - '50055:50055' image: ${DOCKER_IMAGE} + platform: linux/amd64 entrypoint: "/bin/bash ansys -grpc" dpf: @@ -105,6 +106,7 @@ services: - mapdl-dpf - local-dpf image: ${DPF_DOCKER_IMAGE} + platform: linux/amd64 ports: - '50056:50052' restart: always @@ -128,6 +130,7 @@ services: ports: - '50052:50052' - '50055:50055' + platform: linux/amd64 image: ${DOCKER_IMAGE} # Mount the current directory to /home/${DOCKER_USER:-mapdl}/pymapdl # This allows you to run the container and have access to the current directory diff --git a/pyproject.toml b/pyproject.toml index 9579f84460..80663456b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,7 +65,7 @@ all = [ ] tests = [ - "ansys-dpf-core==0.13.6", + "ansys-dpf-core[graphics]==0.13.6", "ansys-tools-visualization-interface==0.9.1", "autopep8==2.3.2", "matplotlib==3.10.3", @@ -86,7 +86,7 @@ tests = [ ] doc = [ - "ansys-dpf-core==0.13.6", + "ansys-dpf-core[graphics]==0.13.6", "ansys-mapdl-reader==0.55.0", "ansys-sphinx-theme==1.4.4", "ansys-tools-visualization-interface==0.9.1", diff --git a/tests/test_dpf.py b/tests/test_dpf.py index 4233b13692..d8a5c14111 100644 --- a/tests/test_dpf.py +++ b/tests/test_dpf.py @@ -32,7 +32,7 @@ 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 + DPF_PORT = int(os.environ.get("DPF_PORT", DPF_DEFAULT_PORT)) # Set in ci.yaml @pytest.fixture() @@ -46,7 +46,7 @@ def dpf_server(): # Start the DPF server if ON_LOCAL: # If running locally, start the server - dpf_server = dpf.start_local_server(port=int(DPF_PORT)) + dpf_server = dpf.start_local_server(port=DPF_PORT) assert not dpf_server.info["server_ip"] else: @@ -64,7 +64,7 @@ def model(dpf_server, mapdl, solved_box, tmpdir): # Upload RST if not dpf_server.local_server: - rst_path = dpf.upload_file_in_tmp_folder(rst_path) + rst_path = dpf.upload_file_in_tmp_folder(rst_path, server=dpf_server) model = dpf.Model(rst_path) assert model.results is not None