ostree: Add unified core mode for compose in rpm-ostree
rpm-ostree is moving to unified core composes and this is now working for Silverblue & Kinoite. This is untested for IoT but they should move to os-build with Fedora 37. See: https://github.com/coreos/rpm-ostree/issues/729 Merges: https://pagure.io/pungi/pull-request/1626 Signed-off-by: Timothée Ravier <tim@siosm.fr>
This commit is contained in:
parent
11fa342507
commit
603c61a033
@ -1707,6 +1707,8 @@ repository with a new commit.
|
|||||||
* ``force_new_commit`` -- (*bool*) Do not use rpm-ostree's built-in change
|
* ``force_new_commit`` -- (*bool*) Do not use rpm-ostree's built-in change
|
||||||
detection.
|
detection.
|
||||||
Defaults to ``False``.
|
Defaults to ``False``.
|
||||||
|
* ``unified_core`` -- (*bool*) Use rpm-ostree in unified core mode for composes.
|
||||||
|
Defaults to ``False``.
|
||||||
* ``version`` -- (*str*) Version string to be added as versioning metadata.
|
* ``version`` -- (*str*) Version string to be added as versioning metadata.
|
||||||
If this option is set to ``!OSTREE_VERSION_FROM_LABEL_DATE_TYPE_RESPIN``,
|
If this option is set to ``!OSTREE_VERSION_FROM_LABEL_DATE_TYPE_RESPIN``,
|
||||||
a value will be generated automatically as ``$VERSION.$RELEASE``.
|
a value will be generated automatically as ``$VERSION.$RELEASE``.
|
||||||
|
@ -332,6 +332,8 @@ This is a shortened configuration for Fedora Radhide compose as of 2019-10-14.
|
|||||||
"tag_ref": False,
|
"tag_ref": False,
|
||||||
# Don't use change detection in ostree.
|
# Don't use change detection in ostree.
|
||||||
"force_new_commit": True,
|
"force_new_commit": True,
|
||||||
|
# Use unified core mode for rpm-ostree composes
|
||||||
|
"unified_core": True,
|
||||||
# This is the location for the repo where new commit will be
|
# This is the location for the repo where new commit will be
|
||||||
# created. Note that this is outside of the compose dir.
|
# created. Note that this is outside of the compose dir.
|
||||||
"ostree_repo": "/mnt/koji/compose/ostree/repo/",
|
"ostree_repo": "/mnt/koji/compose/ostree/repo/",
|
||||||
|
@ -1027,6 +1027,7 @@ def make_schema():
|
|||||||
},
|
},
|
||||||
"update_summary": {"type": "boolean"},
|
"update_summary": {"type": "boolean"},
|
||||||
"force_new_commit": {"type": "boolean"},
|
"force_new_commit": {"type": "boolean"},
|
||||||
|
"unified_core": {"type": "boolean"},
|
||||||
"version": {"type": "string"},
|
"version": {"type": "string"},
|
||||||
"config_branch": {"type": "string"},
|
"config_branch": {"type": "string"},
|
||||||
"tag_ref": {"type": "boolean"},
|
"tag_ref": {"type": "boolean"},
|
||||||
@ -1061,6 +1062,7 @@ def make_schema():
|
|||||||
"failable": {"$ref": "#/definitions/list_of_strings"},
|
"failable": {"$ref": "#/definitions/list_of_strings"},
|
||||||
"update_summary": {"type": "boolean"},
|
"update_summary": {"type": "boolean"},
|
||||||
"force_new_commit": {"type": "boolean"},
|
"force_new_commit": {"type": "boolean"},
|
||||||
|
"unified_core": {"type": "boolean"},
|
||||||
"version": {"type": "string"},
|
"version": {"type": "string"},
|
||||||
"config_branch": {"type": "string"},
|
"config_branch": {"type": "string"},
|
||||||
"tag_ref": {"type": "boolean"},
|
"tag_ref": {"type": "boolean"},
|
||||||
|
@ -65,6 +65,11 @@ def main(args=None):
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help="do not use rpm-ostree's built-in change detection",
|
help="do not use rpm-ostree's built-in change detection",
|
||||||
)
|
)
|
||||||
|
treep.add_argument(
|
||||||
|
"--unified-core",
|
||||||
|
action="store_true",
|
||||||
|
help="use unified core mode in rpm-ostree",
|
||||||
|
)
|
||||||
|
|
||||||
installerp = subparser.add_parser(
|
installerp = subparser.add_parser(
|
||||||
"installer", help="Create an OSTree installer image"
|
"installer", help="Create an OSTree installer image"
|
||||||
|
@ -43,6 +43,9 @@ class Tree(OSTree):
|
|||||||
# because something went wrong.
|
# because something went wrong.
|
||||||
"--touch-if-changed=%s.stamp" % self.commitid_file,
|
"--touch-if-changed=%s.stamp" % self.commitid_file,
|
||||||
]
|
]
|
||||||
|
if self.unified_core:
|
||||||
|
# See https://github.com/coreos/rpm-ostree/issues/729
|
||||||
|
cmd.append("--unified-core")
|
||||||
if self.version:
|
if self.version:
|
||||||
# Add versioning metadata
|
# Add versioning metadata
|
||||||
cmd.append("--add-metadata-string=version=%s" % self.version)
|
cmd.append("--add-metadata-string=version=%s" % self.version)
|
||||||
@ -121,6 +124,7 @@ class Tree(OSTree):
|
|||||||
self.extra_config = self.args.extra_config
|
self.extra_config = self.args.extra_config
|
||||||
self.ostree_ref = self.args.ostree_ref
|
self.ostree_ref = self.args.ostree_ref
|
||||||
self.force_new_commit = self.args.force_new_commit
|
self.force_new_commit = self.args.force_new_commit
|
||||||
|
self.unified_core = self.args.unified_core
|
||||||
|
|
||||||
if self.extra_config or self.ostree_ref:
|
if self.extra_config or self.ostree_ref:
|
||||||
if self.extra_config:
|
if self.extra_config:
|
||||||
|
@ -165,6 +165,7 @@ class OSTreeThread(WorkerThread):
|
|||||||
("update-summary", config.get("update_summary", False)),
|
("update-summary", config.get("update_summary", False)),
|
||||||
("ostree-ref", config.get("ostree_ref")),
|
("ostree-ref", config.get("ostree_ref")),
|
||||||
("force-new-commit", config.get("force_new_commit", False)),
|
("force-new-commit", config.get("force_new_commit", False)),
|
||||||
|
("unified-core", config.get("unified_core", False)),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
packages = ["pungi", "ostree", "rpm-ostree"]
|
packages = ["pungi", "ostree", "rpm-ostree"]
|
||||||
|
@ -325,6 +325,7 @@ class OSTreeThreadTest(helpers.PungiTestCase):
|
|||||||
"ostree-ref": None,
|
"ostree-ref": None,
|
||||||
"force-new-commit": False,
|
"force-new-commit": False,
|
||||||
"version": None,
|
"version": None,
|
||||||
|
"unified-core": False,
|
||||||
},
|
},
|
||||||
channel=None,
|
channel=None,
|
||||||
mounts=[self.topdir, self.repo],
|
mounts=[self.topdir, self.repo],
|
||||||
|
@ -238,6 +238,22 @@ class OstreeTreeScriptTest(helpers.PungiTestCase):
|
|||||||
|
|
||||||
self.assertCorrectCall(run, extra_args=["--force-nocache"])
|
self.assertCorrectCall(run, extra_args=["--force-nocache"])
|
||||||
|
|
||||||
|
@mock.patch("kobo.shortcuts.run")
|
||||||
|
def test_unified_core(self, run):
|
||||||
|
helpers.touch(os.path.join(self.repo, "initialized"))
|
||||||
|
|
||||||
|
ostree.main(
|
||||||
|
[
|
||||||
|
"tree",
|
||||||
|
"--repo=%s" % self.repo,
|
||||||
|
"--log-dir=%s" % os.path.join(self.topdir, "logs", "Atomic"),
|
||||||
|
"--treefile=%s/fedora-atomic-docker-host.json" % self.topdir,
|
||||||
|
"--unified-core",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
self.assertCorrectCall(run, extra_args=["--unified-core"])
|
||||||
|
|
||||||
@mock.patch("kobo.shortcuts.run")
|
@mock.patch("kobo.shortcuts.run")
|
||||||
def test_extra_config_with_extra_repos(self, run):
|
def test_extra_config_with_extra_repos(self, run):
|
||||||
configdir = os.path.join(self.topdir, "config")
|
configdir = os.path.join(self.topdir, "config")
|
||||||
|
Loading…
Reference in New Issue
Block a user