Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Run fluent tests with 25.2 image #3491

Merged
merged 3 commits into from
Nov 18, 2024
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
7 changes: 5 additions & 2 deletions .ci/fluent_test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import yaml

import ansys.fluent.core as pyfluent
from ansys.fluent.core import FluentVersion
import docker


Expand Down Expand Up @@ -38,7 +39,8 @@ def run_fluent_test(journal_file: Path, launcher_args: str = "") -> None:
"""
logging.debug(f"journal_file: {journal_file}")
src_pyfluent_dir = str(Path(pyfluent.__file__).parent)
dst_pyfluent_dir = "/ansys_inc/v251/commonfiles/CPython/3_10/linx64/Release/python/lib/python3.10/site-packages/ansys/fluent/core"
verion_for_file_name = FluentVersion.current_dev().number
dst_pyfluent_dir = f"/ansys_inc/v{verion_for_file_name}/commonfiles/CPython/3_10/linx64/Release/python/lib/python3.10/site-packages/ansys/fluent/core"
src_test_dir = str(journal_file.parent)
dst_test_dir = "/testing"
logging.debug(f"src_pyfluent_dir: {src_pyfluent_dir}")
Expand All @@ -47,7 +49,8 @@ def run_fluent_test(journal_file: Path, launcher_args: str = "") -> None:
logging.debug(f"dst_test_dir: {dst_test_dir}")

docker_client = docker.from_env()
image_name = "ghcr.io/ansys/pyfluent:v25.1.0"
version_for_image_tag = FluentVersion.current_dev().docker_image_tag
image_name = f"ghcr.io/ansys/pyfluent:{version_for_image_tag}"
container = docker_client.containers.run(
image=image_name,
volumes=[
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/test-fluent-journals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ env:
PYFLUENT_WATCHDOG_DEBUG: 'OFF'
PYFLUENT_HIDE_LOG_SECRETS: 1
MAIN_PYTHON_VERSION: '3.10'
FLUENT_IMAGE_TAG: v25.2.0
FLUENT_VERSION: 252

jobs:
test:
Expand Down Expand Up @@ -58,20 +60,20 @@ 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: |
Expand Down
2 changes: 1 addition & 1 deletion doc/settings_rstgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def _populate_rst_from_settings(rst_dir, cls, version):
os.makedirs(rst_dir)

image_tag = os.getenv(
"FLUENT_IMAGE_TAG", FluentVersion.current_release().docker_image_tag
"FLUENT_IMAGE_TAG", FluentVersion.current_dev().docker_image_tag
)
version = get_version_for_file_name(image_tag.lstrip("v"))
settings = importlib.import_module(
Expand Down
3 changes: 3 additions & 0 deletions src/ansys/fluent/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@

# Current Fluent version
fluent_release_version = "24.2.0"

# Dev Fluent version
fluent_dev_version = "25.2.0"
13 changes: 12 additions & 1 deletion src/ansys/fluent/core/utils/fluent_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os

import ansys.fluent.core as pyfluent
from ansys.fluent.core._version import fluent_release_version
from ansys.fluent.core._version import fluent_dev_version, fluent_release_version


class AnsysVersionNotFound(RuntimeError):
Expand Down Expand Up @@ -111,6 +111,17 @@ def current_release(cls):
"""
return cls(fluent_release_version)

@classmethod
def current_dev(cls):
"""Return the version member of the current development version.

Returns
-------
FluentVersion
FluentVersion member corresponding to the latest development version.
"""
return cls(fluent_dev_version)

@property
def awp_var(self):
"""Get the Fluent version in AWP environment variable format."""
Expand Down
Loading