Skip to content

Commit 03683d2

Browse files
trifo13claude
andcommitted
PRODENG-3446: add airgapped multi-hop upgrade smoke test (customer scenario)
Adds TestAirgappedMultiHopUpgrade, a smoke test that exercises the full upgrade chain reported by the Vocalink customer: install with MCR 25.0 / MKE 3.8.8 / MSR 2.9.27, then upgrade through 3.8.11 → 3.8.12 (MCR 29.2) → 3.9.2 → latest MKE 3.x / MCR 29.x. All post-install upgrade steps pull images from an internal DTR exposed on a non-standard port (4443) via an NLB, simulating an airgapped registry configuration. Key design decisions -------------------- - Image preload strategy: rather than pushing images to DTR (which requires namespace provisioning and hits DTR auth edge cases), all upgrade images are pulled from docker.io/mirantis on every node and tagged with the DTR registry address. Launchpad's "Pull MKE images" phase runs docker image inspect before docker pull; finding the image locally it skips the pull entirely. This exercises Launchpad's imageRepo feature without requiring actual DTR push/pull. - SSH key compatibility: Terraform's tls_private_key emits OpenSSH-format ed25519 keys that golang.org/x/crypto/ssh.ParsePrivateKey rejects. All remote commands use the system ssh binary (sshRun/sshRunScript) to avoid Go-side key parsing. - DTR image listing: UCP bootstrapper uses "images --list"; DTR 2.x uses "images" (the --list flag is unrecognised and causes help text on stdout with exit 0). The preload script filters output for valid image-reference patterns and falls back to the plain "images" subcommand automatically. - Dynamic latest-version step: fetchLatestMKEVersion queries Docker Hub tags for mirantis/ucp; fetchLatestMCRChannel probes the Mirantis apt repository (channels are non-sequential so the probe scans the full range rather than stopping at the first 404). The dynamic step is appended only when it differs from the last fixed step. Supporting changes ------------------ - examples/terraform/aws-simple: add msr_port variable (default 443) so the NLB can expose DTR on a non-standard port; all other smoke tests are unaffected. --dtr-external-url appends :PORT only when port != 443. - test/platforms.go: fix RHEL8 MCR install — disable the container-tools module stream before installing MCR to prevent the system runc from conflicting with Mirantis's containerd.io-runc. - Makefile: add smoke-airgapped-multi-hop target (-timeout 200m). - .github/workflows/smoke-tests.yaml: add smoke-airgapped-multi-hop CI job triggered by the smoke-test or smoke-airgapped-multi-hop PR labels. Tested: two passing runs (2537s with 3 fixed steps; 3329s with 4 steps including the dynamic latest-version step MKE 3.9.3 / MCR stable-29.4). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8484015 commit 03683d2

7 files changed

Lines changed: 674 additions & 5 deletions

File tree

.github/workflows/smoke-tests.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,21 @@ jobs:
8585
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
8686
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
8787
run: make smoke-upgrade
88+
89+
smoke-airgapped-multi-hop:
90+
runs-on: ubuntu-latest
91+
timeout-minutes: 205
92+
if: |
93+
github.event_name == 'push' ||
94+
contains(github.event.pull_request.labels.*.name, 'smoke-test') ||
95+
contains(github.event.pull_request.labels.*.name, 'smoke-airgapped-multi-hop')
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@v4
99+
- name: Setup Terraform
100+
uses: hashicorp/setup-terraform@v3
101+
- name: Run airgapped multi-hop upgrade smoke test
102+
env:
103+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
104+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
105+
run: make smoke-airgapped-multi-hop

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ smoke-windows:
6666
.PHONY: smoke-upgrade
6767
smoke-upgrade:
6868
go test -count=1 -v ./test/smoke/... -run TestUpgrade -timeout 90m
69+
70+
.PHONY: smoke-airgapped-multi-hop
71+
smoke-airgapped-multi-hop:
72+
go test -count=1 -v ./test/smoke/... -run TestAirgappedMultiHopUpgrade -timeout 200m
73+
6974
.PHONY: clean-launchpad-chart
7075
clean-launchpad-chart:
7176
terraform -chdir=./examples/tf-aws/launchpad apply --auto-approve --destroy

examples/terraform/aws-simple/.terraform.lock.hcl

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/terraform/aws-simple/launchpad.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ locals {
5353

5454
routes = {
5555
"msr" = {
56-
port_incoming = 443
57-
port_target = 443
56+
port_incoming = var.msr_port
57+
port_target = 443 # DTR always listens on 443 internally; msr_port is the external NLB port
5858
protocol = "TCP"
5959
}
6060
}
@@ -188,7 +188,7 @@ spec:
188188
"replicaIDs": "sequential"
189189
installFlags:
190190
- "--ucp-insecure-tls"
191-
- "--dtr-external-url=${local.MSR_URL}"
191+
- "--dtr-external-url=${local.MSR_URL}${var.msr_port != 443 ? ":${var.msr_port}" : ""}"
192192
%{endif}
193193
EOT
194194

examples/terraform/aws-simple/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,9 @@ variable "ssh_pk_location" {
7373
type = string
7474
default = ""
7575
}
76+
77+
variable "msr_port" {
78+
description = "External port on which DTR/MSR is exposed via the NLB. The DTR replica always listens on 443 internally; this controls only the NLB's port_incoming and the --dtr-external-url flag. Use a non-standard port (e.g. 4443) to test airgap registry configurations."
79+
type = number
80+
default = 443
81+
}

test/platforms.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ var Platforms = map[string]Platform{
7373
Count: 1,
7474
VolumeSize: "100",
7575
Public: true,
76-
UserData: "sudo firewall-cmd --permanent --add-port=2377/tcp --add-port=7946/tcp --add-port=7946/udp --add-port=4789/udp --add-port=10250/tcp; sudo firewall-cmd --reload",
76+
// Disable the container-tools module stream before MCR install. RHEL8
77+
// AppStream pulls in system runc as a container-selinux dependency; that
78+
// package conflicts with Mirantis's containerd.io-runc at install time.
79+
UserData: "sudo dnf module disable container-tools -y; sudo firewall-cmd --permanent --add-port=2377/tcp --add-port=7946/tcp --add-port=7946/udp --add-port=4789/udp --add-port=10250/tcp; sudo firewall-cmd --reload",
7780
},
7881
"Centos7": {
7982
Name: "centos_7",

0 commit comments

Comments
 (0)