diff --git a/.github/workflows/e2e-baremetal.yml b/.github/workflows/e2e-baremetal.yml index 7ec7c9e14..83aa004ba 100644 --- a/.github/workflows/e2e-baremetal.yml +++ b/.github/workflows/e2e-baremetal.yml @@ -81,14 +81,14 @@ jobs: - name: Cache VM images run: | - UBUNTU_IMG="${BM_ISO_CACHE}/ubuntu-24.04-cloudimg-amd64.img" + UBUNTU_IMG="${BM_ISO_CACHE}/ubuntu-26.04-cloudimg-amd64.img" if [ ! -f "$UBUNTU_IMG" ]; then - echo "Downloading Ubuntu 24.04 cloud image..." + echo "Downloading Ubuntu 26.04 cloud image..." sudo curl -fsSL -o "$UBUNTU_IMG" \ - "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img" + "https://cloud-images.ubuntu.com/resolute/current/resolute-server-cloudimg-amd64.img" echo " Downloaded $(du -h "$UBUNTU_IMG" | cut -f1)" else - echo "Ubuntu 24.04 cloud image cached ($(du -h "$UBUNTU_IMG" | cut -f1))" + echo "Ubuntu 26.04 cloud image cached ($(du -h "$UBUNTU_IMG" | cut -f1))" fi LB_IMG="${BM_ISO_CACHE}/lb-alpine-3.21.6-x86_64.raw" @@ -106,7 +106,7 @@ jobs: BM_CI_PASSWORD: ${{ secrets.BM_CI_PASSWORD }} BM_SSH_KEY: ${{ runner.temp }}/bm-ci BM_EPDU_ENV: ${{ runner.temp }}/epdu.env - BM_UBUNTU_IMAGE: ${{ env.BM_ISO_CACHE }}/ubuntu-24.04-cloudimg-amd64.img + BM_UBUNTU_IMAGE: ${{ env.BM_ISO_CACHE }}/ubuntu-26.04-cloudimg-amd64.img BM_LB_ALPINE_IMAGE: ${{ env.BM_ISO_CACHE }}/lb-alpine-3.21.6-x86_64.raw SPX_EXTERNAL_POOL: ${{ env.SPINIFEX_CI_POOL }} run: | diff --git a/docs/terraform-workbooks/bastion-private-subnet/main.tf b/docs/terraform-workbooks/bastion-private-subnet/main.tf index 7ba0fcedd..af22b83b5 100644 --- a/docs/terraform-workbooks/bastion-private-subnet/main.tf +++ b/docs/terraform-workbooks/bastion-private-subnet/main.tf @@ -96,7 +96,7 @@ data "aws_ami" "ubuntu" { filter { name = "name" - values = ["*ubuntu-24.04*"] + values = ["*ubuntu-26.04*", "*ubuntu-24.04*"] } filter { diff --git a/docs/terraform-workbooks/nginx-webserver/main.tf b/docs/terraform-workbooks/nginx-webserver/main.tf index 04c14ed1a..34d8b1f24 100644 --- a/docs/terraform-workbooks/nginx-webserver/main.tf +++ b/docs/terraform-workbooks/nginx-webserver/main.tf @@ -85,7 +85,7 @@ data "aws_ami" "ubuntu" { filter { name = "name" - values = ["*ubuntu-24.04*"] + values = ["*ubuntu-26.04*", "*ubuntu-24.04*"] } filter { diff --git a/docs/terraform-workbooks/s3-webapp/main.tf b/docs/terraform-workbooks/s3-webapp/main.tf index 0c7f40db9..abf42870b 100644 --- a/docs/terraform-workbooks/s3-webapp/main.tf +++ b/docs/terraform-workbooks/s3-webapp/main.tf @@ -132,7 +132,7 @@ data "aws_ami" "ubuntu" { filter { name = "name" - values = ["*ubuntu-24.04*"] + values = ["*ubuntu-26.04*", "*ubuntu-24.04*"] } filter { diff --git a/tests/e2e/run-e2e.sh b/tests/e2e/run-e2e.sh index 46a5e14eb..0c65000e4 100755 --- a/tests/e2e/run-e2e.sh +++ b/tests/e2e/run-e2e.sh @@ -232,20 +232,25 @@ fi # Phase 4: Image Management echo "Phase 4: Image Management" -# Detect correct image name based on architecture +# Discover whichever Ubuntu AMI bootstrap-install.sh staged. v6+ gold image +# stages 26.04 (resolute); v3 staged 24.04 (noble). Catalog name follows +# `ami-ubuntu--`. if [ "$ARCH" = "x86_64" ]; then - IMAGE_NAME="ubuntu-24.04-x86_64" + ARCH_LABEL="x86_64" else - IMAGE_NAME="ubuntu-24.04-arm64" + ARCH_LABEL="arm64" fi +echo "Looking up Ubuntu AMI for arch=${ARCH_LABEL}..." +AMI_ID=$(aws ec2 describe-images \ + --filters "Name=name,Values=ami-ubuntu-26.04-${ARCH_LABEL},ami-ubuntu-24.04-${ARCH_LABEL}" \ + --query 'Images[0].ImageId' --output text) +IMAGE_NAME=$(aws ec2 describe-images \ + --filters "Name=name,Values=ami-ubuntu-26.04-${ARCH_LABEL},ami-ubuntu-24.04-${ARCH_LABEL}" \ + --query 'Images[0].Name' --output text | sed 's/^ami-//') echo "Using image: $IMAGE_NAME" -# AMI already imported by bootstrap-install.sh — discover the existing AMI -echo "Discovering existing AMI (imported by bootstrap)..." -AMI_ID=$(aws ec2 describe-images --filters "Name=name,Values=ami-${IMAGE_NAME}" --query 'Images[0].ImageId' --output text) - if [ -z "$AMI_ID" ] || [ "$AMI_ID" = "None" ]; then - echo "Failed to capture AMI ID" + echo "Failed to capture AMI ID — bootstrap-install.sh did not stage ubuntu-{24,26}.04-${ARCH_LABEL}" exit 1 fi echo "Captured AMI ID: $AMI_ID" diff --git a/tests/e2e/run-pseudo-multinode-e2e.sh b/tests/e2e/run-pseudo-multinode-e2e.sh index a09370b36..5ba4e3e15 100755 --- a/tests/e2e/run-pseudo-multinode-e2e.sh +++ b/tests/e2e/run-pseudo-multinode-e2e.sh @@ -274,14 +274,27 @@ $AWS_EC2 authorize-security-group-ingress \ --group-id "$MULTINODE_SG" --protocol icmp --port -1 --cidr 0.0.0.0/0 > /dev/null echo " SG created: $MULTINODE_SG (tcp/22 + icmp from 0.0.0.0/0)" -# Import Ubuntu image (use node1's config and spinifex-dir) +# Import Ubuntu image (use node1's config and spinifex-dir). v6+ gold image +# stages ubuntu-26.04 (resolute); v3 staged ubuntu-24.04 (noble). Detect +# which is present so we can keep running both during the v3→v6 transition. echo "" echo "Importing Ubuntu image..." +if [ -f "$HOME/images/ubuntu-26.04.img" ]; then + UBUNTU_IMG="$HOME/images/ubuntu-26.04.img" + UBUNTU_VER="26.04" +elif [ -f "$HOME/images/ubuntu-24.04.img" ]; then + UBUNTU_IMG="$HOME/images/ubuntu-24.04.img" + UBUNTU_VER="24.04" +else + echo "ERROR: no ubuntu cloud image at ~/images/ubuntu-{24,26}.04.img" >&2 + exit 1 +fi +echo " Using: $UBUNTU_IMG (version $UBUNTU_VER)" IMPORT_LOG=$(./bin/spx admin images import \ - --file ~/images/ubuntu-24.04.img \ + --file "$UBUNTU_IMG" \ --arch "$ARCH" \ --distro ubuntu \ - --version 24.04 \ + --version "$UBUNTU_VER" \ --config "$HOME/node1/config/spinifex.toml" \ --spinifex-dir "$HOME/node1/" \ --force 2>/dev/null) diff --git a/tests/e2e/single/image_test.go b/tests/e2e/single/image_test.go index e2a629802..e86466d3a 100644 --- a/tests/e2e/single/image_test.go +++ b/tests/e2e/single/image_test.go @@ -26,19 +26,36 @@ func phase4_Image(t *testing.T, fix *Fixture) { harness.Phase(t, "Phase 4 — Image Management") require.NotEmpty(t, fix.Arch, "Phase 2 must populate fix.Arch before Phase 4") - // Bash hard-coded the mapping to ubuntu-24.04-{x86_64,arm64}; keep - // parity. fix.Arch comes from DescribeInstanceTypes so it'll be the - // canonical AWS arch label. - imgName := "ubuntu-24.04-" + fix.Arch - harness.Detail(t, "image", imgName, "arch", fix.Arch) - - harness.Step(t, "spx admin images import --name %s", imgName) - // wantErr=true: bootstrap-install.sh has already imported this AMI in - // most environments, so the import returns non-zero on duplicate. We - // don't care about the exit code — we care about either parsing an - // AMI ID out of the output or successfully filtering DescribeImages - // by the canonical ami- tag afterwards. - out := harness.SpxRun(t, true, "admin", "images", "import", "--name", imgName) + // Try the current catalog entry (26.04 / resolute) first, fall back to + // 24.04 (noble) for clusters still on the v3 gold image. Drop the + // fallback once 24.04 is gone from spinifex/utils/images.go. + candidates := []string{ + "ubuntu-26.04-" + fix.Arch, + "ubuntu-24.04-" + fix.Arch, + } + var imgName, out string + for _, name := range candidates { + harness.Detail(t, "image_candidate", name, "arch", fix.Arch) + harness.Step(t, "spx admin images import --name %s", name) + // wantErr=true: bootstrap-install.sh has already imported the + // AMI in most environments, so the import returns non-zero on + // duplicate. We don't care about the exit code — we care about + // either parsing an AMI ID or successfully filtering + // DescribeImages by the canonical ami- tag afterwards. + out = harness.SpxRun(t, true, "admin", "images", "import", "--name", name) + imgName = name + // If DescribeImages can find this name, stop trying further + // candidates — bootstrap staged this version. + probe, err := fix.AWS.EC2.DescribeImages(&ec2.DescribeImagesInput{ + Filters: []*ec2.Filter{ + {Name: aws.String("name"), Values: []*string{aws.String("ami-" + name)}}, + }, + }) + if err == nil && len(probe.Images) > 0 { + break + } + } + harness.Detail(t, "image", imgName) // Try to parse the AMI ID directly out of the CLI's success line. amiID := amiIDRE.FindString(out)