Skip to content

Commit 30028f2

Browse files
committed
Merge branch 'main' into dependabot/pip/grpc-deps-8c3042ba23
2 parents 50b9e7d + 9f07547 commit 30028f2

File tree

9 files changed

+185
-28
lines changed

9 files changed

+185
-28
lines changed

.github/workflows/ci_cd.yml

Lines changed: 101 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,71 @@ jobs:
102102
directory: docker
103103
recursive: true
104104

105+
manifests:
106+
name: Check Docker manifests
107+
runs-on: ubuntu-latest
108+
outputs:
109+
skip_dms: ${{ steps.services.outputs.skip_dms }}
110+
skip_core_windows: ${{ steps.services.outputs.skip_core_windows }}
111+
skip_core_linux: ${{ steps.services.outputs.skip_core_linux }}
112+
strategy:
113+
matrix:
114+
include:
115+
- container-stable: "windows-latest"
116+
container-unstable: "windows-latest-unstable"
117+
service: "dms"
118+
service-name: "Windows DMS"
119+
- container-stable: "core-windows-latest"
120+
container-unstable: "core-windows-latest-unstable"
121+
service: "core_windows"
122+
service-name: "Windows Core Service"
123+
- container-stable: "core-linux-latest"
124+
container-unstable: "core-linux-latest-unstable"
125+
service: "core_linux"
126+
service-name: "Linux Core Service"
127+
steps:
128+
- name: Login to GitHub Container Registry
129+
uses: docker/login-action@v3
130+
with:
131+
registry: ghcr.io
132+
username: ${{ github.actor }}
133+
password: ${{ secrets.GITHUB_TOKEN }}
134+
135+
- name: Check ${{ matrix.service-name }} manifest
136+
id: services
137+
run: |
138+
docker manifest inspect ghcr.io/ansys/geometry:${{ matrix.container-stable }} > ${{ matrix.container-stable }}.json
139+
docker manifest inspect ghcr.io/ansys/geometry:${{ matrix.container-unstable }} > ${{ matrix.container-unstable }}.json || true
140+
141+
# Verify that the unstable manifest exists - otherwise create an empty file
142+
if [ ! -f ${{ matrix.container-unstable }}.json ]; then
143+
touch ${{ matrix.container-unstable }}.json
144+
fi
145+
146+
147+
# Check if the manifests are the same (and if so, create an output that will skip the next job)
148+
if diff ${{ matrix.container-stable }}.json ${{ matrix.container-unstable }}.json; then
149+
echo "${{ matrix.service-name }} container manifests are the same... skipping"
150+
echo "skip_${{ matrix.service }}=1" >> "$GITHUB_OUTPUT"
151+
else
152+
echo "${{ matrix.service-name }} container manifests are different"
153+
echo "skip_${{ matrix.service }}=0" >> "$GITHUB_OUTPUT"
154+
fi
155+
105156
# =================================================================================================
106157
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
107158
# =================================================================================================
108159

109160
testing-windows:
110161
name: Testing and coverage (Windows)
111-
needs: [smoke-tests]
162+
needs: [smoke-tests, manifests]
112163
# runs-on: [self-hosted, Windows, pygeometry]
113164
runs-on: # TODO: Waiting for ansys-network runner to be updated
114165
group: pyansys-self-hosted
115166
labels: [self-hosted, Windows, pygeometry]
116167
continue-on-error: ${{ matrix.experimental }}
117168
env:
118-
SKIP_UNSTABLE: ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY == 1 && matrix.experimental }}
169+
SKIP_UNSTABLE: false
119170
PYVISTA_OFF_SCREEN: true
120171
strategy:
121172
fail-fast: false
@@ -131,6 +182,30 @@ jobs:
131182
experimental: true
132183

133184
steps:
185+
- name: Calculate SKIP_UNSTABLE
186+
if: matrix.experimental
187+
run: |
188+
# Choose the manifests output to consider (for DMS or Core service)
189+
# based on the matrix value
190+
if ("${{ matrix.docker-image }}" -eq "windows-latest-unstable") {
191+
$ImagesAreEqual = ${{ needs.manifests.outputs.skip_dms }}
192+
} elseif ("${{ matrix.docker-image }}" -eq "core-windows-latest-unstable") {
193+
$ImagesAreEqual = ${{ needs.manifests.outputs.skip_core_windows }}
194+
} else {
195+
Write-Output "Unknown docker image"
196+
exit 1
197+
}
198+
199+
$A = $env:SKIP_UNSTABLE_CONTAINERS_TEMPORARILY -eq 1
200+
$B = $ImagesAreEqual -eq 1
201+
202+
# Calculate the logical expression
203+
$Result = ($A -or $B).ToString().ToLower()
204+
205+
# Export it as an environment variable with true/false value
206+
Write-Output "SKIP_UNSTABLE=$Result" | Out-File -FilePath $env:GITHUB_ENV -Append
207+
Write-Output "SKIP_UNSTABLE will be: $Result"
208+
134209
- uses: actions/checkout@v4
135210
if: env.SKIP_UNSTABLE == 'false'
136211

@@ -329,11 +404,11 @@ jobs:
329404

330405
testing-linux:
331406
name: Testing and coverage (Linux)
332-
needs: [smoke-tests]
407+
needs: [smoke-tests, manifests]
333408
runs-on: ubuntu-latest
334409
continue-on-error: ${{ matrix.experimental }}
335410
env:
336-
SKIP_UNSTABLE: ${{ vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY == 1 && matrix.experimental }}
411+
SKIP_UNSTABLE: false
337412
strategy:
338413
fail-fast: false
339414
matrix:
@@ -344,6 +419,28 @@ jobs:
344419
experimental: true
345420

346421
steps:
422+
- name: Calculate SKIP_UNSTABLE
423+
if: matrix.experimental
424+
run: |
425+
# Choose the manifests output to consider (for Core service)
426+
# based on the matrix value
427+
if [[ "${{ matrix.docker-image }}" == "core-linux-latest-unstable" ]]; then
428+
ImagesAreEqual=${{ needs.manifests.outputs.skip_core_linux }}
429+
else
430+
echo "Unknown docker image"
431+
exit 1
432+
fi
433+
434+
A=$([[ "$SKIP_UNSTABLE_CONTAINERS_TEMPORARILY" == "1" ]] && echo true || echo false)
435+
B=$([[ "$ImagesAreEqual" == "1" ]] && echo true || echo false)
436+
437+
# Calculate the logical expression
438+
Result=$([[ "$A" == true || "$B" == true ]] && echo true || echo false)
439+
440+
# Export it as an environment variable with true/false value
441+
echo "SKIP_UNSTABLE=$Result" >> $GITHUB_ENV
442+
echo "SKIP_UNSTABLE will be: $Result"
443+
347444
- name: Login in Github Container registry
348445
if: env.SKIP_UNSTABLE == 'false'
349446
uses: docker/login-action@v3

.github/workflows/nightly_docker_test.yml

Lines changed: 76 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Nightly Server test - Latest build
1+
name: Unstable build tests and promotion
22
on:
33
workflow_dispatch:
44
inputs:
@@ -35,13 +35,65 @@ concurrency:
3535

3636
jobs:
3737

38+
manifests:
39+
name: Check Docker manifests
40+
runs-on: ubuntu-latest
41+
outputs:
42+
skip_dms: ${{ steps.services.outputs.skip_dms }}
43+
skip_core_windows: ${{ steps.services.outputs.skip_core_windows }}
44+
skip_core_linux: ${{ steps.services.outputs.skip_core_linux }}
45+
strategy:
46+
matrix:
47+
include:
48+
- container-stable: "windows-latest"
49+
container-unstable: "windows-latest-unstable"
50+
service: "dms"
51+
service-name: "Windows DMS"
52+
- container-stable: "core-windows-latest"
53+
container-unstable: "core-windows-latest-unstable"
54+
service: "core_windows"
55+
service-name: "Windows Core Service"
56+
- container-stable: "core-linux-latest"
57+
container-unstable: "core-linux-latest-unstable"
58+
service: "core_linux"
59+
service-name: "Linux Core Service"
60+
steps:
61+
- name: Login to GitHub Container Registry
62+
uses: docker/login-action@v3
63+
with:
64+
registry: ghcr.io
65+
username: ${{ github.actor }}
66+
password: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: Check ${{ matrix.service-name }} manifest
69+
id: services
70+
run: |
71+
docker manifest inspect ghcr.io/ansys/geometry:${{ matrix.container-stable }} > ${{ matrix.container-stable }}.json
72+
docker manifest inspect ghcr.io/ansys/geometry:${{ matrix.container-unstable }} > ${{ matrix.container-unstable }}.json || true
73+
74+
# Verify that the unstable manifest exists - otherwise create an empty file
75+
if [ ! -f ${{ matrix.container-unstable }}.json ]; then
76+
touch ${{ matrix.container-unstable }}.json
77+
fi
78+
79+
80+
# Check if the manifests are the same (and if so, create an output that will skip the next job)
81+
if diff ${{ matrix.container-stable }}.json ${{ matrix.container-unstable }}.json; then
82+
echo "${{ matrix.service-name }} container manifests are the same... skipping"
83+
echo "skip_${{ matrix.service }}=1" >> "$GITHUB_OUTPUT"
84+
else
85+
echo "${{ matrix.service-name }} container manifests are different"
86+
echo "skip_${{ matrix.service }}=0" >> "$GITHUB_OUTPUT"
87+
fi
88+
3889
# =================================================================================================
3990
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUNNING ON SELF-HOSTED RUNNER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4091
# =================================================================================================
4192

4293
windows-dms-tests:
43-
name: Nightly unstable testing - Windows DMS
44-
if: vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1
94+
name: Windows DMS
95+
needs: manifests
96+
if: needs.manifests.outputs.skip_dms == 0
4597
runs-on: [self-hosted, Windows, pygeometry]
4698
env:
4799
PYVISTA_OFF_SCREEN: true
@@ -127,12 +179,12 @@ jobs:
127179
{
128180
"@type": "MessageCard",
129181
"@context": "http://schema.org/extensions",
130-
"summary": "Nightly Tests for Windows DMS failing",
182+
"summary": "Unstable build tests for Windows DMS failing",
131183
"themeColor": "f44336",
132-
"title": "PyAnsys Geometry Nightly Tests - Windows DMS failing",
184+
"title": "PyAnsys Geometry unstable build tests - Windows DMS failing",
133185
"sections": [
134186
{
135-
"activityTitle": "Windows DMS nightly tests are failing",
187+
"activityTitle": "Windows DMS unstable build tests are failing",
136188
"activitySubtitle": "Check the run for more details: https://github.com/ansys/pyansys-geometry/actions/runs/${{ github.run_id }}",
137189
"facts": [
138190
{
@@ -145,8 +197,9 @@ jobs:
145197
}
146198
147199
windows-core-tests:
148-
name: Nightly unstable testing - Windows Core Service
149-
if: vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1
200+
name: Windows Core Service
201+
needs: manifests
202+
if: needs.manifests.outputs.skip_core_windows == 0
150203
# runs-on: [self-hosted, Windows, pygeometry]
151204
runs-on: # TODO: Waiting for ansys-network runner to be updated
152205
group: pyansys-self-hosted
@@ -235,12 +288,12 @@ jobs:
235288
{
236289
"@type": "MessageCard",
237290
"@context": "http://schema.org/extensions",
238-
"summary": "Nightly Tests for Windows Core Service failing",
291+
"summary": "Unstable build tests for Windows Core Service failing",
239292
"themeColor": "f44336",
240-
"title": "PyAnsys Geometry Nightly Tests - Windows Core Service failing",
293+
"title": "PyAnsys Geometry unstable build tests - Windows Core Service failing",
241294
"sections": [
242295
{
243-
"activityTitle": "Windows Core Service nightly tests are failing",
296+
"activityTitle": "Windows Core Service unstable build tests are failing",
244297
"activitySubtitle": "Check the run for more details: https://github.com/ansys/pyansys-geometry/actions/runs/${{ github.run_id }}",
245298
"facts": [
246299
{
@@ -258,8 +311,9 @@ jobs:
258311
# =================================================================================================
259312

260313
linux-tests:
261-
name: Nightly unstable testing - Linux
262-
if: vars.SKIP_UNSTABLE_CONTAINERS_TEMPORARILY != 1
314+
name: Linux Core Service
315+
needs: manifests
316+
if: needs.manifests.outputs.skip_core_linux == 0
263317
runs-on: ubuntu-latest
264318

265319
steps:
@@ -300,12 +354,12 @@ jobs:
300354
{
301355
"@type": "MessageCard",
302356
"@context": "http://schema.org/extensions",
303-
"summary": "Nightly Tests for Linux failing",
357+
"summary": "Unstable build tests for Linux Core Service failing",
304358
"themeColor": "f44336",
305-
"title": "PyAnsys Geometry Nightly Tests - Linux failing",
359+
"title": "PyAnsys Geometry unstable build tests - Linux Core Service failing",
306360
"sections": [
307361
{
308-
"activityTitle": "Linux nightly tests are failing",
362+
"activityTitle": "Linux Core Service unstable build tests are failing",
309363
"activitySubtitle": "Check the run for more details: https://github.com/ansys/pyansys-geometry/actions/runs/${{ github.run_id }}",
310364
"facts": [
311365
{
@@ -318,9 +372,9 @@ jobs:
318372
}
319373
320374
promote-windows-dms:
321-
needs: [windows-dms-tests, windows-core-tests, linux-tests]
375+
needs: windows-dms-tests
322376
runs-on: windows-latest
323-
name: Promote Windows container
377+
name: Promote Windows DMS container
324378
if: ${{ github.event.inputs.promote == 'true' || github.event_name == 'schedule' }}
325379
env:
326380
WINDOWS_UNSTABLE: ghcr.io/ansys/geometry:windows-latest-unstable
@@ -343,9 +397,9 @@ jobs:
343397
run: docker push ${{ env.WINDOWS_STABLE_GHCR }}
344398

345399
promote-windows-core:
346-
needs: [windows-dms-tests, windows-core-tests, linux-tests]
400+
needs: windows-core-tests
347401
runs-on: windows-latest
348-
name: Promote Windows container
402+
name: Promote Windows Core Service container
349403
if: ${{ github.event.inputs.promote == 'true' || github.event_name == 'schedule' }}
350404
env:
351405
WINDOWS_UNSTABLE: ghcr.io/ansys/geometry:core-windows-latest-unstable
@@ -368,9 +422,9 @@ jobs:
368422
run: docker push ${{ env.WINDOWS_STABLE_GHCR }}
369423

370424
promote-linux:
371-
needs: [windows-dms-tests, windows-core-tests, linux-tests]
425+
needs: linux-tests
372426
runs-on: ubuntu-latest
373-
name: Promote Linux container
427+
name: Promote Linux Core Service container
374428
if: ${{ github.event.inputs.promote == 'true' || github.event_name == 'schedule' }}
375429
env:
376430
LINUX_UNSTABLE: ghcr.io/ansys/geometry:core-linux-latest-unstable

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exclude: "tests/integration/files"
77
repos:
88

99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.8.2
10+
rev: v0.8.3
1111
hooks:
1212
- id: ruff
1313
- id: ruff-format
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pre-commit automatic update
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
avoid the usage of attrs 24.3.0 (temporary)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bump jupytext from 1.16.4 to 1.16.5 in the docs-deps group
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
decouple unstable image promotion
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
skip unnecessary stages when containers are the same

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ dependencies = [
2727
"ansys-api-geometry==0.4.24",
2828
"ansys-tools-path>=0.3,<1",
2929
"ansys-tools-visualization-interface>=0.2.6,<1",
30+
"attrs!=24.3.0",
3031
"beartype>=0.11.0,<0.20",
3132
"grpcio>=1.35.0,<2",
3233
"grpcio-health-checking>=1.45.0,<2",
@@ -85,7 +86,7 @@ doc = [
8586
"grpcio-health-checking==1.68.1",
8687
"ipyvtklink==0.2.3",
8788
"jupyter_sphinx==0.5.3",
88-
"jupytext==1.16.4",
89+
"jupytext==1.16.5",
8990
"myst-parser==4.0.0",
9091
"nbconvert==7.16.4",
9192
"nbsphinx==0.9.5",

0 commit comments

Comments
 (0)