[ansible] Update koji builder for oz
by Nicolas Chauvet
commit df8568767624d015dacc3b7bab50b0b8034217ed
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Wed Sep 12 12:51:46 2018 +0200
Update koji builder for oz
roles/koji_builder/tasks/main.yml | 39 ++++++++++++++++++--
roles/koji_builder/templates/kojid.conf | 7 +++-
.../{files/oz.cfg => templates/oz.cfg.j2} | 5 +++
3 files changed, 47 insertions(+), 4 deletions(-)
---
diff --git a/roles/koji_builder/tasks/main.yml b/roles/koji_builder/tasks/main.yml
index f74e2bc..66c798d 100644
--- a/roles/koji_builder/tasks/main.yml
+++ b/roles/koji_builder/tasks/main.yml
@@ -186,8 +186,7 @@
# oz.cfg upstream ram and cpu definitions are not enough
- name: oz.cfg
- copy: src=oz.cfg dest=/etc/oz/oz.cfg
- when: ansible_architecture != 'armv7l'
+ template: src=oz.cfg.j2 dest=/etc/oz/oz.cfg
tags:
- koji_builder
@@ -202,7 +201,6 @@
- restart libvirtd
tags:
- koji_builder
- when: ansible_architecture != 'armv7l'
#
# On primary we want to make a /mnt/koji link to /mnt/rpmfusion_koji/koji
@@ -232,6 +230,16 @@
tags:
- koji_builder
+# non-bkernel x86_64 builders run container_build, which needs osbs
+- name: special pkgs for the x86_64 builders
+ package: state=present pkg={{ item }}
+ with_items:
+ - python2-osbs-client.noarch
+ - python3-osbs-client.noarch
+ when: "ansible_architecture == 'x86_64' and not inventory_hostname.startswith('bkernel')"
+ tags:
+ - koji_builder
+
# Before, the builders had the "apache" role. This is a temporary play to remove the httpd daemon everywhere
- name: Uninstall httpd
package: name=httpd
@@ -284,3 +292,28 @@
tags:
- koji_builder
when: ansible_architecture == 'armv7l'
+
+# set highmem_is_dirtyable in compose armv7 machines.
+# see: https://bugzilla.redhat.com/show_bug.cgi?id=1504264
+#
+- name: set highmem_is_dirtyable on armv7 builders that are in the compose channel.
+ sysctl: name=vm.highmem_is_dirtyable value=1 state=present sysctl_set=yes reload=yes
+ tags:
+ - koji_builder
+ when: inventory_hostname.startswith(('arm-'))
+
+#
+# Add rngd so that virtual maachines have enough randomness to boot in our lifetimes
+#
+- name: Install rng-tools for entropy
+ package: name=rng-tools state=present
+ tags:
+ - koji_builder
+ - koji_builder/rngd
+
+- name: Start rngd
+ service: name=rngd state=started enabled=yes
+ tags:
+ - koji_builder
+ - koji_builder/rngd
+ when: ansible_architecture != 's390x'
diff --git a/roles/koji_builder/templates/kojid.conf b/roles/koji_builder/templates/kojid.conf
index 36b543d..6d24455 100644
--- a/roles/koji_builder/templates/kojid.conf
+++ b/roles/koji_builder/templates/kojid.conf
@@ -3,7 +3,7 @@
; sleeptime=15
; The maximum number of jobs that kojid will handle at a time
-maxjobs=25
+maxjobs=1
; The minimum amount of free space (in MBs) required for each build root
; minspace=8192
@@ -20,6 +20,10 @@ rpmbuild_timeout=259200
rpmbuild_timeout=172800
{% endif %}
+; Set oz timeout higher to allow aarch64, ppc64{le} and s390x to finish.
+; Install timeout(seconds) for image build
+; if it's unset, use the number in /etc/oz/oz.cfg, supported since oz-0.16.0
+oz_install_timeout=14400
use_createrepo_c=True
;url of package download site
@@ -58,6 +62,7 @@ pkgurl=http://kojipkgs.stg.rpmfusion.org/packages
allowed_scms=
pkgs.rpmfusion.org:/*:false:rfpkg-minimal,sources
pkgs.fedoraproject.org:/*:false:fedpkg,sources
+ github.com:/rpmfusion-infra/rpmfusion-kickstarts.git:false
pagure.io:/fedora-kickstarts.git:false
src.fedoraproject.org:/*:false:fedpkg,sources
pagure.io:/fork/*/fedora-kickstarts.git:false
diff --git a/roles/koji_builder/files/oz.cfg b/roles/koji_builder/templates/oz.cfg.j2
similarity index 73%
rename from roles/koji_builder/files/oz.cfg
rename to roles/koji_builder/templates/oz.cfg.j2
index 3d045d2..33a76e4 100644
--- a/roles/koji_builder/files/oz.cfg
+++ b/roles/koji_builder/templates/oz.cfg.j2
@@ -9,8 +9,13 @@ uri = qemu:///system
image_type = raw
# type = kvm
# bridge_name = virbr0
+{% if ansible_architecture == 'armv7l' or ansible_architecture == 'aarch64' %}
+cpus = 1
+memory = 1024
+{% else %}
cpus = 2
memory = 3096
+{% endif %}
[cache]
original_media = yes
6 years, 2 months