This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master in repository copr/copr.
The following commit(s) were added to refs/heads/master by this push: new ceaa4bb frontend, doc: more scripted fedora branching ceaa4bb is described below
commit ceaa4bb09c5f4826a70f6507214cdf4fafe1d68f Author: Pavel Raiskup praiskup@redhat.com AuthorDate: Wed Aug 28 09:29:33 2019 +0200
frontend, doc: more scripted fedora branching
This change adds `manage.py branch_fedora` command - that is a more automated variant of manual rawhide_to_release command execution for each rawhide chroot. The change also introduces convenience option `--deactivated` for `create_chroot` command, so we don't have to create the chroot and disable right after that (racy).
Suggest in doc that we should newly use `branch_fedora` command, and explain why is important to run the command as soon as possible.
Fixes: #955 Merges: #973 --- doc/how_to_manage_chroots.rst | 59 ++++++++++++++--------- frontend/coprs_frontend/commands/branch_fedora.py | 42 ++++++++++++++++ frontend/coprs_frontend/commands/create_chroot.py | 22 ++++++--- frontend/coprs_frontend/manage.py | 1 + 4 files changed, 94 insertions(+), 30 deletions(-)
diff --git a/doc/how_to_manage_chroots.rst b/doc/how_to_manage_chroots.rst index fac99e9..e878800 100644 --- a/doc/how_to_manage_chroots.rst +++ b/doc/how_to_manage_chroots.rst @@ -17,6 +17,7 @@ Chroots can be easily managed with these few commands. copr-frontend create_chroot <name> copr-frontend alter_chroot --action activate <name> copr-frontend alter_chroot --action deactivate <name> + copr-frontend branch_fedora <new-branched-version> copr-frontend rawhide_to_release <rawhide-chroot> <newly-created-chroot>
However, `enablement process upon Fedora branching <#branching-process>`_ and also @@ -27,39 +28,51 @@ That's why the rest of this article explains the certain use-cases rather than a Branching process -----------------
-Immediately after Fedora branching, you want to do something like this +Projects can be configured to follow Fedora branching. That means, that once a +chroot for new Fedora release is enabled, it should be automatically turned-on +for such projects. Moreover, builds from Rawhide should be forked into this new +chroot.
-:: - - copr-frontend create_chroot fedora-27-x86_64 fedora-27-i386 fedora-27-ppc64le +So **immediately** after Fedora branching (for exmaple to version **31**), you +want to do this (the command takes a very long time, be prepared)::
+ copr-frontend branch_fedora 31
-Copr uses `Mock https://github.com/rpm-software-management/mock`_ for building packages, so you should check if -the mock configs -`are already available https://github.com/rpm-software-management/mock/tree/devel/mock-core-configs/etc/mock`_ -and in which version of the :code:`mock-core-configs` package they were added. If that version is not installed -on builders, you should temporarily disable the chroots. +This command creates ``fedora-31-*`` chroots from corresponding +``fedora-rawhide-*`` chroots, and it also copies (duplicates/forks) latest +successful rawhide package builds into the new chroots. This can be done +manually for each architecture by::
-:: + copr-frontend create_chroot fedora-31-x86_64 --deactivated + copr-frontend rawhide_to_release fedora-rawhide-x86_64 fedora-31-x86_64
- copr-frontend alter_chroot --action deactivate fedora-27-x86_64 fedora-27-i386 fedora-27-ppc64le +From the manual steps you can see that the new chroots are **deactivated** at +the beginning.
+It's important to do ``rawhide_to_release`` as soon as possible, because right +after branching action - Fedora Rawhide starts to live it's own separate life - +and the builds in Rawhide become more and more incompatible with the branched +Fedora. So - if we copied the packages later - the branched chroot in copr +could become unusable. You may consider sending an email to mailing list that +rawhide packages were copied.
-Projects can be configured to follow Fedora branching. That means, that once a chroot for new Fedora release is -enabled, it should be automatically turned-on for such projects. Moreover, builds from Rawhide should be forked into -this new chroot. It can be done like this +The next needs to wait a bit, namely +* till there's a working compose for the freshly branched Fedora, and +* till the new mock configs are available on the builders.
-:: - - copr-frontend rawhide_to_release fedora-rawhide-x86_64 fedora-27-x86_64 - copr-frontend rawhide_to_release fedora-rawhide-i386 fedora-27-i386 - copr-frontend rawhide_to_release fedora-rawhide-ppc64le fedora-27-ppc64le - -Once the mock configs are available on the builders, you can re-enable the chroots +Copr uses `Mock https://github.com/rpm-software-management/mock`_ for building packages, so you should check if +the mock configs +`are already available https://github.com/rpm-software-management/mock/tree/devel/mock-core-configs/etc/mock`_ +and in which version of the :code:`mock-core-configs` package they were added. If that version is not installed +on builders, you should keep the chroots deactivated for now and continue later.
-:: +But the sooner we can enable the new chroots, the better -- all the builds that +happened in the time window between ``rawhide_to_release`` and chroot enablement +will be missed in the branched chroot later (users will have to rebuild them +manually). So as soon as it is possible, do::
- copr-frontend alter_chroot --action activate fedora-27-x86_64 fedora-27-i386 fedora-27-ppc64le + copr-frontend alter_chroot --action activate \ + fedora-31-x86_64 fedora-31-i386 fedora-31-ppc64le fedora-31-aarch64
When everything is done, `send an information email to a mailing list <#mailing-lists>`_.
diff --git a/frontend/coprs_frontend/commands/branch_fedora.py b/frontend/coprs_frontend/commands/branch_fedora.py new file mode 100644 index 0000000..ddbf02d --- /dev/null +++ b/frontend/coprs_frontend/commands/branch_fedora.py @@ -0,0 +1,42 @@ +from flask_script import Command, Option +from coprs.logic import coprs_logic + +from commands.create_chroot import CreateChrootCommand +from commands.rawhide_to_release import RawhideToReleaseCommand + + +class BranchFedoraCommand(Command): + """ + Branch fedora-rawhide-* chroots to fedora-N* and execute rawhide_to_release + on them + """ + + option_list = [ + Option("fedora_version", + help="The version of Fedora to branch Rawhide into, e.g. 32", + type=int), + Option( + "--dist-git-branch", + "-b", + dest="branch", + help="Branch name for this set of new chroots"), + ] + + def run(self, fedora_version, branch=None): + rawhide_chroots = coprs_logic.MockChrootsLogic.get_from_name( + "fedora-rawhide", + active_only=True, + noarch=True).all() + + chroot_pairs = { + 'fedora-{}-{}'.format(fedora_version, rch.arch): + 'fedora-rawhide-{}'.format(rch.arch) + for rch in rawhide_chroots + } + + c_cmd = CreateChrootCommand() + c_cmd.run(chroot_pairs.keys(), branch, True) + + r2r_cmd = RawhideToReleaseCommand() + for new_chroot, rawhide_chroot in chroot_pairs.items(): + r2r_cmd.run(rawhide_chroot, new_chroot) diff --git a/frontend/coprs_frontend/commands/create_chroot.py b/frontend/coprs_frontend/commands/create_chroot.py index dd97fac..48ddcc0 100644 --- a/frontend/coprs_frontend/commands/create_chroot.py +++ b/frontend/coprs_frontend/commands/create_chroot.py @@ -30,13 +30,20 @@ class CreateChrootCommand(ChrootCommand): "Creates a mock chroot in DB"
def __init__(self): - self.option_list += Option( - "--dist-git-branch", - "-b", - dest="branch", - help="Branch name for this set of new chroots"), - - def run(self, chroot_names, branch=None): + self.option_list += ( + Option( + "--dist-git-branch", + "-b", + dest="branch", + help="Branch name for this set of new chroots"), + Option( + "--deactivated", + action="store_true", + help="Activate the chroot later, manually by `alter_chroot`" + ), + ) + + def run(self, chroot_names, branch=None, deactivated=False): for chroot_name in chroot_names: if not branch: branch = chroot_to_branch(chroot_name) @@ -44,6 +51,7 @@ class CreateChrootCommand(ChrootCommand): try: chroot = coprs_logic.MockChrootsLogic.add(chroot_name) chroot.distgit_branch = branch_object + chroot.is_active = not deactivated db.session.commit() except exceptions.MalformedArgumentException: self.print_invalid_format(chroot_name) diff --git a/frontend/coprs_frontend/manage.py b/frontend/coprs_frontend/manage.py index 455e3c5..3701370 100755 --- a/frontend/coprs_frontend/manage.py +++ b/frontend/coprs_frontend/manage.py @@ -23,6 +23,7 @@ commands = { "alter_chroot": "AlterChrootCommand", "display_chroots": "DisplayChrootsCommand", "drop_chroot": "DropChrootCommand", + "branch_fedora": "BranchFedoraCommand",
# User commands "alter_user": "AlterUserCommand",
copr-commits@lists.fedorahosted.org