Repository navigation
425 lines (414 loc) · 20.2 KB
/
Copy pathinteg-test.yml
File metadata and controls
425 lines (414 loc) · 20.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
name: integ-test
on:
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
inputs:
integ_tests_include:
type: string
description: |-
List integration tests to include.
Use "*" to run all tests.
Use regex like 'node|^git_issue' to run only a subset.
default: "*"
# dns_config|time_server - NTP cannot be reconfigured if DNS is invalid
# git_issues - slow, do not run on each push. TODO - run them only once a day
# oidc_config - during reconfiguration API returns 500/502 errors for other requests
# utils_login - it uses OIDC user to login
# smtp - email_alert test requires a configured SMTP
# role_cluster_config - role cluster_config reconfigures DNS, SMTP, OIDC. And it is slow.
# version_update_single_node - role would change version, VSNS system cannot be updated.
# vm_replication vm_clone__replicated - VSNS were not configured with replication
integ_tests_exclude:
type: string
description: |-
List integration tests to exclude.
Use "*" to exclude all tests.
Use regex like 'node|^git_issue|^dns_config$' to exclude only a subset.
default: "^dns_config$|^cluster_shutdown$|^version_update$|^oidc_config$|^smtp$|^role_cluster_config$|^role_version_update_single_node$|^version_update__shutdown_restart_vms$|^utils_login$|^certificate$|^vm_replication$|^vm_replication_info$|^vm_clone__replicated$|^support_tunnel$"
integ_seq_tests_include:
type: string
description: |-
List seq integration tests to include.
# We want to run sequentially all tests that cannot run in parallel (e.g. all that listed in integ_tests_exclude).
# Some tests can be tested on VSNS - those are run on VSNS.
# Some cannot, those are run on test cluster 10.5.11.50.
# Some cannot be tested at all - shutdown and version update.
default: "^dns_config$|^oidc_config$|^smtp$|^role_cluster_config$|^version_update__shutdown_restart_vms$|^utils_login$|^certificate$"
integ_seq_tests_exclude:
type: string
description: |-
List seq integration tests to exclude.
default: ""
examples_tests_include:
type: string
description: |-
List examples to include into testing.
Use "*" to test all examples.
default: "iso_info"
examples_tests_exclude:
type: string
description: |-
List examples to exclude from testing.
default: "^version_update_single_node.yml$|^vm_os_upgrade$|^vm_snapshot_attach_disk.yml$|^url2template$"
env:
INTEG_TESTS_INCLUDE_SCHEDULE: "*"
INTEG_TESTS_EXCLUDE_SCHEDULE: "^dns_config$|^cluster_shutdown$|^version_update$|^oidc_config$|^smtp$|^role_cluster_config$|^role_version_update_single_node$|^version_update__shutdown_restart_vms$|^utils_login$|^certificate$|^vm_replication$|^vm_replication_info$|^vm_clone__replicated$|^support_tunnel$"
INTEG_SEQ_TESTS_INCLUDE_SCHEDULE: "^dns_config$|^oidc_config$|^smtp$|^role_cluster_config$|^version_update__shutdown_restart_vms$|^utils_login$|^certificate$"
INTEG_SEQ_TESTS_EXCLUDE_SCHEDULE: ""
EXAMPLES_TESTS_INCLUDE_SCHEDULE: "*"
EXAMPLES_TESTS_EXCLUDE_SCHEDULE: "^version_update_single_node.yml$|^vm_os_upgrade$|^vm_snapshot_attach_disk.yml$|^url2template$"
# ansible-test needs special directory structure.
# WORKDIR is a subdir of GITHUB_WORKSPACE
WORKDIR: work-dir/ansible_collections/scale_computing/hypercore
LANG: C.UTF-8
# Run only one workflow for specific branch.
concurrency:
group: ${{ github.ref_name }}
cancel-in-progress: true
# ----------------------------------------------------------------------------------------
# Indy-lab failover, 2026-10-29: PUB5/XLab (10.5.11.x) became unreachable ~2026-10-27, taking
# out every sc_host this workflow used to run against. Replaced with the two hosts required
# by hypercore-ci-fleet's CI policy (last two Standard lines): the 10.5.11.x matrix entries
# below are commented inline for when that hardware returns, not deleted. See
# hypercore-ci-fleet's local/ci-failover-2026-10-28/ANSIBLE_INDY_LAB_FIXTURE.md (gitignored
# there -- ask Dave) and tests/integration/integration_config.yml.j2's own matching comment
# block for the new https://10.6.112.64 / https://10.6.42.19 entries.
# ----------------------------------------------------------------------------------------
jobs:
# This should be run at least once before first integration tests run.
# As long as prepared HC3 host remains prepared, we do not need (except on very first run)
# to delay integ-test until integration-prepare-env finishes.
integration-prepare-env:
runs-on: [self-hosted2]
container: quay.io/justinc1_github/scale_ci_integ:11
env:
ANSIBLE_COLLECTIONS_PATH: $GITHUB_WORKSPACE/work-dir
defaults:
run:
working-directory: ${{ env.WORKDIR }}
strategy:
fail-fast: false
matrix:
sc_host:
- https://10.6.112.64 # required: 9.6.32, 3-node, also replication source -> vsns67
- https://10.6.42.19 # required: 9.5.10 (vsns19, reused as-is)
# - https://10.5.11.200 # HC 9.1.x -- PUB5/XLab, unreachable since 2026-10-27
# - https://10.5.11.201 # HC 9.2.x -- PUB5/XLab, unreachable since 2026-10-27
# - https://10.5.11.203 # HC 9.3.x -- PUB5/XLab, unreachable since 2026-10-27
# - https://10.5.11.205 # HC 9.4.x -- PUB5/XLab, unreachable since 2026-10-27
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.WORKDIR }}
- run: ansible-galaxy collection install community.crypto community.general
- run: ansible-galaxy collection list
- uses: ./work-dir/ansible_collections/scale_computing/hypercore/.github/actions/make-integ-config
with:
sc_host: ${{ matrix.sc_host }}
sc_password_50: ${{ secrets.CI_CONFIG_HC_IP50_SC_PASSWORD }}
# 10.5.11.39's secret, CI_CONFIG_HC_IP50_SMB_PASSWORD, is kept for when PUB5/XLab
# returns. 10.6.42.5 needs its own secret -- Dave: `gh secret set
# CI_CONFIG_INDY_SMB_PASSWORD --repo ScaleComputing/HyperCoreAnsibleCollection`.
smb_password: ${{ secrets.CI_CONFIG_INDY_SMB_PASSWORD }}
oidc_client_secret: ${{ secrets.OIDC_CLIENT_SECRET }}
oidc_users_0_password: ${{ secrets.OIDC_USERS_0_PASSWORD }}
working_directory: ${{ env.WORKDIR }}
- run: ansible-playbook tests/integration/prepare/prepare_iso.yml
- run: ansible-playbook tests/integration/prepare/prepare_vm.yml
- run: ansible-playbook tests/integration/prepare/prepare_examples.yml
if: "${{ github.event.inputs.integ_tests_include || github.event.schedule }}"
integ-matrix:
runs-on: [ubuntu-latest]
container: quay.io/justinc1_github/scale_ci_integ:11
defaults:
run:
working-directory: ${{ env.WORKDIR }}
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.WORKDIR }}
# We want to run all integ tests periodically - "integ_tests_include || '*'", the '*' is used.
# When running with workflow-dispatch, user is required to put some non-empty string into integ_tests_include.
- run: echo 'INTEG_TESTS_INCLUDE=${{ github.event.inputs.integ_tests_include || env.INTEG_TESTS_INCLUDE_SCHEDULE }}' >> $GITHUB_ENV
- run: echo 'INTEG_TESTS_EXCLUDE=${{ github.event.inputs.integ_tests_exclude || env.INTEG_TESTS_EXCLUDE_SCHEDULE }}' >> $GITHUB_ENV
- id: set-matrix
shell: bash
run: |-
echo "matrix=$(
ls -r tests/integration/targets |
grep -v -E "${{ env.INTEG_TESTS_EXCLUDE || '^dummy-no-such-test$' }}" |
grep -E "${{ env.INTEG_TESTS_INCLUDE }}" |
jq -R -s -c 'split("\n")[:-1]'
)" >> $GITHUB_OUTPUT
if: "${{ github.event.inputs.integ_tests_include || github.event.schedule }}"
integ-seq-matrix:
needs:
- integ-matrix
runs-on: [ubuntu-latest]
container: quay.io/justinc1_github/scale_ci_integ:11
defaults:
run:
working-directory: ${{ env.WORKDIR }}
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.WORKDIR }}
- run: echo 'INTEG_SEQ_TESTS_INCLUDE=${{ github.event.inputs.integ_seq_tests_include || env.INTEG_SEQ_TESTS_INCLUDE_SCHEDULE }}' >> $GITHUB_ENV
- run: echo 'INTEG_SEQ_TESTS_EXCLUDE=${{ github.event.inputs.integ_seq_tests_exclude || env.INTEG_SEQ_TESTS_EXCLUDE_SCHEDULE }}' >> $GITHUB_ENV
- id: set-matrix
shell: bash
run: |-
echo "matrix=$(
ls -r tests/integration/targets |
grep -v -E "${{ env.INTEG_SEQ_TESTS_EXCLUDE || '^dummy-no-such-test$' }}" |
grep -E "${{ env.INTEG_SEQ_TESTS_INCLUDE }}" |
jq -R -s -c 'split("\n")[:-1]'
)" >> $GITHUB_OUTPUT
if: "${{ github.event.inputs.integ_seq_tests_include || github.event.schedule }}"
examples-matrix:
needs:
- integ-seq-matrix
runs-on: [ ubuntu-latest ]
container: quay.io/justinc1_github/scale_ci_integ:11
defaults:
run:
working-directory: ${{ env.WORKDIR }}
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.WORKDIR }}
- run: echo 'EXAMPLES_TESTS_INCLUDE=${{ github.event.inputs.examples_tests_include || env.EXAMPLES_TESTS_INCLUDE_SCHEDULE }}' >> $GITHUB_ENV
- run: echo 'EXAMPLES_TESTS_EXCLUDE=${{ github.event.inputs.examples_tests_exclude || env.EXAMPLES_TESTS_EXCLUDE_SCHEDULE }}' >> $GITHUB_ENV
# A few files are not an example playbook:
# hypercore_inventory.yml - inventory example
# cloud-init-user-data-example.yml - cloud-init user-data example
- id: set-matrix
shell: bash
run: |-
echo "matrix=$(
ls -r examples |
grep -v -E "^README.md$|^hypercore_inventory.yml$|^cloud-init-user-data-example.yml$" |
grep -v -E "${{ env.EXAMPLES_TESTS_EXCLUDE || '^dummy-no-such-example$' }}" |
grep -E "${{ env.EXAMPLES_TESTS_INCLUDE }}" |
jq -R -s -c 'split("\n")[:-1]'
)" >> $GITHUB_OUTPUT
if: "${{ github.event.inputs || github.event.schedule }}"
examples-run:
needs:
- examples-matrix
# run examples after integ - they will both try to modify say syslog_server etc
- integ-seq-run
if: "(!cancelled()) && (needs.examples-matrix.result=='success')"
runs-on: [ self-hosted2 ]
container: quay.io/justinc1_github/scale_ci_integ:11
env:
ANSIBLE_COLLECTIONS_PATH: $GITHUB_WORKSPACE/work-dir
DEBIAN_FRONTEND: noninteractive
defaults:
run:
working-directory: ${{ env.WORKDIR }}
strategy:
fail-fast: false
matrix:
ansible: [ 2.16.0 ]
example_name: ${{ fromJson(needs.examples-matrix.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.WORKDIR }}
- name: SKIP test if it succeeded before
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
X_GITHUB_JOB_NAME: "examples-run (${{ matrix.ansible }}, ${{ matrix.example_name }})"
run: |
if ! .github/job_retry_needed.py
then
echo SKIP test, job retry not needed
echo 'X_GITHUB_SKIP_TEST=1' >> $GITHUB_ENV
else
echo 'X_GITHUB_SKIP_TEST=0' >> $GITHUB_ENV
fi
- name: Install prerequisites
shell: bash
run: |
[ "$X_GITHUB_SKIP_TEST" == "1" ] && exit 0
pip install ansible-core~=${{ matrix.ansible }}
ansible-galaxy collection install community.crypto community.general
ansible-galaxy collection list
# ${{ env.WORKDIR }} cannot be used in "uses:"
- uses: ./work-dir/ansible_collections/scale_computing/hypercore/.github/actions/make-integ-config
with:
# Was https://10.5.11.205 (PUB5/XLab, dead since 2026-10-27). Pointed at vsns19
# rather than vsns64 so examples-run doesn't contend with the main matrix's host.
sc_host: https://10.6.42.19
sc_password_50: ${{ secrets.CI_CONFIG_HC_IP50_SC_PASSWORD }}
# 10.5.11.39's secret, CI_CONFIG_HC_IP50_SMB_PASSWORD, is kept for when PUB5/XLab
# returns. 10.6.42.5 needs its own secret -- Dave: `gh secret set
# CI_CONFIG_INDY_SMB_PASSWORD --repo ScaleComputing/HyperCoreAnsibleCollection`.
smb_password: ${{ secrets.CI_CONFIG_INDY_SMB_PASSWORD }}
oidc_client_secret: ${{ secrets.OIDC_CLIENT_SECRET }}
oidc_users_0_password: ${{ secrets.OIDC_USERS_0_PASSWORD }}
working_directory: ${{ env.WORKDIR }}
- name: Debug test config
shell: bash
run: |
pwd
ls -al tests/integration/integration_config.yml
head tests/integration/integration_config.yml
- name: Run test
shell: bash
run: |
[ "$X_GITHUB_SKIP_TEST" == "1" ] && exit 0
eval export SC_HOST=$(cat tests/integration/integration_config.yml | yq '.sc_host')
# Was hardcoded to the "https://10.5.11.200" key regardless of sc_host above --
# only worked because every vsns2xx block shares admin/admin. Fixed to actually
# look up the host this job configured, 2026-10-29.
eval export SC_USERNAME=$(cat tests/integration/integration_config.yml | yq ".sc_config.\"$SC_HOST\".sc_username")
eval export SC_PASSWORD=$(cat tests/integration/integration_config.yml | yq ".sc_config.\"$SC_HOST\".sc_password")
eval export SC_TIMEOUT=$(cat tests/integration/integration_config.yml | yq '.sc_timeout')
ansible-playbook -i localhost, -e hypercore_example_check_mode=true examples/${{ matrix.example_name }}
integ-run:
needs:
- integ-matrix
if: "(!cancelled()) && (needs.integ-matrix.result=='success')"
strategy:
fail-fast: false
matrix:
sc_host:
- https://10.6.112.64 # required: 9.6.32, 3-node, also replication source -> vsns67
- https://10.6.42.19 # required: 9.5.10 (vsns19, reused as-is)
# - https://10.5.11.200 # HC 9.1.x -- PUB5/XLab, unreachable since 2026-10-27
# - https://10.5.11.201 # HC 9.2.x -- PUB5/XLab, unreachable since 2026-10-27
# - https://10.5.11.203 # HC 9.3.x -- PUB5/XLab, unreachable since 2026-10-27
# - https://10.5.11.205 # HC 9.4.x -- PUB5/XLab, unreachable since 2026-10-27
secrets: inherit
uses: ./.github/workflows/z_ansible-test.yml
with:
sc_host: ${{ matrix.sc_host }}
test_names: ${{ needs.integ-matrix.outputs.matrix }}
outer_job_name: integ-run
integ-seq-run:
needs:
- integ-seq-matrix
- integ-run
if: "(!cancelled()) && (needs.integ-seq-matrix.result=='success')"
strategy:
fail-fast: false
matrix:
sc_host:
- https://10.6.112.64 # required: 9.6.32, 3-node, also replication source -> vsns67
- https://10.6.42.19 # required: 9.5.10 (vsns19, reused as-is)
# - https://10.5.11.200 # HC 9.1.x -- PUB5/XLab, unreachable since 2026-10-27
# - https://10.5.11.201 # HC 9.2.x -- PUB5/XLab, unreachable since 2026-10-27
# - https://10.5.11.203 # HC 9.3.x -- PUB5/XLab, unreachable since 2026-10-27
# - https://10.5.11.205 # HC 9.4.x -- PUB5/XLab, unreachable since 2026-10-27
secrets: inherit
uses: ./.github/workflows/z_ansible-test.yml
with:
sc_host: ${{ matrix.sc_host }}
test_names: ${{ needs.integ-seq-matrix.outputs.matrix }}
outer_job_name: integ-seq-run
# Was "On physical HyperCore" against PUB5's .50 (dead since 2026-10-27). Repointed
# 2026-10-29 at the new required 9.6.32 cluster, which is also the replication source now
# that vsns67 is paired to it, so these can run there instead of a dedicated physical node.
# needs/if added because .64 is now also the main matrix's host -- it was a dedicated node
# before, so nothing serialized these against it previously.
#
# test_names had a quote typo ('vm_replication_info" -- single open, double close) that
# broke fromJson(inputs.test_names) in z_ansible-test.yml. Per `git log -S`, this landed in
# b9a0f30 and was never caught, so this job's replication/support_tunnel coverage was
# already failing at matrix generation before the outage -- fixed here, not something this
# outage broke.
integ-physical:
needs:
- integ-seq-run
if: "(!cancelled())"
secrets: inherit
uses: ./.github/workflows/z_ansible-test.yml
with:
sc_host: https://10.6.112.64
test_names: >-
[
"vm_replication",
"vm_replication_info",
"vm_clone__replicated",
"support_tunnel"
]
outer_job_name: integ-physical
replica_cleanup:
needs: []
runs-on: [self-hosted2]
container: quay.io/justinc1_github/scale_ci_integ:11
env:
ANSIBLE_COLLECTIONS_PATH: $GITHUB_WORKSPACE/work-dir
defaults:
run:
working-directory: ${{ env.WORKDIR }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.WORKDIR }}
- run: pip install ansible-core~=2.16.0
# ${{ env.WORKDIR }} cannot be used
- uses: ./work-dir/ansible_collections/scale_computing/hypercore/.github/actions/make-integ-config
with:
# Was https://10.5.11.50 (PUB5, dead since 2026-10-27). .64 is now the replication
# source (paired to vsns67), so its RemoteClusterConnection is what this cleans up.
sc_host: https://10.6.112.64
sc_password_50: ${{ secrets.CI_CONFIG_HC_IP50_SC_PASSWORD }}
# 10.5.11.39's secret, CI_CONFIG_HC_IP50_SMB_PASSWORD, is kept for when PUB5/XLab
# returns. 10.6.42.5 needs its own secret -- Dave: `gh secret set
# CI_CONFIG_INDY_SMB_PASSWORD --repo ScaleComputing/HyperCoreAnsibleCollection`.
smb_password: ${{ secrets.CI_CONFIG_INDY_SMB_PASSWORD }}
oidc_client_secret: ${{ secrets.OIDC_CLIENT_SECRET }}
oidc_users_0_password: ${{ secrets.OIDC_USERS_0_PASSWORD }}
working_directory: ${{ env.WORKDIR }}
- run: ansible-galaxy collection install community.general
- run: ansible-playbook tests/integration/cleanup/ci_replica_cleanup.yml
smb_cleanup:
needs: []
runs-on: [self-hosted2]
container: quay.io/justinc1_github/scale_ci_integ:11
defaults:
run:
working-directory: ${{ env.WORKDIR }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.WORKDIR }}
# ${{ env.WORKDIR }} cannot be used
- uses: ./work-dir/ansible_collections/scale_computing/hypercore/.github/actions/make-integ-config
with:
# Was https://10.5.11.200 (PUB5/XLab, dead since 2026-10-27). smb_* fields are
# top-level in integration_config.yml, not per-host, so any sc_host works here --
# .64 picked for consistency with replica_cleanup above.
sc_host: https://10.6.112.64
sc_password_50: ${{ secrets.CI_CONFIG_HC_IP50_SC_PASSWORD }}
# 10.5.11.39's secret, CI_CONFIG_HC_IP50_SMB_PASSWORD, is kept for when PUB5/XLab
# returns. 10.6.42.5 needs its own secret -- Dave: `gh secret set
# CI_CONFIG_INDY_SMB_PASSWORD --repo ScaleComputing/HyperCoreAnsibleCollection`.
smb_password: ${{ secrets.CI_CONFIG_INDY_SMB_PASSWORD }}
oidc_client_secret: ${{ secrets.OIDC_CLIENT_SECRET }}
oidc_users_0_password: ${{ secrets.OIDC_USERS_0_PASSWORD }}
working_directory: ${{ env.WORKDIR }}
- run: |
cd tests/integration/cleanup && ./smb_cleanup.sh \
"$(cat ../integration_config.yml | yq '.smb_server' | sed -e 's/^"//' -e 's/"$//')" \
"$(cat ../integration_config.yml | yq '.smb_share' | sed -e 's/^"//' -e 's/"$//')" \
"$(cat ../integration_config.yml | yq '.smb_username' | sed -e 's/^"//' -e 's/"$//')" \
"$(cat ../integration_config.yml | yq '.smb_password' | sed -e 's/^"//' -e 's/"$//')"