#11 Add flr-koji for container rebuilds
Merged by maxamillion. Opened by maxamillion.
maxamillion/flr flr-koji  into  develop

Download 11.patch

we should commit, and push in the one command.

we should background the rebuilds and possibly add --nowait unless we are going to spawn lots of threads and wait until image completion.

For now I want to wait for them all (there's only 5 images at the moment), eventually I want to background them but I'm trying to sort out a good way to determine when they've all completed.

I'm open to suggestions though if there's a known good way to handle that now, I'd certainly prefer to not wait for each one if we can avoid it.

How about koji's watch-task? I think the python library can do just the waiting.

koji background option lowers the priority of the task so that regular builds have precedence. It is standard procedure for all types of mass rebuilding run by releng. as things are written you will do all the images in serial. best bet may be take advantage of koji's api, you can submit and get the task numbers then watch them all at the end

1 new commit added

  • add flr/util.py, refactor flr/koju.py to use it

These options do not seem to match the names of the options in the option definitions?

Wouldn't it be ideal to just set default='rpm'?

I would prefer it if you'd use a tempfile.mkdtemp.
That way, other people can't attack the process by changing things in the /tmp after you clone them.

If the dfp_release would be x.9, this would bump it to x+1.0, which is probably not what we want?

Does fedpkg commit automatically run git add? If so, on which files?

You probably want to make sure you catch and throw an exception if you can't find this line in the end.

Passing the fedpkg_cmd, user_opt[0], user_opt[1] every time feels kinda "meh" to me..
Maybe it's an idea to just build a single list with that at the start, and then constantly say cmd = cmd_prefix + ['container-build', '--nowait'] or something?

I think you might've forgotten to "git add flr/util.py"? I'm not seeing that file...

1 new commit added

  • fix up test_koji after code refactor to use util, actually add util.py this time

Absolutely forgot to update these.

Yes, updating.

3 new commits added

  • flr-koji input validation, fix bug for dir cleanup
  • switch to tempfile, refactor tests accordingly and simplify setup/teardown of rebuild tests
  • set build_type default to rpm, update flr-koji docstring to match reality

Incorrect comment? :)

Why do this?
Why not "cmd = koji_prefix + ['watch-task']; cmd.extend(koji_tasks)"??

In utils functions, it might be better to call an exception I'd say

Again: exception?

Because I didn't realize that I could watch multiple tasks at the same time with a single koji command.

Yes

obviously I meant "raise an exception"*. I can type! :D

:thumbsup:

:thumbsup:

1 new commit added

  • raise exceptions upon cmd failure, fix up koji watch-task to not loop

rebased

Pull-Request has been merged by maxamillion

Metadata