diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 5760bfa17a..6edf5eb03b 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -9,7 +9,7 @@ on: - main env: - MAIN_PYTHON_VERSION: '3.13' + MAIN_PYTHON_VERSION: '3.12' PACKAGE_NAME: 'ansys-geometry-core' DOCUMENTATION_CNAME: 'geometry.docs.pyansys.com' ANSRV_GEO_IMAGE: 'ghcr.io/ansys/geometry' @@ -102,20 +102,71 @@ jobs: directory: docker recursive: true + manifests: + name: Check Docker manifests + runs-on: ubuntu-latest + outputs: + skip_dms: ${{ steps.services.outputs.skip_dms }} + skip_core_windows: ${{ steps.services.outputs.skip_core_windows }} + skip_core_linux: ${{ steps.services.outputs.skip_core_linux }} + strategy: + matrix: + include: + - container-stable: "windows-latest" + container-unstable: "windows-latest-unstable" + service: "dms" + service-name: "Windows DMS" + - container-stable: "core-windows-latest" + container-unstable: "core-windows-latest-unstable" + service: "core_windows" + service-name: "Windows Core Service" + - container-stable: "core-linux-latest" + container-unstable: "core-linux-latest-unstable" + service: "core_linux" + service-name: "Linux Core Service" + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Check ${{ matrix.service-name }} manifest + id: services + run: | + docker manifest inspect ghcr.io/ansys/geometry:${{ matrix.container-stable }} > ${{ matrix.container-stable }}.json + docker manifest inspect ghcr.io/ansys/geometry:${{ matrix.container-unstable }} > ${{ matrix.container-unstable }}.json || true + + # Verify that the unstable manifest exists - otherwise create an empty file + if [ ! -f ${{ matrix.container-unstable }}.json ]; then + touch ${{ matrix.container-unstable }}.json + fi + + + # Check if the manifests are the same (and if so, create an output that will skip the next job) + if diff ${{ matrix.container-stable }}.json ${{ matrix.container-unstable }}.json; then + echo "${{ matrix.service-name }} container manifests are the same... skipping" + echo "skip_${{ matrix.service }}=1" >> "$GITHUB_OUTPUT" + else + echo "${{ matrix.service-name }} container manifests are different" + echo "skip_${{ matrix.service }}=0" >> "$GITHUB_OUTPUT" + fi + # ================================================================================================= # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv # ================================================================================================= testing-windows: name: Testing and coverage (Windows) - needs: [smoke-tests] + needs: [smoke-tests, manifests] # runs-on: [self-hosted, Windows, pygeometry] runs-on: # TODO: Waiting for ansys-network runner to be updated group: pyansys-self-hosted labels: [self-hosted, Windows, pygeometry] continue-on-error: ${{ matrix.experimental }} env: - SKIP_UNSTABLE: ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY == 1 && matrix.experimental }} + SKIP_UNSTABLE: false PYVISTA_OFF_SCREEN: true strategy: fail-fast: false @@ -131,6 +182,30 @@ jobs: experimental: true steps: + - name: Calculate SKIP_UNSTABLE + if: matrix.experimental + run: | + # Choose the manifests output to consider (for DMS or Core service) + # based on the matrix value + if ("${{ matrix.docker-image }}" -eq "windows-latest-unstable") { + $ImagesAreEqual = ${{ needs.manifests.outputs.skip_dms }} + } elseif ("${{ matrix.docker-image }}" -eq "core-windows-latest-unstable") { + $ImagesAreEqual = ${{ needs.manifests.outputs.skip_core_windows }} + } else { + Write-Output "Unknown docker image" + exit 1 + } + + $A = $env:SKIP_UNSTABLE_CONTAINERS_TEMPORARILY -eq 1 + $B = $ImagesAreEqual -eq 1 + + # Calculate the logical expression + $Result = ($A -or $B).ToString().ToLower() + + # Export it as an environment variable with true/false value + Write-Output "SKIP_UNSTABLE=$Result" | Out-File -FilePath $env:GITHUB_ENV -Append + Write-Output "SKIP_UNSTABLE will be: $Result" + - uses: actions/checkout@v4 if: env.SKIP_UNSTABLE == 'false' @@ -329,11 +404,11 @@ jobs: testing-linux: name: Testing and coverage (Linux) - needs: [smoke-tests] + needs: [smoke-tests, manifests] runs-on: ubuntu-latest continue-on-error: ${{ matrix.experimental }} env: - SKIP_UNSTABLE: ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY == 1 && matrix.experimental }} + SKIP_UNSTABLE: false strategy: fail-fast: false matrix: @@ -344,6 +419,28 @@ jobs: experimental: true steps: + - name: Calculate SKIP_UNSTABLE + if: matrix.experimental + run: | + # Choose the manifests output to consider (for Core service) + # based on the matrix value + if [[ "${{ matrix.docker-image }}" == "core-linux-latest-unstable" ]]; then + ImagesAreEqual=${{ needs.manifests.outputs.skip_core_linux }} + else + echo "Unknown docker image" + exit 1 + fi + + A=$([[ "$SKIP_UNSTABLE_CONTAINERS_TEMPORARILY" == "1" ]] && echo true || echo false) + B=$([[ "$ImagesAreEqual" == "1" ]] && echo true || echo false) + + # Calculate the logical expression + Result=$([[ "$A" == true || "$B" == true ]] && echo true || echo false) + + # Export it as an environment variable with true/false value + echo "SKIP_UNSTABLE=$Result" >> $GITHUB_ENV + echo "SKIP_UNSTABLE will be: $Result" + - name: Login in Github Container registry if: env.SKIP_UNSTABLE == 'false' uses: docker/login-action@v3 diff --git a/.github/workflows/nightly_docker_test.yml b/.github/workflows/nightly_docker_test.yml index e57ae775f4..af3131626c 100644 --- a/.github/workflows/nightly_docker_test.yml +++ b/.github/workflows/nightly_docker_test.yml @@ -1,4 +1,4 @@ -name: Nightly Server test - Latest build +name: Unstable build tests and promotion on: workflow_dispatch: inputs: @@ -21,7 +21,7 @@ on: - v* env: - MAIN_PYTHON_VERSION: '3.13' + MAIN_PYTHON_VERSION: '3.12' ANSRV_GEO_IMAGE_WINDOWS_TAG: ghcr.io/ansys/geometry:windows-latest-unstable ANSRV_GEO_IMAGE_WINDOWS_CORE_TAG: ghcr.io/ansys/geometry:core-windows-latest-unstable ANSRV_GEO_IMAGE_LINUX_CORE_TAG: ghcr.io/ansys/geometry:core-linux-latest-unstable @@ -35,13 +35,65 @@ concurrency: jobs: + manifests: + name: Check Docker manifests + runs-on: ubuntu-latest + outputs: + skip_dms: ${{ steps.services.outputs.skip_dms }} + skip_core_windows: ${{ steps.services.outputs.skip_core_windows }} + skip_core_linux: ${{ steps.services.outputs.skip_core_linux }} + strategy: + matrix: + include: + - container-stable: "windows-latest" + container-unstable: "windows-latest-unstable" + service: "dms" + service-name: "Windows DMS" + - container-stable: "core-windows-latest" + container-unstable: "core-windows-latest-unstable" + service: "core_windows" + service-name: "Windows Core Service" + - container-stable: "core-linux-latest" + container-unstable: "core-linux-latest-unstable" + service: "core_linux" + service-name: "Linux Core Service" + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Check ${{ matrix.service-name }} manifest + id: services + run: | + docker manifest inspect ghcr.io/ansys/geometry:${{ matrix.container-stable }} > ${{ matrix.container-stable }}.json + docker manifest inspect ghcr.io/ansys/geometry:${{ matrix.container-unstable }} > ${{ matrix.container-unstable }}.json || true + + # Verify that the unstable manifest exists - otherwise create an empty file + if [ ! -f ${{ matrix.container-unstable }}.json ]; then + touch ${{ matrix.container-unstable }}.json + fi + + + # Check if the manifests are the same (and if so, create an output that will skip the next job) + if diff ${{ matrix.container-stable }}.json ${{ matrix.container-unstable }}.json; then + echo "${{ matrix.service-name }} container manifests are the same... skipping" + echo "skip_${{ matrix.service }}=1" >> "$GITHUB_OUTPUT" + else + echo "${{ matrix.service-name }} container manifests are different" + echo "skip_${{ matrix.service }}=0" >> "$GITHUB_OUTPUT" + fi + # ================================================================================================= # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # ================================================================================================= windows-dms-tests: - name: Nightly unstable testing - Windows DMS - if: vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1 + name: Windows DMS + needs: manifests + if: needs.manifests.outputs.skip_dms == 0 runs-on: [self-hosted, Windows, pygeometry] env: PYVISTA_OFF_SCREEN: true @@ -127,12 +179,12 @@ jobs: { "@type": "MessageCard", "@context": "http://schema.org/extensions", - "summary": "Nightly Tests for Windows DMS failing", + "summary": "Unstable build tests for Windows DMS failing", "themeColor": "f44336", - "title": "PyAnsys Geometry Nightly Tests - Windows DMS failing", + "title": "PyAnsys Geometry unstable build tests - Windows DMS failing", "sections": [ { - "activityTitle": "Windows DMS nightly tests are failing", + "activityTitle": "Windows DMS unstable build tests are failing", "activitySubtitle": "Check the run for more details: https://github.com/ansys/pyansys-geometry/actions/runs/${{ github.run_id }}", "facts": [ { @@ -145,8 +197,9 @@ jobs: } windows-core-tests: - name: Nightly unstable testing - Windows Core Service - if: vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1 + name: Windows Core Service + needs: manifests + if: needs.manifests.outputs.skip_core_windows == 0 # runs-on: [self-hosted, Windows, pygeometry] runs-on: # TODO: Waiting for ansys-network runner to be updated group: pyansys-self-hosted @@ -235,12 +288,12 @@ jobs: { "@type": "MessageCard", "@context": "http://schema.org/extensions", - "summary": "Nightly Tests for Windows Core Service failing", + "summary": "Unstable build tests for Windows Core Service failing", "themeColor": "f44336", - "title": "PyAnsys Geometry Nightly Tests - Windows Core Service failing", + "title": "PyAnsys Geometry unstable build tests - Windows Core Service failing", "sections": [ { - "activityTitle": "Windows Core Service nightly tests are failing", + "activityTitle": "Windows Core Service unstable build tests are failing", "activitySubtitle": "Check the run for more details: https://github.com/ansys/pyansys-geometry/actions/runs/${{ github.run_id }}", "facts": [ { @@ -258,8 +311,9 @@ jobs: # ================================================================================================= linux-tests: - name: Nightly unstable testing - Linux - if: vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1 + name: Linux Core Service + needs: manifests + if: needs.manifests.outputs.skip_core_linux == 0 runs-on: ubuntu-latest steps: @@ -300,12 +354,12 @@ jobs: { "@type": "MessageCard", "@context": "http://schema.org/extensions", - "summary": "Nightly Tests for Linux failing", + "summary": "Unstable build tests for Linux Core Service failing", "themeColor": "f44336", - "title": "PyAnsys Geometry Nightly Tests - Linux failing", + "title": "PyAnsys Geometry unstable build tests - Linux Core Service failing", "sections": [ { - "activityTitle": "Linux nightly tests are failing", + "activityTitle": "Linux Core Service unstable build tests are failing", "activitySubtitle": "Check the run for more details: https://github.com/ansys/pyansys-geometry/actions/runs/${{ github.run_id }}", "facts": [ { @@ -318,9 +372,9 @@ jobs: } promote-windows-dms: - needs: [windows-dms-tests, windows-core-tests, linux-tests] + needs: windows-dms-tests runs-on: windows-latest - name: Promote Windows container + name: Promote Windows DMS container if: ${{ github.event.inputs.promote == 'true' || github.event_name == 'schedule' }} env: WINDOWS_UNSTABLE: ghcr.io/ansys/geometry:windows-latest-unstable @@ -343,9 +397,9 @@ jobs: run: docker push ${{ env.WINDOWS_STABLE_GHCR }} promote-windows-core: - needs: [windows-dms-tests, windows-core-tests, linux-tests] + needs: windows-core-tests runs-on: windows-latest - name: Promote Windows container + name: Promote Windows Core Service container if: ${{ github.event.inputs.promote == 'true' || github.event_name == 'schedule' }} env: WINDOWS_UNSTABLE: ghcr.io/ansys/geometry:core-windows-latest-unstable @@ -368,9 +422,9 @@ jobs: run: docker push ${{ env.WINDOWS_STABLE_GHCR }} promote-linux: - needs: [windows-dms-tests, windows-core-tests, linux-tests] + needs: linux-tests runs-on: ubuntu-latest - name: Promote Linux container + name: Promote Linux Core Service container if: ${{ github.event.inputs.promote == 'true' || github.event_name == 'schedule' }} env: LINUX_UNSTABLE: ghcr.io/ansys/geometry:core-linux-latest-unstable diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3656ada557..89176c0b0e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ exclude: "tests/integration/files" repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.2 + rev: v0.8.3 hooks: - id: ruff - id: ruff-format diff --git a/doc/changelog.d/1581.dependencies.md b/doc/changelog.d/1581.dependencies.md new file mode 100644 index 0000000000..56b9f21194 --- /dev/null +++ b/doc/changelog.d/1581.dependencies.md @@ -0,0 +1 @@ +bump ansys-api-geometry from 0.4.20 to 0.4.23 \ No newline at end of file diff --git a/doc/changelog.d/1582.dependencies.md b/doc/changelog.d/1582.dependencies.md new file mode 100644 index 0000000000..81597907a8 --- /dev/null +++ b/doc/changelog.d/1582.dependencies.md @@ -0,0 +1 @@ +bump ansys-api-geometry from 0.4.23 to 0.4.24 \ No newline at end of file diff --git a/doc/changelog.d/1583.dependencies.md b/doc/changelog.d/1583.dependencies.md new file mode 100644 index 0000000000..d4324bfdf1 --- /dev/null +++ b/doc/changelog.d/1583.dependencies.md @@ -0,0 +1 @@ +bump ansys-tools-visualization-interface from 0.6.0 to 0.6.1 \ No newline at end of file diff --git a/doc/changelog.d/1584.fixed.md b/doc/changelog.d/1584.fixed.md new file mode 100644 index 0000000000..ee772e6165 --- /dev/null +++ b/doc/changelog.d/1584.fixed.md @@ -0,0 +1 @@ +vtk/pyvista issues \ No newline at end of file diff --git a/doc/changelog.d/1586.dependencies.md b/doc/changelog.d/1586.dependencies.md new file mode 100644 index 0000000000..87a0275fa0 --- /dev/null +++ b/doc/changelog.d/1586.dependencies.md @@ -0,0 +1 @@ +bump ansys-tools-visualization-interface from 0.6.1 to 0.6.2 \ No newline at end of file diff --git a/doc/changelog.d/1588.maintenance.md b/doc/changelog.d/1588.maintenance.md new file mode 100644 index 0000000000..c655a0905a --- /dev/null +++ b/doc/changelog.d/1588.maintenance.md @@ -0,0 +1 @@ +pre-commit automatic update \ No newline at end of file diff --git a/doc/changelog.d/1589.dependencies.md b/doc/changelog.d/1589.dependencies.md new file mode 100644 index 0000000000..b9c5b2fa18 --- /dev/null +++ b/doc/changelog.d/1589.dependencies.md @@ -0,0 +1 @@ +avoid the usage of attrs 24.3.0 (temporary) \ No newline at end of file diff --git a/doc/changelog.d/1590.dependencies.md b/doc/changelog.d/1590.dependencies.md new file mode 100644 index 0000000000..9b6f267828 --- /dev/null +++ b/doc/changelog.d/1590.dependencies.md @@ -0,0 +1 @@ +bump jupytext from 1.16.4 to 1.16.5 in the docs-deps group \ No newline at end of file diff --git a/doc/changelog.d/1591.maintenance.md b/doc/changelog.d/1591.maintenance.md new file mode 100644 index 0000000000..cb94f1814c --- /dev/null +++ b/doc/changelog.d/1591.maintenance.md @@ -0,0 +1 @@ +decouple unstable image promotion \ No newline at end of file diff --git a/doc/changelog.d/1592.maintenance.md b/doc/changelog.d/1592.maintenance.md new file mode 100644 index 0000000000..ef7b20ec82 --- /dev/null +++ b/doc/changelog.d/1592.maintenance.md @@ -0,0 +1 @@ +skip unnecessary stages when containers are the same \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 1b45719377..1920c8c0b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,9 +24,10 @@ classifiers = [ ] dependencies = [ - "ansys-api-geometry==0.4.20", + "ansys-api-geometry==0.4.24", "ansys-tools-path>=0.3,<1", "ansys-tools-visualization-interface>=0.2.6,<1", + "attrs!=24.3.0", "beartype>=0.11.0,<0.20", "grpcio>=1.35.0,<1.68", "grpcio-health-checking>=1.45.0,<1.68", @@ -50,7 +51,7 @@ all = [ tests = [ "ansys-platform-instancemanagement==1.1.2", "ansys-tools-path==0.7.0", - "ansys-tools-visualization-interface==0.6.0", + "ansys-tools-visualization-interface==0.6.2", "beartype==0.19.0", "docker==7.1.0", "grpcio==1.67.1", @@ -62,12 +63,12 @@ tests = [ "pytest-cov==6.0.0", "pytest-pyvista==0.1.9", "pytest-xvfb==3.0.0", - "pyvista[jupyter]==0.44.1", + "pyvista[jupyter]==0.44.2", "requests==2.32.3", "scipy==1.14.1", "semver==3.0.2", "six==1.17.0", - "vtk==9.4.0", + "vtk==9.3.1", ] tests-minimal = [ "pytest==8.3.4", @@ -78,14 +79,14 @@ tests-minimal = [ doc = [ "ansys-sphinx-theme[autoapi]==1.2.3", "ansys-tools-path==0.7.0", - "ansys-tools-visualization-interface==0.6.0", + "ansys-tools-visualization-interface==0.6.2", "beartype==0.19.0", "docker==7.1.0", "grpcio==1.67.1", "grpcio-health-checking==1.67.1", "ipyvtklink==0.2.3", "jupyter_sphinx==0.5.3", - "jupytext==1.16.4", + "jupytext==1.16.5", "myst-parser==4.0.0", "nbconvert==7.16.4", "nbsphinx==0.9.5", @@ -95,7 +96,7 @@ doc = [ "panel==1.5.4", "Pint==0.24.4", "protobuf==5.28.3", - "pyvista[jupyter]==0.44.1", + "pyvista[jupyter]==0.44.2", "requests==2.32.3", "scipy==1.14.1", "semver==3.0.2", @@ -105,7 +106,7 @@ doc = [ "sphinx-copybutton==0.5.2", "sphinx-jinja==2.0.2", "trame-vtk==2.8.12", - "vtk==9.4.0", + "vtk==9.3.1", ] [project.urls]