From 80e68dd9d750f0692becaf0a136e97ed382f4717 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Fri, 14 Feb 2025 08:56:48 -0500 Subject: [PATCH 01/15] cmd-compress: set default gzip compression level to 9 It was originally set to 6 because that was the tool default (5cbba452) but we have used level 9 in other places [1]. [1] https://github.com/coreos/coreos-assembler/blob/e1943d6adb8f0cb257630a76d02d0aa333261c70/src/cosalib/qemuvariants.py#L327 --- src/cmd-compress | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd-compress b/src/cmd-compress index ea11867ff9..4251aa43a0 100755 --- a/src/cmd-compress +++ b/src/cmd-compress @@ -274,7 +274,7 @@ if args.mode == "compress": # Find what compressor we should use, either picking it up from # CLI args or from image.json image_json = get_image_json() - gzip_level = 6 + gzip_level = 9 if args.fast: args.compressor = 'gzip' gzip_level = 1 From e526a1bb96f6be7ffc4ef87764b53229e7700995 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Fri, 14 Feb 2025 08:50:56 -0500 Subject: [PATCH 02/15] osbuild: add patch for more options to qemu vmdk stage This will give us all the options we need to create a few of our images that are VMDKs. https://github.com/osbuild/osbuild/pull/2017 --- build.sh | 1 + ...-more-options-to-qemu-vmdk-disk-type.patch | 74 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 src/0001-stages-add-more-options-to-qemu-vmdk-disk-type.patch diff --git a/build.sh b/build.sh index f6a29c29de..925e7407d2 100755 --- a/build.sh +++ b/build.sh @@ -171,6 +171,7 @@ patch_osbuild() { # Now all the software is under the /usr/lib/osbuild dir and we can patch cat /usr/lib/coreos-assembler/0001-stages-coreos.live-artifacts-add-erofs-support.patch \ /usr/lib/coreos-assembler/0002-stages-coreos.live-artifacts-update-comments-names-t.patch \ + /usr/lib/coreos-assembler/0001-stages-add-more-options-to-qemu-vmdk-disk-type.patch \ | patch -d /usr/lib/osbuild -p1 # And then move the files back; supermin appliance creation will need it back diff --git a/src/0001-stages-add-more-options-to-qemu-vmdk-disk-type.patch b/src/0001-stages-add-more-options-to-qemu-vmdk-disk-type.patch new file mode 100644 index 0000000000..c0134c29fa --- /dev/null +++ b/src/0001-stages-add-more-options-to-qemu-vmdk-disk-type.patch @@ -0,0 +1,74 @@ +From 60f54f468bbdb6f245bf16bd5faf95b21e5b25d9 Mon Sep 17 00:00:00 2001 +From: Dusty Mabe +Date: Fri, 14 Feb 2025 08:36:25 -0500 +Subject: [PATCH] stages: add more options to qemu vmdk disk type + +The CoreOS team uses the compat6 and adapter_type options when creating +a VMDK for AWS. + +https://github.com/coreos/coreos-assembler/blob/e1943d6adb8f0cb257630a76d02d0aa333261c70/src/cosalib/qemuvariants.py#L48 +--- + stages/org.osbuild.qemu | 14 ++++++++++++-- + stages/org.osbuild.qemu.meta.json | 15 +++++++++++++++ + 2 files changed, 27 insertions(+), 2 deletions(-) + +diff --git a/stages/org.osbuild.qemu b/stages/org.osbuild.qemu +index a6df9166..caad5e88 100755 +--- a/stages/org.osbuild.qemu ++++ b/stages/org.osbuild.qemu +@@ -21,14 +21,24 @@ def qcow2_arguments(options): + + def vmdk_arguments(options): + argv = [] ++ adapter_type = options.get("adapter_type") ++ compat6 = options.get("compat6", False) + compression = options.get("compression", True) + subformat = options.get("subformat") + + if compression: + argv += ["-c"] + +- if subformat: +- argv += ["-o", f"subformat={subformat}"] ++ if compat6 or subformat or adapter_type: ++ opts = [] ++ if adapter_type: ++ opts += [f"adapter_type={adapter_type}"] ++ if compat6: ++ opts += ["compat6"] ++ if subformat: ++ opts += [f"subformat={subformat}"] ++ argv += ["-o", ",".join(opts)] ++ + return argv + + +diff --git a/stages/org.osbuild.qemu.meta.json b/stages/org.osbuild.qemu.meta.json +index 5542d27f..5fb38e04 100644 +--- a/stages/org.osbuild.qemu.meta.json ++++ b/stages/org.osbuild.qemu.meta.json +@@ -68,6 +68,21 @@ + "vmdk" + ] + }, ++ "adapter_type": { ++ "description": "Virtual adapter type", ++ "type": "string", ++ "enum": [ ++ "ide", ++ "lsilogic", ++ "buslogic", ++ "legacyESX" ++ ] ++ }, ++ "compat6": { ++ "description": "VMDK version 6 image", ++ "type": "boolean", ++ "default": false ++ }, + "compression": { + "description": "Enable/disable compression of the vmdk image", + "type": "boolean", +-- +2.48.1 + From c92e6e1791460c5b921f4351e9c02e95015c07d8 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 13 Feb 2025 15:13:57 -0500 Subject: [PATCH 03/15] osbuild: support building aliyun disks --- src/cmd-osbuild | 1 + .../coreos.osbuild.x86_64.mpp.yaml | 2 + .../platform.aliyun.ipp.yaml | 71 +++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 src/osbuild-manifests/platform.aliyun.ipp.yaml diff --git a/src/cmd-osbuild b/src/cmd-osbuild index dc0c1302d1..0212932996 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -8,6 +8,7 @@ dn=$(dirname "$0") # A list of supported platforms and the filename suffix of the main # artifact that platform produces. declare -A SUPPORTED_PLATFORMS=( + ['aliyun']='qcow2' ['applehv']='raw' ['gcp']='tar.gz' ['hetzner']='raw' diff --git a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml index 08d5119de0..65433b263c 100644 --- a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml @@ -774,6 +774,8 @@ pipelines: source: mount deployment: default: true + - mpp-import-pipelines: + path: platform.aliyun.ipp.yaml - mpp-import-pipelines: path: platform.applehv.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/platform.aliyun.ipp.yaml b/src/osbuild-manifests/platform.aliyun.ipp.yaml new file mode 100644 index 0000000000..ca75b22a24 --- /dev/null +++ b/src/osbuild-manifests/platform.aliyun.ipp.yaml @@ -0,0 +1,71 @@ +# This file defines the artifact to be used for the aliyun platform. +version: '2' +pipelines: + - name: raw-aliyun-image + build: + mpp-format-string: '{buildroot}' + stages: + - type: org.osbuild.copy + inputs: + tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:raw-image + options: + paths: + - from: input://tree/disk.img + to: tree:///disk.img + # Increase the size to the cloud image size + - type: org.osbuild.truncate + options: + filename: disk.img + size: + mpp-format-string: "{cloud_image_size_mb * 1024 * 1024}" + - type: org.osbuild.coreos.platform + options: + platform: aliyun + devices: + disk: + type: org.osbuild.loopback + options: + filename: disk.img + partscan: true + mounts: + - name: root + type: org.osbuild.xfs + source: disk + partition: + mpp-format-int: '{image.layout[''root''].partnum}' + target: / + - name: ostree.deployment + type: org.osbuild.ostree.deployment + options: + source: mount + deployment: + default: true + - name: boot + type: org.osbuild.ext4 + source: disk + partition: + mpp-format-int: '{image.layout[''boot''].partnum}' + target: /boot + - name: aliyun + build: + mpp-format-string: '{host_as_buildroot}' + stages: + - type: org.osbuild.qemu + inputs: + image: + type: org.osbuild.files + origin: org.osbuild.pipeline + references: + name:raw-aliyun-image: + file: disk.img + options: + filename: + mpp-format-string: '{artifact_name_prefix}-aliyun.{arch}.qcow2' + format: + type: qcow2 + compression: false + compat: '1.1' From 593879235de6a5c457992a3de4e9c5e19dc5188a Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 13 Feb 2025 15:14:38 -0500 Subject: [PATCH 04/15] osbuild: support building exoscale disks --- src/cmd-osbuild | 1 + .../coreos.osbuild.x86_64.mpp.yaml | 2 + .../platform.exoscale.ipp.yaml | 71 +++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 src/osbuild-manifests/platform.exoscale.ipp.yaml diff --git a/src/cmd-osbuild b/src/cmd-osbuild index 0212932996..668bae2877 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -10,6 +10,7 @@ dn=$(dirname "$0") declare -A SUPPORTED_PLATFORMS=( ['aliyun']='qcow2' ['applehv']='raw' + ['exoscale']='qcow2' ['gcp']='tar.gz' ['hetzner']='raw' ['hyperv']='vhdx' diff --git a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml index 65433b263c..9a0972b5d8 100644 --- a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml @@ -778,6 +778,8 @@ pipelines: path: platform.aliyun.ipp.yaml - mpp-import-pipelines: path: platform.applehv.ipp.yaml + - mpp-import-pipelines: + path: platform.exoscale.ipp.yaml - mpp-import-pipelines: path: platform.gcp.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/platform.exoscale.ipp.yaml b/src/osbuild-manifests/platform.exoscale.ipp.yaml new file mode 100644 index 0000000000..43a6aead27 --- /dev/null +++ b/src/osbuild-manifests/platform.exoscale.ipp.yaml @@ -0,0 +1,71 @@ +# This file defines the artifact to be used for the exoscale platform. +version: '2' +pipelines: + - name: raw-exoscale-image + build: + mpp-format-string: '{buildroot}' + stages: + - type: org.osbuild.copy + inputs: + tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:raw-image + options: + paths: + - from: input://tree/disk.img + to: tree:///disk.img + # Increase the size to the cloud image size + - type: org.osbuild.truncate + options: + filename: disk.img + size: + mpp-format-string: "{cloud_image_size_mb * 1024 * 1024}" + - type: org.osbuild.coreos.platform + options: + platform: exoscale + devices: + disk: + type: org.osbuild.loopback + options: + filename: disk.img + partscan: true + mounts: + - name: root + type: org.osbuild.xfs + source: disk + partition: + mpp-format-int: '{image.layout[''root''].partnum}' + target: / + - name: ostree.deployment + type: org.osbuild.ostree.deployment + options: + source: mount + deployment: + default: true + - name: boot + type: org.osbuild.ext4 + source: disk + partition: + mpp-format-int: '{image.layout[''boot''].partnum}' + target: /boot + - name: exoscale + build: + mpp-format-string: '{host_as_buildroot}' + stages: + - type: org.osbuild.qemu + inputs: + image: + type: org.osbuild.files + origin: org.osbuild.pipeline + references: + name:raw-exoscale-image: + file: disk.img + options: + filename: + mpp-format-string: '{artifact_name_prefix}-exoscale.{arch}.qcow2' + format: + type: qcow2 + compression: false + compat: '1.1' From eb4d341dac1c499edbadf617c7c0d2ab2fafcd77 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 13 Feb 2025 15:20:09 -0500 Subject: [PATCH 05/15] osbuild: support building openstack disks --- src/cmd-osbuild | 1 + .../coreos.osbuild.aarch64.mpp.yaml | 2 + .../coreos.osbuild.ppc64le.mpp.yaml | 2 + .../coreos.osbuild.s390x.mpp.yaml | 2 + .../coreos.osbuild.x86_64.mpp.yaml | 2 + .../platform.openstack.ipp.yaml | 71 +++++++++++++++++++ 6 files changed, 80 insertions(+) create mode 100644 src/osbuild-manifests/platform.openstack.ipp.yaml diff --git a/src/cmd-osbuild b/src/cmd-osbuild index 668bae2877..7e80e1e245 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -16,6 +16,7 @@ declare -A SUPPORTED_PLATFORMS=( ['hyperv']='vhdx' ['metal4k']='raw' ['metal']='raw' + ['openstack']='qcow2' ['qemu']='qcow2' ['qemu-secex']='qcow2' ['live']='iso' diff --git a/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml index 6acb1539c1..a25df15536 100644 --- a/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml @@ -780,6 +780,8 @@ pipelines: path: platform.hyperv.ipp.yaml - mpp-import-pipelines: path: platform.metal.ipp.yaml + - mpp-import-pipelines: + path: platform.openstack.ipp.yaml - mpp-import-pipelines: path: platform.qemu.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/coreos.osbuild.ppc64le.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.ppc64le.mpp.yaml index 54a4659c63..74783a2824 100644 --- a/src/osbuild-manifests/coreos.osbuild.ppc64le.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.ppc64le.mpp.yaml @@ -720,6 +720,8 @@ pipelines: default: true - mpp-import-pipelines: path: platform.metal.ipp.yaml + - mpp-import-pipelines: + path: platform.openstack.ipp.yaml - mpp-import-pipelines: path: platform.qemu.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml index 6a0eb25384..f7a2049875 100644 --- a/src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml @@ -662,6 +662,8 @@ pipelines: default: true - mpp-import-pipelines: path: platform.metal.ipp.yaml + - mpp-import-pipelines: + path: platform.openstack.ipp.yaml - mpp-import-pipelines: path: platform.qemu.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml index 9a0972b5d8..e7ffb734ea 100644 --- a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml @@ -786,6 +786,8 @@ pipelines: path: platform.hetzner.ipp.yaml - mpp-import-pipelines: path: platform.hyperv.ipp.yaml + - mpp-import-pipelines: + path: platform.openstack.ipp.yaml - mpp-import-pipelines: path: platform.metal.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/platform.openstack.ipp.yaml b/src/osbuild-manifests/platform.openstack.ipp.yaml new file mode 100644 index 0000000000..ac689e97a0 --- /dev/null +++ b/src/osbuild-manifests/platform.openstack.ipp.yaml @@ -0,0 +1,71 @@ +# This file defines the artifact to be used for the openstack platform. +version: '2' +pipelines: + - name: raw-openstack-image + build: + mpp-format-string: '{buildroot}' + stages: + - type: org.osbuild.copy + inputs: + tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:raw-image + options: + paths: + - from: input://tree/disk.img + to: tree:///disk.img + # Increase the size to the cloud image size + - type: org.osbuild.truncate + options: + filename: disk.img + size: + mpp-format-string: "{cloud_image_size_mb * 1024 * 1024}" + - type: org.osbuild.coreos.platform + options: + platform: openstack + devices: + disk: + type: org.osbuild.loopback + options: + filename: disk.img + partscan: true + mounts: + - name: root + type: org.osbuild.xfs + source: disk + partition: + mpp-format-int: '{image.layout[''root''].partnum}' + target: / + - name: ostree.deployment + type: org.osbuild.ostree.deployment + options: + source: mount + deployment: + default: true + - name: boot + type: org.osbuild.ext4 + source: disk + partition: + mpp-format-int: '{image.layout[''boot''].partnum}' + target: /boot + - name: openstack + build: + mpp-format-string: '{host_as_buildroot}' + stages: + - type: org.osbuild.qemu + inputs: + image: + type: org.osbuild.files + origin: org.osbuild.pipeline + references: + name:raw-openstack-image: + file: disk.img + options: + filename: + mpp-format-string: '{artifact_name_prefix}-openstack.{arch}.qcow2' + format: + type: qcow2 + compression: false + compat: '1.1' From 098a2d41d1b85a840b8d317c6b5a770812a04ff9 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 13 Feb 2025 15:24:26 -0500 Subject: [PATCH 06/15] osbuild: support building vultr disks --- src/cmd-osbuild | 1 + .../coreos.osbuild.x86_64.mpp.yaml | 2 + src/osbuild-manifests/platform.vultr.ipp.yaml | 68 +++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 src/osbuild-manifests/platform.vultr.ipp.yaml diff --git a/src/cmd-osbuild b/src/cmd-osbuild index 7e80e1e245..d2a5ce2cc7 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -19,6 +19,7 @@ declare -A SUPPORTED_PLATFORMS=( ['openstack']='qcow2' ['qemu']='qcow2' ['qemu-secex']='qcow2' + ['vultr']='raw' ['live']='iso' ) diff --git a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml index e7ffb734ea..6863416437 100644 --- a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml @@ -792,5 +792,7 @@ pipelines: path: platform.metal.ipp.yaml - mpp-import-pipelines: path: platform.qemu.ipp.yaml + - mpp-import-pipelines: + path: platform.vultr.ipp.yaml - mpp-import-pipelines: path: platform.live.ipp.yaml diff --git a/src/osbuild-manifests/platform.vultr.ipp.yaml b/src/osbuild-manifests/platform.vultr.ipp.yaml new file mode 100644 index 0000000000..5769bdd262 --- /dev/null +++ b/src/osbuild-manifests/platform.vultr.ipp.yaml @@ -0,0 +1,68 @@ +# This file defines the artifact to be used for the vultr platform. +version: '2' +pipelines: + - name: raw-vultr-image + build: + mpp-format-string: '{buildroot}' + stages: + - type: org.osbuild.copy + inputs: + tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:raw-image + options: + paths: + - from: input://tree/disk.img + to: tree:///disk.img + # Increase the size to the cloud image size + - type: org.osbuild.truncate + options: + filename: disk.img + size: + mpp-format-string: "{cloud_image_size_mb * 1024 * 1024}" + - type: org.osbuild.coreos.platform + options: + platform: vultr + devices: + disk: + type: org.osbuild.loopback + options: + filename: disk.img + partscan: true + mounts: + - name: root + type: org.osbuild.xfs + source: disk + partition: + mpp-format-int: '{image.layout[''root''].partnum}' + target: / + - name: ostree.deployment + type: org.osbuild.ostree.deployment + options: + source: mount + deployment: + default: true + - name: boot + type: org.osbuild.ext4 + source: disk + partition: + mpp-format-int: '{image.layout[''boot''].partnum}' + target: /boot + - name: vultr + build: + mpp-format-string: '{buildroot}' + stages: + - type: org.osbuild.copy + inputs: + tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:raw-vultr-image + options: + paths: + - from: input://tree/disk.img + to: + mpp-format-string: 'tree:///{artifact_name_prefix}-vultr.{arch}.raw' From d9732dbbaf953e5b1b0cdeca69eb8fe3c1356e79 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 13 Feb 2025 15:49:27 -0500 Subject: [PATCH 07/15] osbuild: support building aws disks --- src/cmd-osbuild | 1 + .../coreos.osbuild.aarch64.mpp.yaml | 2 + .../coreos.osbuild.x86_64.mpp.yaml | 2 + src/osbuild-manifests/platform.aws.ipp.yaml | 72 +++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 src/osbuild-manifests/platform.aws.ipp.yaml diff --git a/src/cmd-osbuild b/src/cmd-osbuild index d2a5ce2cc7..07a1222f56 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -10,6 +10,7 @@ dn=$(dirname "$0") declare -A SUPPORTED_PLATFORMS=( ['aliyun']='qcow2' ['applehv']='raw' + ['aws']='vmdk' ['exoscale']='qcow2' ['gcp']='tar.gz' ['hetzner']='raw' diff --git a/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml index a25df15536..6fa768d017 100644 --- a/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml @@ -772,6 +772,8 @@ pipelines: default: true - mpp-import-pipelines: path: platform.applehv.ipp.yaml + - mpp-import-pipelines: + path: platform.aws.ipp.yaml - mpp-import-pipelines: path: platform.gcp.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml index 6863416437..2a0e47ba8d 100644 --- a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml @@ -778,6 +778,8 @@ pipelines: path: platform.aliyun.ipp.yaml - mpp-import-pipelines: path: platform.applehv.ipp.yaml + - mpp-import-pipelines: + path: platform.aws.ipp.yaml - mpp-import-pipelines: path: platform.exoscale.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/platform.aws.ipp.yaml b/src/osbuild-manifests/platform.aws.ipp.yaml new file mode 100644 index 0000000000..242173c9e5 --- /dev/null +++ b/src/osbuild-manifests/platform.aws.ipp.yaml @@ -0,0 +1,72 @@ +# This file defines the artifact to be used for the aws platform. +version: '2' +pipelines: + - name: raw-aws-image + build: + mpp-format-string: '{buildroot}' + stages: + - type: org.osbuild.copy + inputs: + tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:raw-image + options: + paths: + - from: input://tree/disk.img + to: tree:///disk.img + # Increase the size to the cloud image size + - type: org.osbuild.truncate + options: + filename: disk.img + size: + mpp-format-string: "{cloud_image_size_mb * 1024 * 1024}" + - type: org.osbuild.coreos.platform + options: + platform: aws + devices: + disk: + type: org.osbuild.loopback + options: + filename: disk.img + partscan: true + mounts: + - name: root + type: org.osbuild.xfs + source: disk + partition: + mpp-format-int: '{image.layout[''root''].partnum}' + target: / + - name: ostree.deployment + type: org.osbuild.ostree.deployment + options: + source: mount + deployment: + default: true + - name: boot + type: org.osbuild.ext4 + source: disk + partition: + mpp-format-int: '{image.layout[''boot''].partnum}' + target: /boot + - name: aws + build: + mpp-format-string: '{host_as_buildroot}' + stages: + - type: org.osbuild.qemu + inputs: + image: + type: org.osbuild.files + origin: org.osbuild.pipeline + references: + name:raw-aws-image: + file: disk.img + options: + filename: + mpp-format-string: '{artifact_name_prefix}-aws.{arch}.vmdk' + format: + type: vmdk + compat6: true + adapter_type: lsilogic + subformat: streamOptimized From 9cb2a8acc972330d2ee40cc072def683641e04a4 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 13 Feb 2025 16:04:58 -0500 Subject: [PATCH 08/15] osbuild: support building digitalocean disks --- src/cmd-osbuild | 1 + .../coreos.osbuild.x86_64.mpp.yaml | 2 + .../platform.digitalocean.ipp.yaml | 71 +++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 src/osbuild-manifests/platform.digitalocean.ipp.yaml diff --git a/src/cmd-osbuild b/src/cmd-osbuild index 07a1222f56..25fa5acfd4 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -11,6 +11,7 @@ declare -A SUPPORTED_PLATFORMS=( ['aliyun']='qcow2' ['applehv']='raw' ['aws']='vmdk' + ['digitalocean']='qcow2' ['exoscale']='qcow2' ['gcp']='tar.gz' ['hetzner']='raw' diff --git a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml index 2a0e47ba8d..7df7b42888 100644 --- a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml @@ -780,6 +780,8 @@ pipelines: path: platform.applehv.ipp.yaml - mpp-import-pipelines: path: platform.aws.ipp.yaml + - mpp-import-pipelines: + path: platform.digitalocean.ipp.yaml - mpp-import-pipelines: path: platform.exoscale.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/platform.digitalocean.ipp.yaml b/src/osbuild-manifests/platform.digitalocean.ipp.yaml new file mode 100644 index 0000000000..aaf6f99a52 --- /dev/null +++ b/src/osbuild-manifests/platform.digitalocean.ipp.yaml @@ -0,0 +1,71 @@ +# This file defines the artifact to be used for the digitalocean platform. +version: '2' +pipelines: + - name: raw-digitalocean-image + build: + mpp-format-string: '{buildroot}' + stages: + - type: org.osbuild.copy + inputs: + tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:raw-image + options: + paths: + - from: input://tree/disk.img + to: tree:///disk.img + # Increase the size to the cloud image size + - type: org.osbuild.truncate + options: + filename: disk.img + size: + mpp-format-string: "{cloud_image_size_mb * 1024 * 1024}" + - type: org.osbuild.coreos.platform + options: + platform: digitalocean + devices: + disk: + type: org.osbuild.loopback + options: + filename: disk.img + partscan: true + mounts: + - name: root + type: org.osbuild.xfs + source: disk + partition: + mpp-format-int: '{image.layout[''root''].partnum}' + target: / + - name: ostree.deployment + type: org.osbuild.ostree.deployment + options: + source: mount + deployment: + default: true + - name: boot + type: org.osbuild.ext4 + source: disk + partition: + mpp-format-int: '{image.layout[''boot''].partnum}' + target: /boot + - name: digitalocean + build: + mpp-format-string: '{host_as_buildroot}' + stages: + - type: org.osbuild.qemu + inputs: + image: + type: org.osbuild.files + origin: org.osbuild.pipeline + references: + name:raw-digitalocean-image: + file: disk.img + options: + filename: + mpp-format-string: '{artifact_name_prefix}-digitalocean.{arch}.qcow2' + format: + type: qcow2 + compression: false + compat: '1.1' From c55f5e75678cb98c5541db8bbc9757f2625c100a Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 13 Feb 2025 16:23:32 -0500 Subject: [PATCH 09/15] osbuild: support building ibmcloud disks --- src/cmd-osbuild | 1 + .../coreos.osbuild.s390x.mpp.yaml | 2 + .../coreos.osbuild.x86_64.mpp.yaml | 2 + .../platform.ibmcloud.ipp.yaml | 73 +++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 src/osbuild-manifests/platform.ibmcloud.ipp.yaml diff --git a/src/cmd-osbuild b/src/cmd-osbuild index 25fa5acfd4..49ccaac033 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -16,6 +16,7 @@ declare -A SUPPORTED_PLATFORMS=( ['gcp']='tar.gz' ['hetzner']='raw' ['hyperv']='vhdx' + ['ibmcloud']='qcow2' ['metal4k']='raw' ['metal']='raw' ['openstack']='qcow2' diff --git a/src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml index f7a2049875..0fc06a7bb6 100644 --- a/src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.s390x.mpp.yaml @@ -660,6 +660,8 @@ pipelines: source: mount deployment: default: true + - mpp-import-pipelines: + path: platform.ibmcloud.ipp.yaml - mpp-import-pipelines: path: platform.metal.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml index 7df7b42888..1977fed904 100644 --- a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml @@ -790,6 +790,8 @@ pipelines: path: platform.hetzner.ipp.yaml - mpp-import-pipelines: path: platform.hyperv.ipp.yaml + - mpp-import-pipelines: + path: platform.ibmcloud.ipp.yaml - mpp-import-pipelines: path: platform.openstack.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/platform.ibmcloud.ipp.yaml b/src/osbuild-manifests/platform.ibmcloud.ipp.yaml new file mode 100644 index 0000000000..b0ba630287 --- /dev/null +++ b/src/osbuild-manifests/platform.ibmcloud.ipp.yaml @@ -0,0 +1,73 @@ +# This file defines the artifact to be used for the ibmcloud platform. +version: '2' +pipelines: + - name: raw-ibmcloud-image + build: + mpp-format-string: '{buildroot}' + stages: + - type: org.osbuild.copy + inputs: + tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:raw-image + options: + paths: + - from: input://tree/disk.img + to: tree:///disk.img + # Increase the size to the cloud image size + - type: org.osbuild.truncate + options: + filename: disk.img + size: + # IBM Cloud has requested virtual size of images to be 100G + # https://github.com/coreos/coreos-assembler/pull/2041 + mpp-format-string: "{100 * 1024 * 1024 * 1024}" + - type: org.osbuild.coreos.platform + options: + platform: ibmcloud + devices: + disk: + type: org.osbuild.loopback + options: + filename: disk.img + partscan: true + mounts: + - name: root + type: org.osbuild.xfs + source: disk + partition: + mpp-format-int: '{image.layout[''root''].partnum}' + target: / + - name: ostree.deployment + type: org.osbuild.ostree.deployment + options: + source: mount + deployment: + default: true + - name: boot + type: org.osbuild.ext4 + source: disk + partition: + mpp-format-int: '{image.layout[''boot''].partnum}' + target: /boot + - name: ibmcloud + build: + mpp-format-string: '{host_as_buildroot}' + stages: + - type: org.osbuild.qemu + inputs: + image: + type: org.osbuild.files + origin: org.osbuild.pipeline + references: + name:raw-ibmcloud-image: + file: disk.img + options: + filename: + mpp-format-string: '{artifact_name_prefix}-ibmcloud.{arch}.qcow2' + format: + type: qcow2 + compression: false + compat: '1.1' From 3d1cf20ccb6afc59d2639c8b1c75fd438497b488 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 13 Feb 2025 16:46:43 -0500 Subject: [PATCH 10/15] osbuild: support building azure disks --- src/cmd-osbuild | 1 + .../coreos.osbuild.aarch64.mpp.yaml | 2 + .../coreos.osbuild.x86_64.mpp.yaml | 2 + src/osbuild-manifests/platform.azure.ipp.yaml | 71 +++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 src/osbuild-manifests/platform.azure.ipp.yaml diff --git a/src/cmd-osbuild b/src/cmd-osbuild index 49ccaac033..3ac7a92f05 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -11,6 +11,7 @@ declare -A SUPPORTED_PLATFORMS=( ['aliyun']='qcow2' ['applehv']='raw' ['aws']='vmdk' + ['azure']='vhd' ['digitalocean']='qcow2' ['exoscale']='qcow2' ['gcp']='tar.gz' diff --git a/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml index 6fa768d017..3b30a829ef 100644 --- a/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml @@ -774,6 +774,8 @@ pipelines: path: platform.applehv.ipp.yaml - mpp-import-pipelines: path: platform.aws.ipp.yaml + - mpp-import-pipelines: + path: platform.azure.ipp.yaml - mpp-import-pipelines: path: platform.gcp.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml index 1977fed904..385b3fdec1 100644 --- a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml @@ -780,6 +780,8 @@ pipelines: path: platform.applehv.ipp.yaml - mpp-import-pipelines: path: platform.aws.ipp.yaml + - mpp-import-pipelines: + path: platform.azure.ipp.yaml - mpp-import-pipelines: path: platform.digitalocean.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/platform.azure.ipp.yaml b/src/osbuild-manifests/platform.azure.ipp.yaml new file mode 100644 index 0000000000..7558063f5c --- /dev/null +++ b/src/osbuild-manifests/platform.azure.ipp.yaml @@ -0,0 +1,71 @@ +# This file defines the artifact to be used for the azure platform. +version: '2' +pipelines: + - name: raw-azure-image + build: + mpp-format-string: '{buildroot}' + stages: + - type: org.osbuild.copy + inputs: + tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:raw-image + options: + paths: + - from: input://tree/disk.img + to: tree:///disk.img + # Increase the size to the cloud image size + - type: org.osbuild.truncate + options: + filename: disk.img + size: + mpp-format-string: "{cloud_image_size_mb * 1024 * 1024}" + - type: org.osbuild.coreos.platform + options: + platform: azure + devices: + disk: + type: org.osbuild.loopback + options: + filename: disk.img + partscan: true + mounts: + - name: root + type: org.osbuild.xfs + source: disk + partition: + mpp-format-int: '{image.layout[''root''].partnum}' + target: / + - name: ostree.deployment + type: org.osbuild.ostree.deployment + options: + source: mount + deployment: + default: true + - name: boot + type: org.osbuild.ext4 + source: disk + partition: + mpp-format-int: '{image.layout[''boot''].partnum}' + target: /boot + - name: azure + build: + mpp-format-string: '{host_as_buildroot}' + stages: + - type: org.osbuild.qemu + inputs: + image: + type: org.osbuild.files + origin: org.osbuild.pipeline + references: + name:raw-azure-image: + file: disk.img + options: + filename: + mpp-format-string: '{artifact_name_prefix}-azure.{arch}.vhd' + format: + type: vpc + force_size: true + subformat: fixed From 2eff2b4380f1daf78bea249ca175b66737549eac Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 13 Feb 2025 16:52:03 -0500 Subject: [PATCH 11/15] osbuild: support building azurestack disks --- src/cmd-osbuild | 1 + .../coreos.osbuild.x86_64.mpp.yaml | 2 + .../platform.azurestack.ipp.yaml | 71 +++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 src/osbuild-manifests/platform.azurestack.ipp.yaml diff --git a/src/cmd-osbuild b/src/cmd-osbuild index 3ac7a92f05..c6290a270a 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -12,6 +12,7 @@ declare -A SUPPORTED_PLATFORMS=( ['applehv']='raw' ['aws']='vmdk' ['azure']='vhd' + ['azurestack']='vhd' ['digitalocean']='qcow2' ['exoscale']='qcow2' ['gcp']='tar.gz' diff --git a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml index 385b3fdec1..1381492ba7 100644 --- a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml @@ -782,6 +782,8 @@ pipelines: path: platform.aws.ipp.yaml - mpp-import-pipelines: path: platform.azure.ipp.yaml + - mpp-import-pipelines: + path: platform.azurestack.ipp.yaml - mpp-import-pipelines: path: platform.digitalocean.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/platform.azurestack.ipp.yaml b/src/osbuild-manifests/platform.azurestack.ipp.yaml new file mode 100644 index 0000000000..bc70a57071 --- /dev/null +++ b/src/osbuild-manifests/platform.azurestack.ipp.yaml @@ -0,0 +1,71 @@ +# This file defines the artifact to be used for the azurestack platform. +version: '2' +pipelines: + - name: raw-azurestack-image + build: + mpp-format-string: '{buildroot}' + stages: + - type: org.osbuild.copy + inputs: + tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:raw-image + options: + paths: + - from: input://tree/disk.img + to: tree:///disk.img + # Increase the size to the cloud image size + - type: org.osbuild.truncate + options: + filename: disk.img + size: + mpp-format-string: "{cloud_image_size_mb * 1024 * 1024}" + - type: org.osbuild.coreos.platform + options: + platform: azurestack + devices: + disk: + type: org.osbuild.loopback + options: + filename: disk.img + partscan: true + mounts: + - name: root + type: org.osbuild.xfs + source: disk + partition: + mpp-format-int: '{image.layout[''root''].partnum}' + target: / + - name: ostree.deployment + type: org.osbuild.ostree.deployment + options: + source: mount + deployment: + default: true + - name: boot + type: org.osbuild.ext4 + source: disk + partition: + mpp-format-int: '{image.layout[''boot''].partnum}' + target: /boot + - name: azurestack + build: + mpp-format-string: '{host_as_buildroot}' + stages: + - type: org.osbuild.qemu + inputs: + image: + type: org.osbuild.files + origin: org.osbuild.pipeline + references: + name:raw-azurestack-image: + file: disk.img + options: + filename: + mpp-format-string: '{artifact_name_prefix}-azurestack.{arch}.vhd' + format: + type: vpc + force_size: true + subformat: fixed From 7703fededf0d92284114f8b289ad0ba00f90a9a4 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 13 Feb 2025 21:04:26 -0500 Subject: [PATCH 12/15] osbuild: support building nutanix disks --- src/cmd-osbuild | 6 +- .../coreos.osbuild.x86_64.mpp.yaml | 2 + .../platform.nutanix.ipp.yaml | 73 +++++++++++++++++++ 3 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 src/osbuild-manifests/platform.nutanix.ipp.yaml diff --git a/src/cmd-osbuild b/src/cmd-osbuild index c6290a270a..733d09ba2e 100755 --- a/src/cmd-osbuild +++ b/src/cmd-osbuild @@ -21,6 +21,7 @@ declare -A SUPPORTED_PLATFORMS=( ['ibmcloud']='qcow2' ['metal4k']='raw' ['metal']='raw' + ['nutanix']='qcow2' ['openstack']='qcow2' ['qemu']='qcow2' ['qemu-secex']='qcow2' @@ -394,9 +395,10 @@ main() { # Perform postprocessing case "$platform" in - gcp) + gcp|nutanix) # Update the meta.json and builddir with the generated artifact. - # Skip Compression on these platforms as they are already compressed. + # Skip Compression on these platforms as they are either already + # compressed or the artifact itself has internal compression enabled. postprocess_artifact "${platform}" "${imgpath}" "${imgname}" 'True' ;; live) diff --git a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml index 1381492ba7..4fe515ce8f 100644 --- a/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml +++ b/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml @@ -800,6 +800,8 @@ pipelines: path: platform.openstack.ipp.yaml - mpp-import-pipelines: path: platform.metal.ipp.yaml + - mpp-import-pipelines: + path: platform.nutanix.ipp.yaml - mpp-import-pipelines: path: platform.qemu.ipp.yaml - mpp-import-pipelines: diff --git a/src/osbuild-manifests/platform.nutanix.ipp.yaml b/src/osbuild-manifests/platform.nutanix.ipp.yaml new file mode 100644 index 0000000000..265255039b --- /dev/null +++ b/src/osbuild-manifests/platform.nutanix.ipp.yaml @@ -0,0 +1,73 @@ +# This file defines the artifact to be used for the nutanix platform. +version: '2' +pipelines: + - name: raw-nutanix-image + build: + mpp-format-string: '{buildroot}' + stages: + - type: org.osbuild.copy + inputs: + tree: + type: org.osbuild.tree + origin: org.osbuild.pipeline + references: + - name:raw-image + options: + paths: + - from: input://tree/disk.img + to: tree:///disk.img + # Increase the size to the cloud image size + - type: org.osbuild.truncate + options: + filename: disk.img + size: + mpp-format-string: "{cloud_image_size_mb * 1024 * 1024}" + - type: org.osbuild.coreos.platform + options: + platform: nutanix + devices: + disk: + type: org.osbuild.loopback + options: + filename: disk.img + partscan: true + mounts: + - name: root + type: org.osbuild.xfs + source: disk + partition: + mpp-format-int: '{image.layout[''root''].partnum}' + target: / + - name: ostree.deployment + type: org.osbuild.ostree.deployment + options: + source: mount + deployment: + default: true + - name: boot + type: org.osbuild.ext4 + source: disk + partition: + mpp-format-int: '{image.layout[''boot''].partnum}' + target: /boot + - name: nutanix + build: + mpp-format-string: '{host_as_buildroot}' + stages: + - type: org.osbuild.qemu + inputs: + image: + type: org.osbuild.files + origin: org.osbuild.pipeline + references: + name:raw-nutanix-image: + file: disk.img + options: + filename: + mpp-format-string: '{artifact_name_prefix}-nutanix.{arch}.qcow2' + format: + type: qcow2 + # Utilize internal compression for the nutanix qcow2 + # https://github.com/coreos/coreos-assembler/commit/a90c7711359e9fc09e18593179bbcca75a9511c8 + compression: true + compat: '1.1' From 3c68ea16298dbda0c38adb40e5a536e3552a467d Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Fri, 14 Feb 2025 12:35:35 -0500 Subject: [PATCH 13/15] osbuild: add patch to set TMPDIR for mkfs.erofs This will help reduce the memory requirements of mkfs.erofs. https://github.com/osbuild/osbuild/pull/2020 --- build.sh | 1 + ...ve-artifacts-use-var-tmp-for-mkfs.er.patch | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/0001-stages-coreos.live-artifacts-use-var-tmp-for-mkfs.er.patch diff --git a/build.sh b/build.sh index 925e7407d2..b7169e3c52 100755 --- a/build.sh +++ b/build.sh @@ -172,6 +172,7 @@ patch_osbuild() { cat /usr/lib/coreos-assembler/0001-stages-coreos.live-artifacts-add-erofs-support.patch \ /usr/lib/coreos-assembler/0002-stages-coreos.live-artifacts-update-comments-names-t.patch \ /usr/lib/coreos-assembler/0001-stages-add-more-options-to-qemu-vmdk-disk-type.patch \ + /usr/lib/coreos-assembler/0001-stages-coreos.live-artifacts-use-var-tmp-for-mkfs.er.patch \ | patch -d /usr/lib/osbuild -p1 # And then move the files back; supermin appliance creation will need it back diff --git a/src/0001-stages-coreos.live-artifacts-use-var-tmp-for-mkfs.er.patch b/src/0001-stages-coreos.live-artifacts-use-var-tmp-for-mkfs.er.patch new file mode 100644 index 0000000000..e8e8b44f34 --- /dev/null +++ b/src/0001-stages-coreos.live-artifacts-use-var-tmp-for-mkfs.er.patch @@ -0,0 +1,35 @@ +From 31faba33b71feb160f436aaf4c9ac9932cb68830 Mon Sep 17 00:00:00 2001 +From: Dusty Mabe +Date: Fri, 14 Feb 2025 12:23:48 -0500 +Subject: [PATCH] stages/coreos.live-artifacts: use /var/tmp for mkfs.erofs + +This helps reduce the memory requirements of mkfs.erofs since +it won't be writing to tmpfs (memory backed) storage, which is +what is mounted on /tmp/. +--- + stages/org.osbuild.coreos.live-artifacts.mono | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/stages/org.osbuild.coreos.live-artifacts.mono b/stages/org.osbuild.coreos.live-artifacts.mono +index 302b24d3..a5837deb 100755 +--- a/stages/org.osbuild.coreos.live-artifacts.mono ++++ b/stages/org.osbuild.coreos.live-artifacts.mono +@@ -606,10 +606,14 @@ def mkrootfs_metal(paths, workdir, img_metal, fstype, fsoptions, loop_client): + # Note the filename must be exactly "root.[squash|ero]fs" + # because the 35coreos-live dracut module requires it. + if fstype == "erofs": ++ # Set TMPDIR='/var/tmp' to write temporary files into non-tmpfs ++ # (memory backed) storage. This helps reduce memory requirements. ++ # https://github.com/erofs/erofs-utils/issues/13 + subprocess.check_call(['mkfs.erofs', + *fsoptions.split(' '), + paths["initrd-rootfs/root.erofs"], +- tmp_rootfs_dir]) ++ tmp_rootfs_dir], ++ env=dict(os.environ, TMPDIR='/var/tmp')) + else: + subprocess.check_call(['mksquashfs', tmp_rootfs_dir, + paths["initrd-rootfs/root.squashfs"], +-- +2.48.1 + From cfabc2ee50cf76061fb978350ad253b8f57722e7 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Fri, 14 Feb 2025 13:28:28 -0500 Subject: [PATCH 14/15] cmdlib: bump default supermin VM memory request Using mkfs.erofs has bumped the requirements for the amount of memory we need here. While the memory usage was improved with the changes in [1] and [2] we want to bump this here anyway to give ourselves some wiggle room (especially because RHCOS is larger than FCOS). [1] https://github.com/erofs/erofs-utils/issues/13 [2] https://github.com/osbuild/osbuild/pull/2020 --- src/cmdlib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmdlib.sh b/src/cmdlib.sh index f83ae98a4c..29dccd7ad5 100755 --- a/src/cmdlib.sh +++ b/src/cmdlib.sh @@ -767,7 +767,7 @@ EOF # There seems to be some false positives in shellcheck # https://github.com/koalaman/shellcheck/issues/2217 - memory_default=2048 + memory_default=3072 # shellcheck disable=2031 case $arch in # Power 8 page faults with 2G of memory in rpm-ostree From 38189f6a5d21aaa1e92c0efb8b3b42f0b03e151c Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Fri, 14 Feb 2025 16:51:20 -0500 Subject: [PATCH 15/15] cmdlib: bump cache qcow2 size Now that we can build more and more artifacts in OSBuild it increases the size we need for the cache qcow that gets attached to the supermin VM. Let's bump to 40G here. Observing a RHCOS and FCOS run here they both use right around 30G today because FCOS builds for more platforms, but RHCOS has a bigger payload, so they even out. In the they will be even bigger when we become able to build the last few artifacts (vmware, virtualbox, etc) using OSBuild. --- src/cmdlib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmdlib.sh b/src/cmdlib.sh index 29dccd7ad5..5848dd9344 100755 --- a/src/cmdlib.sh +++ b/src/cmdlib.sh @@ -579,7 +579,7 @@ runcompose_tree() { # Run with cache disk. runvm_with_cache() { - local cache_size=${RUNVM_CACHE_SIZE:-30G} + local cache_size=${RUNVM_CACHE_SIZE:-40G} # "cache2" has an explicit label so we can find it in qemu easily if [ ! -f "${workdir}"/cache/cache2.qcow2 ]; then qemu-img create -f qcow2 cache2.qcow2.tmp "$cache_size"