Skip to content

Commit 3e7f524

Browse files
ci: use own DPF standalone Docker image reference in workflows (#3882)
* ci: use own DPF standalone Docker image reference in workflows * chore: adding changelog file 3882.maintenance.md [dependabot-skip] * fix: enable DPF support in test workflow * feat: add DPF log collection to remote log script and update DPF server activation logging * fix: update vtk dependency version to 9.4.2 in tests and documentation * fix: correct DPF_PORT type and update file upload method in test_dpf.py * chore: adding changelog file 3882.dependencies.md [dependabot-skip] * fix: update ansys-dpf-core dependency to include graphics support in tests and documentation * fix: specify platform as linux/amd64 for all services in docker-compose * fix: update DPF Docker image tag to remove platform specification and use rocky version * fix: add environment variable to accept DPF license agreement during server activation * fix: comment out DPF port waiting logic in waiting_services.sh * fix: correct PID logging for MAPDL service launch and add environment variable for DPF server * fix: uncomment DPF port waiting logic in waiting_services.sh * fix: correct DPF Docker image tag in documentation build workflow * fix: missing env var * cicd: empty commit to retrigger cicd * fix: update DPF Docker image tag to use rocky variant in workflows --------- Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
1 parent fb448fb commit 3e7f524

File tree

7 files changed

+18
-8
lines changed

7 files changed

+18
-8
lines changed

.ci/collect_mapdl_logs_remote.sh

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ echo "Collecting local build logs..."
2727

2828
echo "Collecting docker run log..."
2929
mv log.txt ./"$LOG_NAMES"/log.txt || echo "MAPDL run docker log not found."
30+
mv log_dpf.txt ./"$LOG_NAMES"/log_dpf.txt || echo "DPF run docker log not found."
3031

3132
echo "Moving docker launch log..."
3233
mv mapdl_launch_0.log ./"$LOG_NAMES"/mapdl_launch_0.log || echo "MAPDL launch docker log not found."

.github/workflows/doc-build.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
PYANSYS_OFF_SCREEN: True
7373
BUILD_CHEATSHEET: '${{ inputs.build_cheatsheet }}'
7474
MAPDL_IMAGE_VERSION_DOCS_BUILD: v24.2-ubuntu-student
75+
DPF_DOCKER_IMAGE: ghcr.io/ansys/mapdl:v25.2-rocky-dpf-standalone
7576
MAPDL_PACKAGE: ghcr.io/ansys/mapdl
7677
PYMAPDL_START_INSTANCE: FALSE
7778
PYMAPDL_PORT: 21000 # default won't work on GitHub runners
@@ -110,7 +111,7 @@ jobs:
110111
- name: "DPF server activation"
111112
shell: bash
112113
run: |
113-
$(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 }}.") &
114+
$(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 }}.") &
114115
115116
- name: "Getting files change filters"
116117
uses: dorny/paths-filter@v3

.github/workflows/test-remote.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ jobs:
6161
PYMAPDL_PORT2: 21001 # for the pool testing and default won't work on GitHub runners
6262
PYMAPDL_DB_PORT: 21002 # default won't work on GitHub runners
6363
PYMAPDL_DB_PORT2: 21003 # default won't work on GitHub runners
64+
DPF_DOCKER_IMAGE: ghcr.io/ansys/mapdl:v25.2-rocky-dpf-standalone
6465
DPF_PORT: 21004
6566
DPF_START_SERVER: False
67+
HAS_DPF: True
6668
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'
6769
MAPDL_PACKAGE: ghcr.io/ansys/mapdl
6870

@@ -142,14 +144,16 @@ jobs:
142144
export INSTANCE_NAME=MAPDL_1
143145
.ci/start_mapdl.sh &> mapdl_launch_1.log & export DOCKER_PID_1=$!
144146
echo "Launching MAPDL service 0 at PID: $DOCKER_PID_0"
145-
echo "Launching MAPDL service 1 at PID: $DOCKER_PID_2"
147+
echo "Launching MAPDL service 1 at PID: $DOCKER_PID_1"
146148
echo "DOCKER_PID_0=$(echo $DOCKER_PID_0)" >> $GITHUB_OUTPUT
147149
echo "DOCKER_PID_1=$(echo $DOCKER_PID_1)" >> $GITHUB_OUTPUT
148150
149151
- name: "DPF server activation"
150152
shell: bash
153+
env:
154+
ANSYS_DPF_ACCEPT_LA: Y
151155
run: |
152-
$(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 }}.") &
156+
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 &
153157
154158
- name: "Getting files change filters"
155159
uses: dorny/paths-filter@v3

doc/changelog.d/3882.dependencies.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ci: use own DPF standalone Docker image reference in workflows

docker/docker-compose.yml

+3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ services:
9797
- '50052:50052'
9898
- '50055:50055'
9999
image: ${DOCKER_IMAGE}
100+
platform: linux/amd64
100101
entrypoint: "/bin/bash ansys -grpc"
101102

102103
dpf:
@@ -105,6 +106,7 @@ services:
105106
- mapdl-dpf
106107
- local-dpf
107108
image: ${DPF_DOCKER_IMAGE}
109+
platform: linux/amd64
108110
ports:
109111
- '50056:50052'
110112
restart: always
@@ -128,6 +130,7 @@ services:
128130
ports:
129131
- '50052:50052'
130132
- '50055:50055'
133+
platform: linux/amd64
131134
image: ${DOCKER_IMAGE}
132135
# Mount the current directory to /home/${DOCKER_USER:-mapdl}/pymapdl
133136
# This allows you to run the container and have access to the current directory

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ all = [
6565
]
6666

6767
tests = [
68-
"ansys-dpf-core==0.13.6",
68+
"ansys-dpf-core[graphics]==0.13.6",
6969
"ansys-tools-visualization-interface==0.9.1",
7070
"autopep8==2.3.2",
7171
"matplotlib==3.10.3",
@@ -86,7 +86,7 @@ tests = [
8686
]
8787

8888
doc = [
89-
"ansys-dpf-core==0.13.6",
89+
"ansys-dpf-core[graphics]==0.13.6",
9090
"ansys-mapdl-reader==0.55.0",
9191
"ansys-sphinx-theme==1.4.4",
9292
"ansys-tools-visualization-interface==0.9.1",

tests/test_dpf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from ansys.dpf import core as dpf
3333
from ansys.dpf.core.server_types import DPF_DEFAULT_PORT
3434

35-
DPF_PORT = os.environ.get("DPF_PORT", DPF_DEFAULT_PORT) # Set in ci.yaml
35+
DPF_PORT = int(os.environ.get("DPF_PORT", DPF_DEFAULT_PORT)) # Set in ci.yaml
3636

3737

3838
@pytest.fixture()
@@ -46,7 +46,7 @@ def dpf_server():
4646
# Start the DPF server
4747
if ON_LOCAL:
4848
# If running locally, start the server
49-
dpf_server = dpf.start_local_server(port=int(DPF_PORT))
49+
dpf_server = dpf.start_local_server(port=DPF_PORT)
5050
assert not dpf_server.info["server_ip"]
5151

5252
else:
@@ -64,7 +64,7 @@ def model(dpf_server, mapdl, solved_box, tmpdir):
6464

6565
# Upload RST
6666
if not dpf_server.local_server:
67-
rst_path = dpf.upload_file_in_tmp_folder(rst_path)
67+
rst_path = dpf.upload_file_in_tmp_folder(rst_path, server=dpf_server)
6868

6969
model = dpf.Model(rst_path)
7070
assert model.results is not None

0 commit comments

Comments
 (0)