Wednesday, 2 October 2013

Learning to Use Mock and Koji Systems

This post will outline my experiences while setting up a mock environment to test build requirements of source RPMs. To begin I installed mock using yum install mock. It was already installed. I added my build user to the mock group by using the command usermod -aG mock username.Using the command mock -r fedora-20-x86_64 ../SPRMS/gettext-.0.3.1-1.fc19.src.rpm the mock environment ran and began building using Fedora 20 packages. Apparently, it built successfully as there were two RPM's inside the /var/lib/mock/fedora-20-x86_64. I suppose all the packages required to build gettext are found in a chrooted Fedora 20 environment. The build time was 32 minutes on the first run. The time needed for yum updates was counteracted because I once again added an extra core to my Fedora VM. The next run of the build took 17 minutes due to many packages being downloaded already. My SPRMS did not change. The mock experience was fairly enjoyable because everything worked! Haha.

Now I will attempted to use the remote building system titled Koji. By entering the command koji build f18 --scratch sbr600/week2/gettext-  I received this response:
Unable to log in, no authentication methods available.
This is because I did not prepare for the lab, hahaha. As I was preparing for the lab, while running the fedora-packager-setup I received this message. The main line of this error was
fedora.client.ServerError: ServerError(, 200, Error returned from json module while processing https:/ Expecting value: line 1 column 1 (char 0))
This is the same bug that was reported and unresolved here.
Crap. I don't know what to do now. I might try uninstalling and re-installing the package. No, that did not work. Let's see if I can grab an older version... So I just grabbed the older version here and attempted to configure and install. It worked but I still receive the same error as above. I will have to talk to my professor about this.

The issue has resolved itself. After severals email between my professor and I, the issue seems to boil down to either the internet authentication process which the college has or the strange behaviour of the machine I was using. When using a classroom which does not have the authentication process, the command works just fine and I am now happily certified.

I am working from my home install now and am going to attempt to complete this lab. So after wrestling with the koji browser SSL certificates I was finally able to get a grasp on my emotions and attempt a build of my source code for fedora 18. It ran as task # 6023017 and built successfully. I was so happy I almost grinned inwardly a little bit. But in all seriousness, this is a really cool system and I can only imagine what the open source guys of 10 - 20 years ago would say if they saw something like this.

I noticed that my package was only building for i686 and x86_64. This is because armv7hl only became a primary architecture in the f20 process as stated here. When I issued the command koji build f20 --scratch gettext- I saw that an armv7hl builder had taken up the job. After a tense moment of waiting for the build to finish I received this message.

6023069 buildArch (gettext-, armv7hl): open ( -> closed
  0 free  1 open  3 done  0 failed

Success. On a side note, the build times for the i686 and x86_64 took about the same time as my home install of Fedora, but were much faster than my VM implementation. The ARMv7hl build took about 5 minutes longer than the i686 and x86_64 builds.

Next, I attempted to build for IBM s390 and PowerPC machines. These were both successful and took about 15 minutes a piece with the s390 builds taking approximately 2-3 minutes less.

Finally, I attempted possibly the most important build. This was the build for armv6. I followed the instructions located here to configure the koji command to allow me to build my college's koji system.Thankfully, the build seemed to complete as the koji system displayed the two rpm packages created. They were gettext- and gettext-debuginfo-

And with those builds, I think I am finally done with this lab. It was a hair pulling but very educational lab. I feel much better prepared for my project after completing this lab.


Post a Comment