FYI
I sent this email to several users, who has most build in Copr.
Anyone else is free to comment as well.
M.
-------- Přeposlaná zpráva --------
Předmět: Bulk deleting builds - RFC
Hi,
I am writing you because you are submitting a lot of builds to Copr and I would like to get your opinion about one feature.
Deleting a build.
As you probably already know, when you delete a build, we have to run createrepo_c, which can take a lot of time when
you run it after each deleted build.
When you delete builds in webUI, backend deletes a build in one bulk and run createrepo_c in one step and runs
createrepo_c only once. But... this will not work when you delete builds one by one in webUI. And the bulk delete cannot
be done using copr-cli or API. So...
We are thinking about two options:
1) Implement copr-cli bulk-delete-build. Technically it can be either:
a) copr-cli delete-build $build-id $build-id $build-id
or
b) copr-cli bulk-delete-build $build-id $build-id $build-id
But
copr-cli delete-build $build-id
copr-cli delete-build $build-id
will still create two independent actions.
Pros:
* You have control over the delete process. You know when bulk-delete will be used.
Cons:
* It will not work when you do something like:
for build in *; do
copr-cli delete-build $build
done
* You have to remember yet another option/command.
2) Group build delete on frontend
When backend asks frontend for pending task and the task is "delete a build", frontend will check if there are some
other builds to be deleted from the same project and create bulk-delete action on the fly from those pending deletes.
Pros:
* No need to change API or copr-cli.
* It will work even when you delete build in webUI one by one.
Cons:
* You have no control when batch-delete is used. Hmm, is this a problem at all? Is there any use-case when you really
want to delete build one-by-one?
* It is not optimal. E.g. when you run:
for build in *; do
copr-cli delete-build $build
done
and request to delete 10 000 builds, it can take e.g. 10 minutes to submit those action. And backend query frontend
every minute. So backend will pick-up first 100 builds as bulk-delete. Then it will take 2 minutes to proceed. In the
mean time another 2000 deleted-builds accrue. So backend will delete 2000 builds. It will take 8 minutes to proceed. And
then backend pick up the remaining 7900 builds.
So instead of one action, it will be splitted into several actions.
Still better than 10k individual action, but worse than one action.
I will appreciate your feedback.
--
Miroslav Suchy, RHCA
Red Hat, Associate Manager ABRT/Copr, #brno, #fedora-buildsys