From 1b736267289153855c1c0de79906e6c9107144c0 Mon Sep 17 00:00:00 2001 From: Mainak Kundu <94432368+mkundu1@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:01:16 -0500 Subject: [PATCH] ci: Run unittests with 25.2 Fluent image in CIs (#3485) * ci: Run unittests with 25.2 Fluent image in CIs * ci: Add missing step * ci: PYFLUENT_CODEGEN_SKIP_BUILTIN_SETTINGS * ci: fix * ci: merge 25.2 testrun * ci: minor --- .github/workflows/ci.yml | 76 ++++++++++--------- .../test-run-dev-version-nightly.yml | 27 ++++--- 2 files changed, 55 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96f641f5370..527477151ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -418,55 +418,57 @@ jobs: doc/source/api/core/meshing/datamodel doc/source/api/core/solver/tui doc/source/api/core/solver/datamodel - key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-${{ vars.FLUENT_STABLE_IMAGE_DEV }}-${{ hashFiles('src/ansys/fluent/core/codegen/**') }} - restore-keys: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-${{ vars.FLUENT_STABLE_IMAGE_DEV }} + key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.1.0-${{ hashFiles('src/ansys/fluent/core/codegen/**') }} + restore-keys: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.1.0 - name: Pull 25.1 Fluent docker image if: steps.cache-251-api-code.outputs.cache-hit != 'true' run: make docker-pull env: - FLUENT_IMAGE_TAG: ${{ vars.FLUENT_STABLE_IMAGE_DEV }} + FLUENT_IMAGE_TAG: v25.1.0 - name: Run 25.1 API codegen if: steps.cache-251-api-code.outputs.cache-hit != 'true' run: make api-codegen env: - FLUENT_IMAGE_TAG: ${{ vars.FLUENT_STABLE_IMAGE_DEV }} + FLUENT_IMAGE_TAG: v25.1.0 + PYFLUENT_CODEGEN_SKIP_BUILTIN_SETTINGS: 1 - name: Print 25.1 Fluent version info run: | cat src/ansys/fluent/core/generated/fluent_version_251.py python -c "from ansys.fluent.core.generated.solver.settings_251 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" - # - name: Cache 25.2 API Code - # uses: actions/cache@v4 - # id: cache-252-api-code - # with: - # path: - # src/ansys/fluent/core/generated - # doc/source/api/core/meshing/tui - # doc/source/api/core/meshing/datamodel - # doc/source/api/core/solver/tui - # doc/source/api/core/solver/datamodel - # key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.2.0-${{ hashFiles('src/ansys/fluent/core/codegen/**') }} - # restore-keys: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.2.0 - - # - name: Pull 25.2 Fluent docker image - # if: steps.cache-252-api-code.outputs.cache-hit != 'true' - # run: make docker-pull - # env: - # FLUENT_IMAGE_TAG: v25.2.0 - - # - name: Run 25.2 API codegen - # if: steps.cache-252-api-code.outputs.cache-hit != 'true' - # run: make api-codegen - # env: - # FLUENT_IMAGE_TAG: v25.2.0 - - # - name: Print 25.2 Fluent version info - # run: | - # cat src/ansys/fluent/core/generated/fluent_version_252.py - # python -c "from ansys.fluent.core.generated.solver.settings_252 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" + # Replace v25.2.0 with ${{ vars.FLUENT_STABLE_IMAGE_DEV }} after the first successful nightly test run + - name: Cache 25.2 API Code + uses: actions/cache@v4 + id: cache-252-api-code + with: + path: + src/ansys/fluent/core/generated + doc/source/api/core/meshing/tui + doc/source/api/core/meshing/datamodel + doc/source/api/core/solver/tui + doc/source/api/core/solver/datamodel + key: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.2.0-${{ hashFiles('src/ansys/fluent/core/codegen/**') }} + restore-keys: API-Code-v${{ env.API_CODE_CACHE }}-${{ steps.version.outputs.PYFLUENT_VERSION }}-v25.2.0 + + - name: Pull 25.2 Fluent docker image + if: steps.cache-251-api-code.outputs.cache-hit != 'true' + run: make docker-pull + env: + FLUENT_IMAGE_TAG: v25.2.0 + + - name: Run 25.2 API codegen + if: steps.cache-252-api-code.outputs.cache-hit != 'true' + run: make api-codegen + env: + FLUENT_IMAGE_TAG: v25.2.0 + + - name: Print 25.2 Fluent version info + run: | + cat src/ansys/fluent/core/generated/fluent_version_252.py + python -c "from ansys.fluent.core.generated.solver.settings_251 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" - name: Install again after codegen run: | @@ -508,11 +510,13 @@ jobs: version: 242 - image-tag: v25.1.0 version: 251 - # - image-tag: v25.2.0 - # version: 252 + - image-tag: v25.2.0 + version: 252 timeout-minutes: 120 env: - FLUENT_IMAGE_TAG: ${{ matrix.version == 251 && vars.FLUENT_STABLE_IMAGE_DEV || matrix.image-tag }} + # Enable this after the first successful nightly test run + # FLUENT_IMAGE_TAG: ${{ matrix.version == 252 && vars.FLUENT_STABLE_IMAGE_DEV || matrix.image-tag }} + FLUENT_IMAGE_TAG: ${{ matrix.image-tag }} steps: diff --git a/.github/workflows/test-run-dev-version-nightly.yml b/.github/workflows/test-run-dev-version-nightly.yml index ef80ad1d028..d4e43379b56 100644 --- a/.github/workflows/test-run-dev-version-nightly.yml +++ b/.github/workflows/test-run-dev-version-nightly.yml @@ -19,6 +19,9 @@ jobs: name: Unit Testing runs-on: [self-hosted, pyfluent] timeout-minutes: 120 + env: + FLUENT_IMAGE_TAG: v25.2.0 + FLUENT_VERSION: 252 steps: - uses: actions/checkout@v4 @@ -55,32 +58,32 @@ jobs: username: ansys-bot password: ${{ secrets.GITHUB_TOKEN }} - - name: Pull 25.1 Fluent docker image + - name: Pull Fluent docker image run: make docker-pull env: - FLUENT_IMAGE_TAG: v25.1.0 + FLUENT_IMAGE_TAG: ${{ env.FLUENT_IMAGE_TAG }} - - name: Run 25.1 API codegen + - name: Run API codegen run: make api-codegen env: - FLUENT_IMAGE_TAG: v25.1.0 + FLUENT_IMAGE_TAG: ${{ env.FLUENT_IMAGE_TAG }} - - name: Print 25.1 Fluent version info + - name: Print Fluent version info run: | - cat src/ansys/fluent/core/generated/fluent_version_251.py - python -c "from ansys.fluent.core.generated.solver.settings_251 import SHASH; print(f'SETTINGS_HASH = {SHASH}')" + cat src/ansys/fluent/core/generated/fluent_version_${{ env.FLUENT_VERSION }}.py + python -c "from ansys.fluent.core.generated.solver.settings_${{ env.FLUENT_VERSION }} import SHASH; print(f'SETTINGS_HASH = {SHASH}')" - name: Install again after codegen run: | rm -rf dist make install > /dev/null - - name: 25.1 Unit Testing + - name: Unit Testing run: | make install-test - make unittest-all-251 + make unittest-all-{{ env.FLUENT_VERSION }} env: - FLUENT_IMAGE_TAG: v25.1.0 + FLUENT_IMAGE_TAG: ${{ env.FLUENT_IMAGE_TAG }} - name: Cleanup previous docker containers if: always() @@ -91,7 +94,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.ADMIN_ACCESS_TOKEN }} if: github.ref == 'refs/heads/main' run: | - DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/ansys/pyfluent:v25.1.0 | sed 's/.*@//') + DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' ghcr.io/ansys/pyfluent:${{ env.FLUENT_IMAGE_TAG }} | sed 's/.*@//') gh variable set FLUENT_STABLE_IMAGE_DEV --body $DIGEST clean-up: @@ -104,4 +107,4 @@ jobs: - uses: actions/checkout@v4 - name: Delete 25.1 Fluent docker image - run: docker rmi -f ghcr.io/ansys/pyfluent:v25.1.0 \ No newline at end of file + run: docker rmi -f ghcr.io/ansys/pyfluent:{{ env.FLUENT_IMAGE_TAG }}