Skip to content

Commit bc6227b

Browse files
committed
update test-gcp
1 parent 766a519 commit bc6227b

File tree

1 file changed

+119
-53
lines changed

1 file changed

+119
-53
lines changed

.github/workflows/test-gcp.yml

Lines changed: 119 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -55,54 +55,95 @@ jobs:
5555
fi
5656
echo "Determined image path: ${image_path}"
5757
echo "image_path=${image_path}" >> $GITHUB_OUTPUT
58+
59+
# this runs an initial set of smoke tests against a shape that we can use with high concurrency
60+
# this is to speed up the feedback loop in case something obvious can be caught quickly with a new image
61+
# without having to wait on the full run of per-shape tests which takes a while
62+
test-gcp-initialtest:
63+
name: AlmaLinux ${{ inputs.image_override || format('{0} {1}', inputs.version_major, matrix.arch) }} Initial Tests
64+
needs: init-data
65+
permissions:
66+
id-token: write
67+
contents: read
68+
runs-on: ubuntu-24.04
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
# this sets the arch matrix based on the input
73+
# if input is ALL, then set to both x86_64 and aarch64
74+
# otherwise set to the selected arch
75+
arch: ${{ fromJSON(inputs.arch == 'ALL' && '["x86_64","aarch64"]' || format('["{0}"]', inputs.arch)) }}
76+
steps:
77+
# we don't need the checked out files, but this is required for the google auth action to work
78+
- uses: 'actions/checkout@v5'
79+
80+
- id: 'google-auth-image-testing'
81+
uses: 'google-github-actions/auth@v2'
82+
with:
83+
workload_identity_provider: 'projects/527193872801/locations/global/workloadIdentityPools/github-actions/providers/github'
84+
service_account: 'github-actions-image-testing@almalinux-image-testing-469421.iam.gserviceaccount.com'
5885

59-
# # this initial test does the generic suite of tests not assigned to any specific shape - letting the test system
60-
# # choose its own shapes and sizes. This is run first to catch any major issues before running the per-shape tests
61-
# # which take a long time and use a lot of resources. Think of this as a smoke test to catch major issues early.
62-
# test-gcp-initialtest:
63-
# name: AlmaLinux ${{ inputs.image_override || format('{0} {1}', inputs.version_major, matrix.arch) }} Generic Full Run
64-
# needs: init-data
65-
# permissions:
66-
# id-token: write
67-
# contents: read
68-
# runs-on: ubuntu-24.04
69-
# strategy:
70-
# fail-fast: false
71-
# matrix:
72-
# # this sets the arch matrix based on the input
73-
# # if input is ALL, then set to both x86_64 and aarch64
74-
# # otherwise set to the selected arch
75-
# arch: ${{ fromJSON(inputs.arch == 'ALL' && '["x86_64","aarch64"]' || format('["{0}"]', inputs.arch)) }}
76-
# steps:
77-
# # we don't need the checked out files, but this is required for the google auth action to work
78-
# - uses: 'actions/checkout@v5'
86+
- name: 'Set up Google Cloud SDK'
87+
uses: 'google-github-actions/[email protected]'
7988

80-
# - id: 'google-auth-image-testing'
81-
# uses: 'google-github-actions/auth@v2'
82-
# with:
83-
# workload_identity_provider: 'projects/527193872801/locations/global/workloadIdentityPools/github-actions/providers/github'
84-
# service_account: 'github-actions-image-testing@almalinux-image-testing-469421.iam.gserviceaccount.com'
89+
- name: 'Run Google cloud-image-testing tests which are hard-coded to specific shapes'
90+
shell: bash
91+
run: |
92+
docker run \
93+
-v ${{ env.GOOGLE_GHA_CREDS_PATH }}:/creds/auth.json \
94+
-e GOOGLE_APPLICATION_CREDENTIALS=/creds/auth.json \
95+
gcr.io/compute-image-tools/cloud-image-tests:latest \
96+
-project almalinux-image-testing-469421 \
97+
-parallel_count 20 \
98+
-parallel_stagger 1s \
99+
-filter '^(cvm|livemigrate|suspendresume|loadbalancer|guestagent|hostnamevalidation|imageboot|licensevalidation|network|security|hotattach|packagevalidation|ssh|metadata)$' \
100+
-images '${{ needs.init-data.outputs.image_path }}${{ inputs.image_override == '' && matrix.arch == 'aarch64' && '-arm64' || ''}}' \
101+
${{ matrix.arch == '' && '-arm64_shape c4a-standard-8' || '-x86_shape c4-standard-8' }}
102+
103+
# this runs tests which are hard-coded to specific shapes in CIT
104+
# running them against all shapes would be pointless as they are forced to specific shapes anyway
105+
test-gcp-nonpershape:
106+
name: AlmaLinux ${{ inputs.image_override || format('{0} {1}', inputs.version_major, matrix.arch) }} Non-Per-Shape Tests
107+
needs: init-data
108+
permissions:
109+
id-token: write
110+
contents: read
111+
runs-on: ubuntu-24.04
112+
strategy:
113+
fail-fast: false
114+
matrix:
115+
# this sets the arch matrix based on the input
116+
# if input is ALL, then set to both x86_64 and aarch64
117+
# otherwise set to the selected arch
118+
arch: ${{ fromJSON(inputs.arch == 'ALL' && '["x86_64","aarch64"]' || format('["{0}"]', inputs.arch)) }}
119+
steps:
120+
# we don't need the checked out files, but this is required for the google auth action to work
121+
- uses: 'actions/checkout@v5'
122+
123+
- id: 'google-auth-image-testing'
124+
uses: 'google-github-actions/auth@v2'
125+
with:
126+
workload_identity_provider: 'projects/527193872801/locations/global/workloadIdentityPools/github-actions/providers/github'
127+
service_account: 'github-actions-image-testing@almalinux-image-testing-469421.iam.gserviceaccount.com'
85128

86-
# - name: 'Set up Google Cloud SDK'
87-
# uses: 'google-github-actions/[email protected]'
129+
- name: 'Set up Google Cloud SDK'
130+
uses: 'google-github-actions/[email protected]'
88131

89-
# - name: 'Run Google cloud-image-testing tests which are hard-coded to specific shapes'
90-
# shell: bash
91-
# run: |
92-
# docker run \
93-
# -v ${{ env.GOOGLE_GHA_CREDS_PATH }}:/creds/auth.json \
94-
# -e GOOGLE_APPLICATION_CREDENTIALS=/creds/auth.json \
95-
# gcr.io/compute-image-tools/cloud-image-tests:latest \
96-
# -project almalinux-image-testing-469421 \
97-
# -parallel_stagger 10s \
98-
# -parallel_count 20 \
99-
# -filter '^(cvm|livemigrate|suspendresume|loadbalancer|guestagent|hostnamevalidation|imageboot|licensevalidation|network|security|hotattach|packagevalidation|ssh|metadata|disk|lssd|vmspec)$' \
100-
# -images '${{ needs.init-data.outputs.image_path }}${{ inputs.image_override == '' && matrix.arch == 'aarch64' && '-arm64' || ''}}'
132+
- name: 'Run Google cloud-image-testing tests which are hard-coded to specific shapes'
133+
shell: bash
134+
run: |
135+
docker run \
136+
-v ${{ env.GOOGLE_GHA_CREDS_PATH }}:/creds/auth.json \
137+
-e GOOGLE_APPLICATION_CREDENTIALS=/creds/auth.json \
138+
gcr.io/compute-image-tools/cloud-image-tests:latest \
139+
-project almalinux-image-testing-469421 \
140+
-parallel_stagger 10s \
141+
-filter '^(lssd|disk|vmspec)$' \
142+
-images '${{ needs.init-data.outputs.image_path }}${{ inputs.image_override == '' && matrix.arch == 'aarch64' && '-arm64' || ''}}'
101143
102144
test-gcp-pershape-x86_64:
103145
name: ${{ inputs.image_override || format('{0}', inputs.version_major) }} x86_64 ${{ matrix.shape }}
104-
#needs: [init-data, test-gcp-initialtest]
105-
needs: init-data
146+
needs: [init-data,test-gcp-initialtest]
106147
permissions:
107148
id-token: write
108149
contents: read
@@ -136,8 +177,9 @@ jobs:
136177
# - c4d-standard-384-lssd
137178
- c3-standard-4
138179
- c3-standard-176
139-
# never any metal capacity available
140-
- c3-standard-192-metal
180+
# <failure message="" type="Failure"><![CDATA[step "create-vms" run error: googleapi: Error 400: C3 Metal instance does not support multi-vNIC., badRequest]]></failure>
181+
# - c3-standard-192-metal
182+
# lssd always fails
141183
# - c3-standard-4-lssd
142184
# - c3-standard-176-lssd
143185
- c3d-standard-4
@@ -219,15 +261,14 @@ jobs:
219261
gcr.io/compute-image-tools/cloud-image-tests:latest \
220262
-project almalinux-image-testing-469421 \
221263
-x86_shape ${{ matrix.shape }} \
222-
-parallel_count ${{ github.run_attempt > 1 && '5' || '1' }} \
264+
-parallel_count ${{ github.run_attempt > 1 && '1' || '1' }} \
223265
${{ matrix.zone && format('-zone {0}', matrix.zone) || '' }} \
224266
-filter '^(cvm|livemigrate|suspendresume|loadbalancer|guestagent|hostnamevalidation|imageboot|licensevalidation|network|security|hotattach|packagevalidation|ssh|metadata)$' \
225267
-images '${{ needs.init-data.outputs.image_path || inputs.image_override }}${{ inputs.image_override == '' && matrix.arch == 'aarch64' && '-arm64' || ''}}'
226268
227269
test-gcp-pershape-aarch64:
228270
name: ${{ inputs.image_override || format('{0}', inputs.version_major) }} aarch64 ${{ matrix.shape }}
229-
#needs: [init-data, test-gcp-initialtest]
230-
needs: init-data
271+
needs: [init-data, test-gcp-initialtest]
231272
permissions:
232273
id-token: write
233274
contents: read
@@ -237,26 +278,49 @@ jobs:
237278
fail-fast: false
238279
matrix:
239280
shape:
240-
- c4a-standard-1
241-
- c4a-standard-72
242-
- c4a-standard-4-lssd
243-
- c4a-standard-72-lssd
244-
- t2a-standard-1
245-
- t2a-standard-48
281+
# pretty limited quotas for this one
282+
# let's test one shape flavor + lssd
283+
# metal gets large-CPUs detection check
284+
- c4a-standard-4
285+
# all lssd shapes fail
286+
# https://github.com/GoogleCloudPlatform/cloud-image-tests/issues/345
287+
#- c4a-standard-4-lssd
288+
# pretty limited quotas for this one
289+
# let's just test one shape flavor
290+
- t2a-standard-4
291+
include:
292+
- shape: c4a-standard-96-metal
293+
# low quota for this one
294+
parallel_count: 1
295+
# only available in us-central1-b and us-east1-f
296+
zone: us-central1-b
246297
steps:
298+
# this isn't a great way to handle this, but GH actions has limitations...
299+
- name: Skip certain jobs
300+
id: checker
301+
if: (matrix.shape == 'c4a-standard-96-metal' && inputs.version_major == '8')
302+
run: |
303+
echo "Skipping ${{ matrix.shape }} for version_major ${{ inputs.version_major}} due to incompatibility."
304+
echo "skip=true" >> $GITHUB_OUTPUT
305+
exit 0
306+
247307
# we don't need the checked out files, but this is required for the google auth action to work
248308
- uses: 'actions/checkout@v5'
309+
if: steps.checker.outputs.skip != 'true'
249310

250311
- id: 'google-auth-image-testing'
251312
uses: 'google-github-actions/auth@v2'
313+
if: steps.checker.outputs.skip != 'true'
252314
with:
253315
workload_identity_provider: 'projects/527193872801/locations/global/workloadIdentityPools/github-actions/providers/github'
254316
service_account: 'github-actions-image-testing@almalinux-image-testing-469421.iam.gserviceaccount.com'
255317

256318
- name: 'Set up Google Cloud SDK'
319+
if: steps.checker.outputs.skip != 'true'
257320
uses: 'google-github-actions/[email protected]'
258321

259322
- name: 'Run Google cloud-image-testing tests on ${{ matrix.shape }}'
323+
if: steps.checker.outputs.skip != 'true'
260324
shell: bash
261325
run: |
262326
docker run \
@@ -265,5 +329,7 @@ jobs:
265329
gcr.io/compute-image-tools/cloud-image-tests:latest \
266330
-project almalinux-image-testing-469421 \
267331
-arm64_shape ${{ matrix.shape }} \
332+
${{ matrix.zone && format('-zone {0}', matrix.zone) || '' }} \
333+
-parallel_count ${{ matrix.parallel_count && format (' {0}', matrix.parallel_count) || '1' }} \
268334
-filter '^(cvm|livemigrate|suspendresume|loadbalancer|guestagent|hostnamevalidation|imageboot|licensevalidation|network|security|hotattach|packagevalidation|ssh|metadata)$' \
269-
-images '${{ needs.init-data.outputs.image_path || inputs.image_override }}${{ inputs.image_override == '' && matrix.arch == 'aarch64' && '-arm64' || ''}}'
335+
-images '${{ needs.init-data.outputs.image_path || inputs.image_override }}${{ inputs.image_override == '' && '-arm64' || ''}}'

0 commit comments

Comments
 (0)