mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-20 11:21:49 +00:00
refactor: strip legacy lb-alpine AMI build path post-microvm-merge
ELBv2 LB instances now boot direct via microvm kernel+initramfs (the lb-alpine-3.21.6 system AMI is no longer used). Remove the build/import scaffolding: - delete scripts/images/lb.conf + lb-setup.sh (system-image bake config) - remove lb-alpine catalog entry from spinifex/utils/images.go - drop LB_IMG download + BM_LB_ALPINE_IMAGE env from e2e-baremetal.yml Tracks mulga-siv-81.
This commit is contained in:
@@ -91,15 +91,6 @@ jobs:
|
||||
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"
|
||||
if [ ! -f "$LB_IMG" ]; then
|
||||
echo "Downloading lb-alpine image..."
|
||||
sudo curl -fsSL -o "$LB_IMG" \
|
||||
"https://iso.mulgadc.com/system-ami/lb-alpine-3.21.6-x86_64.raw"
|
||||
echo " Downloaded $(du -h "$LB_IMG" | cut -f1)"
|
||||
else
|
||||
echo "lb-alpine image cached ($(du -h "$LB_IMG" | cut -f1))"
|
||||
fi
|
||||
|
||||
- name: Run Bare-Metal E2E
|
||||
env:
|
||||
@@ -107,7 +98,6 @@ jobs:
|
||||
BM_SSH_KEY: ${{ runner.temp }}/bm-ci
|
||||
BM_EPDU_ENV: ${{ runner.temp }}/epdu.env
|
||||
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: |
|
||||
sudo -E mulga/scripts/baremetal/run-baremetal-e2e.sh \
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/bin/sh
|
||||
# lb-setup.sh — LB-specific chroot setup
|
||||
#
|
||||
# Runs inside the Alpine image chroot after packages are installed.
|
||||
# Sets up HAProxy placeholder config and lb-agent OpenRC init script.
|
||||
# The lb-agent polls the AWS gateway for config updates and reports health
|
||||
# via SigV4-signed HTTP requests. Credentials come from cloud-init env vars.
|
||||
|
||||
set -e
|
||||
|
||||
# Create haproxy config directory and placeholder config.
|
||||
mkdir -p /etc/haproxy
|
||||
cat > /etc/haproxy/haproxy.cfg <<'EOF'
|
||||
# Placeholder config — replaced by lb-agent on first config fetch
|
||||
global
|
||||
daemon
|
||||
maxconn 256
|
||||
|
||||
defaults
|
||||
mode http
|
||||
timeout connect 5s
|
||||
timeout client 30s
|
||||
timeout server 30s
|
||||
EOF
|
||||
|
||||
# Create lb-agent OpenRC init script
|
||||
mkdir -p /etc/init.d
|
||||
cat > /etc/init.d/lb-agent <<'INITSCRIPT'
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="LB Gateway Config Agent"
|
||||
command="/usr/local/bin/lb-agent"
|
||||
command_args="--lb-id=${LB_LB_ID:-unknown} --gateway=${LB_GATEWAY_URL} --access-key=${LB_ACCESS_KEY} --secret-key=${LB_SECRET_KEY}"
|
||||
command_background=true
|
||||
pidfile="/run/lb-agent.pid"
|
||||
output_log="/var/log/lb-agent.log"
|
||||
error_log="/var/log/lb-agent.log"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
after firewall
|
||||
}
|
||||
INITSCRIPT
|
||||
chmod 755 /etc/init.d/lb-agent
|
||||
|
||||
# Move networking from boot to default runlevel so cloud-init can write
|
||||
# the network config before the networking service starts. Without this,
|
||||
# Alpine's networking service races cloud-init and starts with no config.
|
||||
rc-update del networking boot 2>/dev/null || true
|
||||
rc-update add networking default
|
||||
|
||||
# Do NOT enable lb-agent at boot — cloud-init must write
|
||||
# /etc/conf.d/lb-agent (with LB_LB_ID, LB_GATEWAY_URL, LB_ACCESS_KEY,
|
||||
# LB_SECRET_KEY) before the service starts.
|
||||
# Cloud-init runcmd starts the service after write_files.
|
||||
@@ -1,26 +0,0 @@
|
||||
# LB system image manifest
|
||||
# Used by build-system-image.sh to create an Alpine AMI with HAProxy + lb-agent
|
||||
|
||||
IMAGE_NAME="lb"
|
||||
IMAGE_DESCRIPTION="LB VM with HAProxy and lb-agent"
|
||||
ALPINE_VERSION="3.21.6"
|
||||
IMAGE_SIZE="256M"
|
||||
|
||||
# Tag applied to the imported AMI so the daemon can discover this as the
|
||||
# system image for ELBv2 load balancers. Must match tags.ManagedByELBv2.
|
||||
SYSTEM_TAG="spinifex:managed-by=elbv2"
|
||||
|
||||
# Packages to install via apk
|
||||
APK_PACKAGES="haproxy curl ca-certificates"
|
||||
|
||||
# Binaries to copy into the image (source:destination)
|
||||
INSTALL_BINARIES="bin/lb-agent:/usr/local/bin/lb-agent"
|
||||
|
||||
# Build command for binaries (run before image build)
|
||||
BUILD_COMMANDS="make build-lb-agent"
|
||||
|
||||
# OpenRC services to enable at boot
|
||||
ENABLE_SERVICES="haproxy"
|
||||
|
||||
# Custom setup script (runs inside chroot after packages are installed)
|
||||
SETUP_SCRIPT="scripts/images/lb-setup.sh"
|
||||
@@ -369,26 +369,6 @@ var AvailableImages = map[string]Images{
|
||||
},
|
||||
*/
|
||||
|
||||
// Alpine Linux (cloud init) x86_64 — LB system image with HAProxy and lb-agent
|
||||
"lb-alpine-3.21.6-x86_64": {
|
||||
Name: "lb-alpine-3.21.6-x86_64",
|
||||
Description: "LB Alpine Linux 3.21.6 x86_64 system image",
|
||||
Distro: "alpine",
|
||||
Version: "3.21.6",
|
||||
Arch: "x86_64",
|
||||
Platform: "Linux/UNIX",
|
||||
CreatedAt: time.Date(2026, 03, 27, 0, 0, 0, 0, time.UTC),
|
||||
URL: "https://iso.mulgadc.com/system-ami/lb-alpine-3.21.6-x86_64.raw",
|
||||
Checksum: "https://iso.mulgadc.com/system-ami/lb-alpine-3.21.6-x86_64.raw.sha512",
|
||||
ChecksumType: "sha512",
|
||||
BootMode: "bios",
|
||||
Starred: false,
|
||||
// Marked system-managed: the UI hides this AMI from the Images
|
||||
// page so customers don't mistake it for a bootable OS image.
|
||||
Tags: map[string]string{
|
||||
"spinifex:managed-by": "elbv2",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// AMI / image extraction utils
|
||||
|
||||
Reference in New Issue
Block a user