#52 Make fixed-architecture job scheduling possible
Closed by jskladan. Opened by jskladan.
feature/arch_specific_tasks  into  develop

Download 52.patch

Adds arch_dependent key to the task section of trigger config file. if set to True, the jobrunner will instruct Buildbot to select a builder tagged with the specified architecture. 'noarch' is used otherwise.

From what I gather based on the current Buildbot configuration ( https://pagure.io/fedora-qa/qa-ansible/blob/qa-master/f/roles/taskotron/buildmaster-configure/templates/taskotron.master.cfg.j2#_78 and following lines), this is already "accidentally enabled", but I'd like to have a second opinion on that.
I also made a guesstimate on which key is used to tell buildbot which Builder to use - see lines 59/60 of the runners.py diff

I'm proposing to use host_arch instead of run_arch, so perhaps it would make sense to be adjusted here as well.

Instead of arch_dependent, would match_host_arch be clearer? (IIRC that as a name you proposed, and I like it).

I'm not sure why you renamed trigger_tasks to trigger_jobs, but since you did, would it make sense to use job instead of task here as well?

I don't understand the FIXME. It is configurable now (as default_run_arch), isn't it?

Perhaps (run on %s host) to make it clearer?

I'm confused here. It the keyval is present, why don't you use the value and instead hardcode True? What if there's arch_dependent: False in the trigger rules config?

host_arch instead of run_arch could be more obvious

See the few nitpicks, otherwise looks reasonable to me. This hasn't been tested, right? We can make a scratch build before committing this and test it on taskotron-dev, if you prefer.

Not really. In my mind, at least. A "job" is a combination of task, arch, item, type, .... I changed the name to better match what the method does - it takes a list of tasks and parameters, and makes sure the jobs are scheduled (we have jobrunners not taskrunners for example).

forgot to remove it, good catch

I could not care less, why not :)

because it is a boolean value, and I like True/False more than 'no'/'' or {1:2}/[].
If there's arch_dependent: False in the config, then the condition on line 43 would be false, and the default value (False) from line 35 is kept.
I give it to you, that the condition could have been simplified to if item.get('arch_depentent')

One could also argue, that the whole thing could have been written as task['arch_dependent'] = item.get('arch_dependent', False) but for some reason I just like the explicit True/False a bit more, even if ... = bool(item.get(...)) is possible.
Anyway, I don't see a functional issue here, it is all the nearly the same to me, but I just prefer explicit True/False for some weird reason.

OK, I get it now.

THX for the feedback, will fix accordingly!

Closed by https://pagure.io/taskotron/taskotron-trigger/c/0d1e3ebed2b1635d4a75a959b5c3eb831d2d6f26?branch=develop

Pull-Request has been closed by jskladan

Metadata