#100 pungi does not do image building correctly
Closed: Fixed None Opened 8 years ago by ausil.

image_build_conf() seems to be the function that is writing out a config file for image build tasks. Image build tasks do not get a repo defined. They should have the repo for the variant enabled, if there is one(the cloud variant puts its images in a different location). optionally we should be able to define variants to use for repos.

/compose/Cloud/

variant goes to

/pub/alt/releases/<version>/Cloud/

/compose/Cloud_Images/

location where we put the cloud images goes to

/pub/fedora/linux/releases/<version>/Cloud/

The image_build_conf method only returns the path to the configuration file. Writing of the config is in KojiWrapper.get_image_build_cmd.

The contents of the config file are defined based on configuration for image build. There is an example for adding repos. Is this not sufficient?

As for the note in documentation about transforming the repos value, the only thing that happens is that if the config contains a list, it will be joined with commas to form a single string.

it is not sufficient and it does not actually work. there are a few cases where we will be able to use an external repo as it is defined. but we need to use the repos for the just made install trees.

I did try as a test

diff --git a/pungi/phases/image_build.py b/pungi/phases/image_build.py
index aad3f98..078d75c 100644
--- a/pungi/phases/image_build.py
+++ b/pungi/phases/image_build.py
@@ -42,8 +42,7 @@ class ImageBuildPhase(PhaseBase):
                     image_conf["install_tree"] = translate_path(self.compose, self.compose.paths.compose.os_tree(arch,   variant)) # ^
                     format = image_conf["format"] # transform format into right 'format' for image-build
                     image_conf["format"] = ",".join([x[0] for x in image_conf["format"]]) # 'docker,qcow2'
-                    if image_conf.has_key("repos") and not isinstance(image_conf["repos"], str):
-                        image_conf["repos"] = ",".join(image_conf["repos"]) # supply repos as str separated by , instead of list
+                    image_conf["repos"] = translate_path(self.compose, self.compose.paths.compose.os_tree(arch, variant))
                     cmd = {
                         "format": format,
                         "image_conf": image_conf,

however that made no change, the repos are not getting to the config

You are right. The problem is actually KojiWrapper class, that assumes the profiles patch is available (here). This is the commit that added that.

In fact, I think anything that uses the wrapper is broken. This would explain so many things.

I have opened pull request #102 which reverts the profiles commit, and adds the repo for current variant.arch to the image-build command. However, it probably breaks a lot of other things.

Ignoring my previous commit, the config key should probably be repo (without the trailing slash) (based on koji source). The patch in PR #107 includes a fix.

Login to comment on this ticket.

Metadata