Skip to content

Commit 8968cc9

Browse files
authored
Merge branch 'blitz' into feat/object_name_setters
2 parents 6a021d7 + ce21ad6 commit 8968cc9

File tree

14 files changed

+64
-220
lines changed

14 files changed

+64
-220
lines changed

.github/workflows/ci_cd.yml

Lines changed: 10 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
PACKAGE_NAME: 'ansys-geometry-core'
1111
DOCUMENTATION_CNAME: 'geometry.docs.pyansys.com'
1212
ANSRV_GEO_IMAGE: 'ghcr.io/ansys/geometry'
13-
ANSRV_GEO_IMAGE_DOCS_TAG: ghcr.io/ansys/geometry:windows-latest
13+
ANSRV_GEO_IMAGE_DOCS_TAG: ghcr.io/ansys/geometry:core-linux-latest
1414
ANSRV_GEO_PORT: 700
1515
ANSRV_GEO_LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
1616
GEO_CONT_NAME: ans_geo
@@ -68,16 +68,11 @@ jobs:
6868
name: Check Docker manifests
6969
runs-on: ubuntu-latest
7070
outputs:
71-
skip_dms: ${{ steps.services.outputs.skip_dms }}
7271
skip_core_windows: ${{ steps.services.outputs.skip_core_windows }}
7372
skip_core_linux: ${{ steps.services.outputs.skip_core_linux }}
7473
strategy:
7574
matrix:
7675
include:
77-
- container-stable: "windows-latest"
78-
container-unstable: "windows-latest-unstable"
79-
service: "dms"
80-
service-name: "Windows DMS"
8176
- container-stable: "core-windows-latest"
8277
container-unstable: "core-windows-latest-unstable"
8378
service: "core_windows"
@@ -131,10 +126,6 @@ jobs:
131126
fail-fast: false
132127
matrix:
133128
include:
134-
- docker-image: "windows-latest"
135-
experimental: false
136-
- docker-image: "windows-latest-unstable"
137-
experimental: true
138129
- docker-image: "core-windows-latest"
139130
experimental: false
140131
- docker-image: "core-windows-latest-unstable"
@@ -144,11 +135,8 @@ jobs:
144135
- name: Calculate SKIP_UNSTABLE
145136
if: matrix.experimental
146137
run: |
147-
# Choose the manifests output to consider (for DMS or Core service)
148-
# based on the matrix value
149-
if ("${{ matrix.docker-image }}" -eq "windows-latest-unstable") {
150-
$ImagesAreEqual = ${{ needs.manifests.outputs.skip_dms }}
151-
} elseif ("${{ matrix.docker-image }}" -eq "core-windows-latest-unstable") {
138+
# Choose the manifests output to consider based on the matrix value
139+
if ("${{ matrix.docker-image }}" -eq "core-windows-latest-unstable") {
152140
$ImagesAreEqual = ${{ needs.manifests.outputs.skip_core_windows }}
153141
} else {
154142
Write-Output "Unknown docker image"
@@ -267,7 +255,7 @@ jobs:
267255

268256
- name: Upload coverage to Codecov
269257
uses: codecov/codecov-action@v5
270-
if: matrix.docker-image == 'windows-latest'
258+
if: matrix.docker-image == 'core-windows-latest'
271259
env:
272260
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
273261
with:
@@ -327,16 +315,14 @@ jobs:
327315
docs:
328316
name: Documentation
329317
needs: [is_docs_pr]
330-
runs-on: [self-hosted, Windows, pygeometry]
318+
runs-on: ubuntu-latest
331319
# Only run if docs build is required
332320
if: ${{ needs.is_docs_pr.outputs.build_required == 'true' }}
333321
env:
334322
PYVISTA_OFF_SCREEN: true
335323
steps:
336324
- name: Set up headless display
337325
uses: pyvista/setup-headless-display-action@v3
338-
with:
339-
pyvista: false
340326

341327
- name: Login to GitHub Container Registry
342328
uses: docker/login-action@v3
@@ -345,31 +331,19 @@ jobs:
345331
username: ${{ github.actor }}
346332
password: ${{ secrets.GITHUB_TOKEN }}
347333

348-
- name: Download Geometry service container (if needed)
349-
run: docker pull ${{ env.ANSRV_GEO_IMAGE_DOCS_TAG }}
350-
351-
- name: Check location of self-hosted runner and define license server accordingly
352-
if: runner.name == 'pygeometry-ci-2'
353-
run:
354-
echo "ANSRV_GEO_LICENSE_SERVER=${{ secrets.INTERNAL_LICENSE_SERVER }}" | Out-File -FilePath $env:GITHUB_ENV -Append
355-
356-
- name: Stop any running containers
334+
- name: Pull and launch geometry service
357335
run: |
358-
$dockerContainers = docker ps -a -q
359-
if (-not [string]::IsNullOrEmpty($dockerContainers)) {
360-
docker stop $dockerContainers
361-
docker rm $dockerContainers
362-
}
363-
364-
- name: Start Geometry service and verify start
365-
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 }}
336+
docker pull ${{ env.ANSRV_GEO_IMAGE_DOCS_TAG }}
337+
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 }}
366338
367339
- name: Run Ansys documentation building action
368340
uses: ansys/actions/doc-build@v8
369341
with:
370342
python-version: ${{ env.MAIN_PYTHON_VERSION }}
371343
add-pdf-html-docs-as-assets: true
372344
needs-quarto: true
345+
dependencies: 'pandoc'
346+
sphinxopts: '-j 1 -W --color'
373347

374348
- name: Stop the Geometry service
375349
if: always()
@@ -378,23 +352,6 @@ jobs:
378352
docker logs ${{ env.GEO_CONT_NAME }}
379353
docker rm ${{ env.GEO_CONT_NAME }}
380354
381-
- name: Stop any remaining containers
382-
if: always()
383-
run: |
384-
$dockerContainers = docker ps -a -q
385-
if (-not [string]::IsNullOrEmpty($dockerContainers)) {
386-
docker stop $dockerContainers
387-
docker rm $dockerContainers
388-
}
389-
390-
- name: Clean all Docker dangling images
391-
if: always()
392-
run: docker image prune -f
393-
394-
# =================================================================================================
395-
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
396-
# =================================================================================================
397-
398355
testing-linux:
399356
name: Testing and coverage (Linux)
400357
needs: [manifests]

.github/workflows/docker_ansyslab_windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ permissions:
1212
packages: read
1313

1414
env:
15-
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:windows-latest
16-
WINDOWS_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:windows-latest
15+
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:core-windows-latest
16+
WINDOWS_STABLE_FUJI: azwepsifujiaksacr.azurecr.io/ansys/discovery/geometry:core-windows-latest
1717

1818
jobs:
1919
windows-ansyslab:

.github/workflows/nightly_docker_test.yml

Lines changed: 3 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ on:
2222

2323
env:
2424
MAIN_PYTHON_VERSION: '3.12'
25-
ANSRV_GEO_IMAGE_WINDOWS_TAG: ghcr.io/ansys/geometry:windows-latest-unstable
2625
ANSRV_GEO_IMAGE_WINDOWS_CORE_TAG: ghcr.io/ansys/geometry:core-windows-latest-unstable
2726
ANSRV_GEO_IMAGE_LINUX_CORE_TAG: ghcr.io/ansys/geometry:core-linux-latest-unstable
2827
ANSRV_GEO_PORT: 710
@@ -39,16 +38,11 @@ jobs:
3938
name: Check Docker manifests
4039
runs-on: ubuntu-latest
4140
outputs:
42-
skip_dms: ${{ steps.services.outputs.skip_dms }}
4341
skip_core_windows: ${{ steps.services.outputs.skip_core_windows }}
4442
skip_core_linux: ${{ steps.services.outputs.skip_core_linux }}
4543
strategy:
4644
matrix:
4745
include:
48-
- container-stable: "windows-latest"
49-
container-unstable: "windows-latest-unstable"
50-
service: "dms"
51-
service-name: "Windows DMS"
5246
- container-stable: "core-windows-latest"
5347
container-unstable: "core-windows-latest-unstable"
5448
service: "core_windows"
@@ -90,113 +84,7 @@ jobs:
9084
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9185
# =================================================================================================
9286

93-
windows-dms-tests:
94-
name: Windows DMS
95-
needs: manifests
96-
if: needs.manifests.outputs.skip_dms == 0
97-
runs-on: [self-hosted, Windows, pygeometry]
98-
env:
99-
PYVISTA_OFF_SCREEN: true
100-
steps:
101-
- uses: actions/checkout@v4
102-
103-
- name: Set up Python
104-
uses: actions/setup-python@v5
105-
with:
106-
python-version: ${{ env.MAIN_PYTHON_VERSION }}
107-
108-
- name: Set up headless display
109-
uses: pyvista/setup-headless-display-action@v3
110-
with:
111-
pyvista: false
112-
113-
- name: Create Python venv
114-
run: |
115-
python -m venv .venv
116-
.\.venv\Scripts\Activate.ps1
117-
118-
- name: Install packages for testing
119-
run: |
120-
.\.venv\Scripts\Activate.ps1
121-
pip install --upgrade build
122-
pip install .[tests]
123-
124-
- name: Login to GitHub Container Registry
125-
uses: docker/login-action@v3
126-
with:
127-
registry: ghcr.io
128-
username: ${{ github.actor }}
129-
password: ${{ secrets.GITHUB_TOKEN }}
130-
131-
- name: Download Geometry service container (always latest version)
132-
run: |
133-
docker image rm ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }}
134-
docker pull ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }}
135-
136-
- name: Check location of self-hosted runner and define license server accordingly
137-
if: runner.name == 'pygeometry-ci-2'
138-
run:
139-
echo "ANSRV_GEO_LICENSE_SERVER=${{ secrets.INTERNAL_LICENSE_SERVER }}" | Out-File -FilePath $env:GITHUB_ENV -Append
140-
141-
- name: Start Geometry service and verify start
142-
run: |
143-
.\.venv\Scripts\Activate.ps1
144-
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 }}
145-
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
146-
147-
- name: Run PyAnsys Geometry tests
148-
run: |
149-
.\.venv\Scripts\Activate.ps1
150-
pytest -v
151-
152-
- name: Stop the Geometry service
153-
if: always()
154-
run: |
155-
docker stop ${{ env.GEO_CONT_NAME }}
156-
docker logs ${{ env.GEO_CONT_NAME }}
157-
docker rm ${{ env.GEO_CONT_NAME }}
158-
159-
- name: Stop any remaining containers
160-
if: always()
161-
run: |
162-
$dockerContainers = docker ps -a -q
163-
if (-not [string]::IsNullOrEmpty($dockerContainers)) {
164-
docker stop $dockerContainers
165-
docker rm $dockerContainers
166-
}
167-
168-
- name: Clean all Docker dangling images
169-
if: always()
170-
run: docker image prune -f
171-
172-
- name: Microsoft Teams Notification
173-
uses: skitionek/notify-microsoft-teams@master
174-
if: failure()
175-
with:
176-
webhook_url: ${{ secrets.MSTEAMS_WEBHOOK }}
177-
# Message to send to Teams as a webhook notification in JSON Payload format
178-
raw: >-
179-
{
180-
"@type": "MessageCard",
181-
"@context": "http://schema.org/extensions",
182-
"summary": "Unstable build tests for Windows DMS failing",
183-
"themeColor": "f44336",
184-
"title": "PyAnsys Geometry unstable build tests - Windows DMS failing",
185-
"sections": [
186-
{
187-
"activityTitle": "Windows DMS unstable build tests are failing",
188-
"activitySubtitle": "Check the run for more details: https://github.com/ansys/pyansys-geometry/actions/runs/${{ github.run_id }}",
189-
"facts": [
190-
{
191-
"name": "Status",
192-
"value": "Failed"
193-
}
194-
]
195-
}
196-
]
197-
}
198-
199-
windows-core-tests:
87+
windows-tests:
20088
name: Windows Core Service
20189
needs: manifests
20290
if: needs.manifests.outputs.skip_core_windows == 0
@@ -368,33 +256,8 @@ jobs:
368256
]
369257
}
370258
371-
promote-windows-dms:
372-
needs: windows-dms-tests
373-
runs-on: windows-latest
374-
name: Promote Windows DMS container
375-
if: ${{ github.event.inputs.promote == 'true' || github.event_name == 'schedule' }}
376-
env:
377-
WINDOWS_UNSTABLE: ghcr.io/ansys/geometry:windows-latest-unstable
378-
WINDOWS_STABLE_GHCR: ghcr.io/ansys/geometry:windows-latest
379-
steps:
380-
- name: Login in Github Container registry
381-
uses: docker/login-action@v3
382-
with:
383-
registry: ghcr.io
384-
username: ${{ github.actor }}
385-
password: ${{ secrets.GITHUB_TOKEN }}
386-
387-
- name: Pull Windows latest unstable container
388-
run: docker pull ${{ env.WINDOWS_UNSTABLE }}
389-
390-
- name: Tag container as latest (stable) for Github Container registry
391-
run: docker tag ${{ env.WINDOWS_UNSTABLE }} ${{ env.WINDOWS_STABLE_GHCR }}
392-
393-
- name: Publish latest stable container in ghcr.io
394-
run: docker push ${{ env.WINDOWS_STABLE_GHCR }}
395-
396-
promote-windows-core:
397-
needs: windows-core-tests
259+
promote-windows:
260+
needs: windows-tests
398261
runs-on: windows-latest
399262
name: Promote Windows Core Service container
400263
if: ${{ github.event.inputs.promote == 'true' || github.event_name == 'schedule' }}

doc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33

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

3333
# Build HTML files and generate examples as .py files
3434
html:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
remove DMS from pipelines and use core service images only
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bump pytest-xvfb from 3.0.0 to 3.1.1

doc/source/cheatsheet/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/.quarto/
2-
MyDesign.*
2+
MyDesign.*
3+
_extensions

doc/source/cheatsheet/cheat_sheet.qmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ pmdb_path = design.export_to_pmdb()
147147
para_txt_path = design.export_to_parasolid_text()
148148
para_bin_path = design.export_to_parasolid_bin()
149149
fmd_path = design.export_to_fmd()
150-
step_path = design.export_to_step()
151-
iges_path = design.export_to_iges()
150+
disco_path = design.export_to_disco()
152151
```
153152

154153
# Extra: Product scripting

doc/source/examples/03_modeling/chamfer.mystnb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Launch the modeler and create a block.
2222
```{code-cell} ipython3
2323
from ansys.geometry.core import launch_modeler, Modeler
2424

25-
modeler = Modeler()
25+
modeler = launch_modeler()
2626
print(modeler)
2727
```
2828

@@ -61,3 +61,14 @@ modeler.geometry_commands.chamfer(body.faces[-1], distance=0.3)
6161

6262
body.plot()
6363
```
64+
65+
## Close session
66+
67+
When you finish interacting with your modeling service, you should close the active
68+
server session. This frees resources wherever the service is running.
69+
70+
Close the server session.
71+
72+
```{code-cell} ipython3
73+
modeler.close()
74+
```

0 commit comments

Comments
 (0)