#1045 FACTORY-1935: limit Koji build architectures
Closed 6 months ago by mprahl. Opened 6 months ago by vmaljulin.
vmaljulin/fm-orchestrator FACTORY-1935  into  master

@@ -754,9 +754,13 @@ 


                  module_target = self.module_target['name']


-             build_opts = {"skip_tag": True,

-                           "mbs_artifact_name": artifact_name,

-                           "mbs_module_target": module_target}

+             build_opts = {

+                 "skip_tag": True,

+                 "mbs_artifact_name": artifact_name,

+                 "mbs_module_target": module_target,

+                 "arch_override": ' '.join(

+                     self.mmd.get_rpm_components[artifact_name].get_arches().get()

+                 )}


              task_id = self.koji_session.build(source, module_target, build_opts,


I'm not sure if this will work because when I've tried to check usages of 'arch_override' I've found this:
[vmaljuli@dhcp-24-206 fm-orchestrator]$ grep -R "arch_override"
.tox/py27/lib64/python2.7/site-packages/koji_cli/commands.py: if build_opts.arch_override and not build_opts.scratch:
.tox/py27/lib64/python2.7/site-packages/koji_cli/commands.py: parser.error(_("--arch_override is only allowed for --scratch builds"))
.tox/py27/lib64/python2.7/site-packages/koji_cli/commands.py: if build_opts.arch_override:
.tox/py27/lib64/python2.7/site-packages/koji_cli/commands.py: opts['arch_override'] = parse_arches(build_opts.arch_override)


It should work, we will need to test that on staging environment though once we deploy this. The arch_override option is passed to Koji when submitting the build, you won't find lot of info in MBS code for this, because we have not been using this feature at all since now.

Note that I'm OK merging this without any test here, because there is no test at all to test this part of MBS and writing tests for this part is non trivial task and should not be done as part of this PR.

@lsedlar, hmm... thanks for pointing that out. This will be an issue :(. I knew I saw "arch_override" in Koji, but when checking those builds now, I found out they are all "buildContainer" tasks where arch_override probably works.

-1, do not merged that before we find out what to do with this :).

I will close this PR, and it can be reopened with a different solution.

Pull-Request has been closed by mprahl

6 months ago