Skip to content

Commit b374f8c

Browse files
committed
Merge branch 'main' into release/0.2
2 parents 4235395 + 06dd45d commit b374f8c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2042
-526
lines changed
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Build Docker images
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
paths:
6+
- 'docker/**'
7+
- '.github/workflows/build_docker_image.yml'
8+
push:
9+
branches:
10+
- main
11+
paths:
12+
- 'docker/**'
13+
- '.github/workflows/build_docker_image.yml'
14+
release:
15+
types: [published]
16+
17+
env:
18+
MAIN_PYTHON_VERSION: '3.10'
19+
ANSRV_GEO_IMAGE_WINDOWS_TAG: ghcr.io/pyansys/geometry:windows-latest-tmp
20+
ANSRV_GEO_IMAGE_LINUX_TAG: ghcr.io/pyansys/geometry:linux-latest-tmp
21+
ANSRV_GEO_PORT: 700
22+
ANSRV_GEO_LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }}
23+
GEO_CONT_NAME: ans_geo
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.ref }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
# =================================================================================================
31+
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
32+
# =================================================================================================
33+
34+
build-windows:
35+
name: Building Geometry Service - Windows
36+
runs-on: [self-hosted, pygeometry-ci-1]
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v3
40+
41+
- name: Set up Python
42+
uses: actions/setup-python@v4
43+
with:
44+
python-version: '3.9' # use python3.9, self-hosted has an issue with 3.10
45+
46+
- name: Download Windows binaries
47+
uses: dsaltares/fetch-gh-release-asset@master
48+
with:
49+
version: 'latest'
50+
file: 'windows-binaries.zip'
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
target: 'docker/windows-binaries.zip'
53+
54+
- name: Build Docker image
55+
working-directory: docker
56+
run: |
57+
docker build -f Dockerfile.windows -t ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }} .
58+
59+
- name: Launch Geometry service
60+
run: |
61+
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 }}
62+
63+
- name: Validate connection using PyGeometry
64+
run: |
65+
python -m venv .venv
66+
.\.venv\Scripts\Activate.ps1
67+
python -m pip install --upgrade pip
68+
pip install .
69+
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
70+
71+
- name: Stop the Geometry service
72+
if: always()
73+
run: |
74+
docker stop ${{ env.GEO_CONT_NAME }}
75+
docker logs ${{ env.GEO_CONT_NAME }}
76+
docker rm ${{ env.GEO_CONT_NAME }}
77+
78+
- name: Delete the Docker images (and untagged ones)
79+
if: always()
80+
run: |
81+
docker image rm ${{ env.ANSRV_GEO_IMAGE_WINDOWS_TAG }}
82+
docker system prune -f
83+
84+
# =================================================================================================
85+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86+
# =================================================================================================
87+
88+
build-linux:
89+
name: Building Geometry Service - Linux
90+
runs-on: ubuntu-latest
91+
steps:
92+
- name: Checkout repository
93+
uses: actions/checkout@v3
94+
95+
- name: Set up Python
96+
uses: actions/setup-python@v4
97+
with:
98+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
99+
100+
- name: Download Linux binaries
101+
uses: dsaltares/fetch-gh-release-asset@master
102+
with:
103+
version: 'latest'
104+
file: 'linux-binaries.zip'
105+
token: ${{ secrets.GITHUB_TOKEN }}
106+
target: 'docker/linux-binaries.zip'
107+
108+
- name: Build Docker image
109+
working-directory: docker
110+
run: |
111+
docker build -f Dockerfile.linux -t ${{ env.ANSRV_GEO_IMAGE_LINUX_TAG }} .
112+
113+
- name: Launch Geometry service
114+
run: |
115+
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_LINUX_TAG }}
116+
117+
- name: Validate connection using PyGeometry
118+
run: |
119+
python -m pip install --upgrade pip
120+
pip install .
121+
python -c "from ansys.geometry.core.connection.validate import validate; validate()"
122+
123+
- name: Stop the Geometry service
124+
if: always()
125+
run: |
126+
docker stop ${{ env.GEO_CONT_NAME }}
127+
docker logs ${{ env.GEO_CONT_NAME }}
128+
docker rm ${{ env.GEO_CONT_NAME }}

.github/workflows/ci_cd.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
python-version: '3.9' # use python3.9, self-hosted has an issue with 3.10
8787

8888
- name: Set up headless display
89-
uses: pyvista/setup-headless-display-action@v1
89+
uses: pyvista/setup-headless-display-action@v2
9090

9191
- name: Create Python venv
9292
run: |
@@ -142,20 +142,23 @@ jobs:
142142
pytest -v
143143
144144
- name: Upload integration test logs
145+
if: always()
145146
uses: actions/upload-artifact@v3
146147
with:
147148
name: integration-test-logs-${{ runner.os }}
148149
path: tests/integration/logs
149150
retention-days: 7
150151

151152
- name: Upload PyVista generated images (cache and results)
153+
if: always()
152154
uses: actions/upload-artifact@v3
153155
with:
154156
name: pytest-pyvista-images-${{ runner.os }}
155157
path: tests/integration/image_cache
156158
retention-days: 7
157159

158160
- name: Upload Coverage Results
161+
if: always()
159162
uses: actions/upload-artifact@v3
160163
with:
161164
name: coverage-html
@@ -185,7 +188,7 @@ jobs:
185188
python-version: '3.9' # use python3.9, self-hosted has an issue with 3.10
186189

187190
- name: Set up headless display
188-
uses: pyvista/setup-headless-display-action@v1
191+
uses: pyvista/setup-headless-display-action@v2
189192

190193
- name: Create Python venv
191194
run: |
@@ -304,13 +307,15 @@ jobs:
304307
requires-xvfb: true
305308

306309
- name: Upload integration test logs
310+
if: always()
307311
uses: actions/upload-artifact@v3
308312
with:
309313
name: integration-test-logs-${{ runner.os }}
310314
path: tests/integration/logs
311315
retention-days: 7
312316

313317
- name: Upload PyVista generated images (cache and results)
318+
if: always()
314319
uses: actions/upload-artifact@v3
315320
with:
316321
name: pytest-pyvista-images-${{ runner.os }}
@@ -326,7 +331,7 @@ jobs:
326331
327332
package:
328333
name: Package library
329-
needs: [testing-windows, docs]
334+
needs: [testing-windows, testing-linux, docs]
330335
runs-on: ubuntu-latest
331336
steps:
332337
- name: Build library source and wheel artifacts
@@ -335,10 +340,38 @@ jobs:
335340
library-name: ${{ env.PACKAGE_NAME }}
336341
python-version: ${{ env.MAIN_PYTHON_VERSION }}
337342

343+
fetch-release-artifacts:
344+
name: Fetch release artifacts
345+
needs: [testing-windows, testing-linux, docs]
346+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
347+
runs-on:
348+
group: ansys-internal
349+
labels: [self-hosted, Windows, signtool]
350+
351+
steps:
352+
- name: Download binaries
353+
run: |
354+
curl.exe -X GET -H "X-JFrog-Art-Api: ${{ secrets.ARTIFACTORY_KEY }}" ${{ secrets.ARTIFACTORY_URL }}/DockerWindows.zip --output windows-binaries.zip
355+
curl.exe -X GET -H "X-JFrog-Art-Api: ${{ secrets.ARTIFACTORY_KEY }}" ${{ secrets.ARTIFACTORY_URL }}/DockerLinux.zip --output linux-binaries.zip
356+
357+
- name: Upload Windows binaries as workflow artifacts
358+
uses: actions/upload-artifact@v3
359+
with:
360+
name: windows-binaries.zip
361+
path: windows-binaries.zip
362+
retention-days: 7
363+
364+
- name: Upload Linux binaries as workflow artifacts
365+
uses: actions/upload-artifact@v3
366+
with:
367+
name: linux-binaries.zip
368+
path: linux-binaries.zip
369+
retention-days: 7
370+
338371
release:
339372
name: Release project
340373
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
341-
needs: [package]
374+
needs: [package, fetch-release-artifacts]
342375
runs-on: ubuntu-latest
343376
steps:
344377
- name: Release to the private PyPI repository
@@ -352,6 +385,7 @@ jobs:
352385
uses: pyansys/actions/release-github@v4
353386
with:
354387
library-name: ${{ env.PACKAGE_NAME }}
388+
additional-artifacts: windows-binaries.zip linux-binaries.zip
355389

356390
upload_dev_docs:
357391
name: Upload dev documentation

.github/workflows/nightly_docker_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
cache-dependency-path: 'pyproject.toml'
3434

3535
- name: Set up headless display
36-
uses: pyvista/setup-headless-display-action@v1
36+
uses: pyvista/setup-headless-display-action@v2
3737

3838
- name: Create Python venv
3939
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ cython_debug/
154154
# vscode
155155
.vscode
156156

157+
# docker
158+
docker/*-binaries.zip
159+
157160
# PyCharm
158161
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
159162
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
- id: flake8
2323

2424
- repo: https://github.com/codespell-project/codespell
25-
rev: v2.2.2
25+
rev: v2.2.4
2626
hooks:
2727
- id: codespell
2828

@@ -43,6 +43,6 @@ repos:
4343

4444
# this validates our github workflow files
4545
- repo: https://github.com/python-jsonschema/check-jsonschema
46-
rev: 0.21.0
46+
rev: 0.22.0
4747
hooks:
4848
- id: check-github-workflows

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
* [Alexander Kaszynski](https://github.com/akaszynski)
1616
* [Jorge Martínez](https://github.com/jorgepiloto)
1717
* [Alejandro Fernández](https://github.com/AlejandroFernandezLuces)
18+
* [Lance Lance](https://github.com/LanceX2214)

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Then, install PyGeometry with:
164164

165165
* Index URL: ``https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/``
166166

167-
If access to this package registry is needed, email `pyansys.support@ansys.com <mailto:pyansys.support@ansys.com>`_
167+
If access to this package registry is needed, email `pyansys.core@ansys.com <mailto:pyansys.core@ansys.com>`_
168168
to request access. The PyAnsys team can provide you a read-only token to be inserted in ``${PRIVATE_PYPI_ACCESS_TOKEN}``.
169169
Once you have it, run the following command:
170170

doc/source/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ should use these issue templates:
3434

3535
If your issue does not fit into these categories, create your own issue.
3636

37-
To reach the PyAnsys team, email `pyansys.support@ansys.com <pyansys.support@ansys.com>`_.
37+
To reach the PyAnsys team, email `pyansys.core@ansys.com <pyansys.core@ansys.com>`_.
3838

3939
View documentation
4040
------------------

doc/source/examples/01_getting_started/01_math.mystnb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ print(eval.parameter.v)
156156

157157
```{code-cell} ipython3
158158
print("Point on the sphere:")
159-
eval.position()
159+
eval.position
160160
```
161161

162162
```{code-cell} ipython3
163163
print("Normal to the surface of the sphere at the evaluation position:")
164-
eval.normal()
164+
eval.normal
165165
```

doc/source/getting_started/docker.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ please install `Docker Engine <https://docs.docker.com/engine/install/>`_ from t
1313
At the moment, the Geometry service backend is only delivered as a Windows Docker container.
1414
As such, this container only runs on a Windows machine. Furthermore, it has also been observed
1515
that certain Docker Desktop versions for Windows are not properly configured for running Windows
16-
Docker containers. Refer to our section
16+
Docker containers. Refer to
1717
:ref:`Running the Geometry service Windows Docker container <ref_docker_windows>` for further details.
1818

1919
.. _ref_docker_windows:
@@ -33,10 +33,10 @@ you follow the upcoming steps when installing Docker:
3333

3434
#. On ``Settings >> Software updates``, deselect ``Automatically check for updates``. Then, ``Apply & restart``.
3535

36-
#. On the Windows taskbar, go to the ``Show hidden icons`` section, right click on the Docker Desktop app and
36+
#. On the Windows taskbar, go to the ``Show hidden icons`` section, right click in the Docker Desktop app and
3737
select ``Switch to Windows containers...``.
3838

39-
At this point, your Docker engine will support running Windows Docker containers. Next step will involve downloading
39+
At this point, your Docker engine supports running Windows Docker containers. Next step involves downloading
4040
the Geometry service Windows Docker image.
4141

4242
Install the PyGeometry image

0 commit comments

Comments
 (0)