Skip to content

Commit febf3be

Browse files
committed
test(upgrade): qualify the latest published release with default images
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 0659fed commit febf3be

9 files changed

Lines changed: 67 additions & 170 deletions

File tree

‎.agents/skills/test-release-canary/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ every approved branch run, independently of optional E2E labels.
4141

4242
The host-package jobs exercise fresh installs, not upgrades from persisted
4343
gateway state. Release Dev and Release Tag additionally run tmachine Ubuntu DEB
44-
and Fedora RPM upgrade lanes: they install the latest retained prerelease
44+
and Fedora RPM upgrade lanes: they install the latest published release
4545
packages and matching runtime images, upgrade to the candidate packages, verify
4646
an existing sandbox survives, and create a new sandbox. Those lanes are part of
4747
the release conformance matrix, not this canary. Validate Homebrew exact-default

‎.github/workflows/prepare-integration-inputs.yml‎

Lines changed: 33 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ on:
2727
type: string
2828
default: ""
2929
include-deb-upgrade-source:
30-
description: Include the latest retained prerelease DEB and runtime images as upgrade inputs
30+
description: Include the latest published release DEB and runtime images as upgrade inputs
3131
required: false
3232
type: boolean
3333
default: false
3434
include-rpm-upgrade-source:
35-
description: Include the latest retained prerelease RPMs and runtime images as upgrade inputs
35+
description: Include the latest published release RPMs and runtime images as upgrade inputs
3636
required: false
3737
type: boolean
3838
default: false
@@ -140,113 +140,37 @@ jobs:
140140
mv "${gateway_rpms[0]}" artifacts/packages/rpm/openshell-gateway.rpm
141141
rm -rf "$download_dir"
142142
143-
- name: Resolve prerelease upgrade source
143+
- name: Resolve released upgrade source
144144
if: inputs['include-deb-upgrade-source'] || inputs['include-rpm-upgrade-source']
145145
id: upgrade-source
146146
env:
147147
GH_TOKEN: ${{ github.token }}
148-
INCLUDE_DEB: ${{ inputs['include-deb-upgrade-source'] }}
149-
INCLUDE_RPM: ${{ inputs['include-rpm-upgrade-source'] }}
150148
run: |
151149
set -euo pipefail
152-
successful_run_ids=$(gh api --paginate \
153-
"repos/${GITHUB_REPOSITORY}/actions/workflows/release-tag.yml/runs?status=success&per_page=100" \
154-
--jq '.workflow_runs[] | select(.status == "completed" and .conclusion == "success") | .id')
155-
artifact_records=$(gh api --paginate \
156-
"repos/${GITHUB_REPOSITORY}/actions/artifacts?per_page=100" \
157-
--jq '.artifacts[] | select(.expired == false) | [.workflow_run.id, .name] | @tsv')
158-
source_record=$(printf '%s\n--ARTIFACTS--\n%s\n' "$successful_run_ids" "$artifact_records" | awk -F '\t' \
159-
-v require_deb="$INCLUDE_DEB" -v require_rpm="$INCLUDE_RPM" '
160-
$0 == "--ARTIFACTS--" {
161-
reading_artifacts = 1
162-
next
163-
}
164-
!reading_artifacts {
165-
if ($1 ~ /^[0-9]+$/) successful_runs[$1] = 1
166-
next
167-
}
168-
$1 in successful_runs {
169-
run_id = $1
170-
artifact = $2
171-
tag = ""
172-
if (artifact ~ /^openshell-v[0-9]+\.[0-9]+\.[0-9]+-pre\.[1-9][0-9]*-linux-amd64-deb$/) {
173-
tag = artifact
174-
sub(/^openshell-/, "", tag)
175-
sub(/-linux-amd64-deb$/, "", tag)
176-
deb[run_id SUBSEP tag] = artifact
177-
} else if (artifact ~ /^openshell-v[0-9]+\.[0-9]+\.[0-9]+-pre\.[1-9][0-9]*-linux-x86_64-rpm$/) {
178-
tag = artifact
179-
sub(/^openshell-/, "", tag)
180-
sub(/-linux-x86_64-rpm$/, "", tag)
181-
rpm[run_id SUBSEP tag] = artifact
182-
}
183-
if (tag != "") {
184-
candidates[run_id SUBSEP tag] = tag
185-
runs[run_id SUBSEP tag] = run_id
186-
}
187-
}
188-
END {
189-
for (key in candidates) {
190-
if (require_deb == "true" && !(key in deb)) continue
191-
if (require_rpm == "true" && !(key in rpm)) continue
192-
tag = candidates[key]
193-
run_id = runs[key]
194-
deb_artifact = (key in deb) ? deb[key] : "-"
195-
rpm_artifact = (key in rpm) ? rpm[key] : "-"
196-
version = tag
197-
sub(/^v/, "", version)
198-
split(version, parts, "-pre\\.")
199-
split(parts[1], core, "\\.")
200-
sequence = parts[2] + 0
201-
if (!found || core[1] + 0 > major ||
202-
(core[1] + 0 == major && core[2] + 0 > minor) ||
203-
(core[1] + 0 == major && core[2] + 0 == minor && core[3] + 0 > patch) ||
204-
(core[1] + 0 == major && core[2] + 0 == minor && core[3] + 0 == patch && sequence > prerelease)) {
205-
selected = tag
206-
selected_run = run_id
207-
selected_deb = deb_artifact
208-
selected_rpm = rpm_artifact
209-
major = core[1] + 0
210-
minor = core[2] + 0
211-
patch = core[3] + 0
212-
prerelease = sequence
213-
found = 1
214-
}
215-
}
216-
if (found) {
217-
printf "%s\t%s\t%s\t%s\n", selected, selected_run, selected_deb, selected_rpm
218-
}
219-
}')
220-
if [[ -z "$source_record" ]]; then
221-
echo "no successful retained prerelease contains all requested package artifacts" >&2
222-
exit 1
223-
fi
224-
IFS=$'\t' read -r source_tag source_run_id deb_artifact rpm_artifact <<< "$source_record"
225-
{
226-
echo "tag=${source_tag}"
227-
echo "run-id=${source_run_id}"
228-
if [[ "$deb_artifact" != "-" ]]; then echo "deb-artifact=${deb_artifact}"; fi
229-
if [[ "$rpm_artifact" != "-" ]]; then echo "rpm-artifact=${rpm_artifact}"; fi
230-
} >> "$GITHUB_OUTPUT"
150+
source_tag=$(gh release view --repo "$GITHUB_REPOSITORY" --json tagName --jq '.tagName')
151+
echo "tag=${source_tag}" >> "$GITHUB_OUTPUT"
231152
232-
- name: Download prerelease Debian upgrade source
153+
- name: Download released Debian upgrade source
233154
if: inputs['include-deb-upgrade-source']
234-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
235-
with:
236-
name: ${{ steps.upgrade-source.outputs['deb-artifact'] }}
237-
path: artifacts/upgrade/deb/source/download
238-
github-token: ${{ github.token }}
239-
run-id: ${{ steps.upgrade-source.outputs['run-id'] }}
155+
env:
156+
GH_TOKEN: ${{ github.token }}
157+
SOURCE_TAG: ${{ steps.upgrade-source.outputs.tag }}
158+
run: |
159+
set -euo pipefail
160+
gh release download "$SOURCE_TAG" --repo "$GITHUB_REPOSITORY" \
161+
--pattern 'openshell_*_amd64.deb' \
162+
--pattern openshell-checksums-sha256.txt \
163+
--dir artifacts/upgrade/deb/source/download
240164
241-
- name: Stage prerelease Debian upgrade source
165+
- name: Stage released Debian upgrade source
242166
if: inputs['include-deb-upgrade-source']
243167
run: |
244168
set -euo pipefail
245169
source_dir=artifacts/upgrade/deb/source
246170
download_dir="${source_dir}/download"
247171
deb_path=$(find "$download_dir" -maxdepth 1 -type f -name 'openshell_*_amd64.deb' -print -quit)
248172
if [[ -z "$deb_path" || ! -f "${download_dir}/openshell-checksums-sha256.txt" ]]; then
249-
echo "prerelease source artifact did not contain the expected Debian package and checksums" >&2
173+
echo "released source artifact did not contain the expected Debian package and checksums" >&2
250174
exit 1
251175
fi
252176
(
@@ -261,7 +185,7 @@ jobs:
261185
# Packages do not embed OCI image payloads. Their gateway binaries pin
262186
# this release tag, while tmachine consumes tarballs to keep guest setup
263187
# independent of registry access.
264-
- name: Export prerelease runtime images for upgrade sources
188+
- name: Export released runtime images for upgrade sources
265189
if: inputs['include-deb-upgrade-source'] || inputs['include-rpm-upgrade-source']
266190
env:
267191
IMAGE_TAG: ${{ steps.upgrade-source.outputs.tag }}
@@ -271,23 +195,25 @@ jobs:
271195
mkdir -p artifacts/upgrade/source-images
272196
273197
docker pull "ghcr.io/nvidia/openshell/sandbox:${image_tag}"
274-
docker tag "ghcr.io/nvidia/openshell/sandbox:${image_tag}" openshell/sandbox:tmachine
275-
docker save --output artifacts/upgrade/source-images/openshell-sandbox-tmachine.tar openshell/sandbox:tmachine
198+
docker save --output artifacts/upgrade/source-images/openshell-sandbox-tmachine.tar "ghcr.io/nvidia/openshell/sandbox:${image_tag}"
276199
277200
docker pull "ghcr.io/nvidia/openshell/supervisor:${image_tag}"
278-
docker tag "ghcr.io/nvidia/openshell/supervisor:${image_tag}" openshell/supervisor:tmachine
279-
docker save --output artifacts/upgrade/source-images/openshell-supervisor-tmachine.tar openshell/supervisor:tmachine
201+
docker save --output artifacts/upgrade/source-images/openshell-supervisor-tmachine.tar "ghcr.io/nvidia/openshell/supervisor:${image_tag}"
280202
281-
- name: Download prerelease RPM upgrade source
203+
- name: Download released RPM upgrade source
282204
if: inputs['include-rpm-upgrade-source']
283-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
284-
with:
285-
name: ${{ steps.upgrade-source.outputs['rpm-artifact'] }}
286-
path: artifacts/upgrade/rpm/source/download
287-
github-token: ${{ github.token }}
288-
run-id: ${{ steps.upgrade-source.outputs['run-id'] }}
205+
env:
206+
GH_TOKEN: ${{ github.token }}
207+
SOURCE_TAG: ${{ steps.upgrade-source.outputs.tag }}
208+
run: |
209+
set -euo pipefail
210+
gh release download "$SOURCE_TAG" --repo "$GITHUB_REPOSITORY" \
211+
--pattern 'openshell-[0-9]*.x86_64.rpm' \
212+
--pattern 'openshell-gateway-[0-9]*.x86_64.rpm' \
213+
--pattern openshell-checksums-sha256.txt \
214+
--dir artifacts/upgrade/rpm/source/download
289215
290-
- name: Stage prerelease RPM upgrade source
216+
- name: Stage released RPM upgrade source
291217
if: inputs['include-rpm-upgrade-source']
292218
run: |
293219
set -euo pipefail
@@ -296,7 +222,7 @@ jobs:
296222
cli_rpm=$(find "$download_dir" -maxdepth 1 -type f -name 'openshell-[0-9]*.x86_64.rpm' -print -quit)
297223
gateway_rpm=$(find "$download_dir" -maxdepth 1 -type f -name 'openshell-gateway-[0-9]*.x86_64.rpm' -print -quit)
298224
if [[ -z "$cli_rpm" || -z "$gateway_rpm" || ! -f "${download_dir}/openshell-checksums-sha256.txt" ]]; then
299-
echo "prerelease source artifact did not contain the expected RPMs and checksums" >&2
225+
echo "released source artifact did not contain the expected RPMs and checksums" >&2
300226
exit 1
301227
fi
302228
(

‎CI.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ the tmachine upgrade execution and its runtime-image preparation.
9393
with both managed and standalone compute drivers in `Branch E2E Checks`
9494
- `test:e2e-gpu` runs GPU E2E in `Branch E2E Checks`
9595
- `test:upgrade` runs tmachine Debian and RPM upgrade qualification in
96-
`Branch E2E Checks`: the latest retained prerelease packages and matching
96+
`Branch E2E Checks`: the latest published release packages and matching
9797
runtime images are installed first, then the PR's packages are installed and
9898
both existing and new sandboxes are verified
9999
- `test:e2e-kubernetes` runs Kubernetes E2E with the HA Helm overlay

‎tests/ansible/playbooks/openshell-deb-upgrade-source.yaml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
---
5-
- name: Install prerelease OpenShell Debian upgrade source
5+
- name: Install released OpenShell Debian upgrade source
66
ansible.builtin.import_playbook: openshell-deb.yaml
77
vars:
8-
openshell_packaged_gateway_legacy_images: true
8+
openshell_packaged_gateway_released_source: true
99

1010
- name: Record OpenShell Debian upgrade source
1111
hosts: all
1212
gather_facts: false
1313
tasks:
14+
- name: Create upgrade source metadata directory
15+
become: true
16+
ansible.builtin.file:
17+
path: /var/lib/openshell-qualification
18+
state: directory
19+
owner: root
20+
group: root
21+
mode: "0755"
22+
1423
- name: Copy upgrade source version metadata
1524
become: true
1625
ansible.builtin.copy:

‎tests/ansible/playbooks/openshell-rpm-upgrade-source.yaml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
---
5-
- name: Install prerelease OpenShell RPM upgrade source
5+
- name: Install released OpenShell RPM upgrade source
66
ansible.builtin.import_playbook: openshell-rpm.yaml
77
vars:
8-
openshell_packaged_gateway_legacy_images: true
8+
openshell_packaged_gateway_released_source: true
99

1010
- name: Record OpenShell RPM upgrade source
1111
hosts: all
1212
gather_facts: false
1313
tasks:
14+
- name: Create upgrade source metadata directory
15+
become: true
16+
ansible.builtin.file:
17+
path: /var/lib/openshell-qualification
18+
state: directory
19+
owner: root
20+
group: root
21+
mode: "0755"
22+
1423
- name: Record installed source package versions
1524
become: true
1625
ansible.builtin.shell: |

‎tests/ansible/playbooks/upgrade/deb.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- name: Wait for SSH
1616
ansible.builtin.wait_for_connection:
1717

18-
- name: Exercise prerelease baseline and upgrade candidate
18+
- name: Exercise released baseline and upgrade candidate
1919
block:
2020
- name: Read expected source package version
2121
become: true
@@ -33,11 +33,11 @@
3333
register: installed_source_version
3434
changed_when: false
3535

36-
- name: Require exact prerelease source package
36+
- name: Require exact released source package
3737
ansible.builtin.assert:
3838
that: installed_source_version.stdout == upgrade_source_version
3939
fail_msg: >-
40-
Expected prerelease source {{ upgrade_source_version }}, found
40+
Expected released source {{ upgrade_source_version }}, found
4141
{{ installed_source_version.stdout }}.
4242
4343
- name: Check source gateway status
@@ -132,7 +132,7 @@
132132
ansible.builtin.assert:
133133
that: installed_target_version.stdout != upgrade_source_version
134134
fail_msg: >-
135-
Candidate package did not replace prerelease source
135+
Candidate package did not replace released source
136136
{{ upgrade_source_version }}.
137137
138138
- name: Wait for upgraded gateway status

‎tests/ansible/playbooks/upgrade/rpm.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
- name: Wait for SSH
1717
ansible.builtin.wait_for_connection:
1818

19-
- name: Exercise prerelease baseline and RPM upgrade candidate
19+
- name: Exercise released baseline and RPM upgrade candidate
2020
block:
2121
- name: Read expected source package versions
2222
become: true
@@ -40,11 +40,11 @@
4040
register: installed_source_versions
4141
changed_when: false
4242

43-
- name: Require exact prerelease source packages
43+
- name: Require exact released source packages
4444
ansible.builtin.assert:
4545
that: installed_source_versions.stdout | trim == upgrade_source_versions
4646
fail_msg: >-
47-
Expected prerelease source packages {{ upgrade_source_versions }},
47+
Expected released source packages {{ upgrade_source_versions }},
4848
found {{ installed_source_versions.stdout | trim }}.
4949
5050
- name: Check source gateway status
@@ -103,7 +103,7 @@
103103
- name: Require candidate RPM packages to replace source packages
104104
ansible.builtin.assert:
105105
that: candidate_package_versions.stdout | trim != upgrade_source_versions
106-
fail_msg: Candidate RPM versions match the retained prerelease source.
106+
fail_msg: Candidate RPM versions match the released source.
107107

108108
- name: Copy candidate runtime images
109109
become: true

‎tests/ansible/roles/openshell_packaged_gateway/tasks/legacy-images.yaml‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)