[PATCH] Read some defaults from an optional config file
by Pat Riehecky
From: Pat Riehecky <riehecky(a)fnal.gov>
Pungi's highly customizable behavior lends itself to some fairly long
execution lines. The attached patch will allow setting some defaults
in a ~/.pungirc while still allowing the end user to override them
on the command line.
I hope to eventually expand this to cover more of the pungi options.
But first things first, are there any objections to this patch?
Pat Riehecky (1):
Allow for setting some defaults via a .pungirc
src/pypungi/config.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
8 years, 5 months
Fix unit tests when running on Python 2.6
by Mathieu Bridon
The unit tests were making use of facilities introduced in Python 2.7.
However, we need to build rpkg on EL 6, which has Python 2.6.
A solution could be to just not run the unit tests when building the EL 6
package, as the actual code of rpkg is properly compatible with Python 2.6.
However, to preserve confidence in our code on all paltforms where we ship it,
this patch series instead make the unit tests work with Python 2.6
test/test_sources.py | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
8 years, 5 months
[PATCH] Allow log of failed callMethod() with callnum=None
by Pavol Babincak
Sometimes self.setSession(None) is called and this sets callnum = None.
Before this change code was failing with TypeError:
TypeError: %d format: a number is required, not NoneType
---
koji/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/koji/__init__.py b/koji/__init__.py
index 24f0808..04b183e 100644
--- a/koji/__init__.py
+++ b/koji/__init__.py
@@ -1948,7 +1948,7 @@ class ClientSession(object):
if self.logger.isEnabledFor(logging.DEBUG):
tb_str = ''.join(traceback.format_exception(*sys.exc_info()))
self.logger.debug(tb_str)
- self.logger.info("Try #%d for call %d (%s) failed: %s", tries, self.callnum, name, e)
+ self.logger.info("Try #%d for call %s (%s) failed: %s", tries, self.callnum, name, e)
if tries > 1:
# first retry is immediate, after that we honor retry_interval
time.sleep(interval)
--
1.9.3
8 years, 5 months
[PATCH] use new vagrant koji format options and add Cloud Vagrant box
by Ian McLeod
---
scripts/build-cloud-images | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/scripts/build-cloud-images b/scripts/build-cloud-images
index c84d994..1b7184d 100755
--- a/scripts/build-cloud-images
+++ b/scripts/build-cloud-images
@@ -49,6 +49,25 @@ do
koji image-build Fedora-Cloud-$spin $RELEASE --distro Fedora-20 $TARGET --kickstart=fedora-cloud-$lspin-$GITHASH.ks $url x86_64 i386 --format=qcow2 --format=raw-xz --release=$BUILD --scratch $REPOS --nowait --disk-size=3
done
+for spin in Base-Vagrant
+do
+ declare -l lspin
+ lspin=$spin
+ kickstart=fedora-cloud-$lspin-$GITHASH.ks
+ ksflatten -c fedora-cloud-$lspin.ks -o $kickstart
+ echo "url --url=$url"|sed -e 's|$arch|$basearch|g' >> $kickstart
+ koji image-build Fedora-Cloud-$spin $RELEASE $TARGET $url x86_64 \
+ $REPOS \
+ --release=$BUILD \
+ --distro Fedora-20 \
+ --kickstart=fedora-cloud-$lspin-$GITHASH.ks \
+ --format=vagrant-libvirt \
+ --format=vagrant-virtualbox \
+ --scratch \
+ --nowait \
+ --disk-size=40
+done
+
for spin in Atomic
do
declare -l lspin
@@ -76,11 +95,8 @@ do
--release=$BUILD \
--distro Fedora-20 \
--kickstart=fedora-cloud-$lspin-$GITHASH.ks \
- --format=qcow2 --format=raw-xz \
- --format=vsphere-ova \
- --format=rhevm-ova \
- --ova-option vsphere_ova_format=vagrant-virtualbox \
- --ova-option rhevm_ova_format=vagrant-libvirt \
+ --format=vagrant-virtualbox \
+ --format=vagrant-libvirt \
--ova-option vagrant_sync_directory=/home/vagrant/sync \
--scratch \
--nowait \
--
2.1.0
8 years, 5 months
[PATCH] Add "real" Vagrant format options to image building.
by Ian McLeod
We originally added Vagrant support by tweaking options sent
to the existing RHEV-M and vSphere OVA generation code. This was
a bit of a hack and resulted in confusing filenames.
This adds "vagrant-libvirt" and "vagrant-virtualbox" image types,
passes in the correct options to Image Factory and produces output
files with the conventional ".box" extension and more descriptive
and less confusing vagrant name suffixes.
---
builder/kojid | 20 +++++++++++++++++++-
cli/koji | 2 +-
docs/schema.sql | 1 +
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/builder/kojid b/builder/kojid
index 3df0588..e460ccc 100755
--- a/builder/kojid
+++ b/builder/kojid
@@ -3051,7 +3051,7 @@ class BaseImageTask(OzImageTask):
Some image formats require others to be processed first, which is why
we have to do this. raw files in particular may not be kept.
"""
- supported = ('raw', 'raw-xz', 'vmdk', 'qcow', 'qcow2', 'vdi', 'rhevm-ova', 'vsphere-ova', 'docker')
+ supported = ('raw', 'raw-xz', 'vmdk', 'qcow', 'qcow2', 'vdi', 'rhevm-ova', 'vsphere-ova', 'docker', 'vagrant-virtualbox', 'vagrant-libvirt')
for f in formats:
if f not in supported:
raise koji.ApplianceError('Invalid format: %s' % f)
@@ -3083,6 +3083,8 @@ class BaseImageTask(OzImageTask):
'qcow2': self._buildConvert,
'rhevm-ova': self._buildOVA,
'vsphere-ova': self._buildOVA,
+ 'vagrant-virtualbox': self._buildOVA,
+ 'vagrant-libvirt': self._buildOVA,
'docker': self._buildDocker
}
# add a handler to the logger so that we capture ImageFactory's logging
@@ -3221,6 +3223,17 @@ class BaseImageTask(OzImageTask):
img_opts = {}
if self.opts.get('ova_option'):
img_opts = dict([o.split('=') for o in self.opts.get('ova_option')])
+ # As far as Image Factory is concerned, vagrant boxes are just another type of OVA
+ # We communicate the desire for vagrant-specific formatting by adding the *_ova_format
+ # options and turning the underlying format option back into one of the two target
+ # image types ('vsphere-ova' or 'rhevm-ova') that are used to generate the intermediate
+ # disk image
+ if format == 'vagrant-virtualbox':
+ format = 'vsphere-ova'
+ img_opts['vsphere_ova_format'] = 'vagrant-virtualbox'
+ if format == 'vagrant-libvirt':
+ format = 'rhevm-ova'
+ img_opts['rhevm_ova_format'] = 'vagrant-libvirt'
targ = self._do_target_image(self.base_img.base_image.identifier,
format.replace('-ova', ''))
targ2 = self._do_target_image(targ.target_image.identifier, 'OVA',
@@ -3381,6 +3394,11 @@ class BaseImageTask(OzImageTask):
newimg = images[format]['image']
if 'ova' in format or format == 'raw-xz':
newname = self.imgname + '.' + format.replace('-', '.')
+ elif 'vagrant' in format:
+ # This embeds the vagrant target and the ".box" format in the name
+ # Previously, based on filename, these looked like OVAs
+ # This was confusing to many people
+ newname = self.imgname + '.' + format + '.box'
elif format == 'docker':
newname = self.imgname + '.' + 'tar.xz'
else:
diff --git a/cli/koji b/cli/koji
index bfb0955..473bcb8 100755
--- a/cli/koji
+++ b/cli/koji
@@ -5243,7 +5243,7 @@ def _build_image_indirection(options, task_opts, session, args):
def handle_image_build(options, session, args):
"""Create a disk image given an install tree"""
formats = ('vmdk', 'qcow', 'qcow2', 'vdi', 'rhevm-ova', 'vsphere-ova',
- 'docker', 'raw-xz')
+ 'vagrant-virtualbox', 'vagrant-libvirt', 'docker', 'raw-xz')
usage = _("usage: %prog image-build [options] <name> <version> " +
"<target> <install-tree-url> <arch> [<arch>...]")
usage += _("\n %prog image-build --config FILE")
diff --git a/docs/schema.sql b/docs/schema.sql
index c087d56..ffe9b22 100644
--- a/docs/schema.sql
+++ b/docs/schema.sql
@@ -736,6 +736,7 @@ insert into archivetypes (name, description, extensions) values ('so', 'Shared l
insert into archivetypes (name, description, extensions) values ('txt', 'Text file', 'txt');
insert into archivetypes (name, description, extensions) values ('vhd', 'Hyper-V image', 'vhd');
insert into archivetypes (name, description, extensions) values ('wsf', 'Windows script file', 'wsf');
+insert into archivetypes (name, description, extensions) values ('box', 'Vagrant Box Image', 'box');
-- Do we want to enforce a constraint that a build can only generate one
--
2.1.0
8 years, 5 months
[PATCH] Make koji.plugin.export_in() decorator working
by Pavol Babincak
Python raised problem with local variable before:
UnboundLocalError: local variable 'alias' referenced before
assignment
---
koji/plugin.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/koji/plugin.py b/koji/plugin.py
index 1b83365..e189d1f 100644
--- a/koji/plugin.py
+++ b/koji/plugin.py
@@ -118,12 +118,12 @@ def export_in(module, alias=None):
"""
def dec(f):
if alias is None:
- alias = "%s.%s" % (module, f.__name__)
+ local_alias = "%s.%s" % (module, f.__name__)
else:
- alias = "%s.%s" % (module, alias)
+ local_alias = "%s.%s" % (module, alias)
setattr(f, 'exported', True)
setattr(f, 'export_module', module)
- setattr(f, 'export_alias', alias)
+ setattr(f, 'export_alias', local_alias)
return f
return dec
--
1.9.3
8 years, 6 months
Re: [fedora-java] how to build with java -8 in epel-6?
by Farkas Levente
On 03/27/2015 03:38 PM, Deepak Bhole wrote:
> * Farkas Levente <lfarkas(a)lfarkas.org> [2015-03-27 10:05]:
>> hi,
>> i'm try to build a java package for epel-6 which use java-8.
>> unfortunately it seem it's not enough to simple add
>> BuildRequires: java-1.8.0-openjdk-devel
>> since it's install it, but also still install during the mock setup
>> session old java packages ie:
>> java-1.5.0-gcj x86_64 1.5.0.0-29.1.el6 os
>> 137 k
>> java-1.6.0-sun x86_64 1:1.6.0.45-1jpp.1.el6 os
>> 25 M
>> java-1.7.0-ibm x86_64 1:1.7.0.5.0-1jpp.2.el6_4 os
>> 73 M
>> java-1.7.0-ibm-devel x86_64 1:1.7.0.5.0-1jpp.2.el6_4 os
>> 7.5 M
>> java-1.7.0-oracle x86_64 1:1.7.0.45-1jpp.2.el6_4 os
>> 28 M
>> and i'm not bale to exclude them. in rpm the is a Obsoletes: but there
>> is no such thing as "BuildRequiresObsoletes":-(
>>
>> what's more i can't run system-switch-java since it's required root
>> access and there is no command line option to switch to a given specific
>> java version.
>>
>> so during build the system use the default javac which is not java8 but
>> ibm's java7 (IBM J9 VM (build 2.6, JRE 1.7.0).
>>
>> is there any way to force java8? or is there any way to exclude other
>> java vm jre to install into mock during build?
>>
>
> Hi,
>
> One of your dependencies likely requires java or java-devel, or perhaps
> even a versioned 6/7, which is why this seems to be happening.
>
> That said though, how are sun/oracle/ibm jdks showing up? They are not
> in base rhel and AFAIK EPEL does not pull from Supplementary, does it?
>
> You can force your build to use a different JVM in a couple of ways:
>
> 1. If you are calling javac directly, use
> /usr/lib/jvm/java-1.8.0-openjdk/bin/javac
>
> 2. If there is additional complexity in the build e.g. ant/maven are
> being used, try setting JAVA_HOME and overriding PATH to put OpenJDK8
> first i.e. do:
> $ export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
> $ export PATH=$JAVA_HOME/bin:${PATH}
>
>
> This should force the usage of OpenJDK8.
the real problem here is that java-1.8.0-openjdk do NOT provides java!
so all other packages which requires java try to install older version,
but since it's install java-1.8.0-openjdk it can't install
java-1.7.0-openjdk.
and this itself cause a lot's of other problems:
- first of all older jdk will be installed (sun, ibm, oracle) and if it
can't find any other version then the build failed.
- the system default java never will be java-1.8.0-openjdk so all tools
will be use a different java.
- even if i set in the spec file:
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
export PATH=$JAVA_HOME/bin:${PATH}
ant clean
Error: Could not find or load main class
org.apache.tools.ant.launch.Launcher
the reason probably the same as in:
https://bugzilla.redhat.com/show_bug.cgi?id=983394
https://bugzilla.redhat.com/show_bug.cgi?id=982683
but jpackage-utils not updated on epel-6 and epel-7 (javapackages-tools)
so currently it's not possible.
anyway i fill a bug about it:
https://bugzilla.redhat.com/show_bug.cgi?id=1208832
--
Levente "Si vis pacem para bellum!"
8 years, 6 months
mergerepos dies with IOError: [Errno 28] No space left on device
by John Florian
I'm trying to get a new Koji deployment up and running atop Fedora 21. I'm mostly there (I think). I was able to "koji regen-repo ..." but my first build attempts were failing due to not having the useradd tool in the build root, despite this:
koji list-groups dist-fedora21-build
build [dist-fedora21-build]
bash: None, default [dist-fedora21-build]
bzip2: None, default [dist-fedora21-build]
coreutils: None, default [dist-fedora21-build]
cpio: None, default [dist-fedora21-build]
diffutils: None, default [dist-fedora21-build]
fedora-release: None, default [dist-fedora21-build]
findutils: None, default [dist-fedora21-build]
gawk: None, default [dist-fedora21-build]
gcc: None, default [dist-fedora21-build]
gcc-c++: None, default [dist-fedora21-build]
grep: None, default [dist-fedora21-build]
gzip: None, default [dist-fedora21-build]
info: None, default [dist-fedora21-build]
make: None, default [dist-fedora21-build]
patch: None, default [dist-fedora21-build]
redhat-rpm-config: None, default [dist-fedora21-build]
rpm-build: None, default [dist-fedora21-build]
sed: None, default [dist-fedora21-build]
shadow-utils: None, default [dist-fedora21-build]
tar: None, default [dist-fedora21-build]
unzip: None, default [dist-fedora21-build]
util-linux: None, default [dist-fedora21-build]
which: None, default [dist-fedora21-build]
xz: None, default [dist-fedora21-build]
srpm-build [dist-fedora21-build]
bash: None, default [dist-fedora21-build]
curl: None, default [dist-fedora21-build]
cvs: None, default [dist-fedora21-build]
fedora-release: None, default [dist-fedora21-build]
fedpkg-minimal: None, default [dist-fedora21-build]
gnupg2: None, default [dist-fedora21-build]
make: None, default [dist-fedora21-build]
redhat-rpm-config: None, default [dist-fedora21-build]
rpm-build: None, default [dist-fedora21-build]
shadow-utils: None, default [dist-fedora21-build
I thus reasoned this is because yum has no idea where to get shadow-utils from which I could rectify by setting up an external-repo pointing to our local mirror of the Fedora 21 repo. Keeping it simple, I ignored updates and stuck to the base release repo only for the moment. With the ext. repo added, I tried the regen-repo command again and now I see from the mergerepos.log:
$ /usr/libexec/kojid/mergerepos -a x86_64 -b /mnt/koji/repos/dist-fedora21-build/20/x86_64/blocklist -o /var/tmp/koji/tasks/66/66/repo -g /mnt/koji/repos/dist-fedora21-build/20/groups/comps.xml -r file:///var/tmp/koji/tasks/66/66/repo_20_premerge/ -r http://mdct-00fs.dartcontainer.com/ftp/pub/fedora/21/Everything/x86_64/os/
JF: Set self.yumbase.conf.cachedir: /tmp/tmpyXkTJb
Adding repo: file:///var/tmp/koji/tasks/66/66/repo_20_premerge/
Adding repo: http://mdct-00fs.dartcontainer.com/ftp/pub/fedora/21/Everything/x86_64/os/
JF: Writing origins: /tmp/tmpyXkTJb/pkgorigins
Traceback (most recent call last):
File "/usr/libexec/kojid/mergerepos", line 278, in <module>
main(sys.argv[1:])
File "/usr/libexec/kojid/mergerepos", line 272, in main
merge.merge_repos()
File "/usr/libexec/kojid/mergerepos", line 162, in merge_repos
self.sort_and_filter()
File "/usr/libexec/kojid/mergerepos", line 232, in sort_and_filter
origins.write('%s\t%s\n' % (pkg_nvra, repo.urls[0]))
IOError: [Errno 28] No space left on device
The lines prefixed "JF: " are my own added messages since the original error didn't provide any details about what device was full. Looking at RepoMerge.__init__(), I don't see any configurable way to change where the cachedir is located and since /tmp is tmpfs this currently seems doomed. Have I missed something or done something stupid or is this a bug?
--
John Florian
8 years, 6 months