or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
On-boarding new CI systems in Fedora
This document is a work in progress, some part of it are quite stable, other will changed without notice.
Please do not rely on it for anything without explicit agreement.
This document describes the requirement for on-boarding/adding a new CI system in Fedora and have it be considered for gating packages.
The unit of change
Fedora has a few places where changes happen, there is the git repository storing the spec files and patches. There is the build system where artifacts are built and there is the update system where artifacts are pushed to our users in the form of updates.
There is however no one to one relation between a commit and an update. A commit can be built but does not have to. A build can be turned into an update but does not have to.
Therefore it is important to consider what is the unit of change your CI system will test.
Currently the system is designed around the concept of NVR (name-version-release) which apply to the RPM ecosystem.
We recommend that updates (ie: bodhi updates) be the unit of change.
Triggering the tests
You will want your CI system to trigger its tests based on messages sent on the Fedora message bus.
The Fedora message bus is a rabbitmq message broker.
The fedora-messaging library has been developed to help standardize and make interaction with that broker easier.
While helpful and recommended, its use is not mandatory.
From the update system
There is currently a dedicated message sent by bodhi (the update system) to inform the CI systems that an update is ready to be tested.
This message has for topic:
org.fedoraproject.prod.bodhi.update.status.testing.koji-build-group.build.complete
You can find example of these messages in datagrepper: https://apps.fedoraproject.org/datagrepper/raw?topic=org.fedoraproject.prod.bodhi.update.status.testing.koji-build-group.build.complete
From the build system
If you really want to run the test for every build made, you can trigger of the messages sent by the build system:
You can see in these messages a
state
field, here is what it corresponds to (from the koji python module):From the commits
If you really want to run tests for every commit made in the git repositories, you can trigger of the messages sent by dist-git:
Reporting test results
Test results from your CI pipeline should be published on the Fedora message bus.
Depending on how/where your tests are running, you may already have certificates to sign your messages be allowed to send messages to our broker.
If you do not, you will need to open a ticket in the fedora-infrastructure tracker: https://pagure.io/fedora-infrastructure/new_issue
Topic of the message
The topic of the message should follow these basic principle:
org.fedoraproject.{prod,stg}
,org.centos.{prod|stg}
,io.pagure.{prod|stg}
and so on. This structure is still expected by some of our apps so please respect it for now.For details on AMQP topic rules, see https://www.rabbitmq.com/amqp-0-9-1-reference.html#queue.bind.routing-key.
While there is currently no generic pattern to follow for the topic of CI systems. We are considering it and may thus adjust this document accordingly.
Content of the message
The OSCI team at Red Hat, has come up with a standardized format, enforced with a JSON schema, which contains all the information (and more) needed for your test results to be considered for gating.
Please use the following example:
Enforced by this schema:
This repository also contains schema and examples if you wish to report test results for a single build or for a commit.
Integrating into Fedora's gating
Fedora is gating its updates using the duo: greenwave and waiverdb.
greenwave queries resultsdb for test results about the artifact of interest and makes a decision about it considering configured policies, the test results and the waivers submitted.
Greenwave's decision is what leads to updates being gated or not.
So for your results to be evaluated, they need to be uploaded to resultsdb. This is achieved by resultsdb-listener which listens for certain messages on the bus and as it sees them, upload them a results into resultsdb.
If your messages are following the schema described in the previous section, adding support for your CI system to resultsdb-listener should be as simple as adding the topic you're sending and a unit-test for it. Otherwise, a little more coding will likely be needed. In all cases, unit-tests will be asked.
Questions?
If you have any question about this document, please contact us using the Fedora CI mailing list: https://lists.fedoraproject.org/archives/list/ci@lists.fedoraproject.org/