From 919a6b5b36a64aced17d9b7a95811e70c4e94998 Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Tue, 14 Nov 2023 14:27:33 +0100 Subject: [PATCH] Use OpenStack image for Brightbox The special Brightbox image uses the OpenStack userdata in Ignition but lacked Afterburn usage. It actually works to use the OpenStack image and directly which also enables Afterburn, thus we can drop the special image. Don't build a special image for Brightbox but recommend to use OpenStack images directly. A symlink is added to help with the download of hardcoded user scripts. --- build_library/vm_image_util.sh | 7 --- changelog/changes/2023-11-14-brightbox.md | 2 + ci-automation/vms.sh | 1 + .../oem-ec2-compat/files/base/README | 4 -- .../oem-ec2-compat/files/base/openstack.ign | 13 ----- .../oem-ec2-compat/files/grub-brightbox.cfg | 3 -- .../oem-ec2-compat/files/grub-openstack.cfg | 3 -- .../oem-ec2-compat/files/oem-release | 5 -- .../coreos-base/oem-ec2-compat/metadata.xml | 4 -- .../oem-ec2-compat-0.1.2-r4.ebuild | 54 ------------------- 10 files changed, 3 insertions(+), 93 deletions(-) create mode 100644 changelog/changes/2023-11-14-brightbox.md delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/base/README delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/base/openstack.ign delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/grub-brightbox.cfg delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/grub-openstack.cfg delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/oem-release delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/metadata.xml delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/oem-ec2-compat-0.1.2-r4.ebuild diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index 76159bf0908..3606a7211da 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -9,7 +9,6 @@ VALID_IMG_TYPES=( ami ami_vmdk azure - brightbox cloudsigma cloudstack cloudstack_vhd @@ -242,12 +241,6 @@ IMG_openstack_mini_OEM_PACKAGE=common-oem-files IMG_openstack_mini_OEM_USE=openstack IMG_openstack_mini_OEM_SYSEXT=oem-openstack -## brightbox, supports ec2's metadata format so use oem-ec2-compat -IMG_brightbox_DISK_FORMAT=qcow2 -IMG_brightbox_DISK_LAYOUT=vm -IMG_brightbox_OEM_PACKAGE=oem-ec2-compat -IMG_brightbox_OEM_USE=brightbox - ## pxe, which is an cpio image IMG_pxe_DISK_FORMAT=cpio IMG_pxe_PARTITIONED_IMG=0 diff --git a/changelog/changes/2023-11-14-brightbox.md b/changelog/changes/2023-11-14-brightbox.md new file mode 100644 index 00000000000..a5efcd87bda --- /dev/null +++ b/changelog/changes/2023-11-14-brightbox.md @@ -0,0 +1,2 @@ +- Brightbox: The regular OpenStack image should now be used, it includes Afterburn for instance metadata attributes +- OpenStack: An uncompressed image is provided for simpler import (since the images use qcow2 inline compression, there is no benefit in using the `.gz` or `.bz2` images) diff --git a/ci-automation/vms.sh b/ci-automation/vms.sh index f796df6a832..2c606b7e686 100644 --- a/ci-automation/vms.sh +++ b/ci-automation/vms.sh @@ -152,6 +152,7 @@ function _vm_build_impl() { create_digests "${SIGNER}" "images/latest/"* sign_artifacts "${SIGNER}" "images/latest/"* + ( cd images/latest ; ln -s flatcar_production_openstack_image.img.bz2 flatcar_production_brightbox_image.img.bz2 ) copy_to_buildcache "images/${arch}/${vernum}/" "images/latest/"* } # -- diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/base/README b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/base/README deleted file mode 100644 index d128309fef3..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/base/README +++ /dev/null @@ -1,4 +0,0 @@ -These Ignition configs are part of the OEM configuration. Do not modify -them. If you want to write an Ignition config directly to disk, put it in -../config.ign and it will be applied at first boot instead of a config -in userdata. diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/base/openstack.ign b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/base/openstack.ign deleted file mode 100644 index 7a069099271..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/base/openstack.ign +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ignition": { - "version": "3.3.0" - }, - "systemd": { - "units": [ - { - "enabled": true, - "name": "coreos-metadata-sshkeys@.service" - } - ] - } -} diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/grub-brightbox.cfg b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/grub-brightbox.cfg deleted file mode 100644 index 2d41cdd4ecf..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/grub-brightbox.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Flatcar GRUB settings for EC2 - -set oem_id="brightbox" diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/grub-openstack.cfg b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/grub-openstack.cfg deleted file mode 100644 index 1e71da2f218..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/grub-openstack.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Flatcar GRUB settings for EC2 - -set oem_id="openstack" diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/oem-release b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/oem-release deleted file mode 100644 index ad1968916f0..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/oem-release +++ /dev/null @@ -1,5 +0,0 @@ -ID=@@OEM_ID@@ -VERSION_ID=@@OEM_VERSION_ID@@ -NAME="@@OEM_NAME@@" -HOME_URL="@@OEM_HOME_URL@@" -BUG_REPORT_URL="https://issues.flatcar.org" diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/metadata.xml b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/metadata.xml deleted file mode 100644 index 097975e3adc..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/metadata.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/oem-ec2-compat-0.1.2-r4.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/oem-ec2-compat-0.1.2-r4.ebuild deleted file mode 100644 index a717f398b16..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/oem-ec2-compat-0.1.2-r4.ebuild +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2013 CoreOS, Inc.. All rights reserved. -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DESCRIPTION="OEM suite for EC2 compatible images" -HOMEPAGE="" -SRC_URI="" - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="amd64 arm64 x86" -IUSE="openstack brightbox" -REQUIRED_USE="^^ ( openstack brightbox )" - -# no source directory -S="${WORKDIR}" - -src_prepare() { - default - if use openstack ; then - ID="openstack" - NAME="Openstack" - HOME_URL="https://www.openstack.org/" - elif use brightbox ; then - ID="brightbox" - NAME="Brightbox" - HOME_URL="http://brightbox.com/" - else - die "Unknown OEM!" - fi - - sed -e "s\\@@OEM_ID@@\\${ID}\\g" \ - -e "s\\@@OEM_NAME@@\\${NAME}\\g" \ - -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \ - -e "s\\@@OEM_HOME_URL@@\\${HOME_URL}\\g" \ - "${FILESDIR}/oem-release" > "${T}/oem-release" || die -} - -src_install() { - insinto "/oem" - doins "${T}/oem-release" - if use openstack ; then - newins "${FILESDIR}/grub-openstack.cfg" grub.cfg - elif use brightbox ; then - newins "${FILESDIR}/grub-brightbox.cfg" grub.cfg - fi - - insinto "/oem/base" - doins "${FILESDIR}/base/README" - if use openstack; then - newins "${FILESDIR}/base/openstack.ign" base.ign - fi -}