Skip to content

ci: remove DMS from pipelines and use core service images only #1812

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

Merged
merged 20 commits into from
Mar 12, 2025
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
70 changes: 11 additions & 59 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
PACKAGE_NAME: 'ansys-geometry-core'
DOCUMENTATION_CNAME: 'geometry.docs.pyansys.com'
ANSRV_GEO_IMAGE: 'ghcr.io/ansys/geometry'
ANSRV_GEO_IMAGE_DOCS_TAG: ghcr.io/ansys/geometry:windows-latest
ANSRV_GEO_IMAGE_DOCS_TAG: ghcr.io/ansys/geometry:core-linux-latest
ANSRV_GEO_PORT: 700
ANSRV_GEO_LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
GEO_CONT_NAME: ans_geo
Expand Down Expand Up @@ -108,16 +108,11 @@ jobs:
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"
Expand Down Expand Up @@ -171,10 +166,6 @@ jobs:
fail-fast: false
matrix:
include:
- docker-image: "windows-latest"
experimental: false
- docker-image: "windows-latest-unstable"
experimental: true
- docker-image: "core-windows-latest"
experimental: false
- docker-image: "core-windows-latest-unstable"
Expand All @@ -184,11 +175,8 @@ jobs:
- 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") {
# Choose the manifests output to consider based on the matrix value
if ("${{ matrix.docker-image }}" -eq "core-windows-latest-unstable") {
$ImagesAreEqual = ${{ needs.manifests.outputs.skip_core_windows }}
} else {
Write-Output "Unknown docker image"
Expand Down Expand Up @@ -307,7 +295,7 @@ jobs:

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: matrix.docker-image == 'windows-latest'
if: matrix.docker-image == 'core-windows-latest'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
Expand Down Expand Up @@ -335,14 +323,12 @@ jobs:
docs:
name: Documentation
needs: [docs-style]
runs-on: [self-hosted, Windows, pygeometry]
runs-on: ubuntu-latest
env:
PYVISTA_OFF_SCREEN: true
steps:
- name: Set up headless display
uses: pyvista/setup-headless-display-action@v3
with:
pyvista: false

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -351,31 +337,19 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download Geometry service container (if needed)
run: docker pull ${{ env.ANSRV_GEO_IMAGE_DOCS_TAG }}

- name: Check location of self-hosted runner and define license server accordingly
if: runner.name == 'pygeometry-ci-2'
run:
echo "ANSRV_GEO_LICENSE_SERVER=${{ secrets.INTERNAL_LICENSE_SERVER }}" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Stop any running containers
- name: Pull and launch geometry service
run: |
$dockerContainers = docker ps -a -q
if (-not [string]::IsNullOrEmpty($dockerContainers)) {
docker stop $dockerContainers
docker rm $dockerContainers
}

- name: Start Geometry service and verify start
run: docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_DOCS_TAG }}
docker pull ${{ env.ANSRV_GEO_IMAGE_DOCS_TAG }}
docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_DOCS_TAG }}

- name: Run Ansys documentation building action
uses: ansys/actions/doc-build@v8
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
add-pdf-html-docs-as-assets: true
needs-quarto: true
dependencies: 'pandoc'
sphinxopts: '-j 1 -W --color'

- name: Stop the Geometry service
if: always()
Expand All @@ -384,15 +358,6 @@ jobs:
docker logs ${{ env.GEO_CONT_NAME }}
docker rm ${{ env.GEO_CONT_NAME }}

- name: Stop any remaining containers
if: always()
run: |
$dockerContainers = docker ps -a -q
if (-not [string]::IsNullOrEmpty($dockerContainers)) {
docker stop $dockerContainers
docker rm $dockerContainers
}


# =================================================================================================
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -633,7 +598,6 @@ jobs:
- name: Download binaries (if conditions met)
if: env.REUSE_LAST_ARTIFACTS == 'false'
run: |
curl.exe -X GET -H "X-JFrog-Art-Api: ${{ secrets.ARTIFACTORY_KEY }}" ${{ secrets.ARTIFACTORY_URL }}/${{ env.ARTIFACTORY_VERSION }}/DockerWindows.zip --output windows-dms-binaries.zip
curl.exe -X GET -H "X-JFrog-Art-Api: ${{ secrets.ARTIFACTORY_KEY }}" ${{ secrets.ARTIFACTORY_URL }}/${{ env.ARTIFACTORY_VERSION }}/DockerCoreWindows.zip --output windows-core-binaries.zip
curl.exe -X GET -H "X-JFrog-Art-Api: ${{ secrets.ARTIFACTORY_KEY }}" ${{ secrets.ARTIFACTORY_URL }}/${{ env.ARTIFACTORY_VERSION }}/DockerCoreLinux.zip --output linux-core-binaries.zip

Expand All @@ -654,17 +618,9 @@ jobs:
git lfs fetch origin --include="$env:PREVIOUS_VERSION/*"
git lfs checkout $env:PREVIOUS_VERSION
# Copy the binaries from the previous version
cp ./$env:PREVIOUS_VERSION/windows-dms-binaries.zip windows-dms-binaries.zip
cp ./$env:PREVIOUS_VERSION/windows-core-binaries.zip windows-core-binaries.zip
cp ./$env:PREVIOUS_VERSION/linux-core-binaries.zip linux-core-binaries.zip

- name: Upload DMS Windows binaries as workflow artifacts
uses: actions/upload-artifact@v4
with:
name: windows-dms-binaries.zip
path: windows-dms-binaries.zip
retention-days: 1

- name: Upload Linux Core service binaries as workflow artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -686,7 +642,6 @@ jobs:
$env:VERSION=$env:VERSION_WITH_PREFIX.substring(1)
mkdir $env:VERSION -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force .\$env:VERSION\*
mv windows-dms-binaries.zip .\$env:VERSION\
mv windows-core-binaries.zip .\$env:VERSION\
mv linux-core-binaries.zip .\$env:VERSION\
git config user.email ${{ secrets.BINARIES_EMAIL }}
Expand All @@ -703,9 +658,6 @@ jobs:
fail-fast: false
matrix:
include:
- mode: "dms"
docker-file: "windows-dms-dockerfile.zip"
zip-file: "windows-dms-binaries.zip"
- mode: "coreservice"
docker-file: "windows-core-dockerfile.zip"
zip-file: "windows-core-binaries.zip"
Expand Down Expand Up @@ -890,7 +842,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
library-name: ${{ env.PACKAGE_NAME }}
additional-artifacts: windows-dms-dockerfile.zip windows-core-dockerfile.zip linux-core-dockerfile.zip
additional-artifacts: windows-core-dockerfile.zip linux-core-dockerfile.zip

upload_dev_docs:
name: Upload dev documentation
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker_ansyslab_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ permissions:
packages: read

env:
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:windows-latest
WINDOWS_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:windows-latest
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:core-windows-latest
WINDOWS_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:core-windows-latest

jobs:
windows-ansyslab:
Expand Down
143 changes: 3 additions & 140 deletions .github/workflows/nightly_docker_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ on:

env:
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
ANSRV_GEO_PORT: 710
Expand All @@ -39,16 +38,11 @@ jobs:
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"
Expand Down Expand Up @@ -90,113 +84,7 @@ jobs:
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# =================================================================================================

windows-dms-tests:
name: Windows DMS
needs: manifests
if: needs.manifests.outputs.skip_dms == 0
runs-on: [self-hosted, Windows, pygeometry]
env:
PYVISTA_OFF_SCREEN: true
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: Set up headless display
uses: pyvista/setup-headless-display-action@v3
with:
pyvista: false

- name: Create Python venv
run: |
python -m venv .venv
.\.venv\Scripts\Activate.ps1

- name: Install packages for testing
run: |
.\.venv\Scripts\Activate.ps1
pip install --upgrade build
pip install .[tests]

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download Geometry service container (always latest version)
run: |
docker image rm ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }}
docker pull ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }}

- name: Check location of self-hosted runner and define license server accordingly
if: runner.name == 'pygeometry-ci-2'
run:
echo "ANSRV_GEO_LICENSE_SERVER=${{ secrets.INTERNAL_LICENSE_SERVER }}" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Start Geometry service and verify start
run: |
.\.venv\Scripts\Activate.ps1
docker run --detach --name ${{ env.GEO_CONT_NAME }} -e LICENSE_SERVER=${{ env.ANSRV_GEO_LICENSE_SERVER }} -p ${{ env.ANSRV_GEO_PORT }}:50051 ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }}
python -c "from ansys.geometry.core.connection.validate import validate; validate()"

- name: Run PyAnsys Geometry tests
run: |
.\.venv\Scripts\Activate.ps1
pytest -v

- name: Stop the Geometry service
if: always()
run: |
docker stop ${{ env.GEO_CONT_NAME }}
docker logs ${{ env.GEO_CONT_NAME }}
docker rm ${{ env.GEO_CONT_NAME }}

- name: Stop any remaining containers
if: always()
run: |
$dockerContainers = docker ps -a -q
if (-not [string]::IsNullOrEmpty($dockerContainers)) {
docker stop $dockerContainers
docker rm $dockerContainers
}

- name: Clean all Docker dangling images
if: always()
run: docker image prune -f

- name: Microsoft Teams Notification
uses: skitionek/notify-microsoft-teams@master
if: failure()
with:
webhook_url: ${{ secrets.MSTEAMS_WEBHOOK }}
# Message to send to Teams as a webhook notification in JSON Payload format
raw: >-
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"summary": "Unstable build tests for Windows DMS failing",
"themeColor": "f44336",
"title": "PyAnsys Geometry unstable build tests - Windows DMS failing",
"sections": [
{
"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": [
{
"name": "Status",
"value": "Failed"
}
]
}
]
}

windows-core-tests:
windows-tests:
name: Windows Core Service
needs: manifests
if: needs.manifests.outputs.skip_core_windows == 0
Expand Down Expand Up @@ -368,33 +256,8 @@ jobs:
]
}

promote-windows-dms:
needs: windows-dms-tests
runs-on: windows-latest
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
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:windows-latest
steps:
- name: Login in Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull Windows latest unstable container
run: docker pull ${{ env.WINDOWS_UNSTABLE }}

- name: Tag container as latest (stable) for Github Container registry
run: docker tag ${{ env.WINDOWS_UNSTABLE }} ${{ env.WINDOWS_STABLE_GHCR }}

- name: Publish latest stable container in ghcr.io
run: docker push ${{ env.WINDOWS_STABLE_GHCR }}

promote-windows-core:
needs: windows-core-tests
promote-windows:
needs: windows-tests
runs-on: windows-latest
name: Promote Windows Core Service container
if: ${{ github.event.inputs.promote == 'true' || github.event_name == 'schedule' }}
Expand Down
4 changes: 2 additions & 2 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS = -j auto -W --color
SPHINXOPTS = -j 1 -W --color
SPHINXBUILD = sphinx-build
APIDIR = api
SOURCEDIR = source
Expand All @@ -28,7 +28,7 @@ clean:
pdf:
@$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true
(test -f $(BUILDDIR)/latex/*.pdf && echo pdf exists) || exit 1
(test -f $(BUILDDIR)/latex/ansys-geometry-core.pdf && echo pdf exists) || exit 1

# Build HTML files and generate examples as .py files
html:
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/1812.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
remove DMS from pipelines and use core service images only
3 changes: 2 additions & 1 deletion doc/source/cheatsheet/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.quarto/
MyDesign.*
MyDesign.*
_extensions
Loading
Loading