bodhi: switch to grouped JSON critical path data on staging

This switches the Bodhi staging instance to use (and regularly
update) its own grouped critical path data, instead of consuming
the data from PDC that is non-grouped and irregularly updated by
releng. If this works out well, we'll also apply it to prod.
This requires Bodhi 7 or higher.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2023-01-19 14:02:36 -08:00
parent d4bcf3b670
commit 8445bb6e26
4 changed files with 46 additions and 0 deletions

View file

@ -43,6 +43,9 @@
- bodhi2/backend
- role: bodhi2/critpath
when: env == 'staging'
- role: nfs/client
mnt_dir: '/mnt/koji/ostree'
nfs_src_dir: 'fedora_ostree_content/ostree'

View file

@ -541,7 +541,13 @@ reboot_pkgs = kernel kernel-smp kernel-PAE glibc hal dbus
# Center by setting this value to `pdc`. If it isn't set, it'll just use the
# hardcoded list below.
# critpath.type =
{% if env == "staging" %}
critpath.type = json
critpath.jsonpath = /etc/bodhi/critpath
{% else %}
critpath.type = pdc
{% endif %}
# You can hardcode a list of critical path packages instead of using the PkgDB
# or PDC. This is used if critpath.type is not defined.

View file

@ -0,0 +1,6 @@
#!/bin/sh
# generate/update critical path data for Bodhi
cd /etc/bodhi/critpath
/root/releng-git/scripts/critpath.py all

View file

@ -0,0 +1,31 @@
- name: Install required packages
package:
name:
- git # for checking out critpath generation script
- python3-dnf # script uses this
state: present
tags:
- packages
- name: Create the bodhi critical path configuration directory
file:
path: /etc/bodhi/critpath
state: directory
owner: root
group: root
- name: Check out releng repo with the script in it
git:
repo: https://pagure.io/releng.git
dest: /root/releng-git
register: gitreleng
- name: Create a cron job to run the script daily
copy: src=critpath.cron dest=/etc/cron.daily/critpath owner=root group=root mode=0755
tags:
- config
- name: Do a first run of the script if it has never run
command:
cmd: /etc/cron.daily/critpath
creates: /etc/bodhi/critpath/rawhide.json