Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .ci/build_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ for version in "${versions[@]}"; do
fi

# Skipping if on remote and on student
if [[ "$ON_STUDENT" != "true" && "$ON_REMOTE" == "true" ]]; then
if [[ "$ON_STUDENT" != "true" && "$ON_REMOTE" == "true" && "$version" == *"cicd"* ]]; then
echo "Not skipping CICD versions when running on remote."
echo ""

elif [[ "$ON_STUDENT" != "true" && "$ON_REMOTE" == "true" ]]; then
echo "Skipping non-student versions when running on remote"
echo ""
continue
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/test-remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,19 @@ jobs:
id: ubuntu_check
shell: bash
run: |
export ON_SAME_CONTAINER=false
if [[ "${{ inputs.mapdl-version }}" == *"ubuntu"* ]];
then export ON_UBUNTU=true; export TAG_UBUNTU="ubuntu";
else export ON_UBUNTU=false; export TAG_UBUNTU="centos";
if [[ "${{ inputs.mapdl-version }}" == *"cicd"* ]]; then export ON_SAME_CONTAINER="true"; fi
fi
echo "ON_UBUNTU: $ON_UBUNTU"
echo "TAG_UBUNTU: $TAG_UBUNTU"
echo "ON_SAME_CONTAINER: $ON_SAME_CONTAINER"

echo "ON_UBUNTU=$(echo $ON_UBUNTU)" >> $GITHUB_OUTPUT
echo "TAG_UBUNTU=$(echo $TAG_UBUNTU)" >> $GITHUB_OUTPUT
echo "ON_SAME_CONTAINER=$(echo $ON_SAME_CONTAINER)" >> $GITHUB_OUTPUT

- name: "Get if running student version"
id: student_check
Expand Down Expand Up @@ -148,12 +153,20 @@ 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"
- name: "Start DPF server on a separate container"
shell: bash
if: ${{ steps.ubuntu_check.outputs.ON_SAME_CONTAINER == 'false' }}
env:
ANSYS_DPF_ACCEPT_LA: Y
run: |
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: "Start DPF server on same container as MAPDL"
if: ${{ steps.ubuntu_check.outputs.ON_SAME_CONTAINER == 'true' }}
shell: bash
run: |
echo "Starting DPF server on same MAPDL container..."
docker exec MAPDL_0 /bin/bash -c "/ansys_inc/v252/aisol/bin/linx64/Ans.Dpf.Grpc.sh --port ${{ env.DPF_PORT }} &" &> log_dpf.txt &

- name: "Getting files change filters"
uses: dorny/paths-filter@v3
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/4008.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ci: allow starting dpf on same container
7 changes: 4 additions & 3 deletions tests/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@
# Check env var
IGNORE_POOL = os.environ.get("IGNORE_POOL", "").upper() == "TRUE"

# skipping if ON_STUDENT and ON_LOCAL because we cannot spawn that many instances.


# skipping if ON_STUDENT because we cannot spawn that many instances.
skip_if_ignore_pool = pytest.mark.skipif(
IGNORE_POOL or ON_STUDENT,
reason=f"Ignoring Pool tests because {'of the IGNORE_POOL env var' if IGNORE_POOL else 'running on student'}.",
Expand Down Expand Up @@ -287,6 +285,7 @@ def test_directory_names_default_with_restart(self, pool):
assert f"Instance_{i}" in dirs_path_pool

@skip_if_ignore_pool
@requires("local")
@patch("ansys.mapdl.core.pool.MapdlPool._spawn_mapdl", patch_spawn_mapdl)
def test_directory_names_custom_string(self, tmpdir):
pool = MapdlPool(
Expand All @@ -305,6 +304,7 @@ def test_directory_names_custom_string(self, tmpdir):
assert all(["my_instance" in each for each in dirs_path_pool])

@skip_if_ignore_pool
@requires("local")
@patch("ansys.mapdl.core.pool.launch_mapdl", lambda *args, **kwargs: kwargs)
@patch(
"ansys.mapdl.core.pool.MapdlPool.is_initialized", lambda *args, **kwargs: True
Expand Down Expand Up @@ -359,6 +359,7 @@ def test_num_instances(self):
)

@skip_if_ignore_pool
@requires("local")
@patch("ansys.mapdl.core.pool.MapdlPool._spawn_mapdl", patch_spawn_mapdl)
def test_only_one_instance(self):
pool_ = MapdlPool(
Expand Down
Loading