-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osbuild: support building kubevirt disks
- Loading branch information
Showing
4 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# This file defines the artifact to be used for the kubevirt platform. | ||
version: '2' | ||
mpp-vars: | ||
build_version: $build_version | ||
pipelines: | ||
- name: raw-kubevirt-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: kubevirt | ||
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: qemu-kubevirt-image | ||
build: | ||
mpp-format-string: '{host_as_buildroot}' | ||
stages: | ||
# Kubevirt looks for the disk/qcow2 file under the /disk directory. | ||
- type: org.osbuild.mkdir | ||
options: | ||
paths: | ||
- path: /disk | ||
mode: 493 | ||
- type: org.osbuild.qemu | ||
inputs: | ||
image: | ||
type: org.osbuild.files | ||
origin: org.osbuild.pipeline | ||
references: | ||
name:raw-kubevirt-image: | ||
file: disk.img | ||
options: | ||
filename: | ||
mpp-format-string: '/disk/{artifact_name_prefix}-kubevirt.{arch}.qcow2' | ||
format: | ||
type: qcow2 | ||
compression: false | ||
compat: '1.1' | ||
- name: kubevirt | ||
build: | ||
mpp-format-string: '{buildroot}' | ||
stages: | ||
- type: org.osbuild.oci-archive | ||
inputs: | ||
base: | ||
type: org.osbuild.tree | ||
origin: org.osbuild.pipeline | ||
references: | ||
- name:qemu-kubevirt-image | ||
options: | ||
# For the architecture for containers/registries we have | ||
# to map x86_64->amd64 and aarch64->arm64 for the image build. | ||
architecture: | ||
mpp-if: arch == 'x86_64' | ||
then: amd64 | ||
else: | ||
mpp-if: arch == 'aarch64' | ||
then: arm64 | ||
else: | ||
mpp-format-string: '{arch}' | ||
filename: | ||
mpp-format-string: '{artifact_name_prefix}-kubevirt.{arch}.ociarchive' | ||
config: | ||
Labels: | ||
version: | ||
mpp-format-string: '{build_version}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters