diff --git a/.ci/collect_mapdl_logs.sh b/.ci/collect_mapdl_logs.sh index 5e075ae096..57ce2bedaf 100755 --- a/.ci/collect_mapdl_logs.sh +++ b/.ci/collect_mapdl_logs.sh @@ -32,7 +32,8 @@ echo "Collecting docker run log..." cp log.txt ./"$LOG_NAMES"/log.txt || echo "MAPDL run docker log not found." echo "Copying docker launch log..." -cp mapdl_launch.log ./"$LOG_NAMES"/mapdl_launch.log || echo "MAPDL launch docker log not found." +cp mapdl_launch_0.log ./"$LOG_NAMES"/mapdl_launch_0.log || echo "MAPDL launch docker log not found." +cp mapdl_launch_1.log ./"$LOG_NAMES"/mapdl_launch_1.log || echo "MAPDL launch docker log not found." echo "Collecting file structure..." ls -R > ./"$LOG_NAMES"/files_structure.txt || echo "Failed to copy file structure to a file" diff --git a/.ci/start_mapdl.sh b/.ci/start_mapdl.sh index 8870e5fd81..68d028c4a4 100755 --- a/.ci/start_mapdl.sh +++ b/.ci/start_mapdl.sh @@ -13,7 +13,12 @@ export VERSION="$MAJOR$MINOR" echo "MAPDL VERSION: $VERSION" -if [[ $MAPDL_VERSION == *"ubuntu"* ]] ; then +if [[ $MAPDL_VERSION == *"latest-ubuntu"* ]]; then + echo "It is latest-ubuntu. Using 'ansys' script to launch" + export EXEC_PATH=ansys + # export P_SCHEMA=/ansys_inc/ansys/ac4/schema + +elif [[ $MAPDL_VERSION == *"ubuntu"* ]] ; then echo "It is an ubuntu based image" export EXEC_PATH=/ansys_inc/v$VERSION/ansys/bin/mapdl export P_SCHEMA=/ansys_inc/v$VERSION/ansys/ac4/schema @@ -40,7 +45,7 @@ docker run \ -e ANSYS_LOCK="OFF" \ -p "$PYMAPDL_PORT":50052 \ -p "$PYMAPDL_DB_PORT":50055 \ - --shm-size=1gb \ + --shm-size=2gb \ -e I_MPI_SHM_LMT=shm \ -e P_SCHEMA="$P_SCHEMA" \ -w /jobs \ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee58f1b8b7..4a9e77d8d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -290,22 +290,49 @@ jobs: strategy: fail-fast: false matrix: - mapdl-version: ['v22.2.1', 'v22.2-ubuntu', 'v23.1.0', 'v23.2.0', 'v24.1.0', 'v24.1-ubuntu-student'] + mapdl-version: [ + 'v22.2.1', + 'v22.2-ubuntu', + 'v23.1.0', + 'v23.1-ubuntu', + 'v23.2.0', + 'v23.2-ubuntu', + 'v24.1.0', + 'v24.1-ubuntu', + 'v24.1-ubuntu-student', + 'v24.2.0', + 'latest-ubuntu', + 'latest-ubuntu-student', + ] extended_testing: - ${{ github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && inputs.run_all_tests ) || ( github.event_name == 'push' && contains(github.ref, 'refs/tags') ) }} exclude: + # In PRs skipping all MAPDL version except student ones (commented out). - extended_testing: false mapdl-version: 'v22.2.1' - extended_testing: false mapdl-version: 'v22.2-ubuntu' - extended_testing: false mapdl-version: 'v23.1.0' + - extended_testing: false + mapdl-version: 'v23.1-ubuntu' - extended_testing: false mapdl-version: 'v23.2.0' - extended_testing: false - mapdl-version: 'v23.1.0' + mapdl-version: 'v23.2-ubuntu' - extended_testing: false mapdl-version: 'v24.1.0' + - extended_testing: false + mapdl-version: 'v24.1-ubuntu' + # - extended_testing: false + # mapdl-version: 'v24.1-ubuntu-student' + - extended_testing: false + mapdl-version: 'v24.2.0' + - extended_testing: false + mapdl-version: 'latest-ubuntu' + # - extended_testing: false + # mapdl-version: 'latest-ubuntu-student' + env: PYMAPDL_PORT: 21000 # default won't work on GitHub runners PYMAPDL_PORT2: 21001 # for the pool testing and default won't work on GitHub runners @@ -482,7 +509,13 @@ jobs: strategy: fail-fast: false matrix: - mapdl-image: ['v23.2-ubuntu', 'v24.1-ubuntu', 'v24.1-ubuntu-student'] + mapdl-image: [ + 'v23.2-ubuntu', + 'v24.1-ubuntu', + 'v24.1-ubuntu-student', + 'latest-ubuntu', + 'latest-ubuntu-student', + ] extended_testing: - ${{ github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && inputs.run_all_tests ) || ( github.event_name == 'push' && contains(github.ref, 'refs/tags') ) }} exclude: @@ -490,6 +523,8 @@ jobs: mapdl-image: 'v23.2-ubuntu' - extended_testing: false mapdl-image: 'v24.1-ubuntu' + - extended_testing: false + mapdl-image: 'latest-ubuntu' container: image: ghcr.io/ansys/mapdl:${{ matrix.mapdl-image }} options: -u=0:0 --oom-kill-disable --memory=6656MB --memory-swap=16896MB --shm-size=1gb --entrypoint /bin/bash @@ -608,7 +643,13 @@ jobs: strategy: fail-fast: false matrix: - mapdl-image: ['v23.2-ubuntu', 'v24.1-ubuntu', 'v24.1-ubuntu-student'] + mapdl-image: [ + 'v23.2-ubuntu', + 'v24.1-ubuntu', + 'v24.1-ubuntu-student', + 'latest-ubuntu', + 'latest-ubuntu-student', + ] extended_testing: - ${{ github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && inputs.run_all_tests ) || ( github.event_name == 'push' && contains(github.ref, 'refs/tags') ) }} exclude: @@ -616,6 +657,8 @@ jobs: mapdl-image: 'v23.2-ubuntu' - extended_testing: false mapdl-image: 'v24.1-ubuntu' + - extended_testing: false + mapdl-image: 'latest-ubuntu' container: image: ghcr.io/ansys/mapdl:${{ matrix.mapdl-image }} options: -u=0:0 --oom-kill-disable --memory=6656MB --memory-swap=16896MB --shm-size=1gb --entrypoint /bin/bash @@ -665,7 +708,13 @@ jobs: run: | # Because there is no 'ansys-tools-path' we need to input the # executable path with the env var: PYMAPDL_MAPDL_EXEC. - version=$(echo "${{ matrix.mapdl-image }}" | head -c 5 | tail -c 4 | tr -d '.') + + if [[ "${{ matrix.mapdl-image }}" == *"latest-ubuntu"* ]] ; then + version="242" + else + version=$(echo "${{ matrix.mapdl-image }}" | head -c 5 | tail -c 4 | tr -d '.') + fi; + echo "$version" export PYMAPDL_MAPDL_EXEC=/ansys_inc/v"$version"/ansys/bin/ansys"$version" @@ -692,6 +741,7 @@ jobs: test-windows: + # Skipped if: github.repository == '' name: "Local: Build & test on Windows" runs-on: [self-hosted, Windows, pymapdl] diff --git a/src/ansys/mapdl/core/_version.py b/src/ansys/mapdl/core/_version.py index 43f141899d..2b73beb61c 100644 --- a/src/ansys/mapdl/core/_version.py +++ b/src/ansys/mapdl/core/_version.py @@ -41,6 +41,7 @@ # In descending order SUPPORTED_ANSYS_VERSIONS = { + 242: "2024R2", 241: "2024R1", 232: "2023R2", 231: "2023R1", diff --git a/src/ansys/mapdl/core/database/database.py b/src/ansys/mapdl/core/database/database.py index 3323a664d1..5877af5f6e 100644 --- a/src/ansys/mapdl/core/database/database.py +++ b/src/ansys/mapdl/core/database/database.py @@ -37,6 +37,7 @@ from ..mapdl_grpc import MapdlGrpc MINIMUM_MAPDL_VERSION = "21.1" +FAILING_DATABASE_MAPDL = ["24.1", "24.2"] class WithinBeginLevel: @@ -236,9 +237,10 @@ def start(self, timeout=10): ) ## Checking MAPDL versions - mapdl_version = self._mapdl.version - if not server_meets_version( - str(mapdl_version), MINIMUM_MAPDL_VERSION + mapdl_version = str(self._mapdl.version) + if ( + not server_meets_version(mapdl_version, MINIMUM_MAPDL_VERSION) + or mapdl_version in FAILING_DATABASE_MAPDL ): # pragma: no cover from ansys.mapdl.core.errors import MapdlVersionError diff --git a/tests/test_database.py b/tests/test_database.py index fe24c729d7..f045af90d8 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -28,7 +28,8 @@ ## Checking MAPDL versions from ansys.mapdl.core.database import MINIMUM_MAPDL_VERSION, DBDef, MapdlDb -from ansys.mapdl.core.errors import MapdlRuntimeError +from ansys.mapdl.core.database.database import FAILING_DATABASE_MAPDL +from ansys.mapdl.core.errors import MapdlRuntimeError, MapdlVersionError from ansys.mapdl.core.misc import random_string from conftest import ON_CI @@ -56,7 +57,7 @@ def db(mapdl): f"This MAPDL version ({mapdl_version}) docker image seems to not support DB, but local does." ) - if mapdl_version == "24.1": + if mapdl_version == "24.1" or mapdl_version == "24.2": pytest.skip( f"This MAPDL version ({mapdl_version}) does not support PyMAPDL Database." ) @@ -72,6 +73,14 @@ def db(mapdl): return mapdl.db +def test_failure_on_non_allowed_versions(mapdl): + if str(mapdl.version) in ["24.1", "24.2"]: + with pytest.raises(MapdlVersionError): + mapdl.db.start() + else: + pytest.skip(f"Should run only on MAPDL 24.1 and 24.2") + + @pytest.fixture(scope="session") def gen_block(mapdl): """Generate nodes and elements in a simple block.""" @@ -109,6 +118,11 @@ def test_database_start_stop(mapdl): f"This MAPDL version ({mapdl_version}) docker image seems to not support DB, but local does." ) + if mapdl_version in FAILING_DATABASE_MAPDL: + pytest.skip( + f"This MAPDL version ({mapdl_version}) docker image does not support Database module." + ) + # verify it can be created twice mapdl.prep7() for _ in range(2):