#274 [backend] acquire proper arch-VM for custom build
Closed 6 years ago by clime. Opened 6 years ago by praiskup.

file modified
+8
@@ -1,5 +1,6 @@

  import copy

  import os

+ import json

  

  

  class BuildJob(object):
@@ -70,6 +71,13 @@

          else:

              self.chroot = 'srpm-builds'

  

+             if self.source_json:

+                 source_json_dict = json.loads(self.source_json)

+                 chroot = source_json_dict.get('chroot')

+                 if chroot:

+                     # custom method requires concrete architecture

+                     self.arch = chroot.split('-')[2]

+ 

          self.destdir = os.path.normpath(os.path.join(

              worker_opts.destdir,

              task_data["project_owner"],

Err, this should be placed in copr-frontend, not copr-backend.

copr-backend might should stop getting this info at some point.

Note that I was explicit about it in the linked issue:

Frontend will need to parse source_json structure for the custom type and request builder of a particular architecture for the srpm build.

No, AIUI, frontend can request architecture by specifying build['chroot'] = *-x86_64, but if I did that (in models.py, probably to have a central place) then backend would think it is rpm-build, not srpm-build. So IMO we have to touch backend anyway... This was the minimalistic attempt that should solve it ... (but I admit I haven't had a chance to test yet).

No, AIUI, frontend can request architecture by specifying build['chroot'] = *-x86_64, but if I did that (in models.py, probably to have a central place) then backend would think it is rpm-build, not srpm-build. So IMO we have to touch backend anyway... This was the minimalistic attempt that should solve it ... (but I admit I haven't had a chance to test yet).

Right, we need to fix that condition in backend to recognize srpm builds by

   task.task_id  == task.id

it's already done like that at some places, but not there (not in job.py). If you want, you can hand this over to me.

I will fix it at some point. Thanks for the patch proposal.

Pull-Request has been closed by clime

6 years ago

Np, could we find at least some relatively prompt solution (!= at some point)? It makes the custom build method pretty unusable atm.

Calmed down over the night, again, ... lets face the copr mils again (and now
without friendly-mode "on", since that's either not applied on me).

Right, we need to fix that condition in backend to recognize srpm builds by

task.task_id == task.id
it's already done like that at some places, but not there (not in job.py).

The srpm handling on backend/rpmbuild is pretty brittle, and weak designed,
yes. And really curious how task_id is related to architecture of VM during
initial VM acquire. I hope that no more hacks are coming..

If you want, you can hand this over to me.

As I said, NP here, but you closed the PR, so you are not giving me other
chance. You are not asking ;).

Afterall, seing you doing many bad decissions and hacks, it's funny to see how
pedantic you are when it comes to reject PRs.

Only argument here before you closed was someething like "hey, I told
you to fix frontend, not backend, you see?".

I will fix it at some point.

Thanks god we have you! :-) But note that if I was OK to have a fix "at
some point" (== maybe never), I wouldn't fill PR.

So ping, do you have ETA for this fix?

Metadata