Skip to content

Commit

Permalink
osbuild: Allow deploy via container image
Browse files Browse the repository at this point in the history
 - Allow osbuild image creation to use also a container image.
It is part of the efforce to enable podman to use osbuild.

Signed-off-by: Renata Ravanelli <[email protected]>
  • Loading branch information
ravanelli authored and jlebon committed Mar 11, 2024
1 parent fd56e40 commit b74e2f9
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 4 deletions.
26 changes: 25 additions & 1 deletion src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ mpp-vars:
ociarchive: $ociarchive
osname: $osname
container_imgref: $container_imgref
container_repo: $container_repo
container_tag: $container_tag
metal_image_size_mb: $metal_image_size_mb
cloud_image_size_mb: $cloud_image_size_mb
bios_boot_size_mb: 1
Expand Down Expand Up @@ -120,7 +122,7 @@ pipelines:
- path: /boot/efi
mode: 493
- type: org.osbuild.ignition
# Deploy via container if we have a container ociarchive, else from repo.
# Deploy via container if we have a container ociarchive or an image, else from repo.
- mpp-if: ociarchive != ''
then:
type: org.osbuild.ostree.deploy.container
Expand All @@ -142,6 +144,28 @@ pipelines:
references:
name:oci-archive:
name: coreos.ociarchive
- mpp-if: container_repo != ''
then:
type: org.osbuild.ostree.deploy.container
options:
osname:
mpp-format-string: '{osname}'
target_imgref:
mpp-format-string: '{container_imgref}'
mounts:
- /boot
- /boot/efi
kernel_opts:
- rw
- '$ignition_firstboot'
inputs:
images:
type: org.osbuild.containers
origin: org.osbuild.source
mpp-resolve-images:
images:
- source: $container_repo
tag: $container_tag
else:
type: org.osbuild.ostree.deploy
options:
Expand Down
26 changes: 25 additions & 1 deletion src/osbuild-manifests/coreos.osbuild.ppc64le.mpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ mpp-vars:
ociarchive: $ociarchive
osname: $osname
container_imgref: $container_imgref
container_repo: $container_repo
container_tag: $container_tag
metal_image_size_mb: $metal_image_size_mb
cloud_image_size_mb: $cloud_image_size_mb
bios_boot_size_mb: 1
Expand Down Expand Up @@ -115,7 +117,7 @@ pipelines:
# will always work.
bootprefix: true
- type: org.osbuild.ignition
# Deploy via container if we have a container ociarchive, else from repo.
# Deploy via container if we have a container ociarchive or an image, else from repo.
- mpp-if: ociarchive != ''
then:
type: org.osbuild.ostree.deploy.container
Expand All @@ -136,6 +138,28 @@ pipelines:
references:
name:oci-archive:
name: coreos.ociarchive
- mpp-if: container_repo != ''
then:
type: org.osbuild.ostree.deploy.container
options:
osname:
mpp-format-string: '{osname}'
target_imgref:
mpp-format-string: '{container_imgref}'
mounts:
- /boot
- /boot/efi
kernel_opts:
- rw
- '$ignition_firstboot'
inputs:
images:
type: org.osbuild.containers
origin: org.osbuild.source
mpp-resolve-images:
images:
- source: $container_repo
tag: $container_tag
else:
type: org.osbuild.ostree.deploy
options:
Expand Down
26 changes: 25 additions & 1 deletion src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ mpp-vars:
ociarchive: $ociarchive
osname: $osname
container_imgref: $container_imgref
container_repo: $container_repo
container_tag: $container_tag
metal_image_size_mb: $metal_image_size_mb
cloud_image_size_mb: $cloud_image_size_mb
bios_boot_size_mb: 1
Expand Down Expand Up @@ -120,7 +122,7 @@ pipelines:
- path: /boot/efi
mode: 493
- type: org.osbuild.ignition
# Deploy via container if we have a container ociarchive, else from repo.
# Deploy via container if we have a container ociarchive or an image, else from repo.
- mpp-if: ociarchive != ''
then:
type: org.osbuild.ostree.deploy.container
Expand All @@ -142,6 +144,28 @@ pipelines:
references:
name:oci-archive:
name: coreos.ociarchive
- mpp-if: container_repo != ''
then:
type: org.osbuild.ostree.deploy.container
options:
osname:
mpp-format-string: '{osname}'
target_imgref:
mpp-format-string: '{container_imgref}'
mounts:
- /boot
- /boot/efi
kernel_opts:
- rw
- '$ignition_firstboot'
inputs:
images:
type: org.osbuild.containers
origin: org.osbuild.source
mpp-resolve-images:
images:
- source: $container_repo
tag: $container_tag
else:
type: org.osbuild.ostree.deploy
options:
Expand Down
5 changes: 4 additions & 1 deletion src/runvm-osbuild
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ deploy_via_container=$(getconfig_def "deploy-via-container" "")
metal_image_size_mb=$(getconfig "metal-image-size")
cloud_image_size_mb=$(getconfig "cloud-image-size")
container_imgref=$(getconfig "container-imgref")

container_repo=$(getconfig "container-repo")
container_tag=$(getconfig "container-tag")
# If we are deploying via container let's go ahead and pull
# the oci archive path from the config
ostree_container=""
Expand Down Expand Up @@ -83,6 +84,8 @@ osbuild-mpp \
-D ociarchive=\""${ostree_container}"\" \
-D osname=\""${osname}"\" \
-D container_imgref=\""${container_imgref}"\" \
-D container_repo=\""${container_repo}"\" \
-D container_tag=\""${container_tag}"\" \
-D metal_image_size_mb="${metal_image_size_mb}" \
-D cloud_image_size_mb="${cloud_image_size_mb}" \
"${mppyaml}" "${processed_json}"
Expand Down

0 comments on commit b74e2f9

Please sign in to comment.