Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support building hetzner disk images #4023

Merged
merged 2 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/builds/cosa_v1.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package builds

// generated by 'make schema'
// source hash: d7b6e01415317b89e346747884eb3536cc9e78049a2c71615739afd51fa65569
// source hash: 58da31f35c1405d5a752a297d0ee012f577720f810113d38cdabca102ec7edd8

type AdvisoryDiff []AdvisoryDiffItems

Expand Down Expand Up @@ -93,6 +93,7 @@ type BuildArtifacts struct {
Exoscale *Artifact `json:"exoscale,omitempty"`
ExtensionsContainer *Artifact `json:"extensions-container,omitempty"`
Gcp *Artifact `json:"gcp,omitempty"`
Hetzner *Artifact `json:"hetzner,omitempty"`
HyperV *Artifact `json:"hyperv,omitempty"`
IbmCloud *Artifact `json:"ibmcloud,omitempty"`
Initramfs *Artifact `json:"initramfs,omitempty"`
Expand Down
9 changes: 8 additions & 1 deletion pkg/builds/schema_doc.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Generated by ./generate-schema.sh
// Source hash: d7b6e01415317b89e346747884eb3536cc9e78049a2c71615739afd51fa65569
// Source hash: 58da31f35c1405d5a752a297d0ee012f577720f810113d38cdabca102ec7edd8
// DO NOT EDIT

package builds
Expand Down Expand Up @@ -458,6 +458,7 @@ var generatedSchemaJSON = `{
"legacy-oscontainer",
"gcp",
"kubevirt",
"hetzner",
"hyperv",
"ibmcloud",
"powervs",
Expand Down Expand Up @@ -684,6 +685,12 @@ var generatedSchemaJSON = `{
"type": "object",
"title": "HyperV",
"$ref": "#/definitions/artifact"
},
"hetzner": {
"$id": "#/properties/images/properties/hetzner",
"type": "object",
"title": "Hetzner",
"$ref": "#/definitions/artifact"
}
}
},
Expand Down
1 change: 1 addition & 0 deletions src/cmd-buildextend-hetzner
2 changes: 1 addition & 1 deletion src/cmd-coreos-prune
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Build = collections.namedtuple("Build", ["id", "images", "arch", "meta_json"])
# set metadata caching to 5m
CACHE_MAX_AGE_METADATA = 60 * 5
# These lists are up to date as of schema hash
# d7b6e01415317b89e346747884eb3536cc9e78049a2c71615739afd51fa65569. If changing
# 58da31f35c1405d5a752a297d0ee012f577720f810113d38cdabca102ec7edd8. If changing
# this hash, ensure that the list of SUPPORTED and UNSUPPORTED artifacts below
# is up to date.
SUPPORTED = ["amis", "gcp"]
Expand Down
1 change: 1 addition & 0 deletions src/cmd-osbuild
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dn=$(dirname "$0")
declare -A SUPPORTED_PLATFORMS=(
['applehv']='raw'
['gcp']='tar.gz'
['hetzner']='raw'
['hyperv']='vhdx'
['metal4k']='raw'
['metal']='raw'
Expand Down
2 changes: 2 additions & 0 deletions src/osbuild-manifests/coreos.osbuild.aarch64.mpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,8 @@ pipelines:
path: platform.applehv.ipp.yaml
- mpp-import-pipelines:
path: platform.gcp.ipp.yaml
- mpp-import-pipelines:
path: platform.hetzner.ipp.yaml
- mpp-import-pipelines:
path: platform.hyperv.ipp.yaml
- mpp-import-pipelines:
Expand Down
2 changes: 2 additions & 0 deletions src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,8 @@ pipelines:
path: platform.applehv.ipp.yaml
- mpp-import-pipelines:
path: platform.gcp.ipp.yaml
- mpp-import-pipelines:
path: platform.hetzner.ipp.yaml
- mpp-import-pipelines:
path: platform.hyperv.ipp.yaml
- mpp-import-pipelines:
Expand Down
3 changes: 1 addition & 2 deletions src/osbuild-manifests/platform.applehv.ipp.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This file isn't yet being used today but holds an OSBuild image
# definition for the applehv platform.
# This file defines the artifact to be used for the applehv platform.
version: '2'
pipelines:
- name: raw-applehv-image
Expand Down
3 changes: 1 addition & 2 deletions src/osbuild-manifests/platform.gcp.ipp.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This file isn't yet being used today but holds an OSBuild image
# definition for the gcp platform.
# This file defines the artifact to be used for the gcp platform.
version: '2'
pipelines:
- name: raw-gcp-image
Expand Down
68 changes: 68 additions & 0 deletions src/osbuild-manifests/platform.hetzner.ipp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# This file defines the artifact to be used for the hetzner platform.
version: '2'
pipelines:
- name: raw-hetzner-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: hetzner
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: hetzner
build:
mpp-format-string: '{buildroot}'
stages:
- type: org.osbuild.copy
inputs:
tree:
type: org.osbuild.tree
origin: org.osbuild.pipeline
references:
- name:raw-hetzner-image
options:
paths:
- from: input://tree/disk.img
to:
mpp-format-string: 'tree:///{artifact_name_prefix}-hetzner.{arch}.raw'
3 changes: 1 addition & 2 deletions src/osbuild-manifests/platform.hyperv.ipp.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This file isn't yet being used today but holds an OSBuild image
# definition for the hyperv platform.
# This file defines the artifact to be used for the hyperv platform.
version: '2'
pipelines:
- name: raw-hyperv-image
Expand Down
2 changes: 1 addition & 1 deletion src/osbuild-manifests/platform.live.ipp.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file defines the pipeline for building the live ISO.
# This file defines the pipeline for building the live ISO/PXE artifacts.
version: '2'
pipelines:
- name: live
Expand Down
7 changes: 7 additions & 0 deletions src/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@
"legacy-oscontainer",
"gcp",
"kubevirt",
"hetzner",
"hyperv",
"ibmcloud",
"powervs",
Expand Down Expand Up @@ -678,6 +679,12 @@
"type": "object",
"title": "HyperV",
"$ref": "#/definitions/artifact"
},
"hetzner": {
"$id": "#/properties/images/properties/hetzner",
"type": "object",
"title": "Hetzner",
"$ref": "#/definitions/artifact"
}
}
},
Expand Down
Loading