2022-01-26 12:50:43 +01:00
|
|
|
= Bodhi Infrastructure Releng SOP
|
2021-07-26 10:39:47 +02:00
|
|
|
|
|
|
|
Bodhi is used by Fedora developers to submit potential package updates
|
|
|
|
for releases and to manage buildroot overrides. From here, bodhi handles
|
|
|
|
all of the dirty work, from sending around emails, dealing with Koji, to
|
|
|
|
composing the repositories.
|
|
|
|
|
2021-08-18 11:44:52 +02:00
|
|
|
Bodhi production instance: https://bodhi.fedoraproject.org
|
|
|
|
|
|
|
|
Bodhi project page: https://github.com/fedora-infra/bodhi
|
2021-07-26 10:39:47 +02:00
|
|
|
|
|
|
|
== Contents
|
|
|
|
|
2021-08-18 11:44:52 +02:00
|
|
|
* <<_contact_information>>
|
|
|
|
* <<_configuring_all_bodhi_nodes>>
|
|
|
|
* <<_pushing_updates>>
|
|
|
|
* <<_monitoring_the_bodhi_composer_output>>
|
|
|
|
* <<_resuming_a_failed_push>>
|
|
|
|
* <<_adding_notices_to_the_front_page_or_new_update_form>>
|
|
|
|
* <<_using_the_bodhi_shell_to_modify_updates_by_hand>>
|
2021-07-26 10:39:47 +02:00
|
|
|
|
|
|
|
== Contact Information
|
|
|
|
|
|
|
|
Owner::
|
|
|
|
Fedora Infrastructure Team
|
|
|
|
Contact::
|
|
|
|
#fedora-admin
|
|
|
|
Location::
|
2021-08-18 11:44:52 +02:00
|
|
|
iad2
|
2021-07-26 10:39:47 +02:00
|
|
|
Servers::
|
2021-08-18 11:44:52 +02:00
|
|
|
* bodhi-backend01.iad2.fedoraproject.org (composer)
|
2023-12-22 09:41:58 -08:00
|
|
|
* bodhi.fedoraproject.org (web front end and backend task workers for
|
2021-07-26 10:39:47 +02:00
|
|
|
non-compose tasks)
|
2021-08-18 11:44:52 +02:00
|
|
|
* bodhi-backend01.stg.iad2.fedoraproject.org (staging composer)
|
2023-12-22 09:41:58 -08:00
|
|
|
* bodhi.fedoraproject.org (staging web front end and backend task
|
2021-07-26 10:39:47 +02:00
|
|
|
workers for non-compose tasks)
|
|
|
|
Purpose::
|
|
|
|
Push package updates, and handle new submissions.
|
|
|
|
|
|
|
|
== Configuring all bodhi nodes
|
|
|
|
|
2021-08-18 11:44:52 +02:00
|
|
|
Run this command from the _ansible_ checkout to configure
|
2021-07-26 10:39:47 +02:00
|
|
|
all of bodhi in production:
|
|
|
|
|
|
|
|
....
|
|
|
|
# This will configure the backends
|
|
|
|
$ sudo rbac-playbook playbooks/groups/bodhi2.yml
|
|
|
|
# This will configure the frontend
|
|
|
|
$ sudo rbac-playbook openshift-apps/bodhi.yml
|
|
|
|
....
|
|
|
|
|
|
|
|
== Pushing updates
|
|
|
|
|
2021-08-18 11:44:52 +02:00
|
|
|
SSH into the `bodhi-backend01` machine and run:
|
2021-07-26 10:39:47 +02:00
|
|
|
|
|
|
|
....
|
|
|
|
$ sudo -u apache bodhi-push
|
|
|
|
....
|
|
|
|
|
|
|
|
You can restrict the updates by release and/or request:
|
|
|
|
|
|
|
|
....
|
|
|
|
$ sudo -u apache bodhi-push --releases f23,f22 --request stable
|
|
|
|
....
|
|
|
|
|
|
|
|
You can also push specific builds:
|
|
|
|
|
|
|
|
....
|
|
|
|
$ sudo -u apache bodhi-push --builds openssl-1.0.1k-14.fc22,openssl-1.0.1k-14.fc23
|
|
|
|
....
|
|
|
|
|
|
|
|
This will display a list of updates that are ready to be pushed.
|
|
|
|
|
|
|
|
== Monitoring the bodhi composer output
|
|
|
|
|
|
|
|
You can monitor the bodhi composer via the `bodhi` CLI tool, or via the
|
|
|
|
systemd journal on `bodhi-backend01`:
|
|
|
|
|
|
|
|
....
|
|
|
|
# From the comfort of your own laptop.
|
|
|
|
$ bodhi composes list
|
|
|
|
# From bodhi-backend01
|
2023-12-22 09:41:58 -08:00
|
|
|
$ journalctl -f -u bodhi-celery
|
2021-07-26 10:39:47 +02:00
|
|
|
....
|
|
|
|
|
|
|
|
== Resuming a failed push
|
|
|
|
|
|
|
|
If a push fails for some reason, you can easily resume it on
|
|
|
|
`bodhi-backend01` by running:
|
|
|
|
|
|
|
|
....
|
|
|
|
$ sudo -u apache bodhi-push --resume
|
|
|
|
....
|
|
|
|
|
|
|
|
== Adding notices to the front page or new update form
|
|
|
|
|
|
|
|
You can easily add notification messages to the front page of bodhi
|
2021-08-18 11:44:52 +02:00
|
|
|
using the _frontpage_notice_ option in
|
|
|
|
_ansible/roles/bodhi2/base/templates/production.ini.j2_. If
|
2021-07-26 10:39:47 +02:00
|
|
|
you want to flash a message on the New Update Form, you can use the
|
2021-08-18 11:44:52 +02:00
|
|
|
_newupdate_notice_ variable instead. This can be useful for
|
2021-07-26 10:39:47 +02:00
|
|
|
announcing things like service outages, etc.
|
|
|
|
|
|
|
|
== Using the Bodhi Shell to modify updates by hand
|
|
|
|
|
|
|
|
The "bodhi shell" is a Python shell with the SQLAlchemy session and
|
|
|
|
transaction manager initialized. It can be run from any
|
|
|
|
production/staging backend instance and allows you to modify any models
|
|
|
|
by hand.
|
|
|
|
|
|
|
|
....
|
|
|
|
sudo pshell /etc/bodhi/production.ini
|
|
|
|
|
|
|
|
# Execute a script that sets up the `db` and provides a `delete_update` function.
|
|
|
|
# This will eventually be shipped in the bodhi package, but can also be found here.
|
|
|
|
# https://raw.githubusercontent.com/fedora-infra/bodhi/develop/tools/shelldb.py
|
|
|
|
>>> execfile('shelldb.py')
|
|
|
|
....
|
|
|
|
|
2021-08-18 11:44:52 +02:00
|
|
|
At this point you have access to a _db_ SQLAlchemy Session
|
|
|
|
instance, a _t_ _transaction module_, and
|
|
|
|
_m_ for the _bodhi.models_.
|
2021-07-26 10:39:47 +02:00
|
|
|
|
|
|
|
....
|
|
|
|
# Fetch an update, and tweak it as necessary.
|
|
|
|
>>> up = m.Update.get(u'u'FEDORA-2016-4d226a5f7e', db)
|
|
|
|
|
|
|
|
# Commit the transaction
|
|
|
|
>>> t.commit()
|
|
|
|
....
|
|
|
|
|
|
|
|
Here is an example of merging two updates together and deleting the
|
|
|
|
original.
|
|
|
|
|
|
|
|
....
|
|
|
|
>>> up = m.Update.get(u'FEDORA-2016-4d226a5f7e', db)
|
|
|
|
>>> up.builds
|
|
|
|
[<Build {'epoch': 0, 'nvr': u'resteasy-3.0.17-2.fc24'}>, <Build {'epoch': 0, 'nvr': u'pki-core-10.3.5-1.fc24'}>]
|
|
|
|
>>> b = up.builds[0]
|
|
|
|
>>> up2 = m.Update.get(u'FEDORA-2016-5f63a874ca', db)
|
|
|
|
>>> up2.builds
|
|
|
|
[<Build {'epoch': 0, 'nvr': u'resteasy-3.0.17-3.fc24'}>]
|
|
|
|
>>> up.builds.remove(b)
|
|
|
|
>>> up.builds.append(up2.builds[0])
|
|
|
|
>>> delete_update(up2)
|
|
|
|
>>> t.commit()
|
|
|
|
....
|