Skip to content

Commit 3f0538d

Browse files
committed
Doc: FBC one step process documentation
The documentation covers a process for releasing FBC bundles with single step. A couple of new files and modification of existing are now described in the doc that are required for the ones step. JIRA: ISV-5508 Signed-off-by: Ales Raszka <araszka@redhat.com>
1 parent be7c4de commit 3f0538d

File tree

10 files changed

+231
-70
lines changed

10 files changed

+231
-70
lines changed

.github/workflows/documentation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
mkdocs build
2525
- name: Deploy
2626
uses: peaceiris/actions-gh-pages@v4
27-
if: github.ref == 'refs/heads/main'
27+
# if: github.ref == 'refs/heads/main'
2828
with:
2929
github_token: ${{ secrets.GITHUB_TOKEN }}
3030
publish_dir: ./site

docs/img/fbc-auto-release-pr.png

85.2 KB
Loading

docs/users/community-operators-troubleshooting.md

Lines changed: 58 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,56 @@ This document provides troubleshooting steps for each Tekton task in the Operato
66
## Table of Contents
77

88
### [Operator Pipeline Tasks Troubleshooting](#tasks)
9-
* [get-pr-number](#get-pr-number)
10-
* [acquire-lease](#acquire-lease)
11-
* [set-github-started-label](#set-github-started-label)
12-
* [set-github-status-pending](#set-github-status-pending)
13-
* [set-env](#set-env)
14-
* [clone-repository-base](#clone-repository-base)
15-
* [clone-repository](#clone-repository)
16-
* [detect-changes](#detect-changes)
17-
* [yaml-lint](#yaml-lint)
18-
* [check-permissions](#check-permissions)
19-
* [set-github-pr-title](#set-github-pr-title)
20-
* [read-config](#read-config)
21-
* [resolve-pr-type](#resolve-pr-type)
22-
* [apply-test-waivers](#apply-test-waivers)
23-
* [content-hash](#content-hash)
24-
* [certification-project-check](#certification-project-check)
25-
* [get-organization](#get-organization)
26-
* [get-pyxis-certification-data](#get-pyxis-certification-data)
27-
* [static-tests](#static-tests)
28-
* [static-tests-results](#static-tests-results)
29-
* [merge-registry-credentials](#merge-registry-credentials)
30-
* [digest-pinning](#digest-pinning)
31-
* [verify-pinned-digest](#verify-pinned-digest)
32-
* [dockerfile-creation](#dockerfile-creation)
33-
* [build-bundle](#build-bundle)
34-
* [make-bundle-repo-public](#make-bundle-repo-public)
35-
* [get-supported-versions](#get-supported-versions)
36-
* [add-bundle-to-index](#add-bundle-to-index)
37-
* [make-index-repo-public](#make-index-repo-public)
38-
* [get-ci-results-attempt](#get-ci-results-attempt)
39-
* [preflight-trigger](#preflight-trigger)
40-
* [evaluate-preflight-result](#evaluate-preflight-result)
41-
* [get-ci-results](#get-ci-results)
42-
* [link-pull-request-with-open-status](#link-pull-request-with-open-status)
43-
* [merge-pr](#merge-pr)
44-
* [link-pull-request-with-merged-status](#link-pull-request-with-merged-status)
45-
* [copy-bundle-image-to-released-registry](#copy-bundle-image-to-released-registry)
46-
* [decide-index-paths](#decide-index-paths)
47-
* [get-manifest-digests](#get-manifest-digests)
48-
* [request-signature](#request-signature)
49-
* [upload-signature](#upload-signature)
50-
* [publish-to-index](#publish-to-index)
9+
- [Troubleshooting the Community Operator Pipeline](#troubleshooting-the-community-operator-pipeline)
10+
- [Table of Contents](#table-of-contents)
11+
- [Operator Pipeline Tasks Troubleshooting](#operator-pipeline-tasks-troubleshooting)
12+
- [FBC-Related Operator Pipeline Tasks Troubleshooting](#fbc-related-operator-pipeline-tasks-troubleshooting)
13+
- [Operator Pipeline Tasks Troubleshooting](#operator-pipeline-tasks-troubleshooting-1)
14+
- [get-pr-number](#get-pr-number)
15+
- [acquire-lease](#acquire-lease)
16+
- [set-github-started-label](#set-github-started-label)
17+
- [set-github-status-pending](#set-github-status-pending)
18+
- [set-env](#set-env)
19+
- [clone-repository-base](#clone-repository-base)
20+
- [clone-repository](#clone-repository)
21+
- [detect-changes](#detect-changes)
22+
- [yaml-lint](#yaml-lint)
23+
- [check-permissions](#check-permissions)
24+
- [set-github-pr-title](#set-github-pr-title)
25+
- [read-config](#read-config)
26+
- [resolve-pr-type](#resolve-pr-type)
27+
- [apply-test-waivers](#apply-test-waivers)
28+
- [content-hash](#content-hash)
29+
- [certification-project-check](#certification-project-check)
30+
- [get-organization](#get-organization)
31+
- [get-pyxis-certification-data](#get-pyxis-certification-data)
32+
- [static-tests](#static-tests)
33+
- [static-tests-results](#static-tests-results)
34+
- [merge-registry-credentials](#merge-registry-credentials)
35+
- [digest-pinning](#digest-pinning)
36+
- [verify-pinned-digest](#verify-pinned-digest)
37+
- [dockerfile-creation](#dockerfile-creation)
38+
- [build-bundle](#build-bundle)
39+
- [make-bundle-repo-public](#make-bundle-repo-public)
40+
- [get-supported-versions](#get-supported-versions)
41+
- [add-bundle-to-index](#add-bundle-to-index)
42+
- [make-index-repo-public](#make-index-repo-public)
43+
- [get-ci-results-attempt](#get-ci-results-attempt)
44+
- [preflight-trigger](#preflight-trigger)
45+
- [evaluate-preflight-result](#evaluate-preflight-result)
46+
- [get-ci-results](#get-ci-results)
47+
- [link-pull-request-with-open-status](#link-pull-request-with-open-status)
48+
- [merge-pr](#merge-pr)
49+
- [link-pull-request-with-merged-status](#link-pull-request-with-merged-status)
50+
- [copy-bundle-image-to-released-registry](#copy-bundle-image-to-released-registry)
51+
- [decide-index-paths](#decide-index-paths)
52+
- [get-manifest-digests](#get-manifest-digests)
53+
- [request-signature](#request-signature)
54+
- [upload-signature](#upload-signature)
55+
- [publish-to-index](#publish-to-index)
56+
- [FBC-Related Operator Pipeline Tasks Troubleshooting](#fbc-related-operator-pipeline-tasks-troubleshooting-1)
57+
- [build-fbc-index-images](#build-fbc-index-images)
58+
- [build-fbc-scratch-catalog](#build-fbc-scratch-catalog)
5159

5260
### [FBC-Related Operator Pipeline Tasks Troubleshooting](#fbc-tasks)
5361
* [build-fbc-index-images](#build-fbc-index-images)
@@ -79,6 +87,7 @@ Failures at this stage are rare. To diagnose the issue, review the pipeline logs
7987

8088
### <a id="detect-changes"></a>detect-changes
8189
The pipeline may fail at this stage due to the following reasons:
90+
8291
1. <b>Changing Non-Operator Files:</b> If the PR attempts to modify external files outside of targeted operator, the pipeline will fail.
8392
1. <b>Affecting Multiple Operators:</b> If the PR impacts more than one operator, it will result in a failure.
8493
1. <b>Modifying Existing Bundles:</b> Changes to existing bundles in the PR are not allowed at this stage.
@@ -88,8 +97,8 @@ Other Failures at this stage are rare. To diagnose the issue, review the pipelin
8897

8998
### <a id="yaml-lint"></a>yaml-lint
9099

91-
**Warnings** at this step should be addressed if possible but won't result in a failure.
92-
**Errors** at this step will need to be addressed. Often errors center around <i>unexpected whitespace</i> at the end of lines or <i>missing newlines</i> at the end of your `yaml` files.
100+
**Warnings** at this step should be addressed if possible but won't result in a failure.
101+
**Errors** at this step will need to be addressed. Often errors center around <i>unexpected whitespace</i> at the end of lines or <i>missing newlines</i> at the end of your `yaml` files.
93102

94103
### <a id="check-permissions"></a>check-permissions
95104
Failures at this stage are rare. To diagnose the issue, review the pipeline logs linked in the PipelineRun summary within the PR. If the logs don’t clarify the problem, feel free to ask for assistance in the PR comments. Maintainers will assist in identifying and resolving the issue.
@@ -127,6 +136,7 @@ If the static tests fail, a summary will be posted as a comment on the Pull Requ
127136
![Preflight test run logs example](../img/static_tests_example.png)
128137

129138
To proceed:
139+
130140
1. Review the comment for the detailed reasons behind the failed static tests.
131141
1. Fix all the reported issues.
132142
1. Commit the changes with a fix to the PR and it will Re-trigger the hosted pipeline.
@@ -158,6 +168,7 @@ Failures at this stage are rare. To diagnose the issue, review the pipeline logs
158168
Failures at this stage are rare and often due to transient issues. Start by reviewing the pipeline logs linked in the PipelineRun summary within the PR.
159169

160170
As an initial step, re-trigger the pipeline by adding the appropriate command in the PR comment:
171+
161172
1. `/pipeline restart operator-hosted-pipeline` for the hosted pipeline.
162173
1. `/pipeline restart operator-release-pipeline` for the release pipeline.
163174

@@ -173,12 +184,13 @@ Failures at this stage are rare. To diagnose the issue, review the pipeline logs
173184
Failures at this stage are rare. To diagnose the issue, review the pipeline logs linked in the PipelineRun summary within the PR. If the logs don’t clarify the problem, feel free to ask for assistance in the PR comments. Maintainers will assist in identifying and resolving the issue.
174185

175186
### <a id="evaluate-preflight-result"></a>evaluate-preflight-result
176-
At this step, the pipeline will primarily fail if the [dynamic tests](../users/dynamic_checks.md) do not pass completely. A link to the test artifacts will be posted as a comment on the PR, as shown below.
187+
At this step, the pipeline will primarily fail if the [dynamic tests](../users/dynamic_checks.md) do not pass completely. A link to the test artifacts will be posted as a comment on the PR, as shown below.
177188

178189
![Preflight test run logs example](../img/preflight_run_logs_example.png)
179190

180191
Please review this link, as it will provide detailed error information.
181192
Failures at this stage are uncommon. To diagnose the issue:
193+
182194
1. Review the pipeline logs linked in the PipelineRun summary within the PR.
183195
1. Examine the test artifacts for detailed error information.
184196

@@ -191,7 +203,7 @@ Failures at this stage are rare. To diagnose the issue, review the pipeline logs
191203
Failures at this stage are rare. To diagnose the issue, review the pipeline logs linked in the PipelineRun summary within the PR. If the logs don’t clarify the problem, feel free to ask for assistance in the PR comments. Maintainers will assist in identifying and resolving the issue.
192204

193205
### <a id="merge-pr"></a>merge-pr
194-
If operator hosted pipeline fails at this task with the error message: `Pull request Auto merge is not allowed for this repository (enablePullRequestAutoMerge)` then re-trigger the pipeline by running command `/pipeline restart operator-hosted-pipeline`.
206+
If operator hosted pipeline fails at this task with the error message: `Pull request Auto merge is not allowed for this repository (enablePullRequestAutoMerge)` then re-trigger the pipeline by running command `/pipeline restart operator-hosted-pipeline`.
195207

196208
Another Failures at this stage are rare. To diagnose the issue, review the pipeline logs linked in the PipelineRun summary within the PR. If the logs don’t clarify the problem, feel free to ask for assistance in the PR comments. Maintainers will assist in identifying and resolving the issue.
197209

@@ -223,4 +235,3 @@ Failures at this stage are rare. To diagnose the issue, review the pipeline logs
223235

224236
### <a id="build-fbc-scratch-catalog"></a>build-fbc-scratch-catalog
225237
Failures at this stage are rare. To diagnose the issue, review the pipeline logs linked in the PipelineRun summary within the PR. If the logs don’t clarify the problem, feel free to ask for assistance in the PR comments. Maintainers will assist in identifying and resolving the issue.
226-

docs/users/contributing-via-pr.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
To submit an operator one has to do these steps
55

66
1. Fork project based on desired [Operator Repository](./pipelines_overview.md#operator-repositories)
7-
1. Place the operator in the target directory. [More info](./contributing-where-to.md)
7+
2. Place the operator in the target directory. [More info](./contributing-where-to.md)
88
- operators
9-
1. Configure `ci.yaml` file. [More info](./operator-ci-yaml.md)
9+
3. Configure `ci.yaml` file. [More info](./operator-ci-yaml.md)
1010
- Setup reviewers
1111
- Enable FBC mode
12-
1. Make a pull request with a new operator bundle or catalog changes
13-
1. Verify tests and fix problems, if possible
14-
1. Ask for help in the PR in case of problems
12+
- Add template to catalog mapping
13+
4. Configure the `release-config.yaml` file if you want to automatically release the operator to the OCP catalogs. [More info](./fcb_autorelease.md#release-configyaml)
14+
5. Make a pull request with a new operator bundle or catalog changes
15+
6. Verify tests and fix problems, if possible
16+
7. Ask for help in the PR in case of problems
1517

1618

1719
## Pull request

docs/users/contributing-where-to.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Once you have forked the upstream repo, you will require to add your Operator Bu
1515
│ │ │ └── tools.opdev.io_demoresources.yaml
1616
│ │ ├── metadata
1717
│ │ │ └── annotations.yaml
18+
│ │ ├── release-config.yaml
1819
│ │ └── tests
1920
│ │ └── scorecard
2021
│ │ └── config.yaml

docs/users/fbc_autorelease.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# File-Based Catalog - auto-release
2+
By the nature of the File-Based Catalog (FBC) mode, the release of operator is made of two steps.
3+
4+
* The first step builds, test and release bundle image
5+
* The second step adds a bundle to OCP catalog and releases it
6+
7+
The second step can be now automated and user is no longer required to manually create a
8+
second PR with catalog changes. The release pipeline will take care of it.
9+
10+
The process will require an additional configuration in the `release-config.yaml` file.
11+
Once a PR with new bundle and `release-config.yaml` is merged, the release pipeline will
12+
open a new PR with catalog changes.
13+
14+
Example of such PR can be found [here](https://github.com/Allda/community-operators-pipeline-preprod/pull/20).
15+
The second PR is linked with it original PR and looks like [this](https://github.com/Allda/community-operators-pipeline-preprod/pull/25):
16+
17+
![Release info](../img/fbc-auto-release-pr.png)
18+
19+
## release-config.yaml
20+
21+
If you want your operators to be automatically released to the OCP catalogs in the FBC mode,
22+
you will need to configure the `release-config.yaml` file. The file should be placed
23+
into the bundle version directory, e.g. `operators/aqua/0.0.2/release-config.yaml`.
24+
25+
```
26+
tree operators/aqua
27+
.
28+
├── 0.0.2
29+
│   ├── release-config.yaml # This is the file
30+
│   ├── manifests
31+
│   └── metadata
32+
├── catalog-templates
33+
├── ci.yaml
34+
└── Makefile
35+
```
36+
Its content determines where exactly the bundle will be released in terms of
37+
the OCP version and the place in the update graph.
38+
39+
### Example
40+
41+
```yaml
42+
---
43+
catalog_templates:
44+
- template_name: basic.yaml
45+
channels: [my-channel]
46+
replaces: aqua.0.0.1
47+
- template_name: semver.yaml
48+
channels: [Fast, Stable]
49+
```
50+
The example above shows a release configuration where operator bundle is going to be
51+
released to the `my-channel` channel in the `basic.yaml` catalog template and to the
52+
`Fast` and `Stable` channels in the `semver.yaml` catalog template.
53+
54+
The `replaces` field is optional and it specifies the bundle that the new bundle
55+
replaces in the update graph.
56+
57+
### File structure
58+
The schema of the file is available here: [release-config.yaml schema](https://github.com/redhat-openshift-ecosystem/operator-pipelines/blob/main/operator-pipeline-images/operatorcert/schemas/release-config-schema.json).
59+
The schema is validated automatically in the pipeline and the PR will fail with explanations if the file is not valid.
60+
61+
Here is a summary of the file structure:
62+
63+
* The top-level key is `catalog_templates` which is a list of objects.
64+
* Each object has the following keys:
65+
* `template_name` - the name of the catalog template file in the `catalog-templates` directory.
66+
* `channels` - a list of channels where the bundle should be released.
67+
* In case of using `SemVer` a user can pick from allowed values: `Fast`, `Stable` and `Candidate`.
68+
* `replaces` - the bundle that the new bundle replaces in the update graph. (**Optional**, only for the basic templates)
69+
* `skips` - a list of bundles that should be skipped in the update graph. (**Optional**, only for the basic templates)
70+
* `skipRange` - a range of bundles that should be skipped in the update graph. (**Optional**, only for the basic templates)

docs/users/fbc_workflow.md

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,59 @@ File-based catalog templates serve as a simplified view of a catalog that can be
1818
by the user. The OPM currently supports 2 types of templates and it is up to the user which
1919
template the operator will be using.
2020
21-
* Basic template
22-
* SemVer template
21+
* Basic template - `olm.template.basic`
22+
* SemVer template - `olm.semver`
2323

2424
More information about each template can be found at [opm doc](https://olm.operatorframework.io/docs/reference/catalog-templates/).
2525

2626
The recommended template from the maintainability point of view is `SemVer`.
2727

28+
### FCB template mapping
29+
To be able to generate a catalog from templates a user needs to provide a mapping between
30+
template and catalog. The mapping is stored in the `ci.yaml` file. Based on your preference
31+
you can map a template to a catalog version with 1:N mapping or 1:1 mapping.
32+
33+
Here is an example of the `ci.yaml` file with single template rendering multiple catalogs (`1:N`):
34+
35+
```yaml
36+
---
37+
fbc:
38+
enabled: true
39+
catalog_mapping:
40+
- template_name: my-custom-semver-template.yaml # The name of the file inside ./catalog-templates directory
41+
catalogs_names: # a list of catalogs within the /catalogs directory
42+
- "v4.15"
43+
- "v4.16"
44+
- "v4.17"
45+
type: olm.semver
46+
- template_name: my-custom-basic-template.yaml # The name of the file inside catalog-templates directory
47+
catalogs_names:
48+
- "v4.12"
49+
- "v4.13"
50+
type: olm.template.basic
51+
```
52+
53+
And here is an example of the `ci.yaml` file with a single template rendering a single catalog (`1:1`):
54+
55+
```yaml
56+
---
57+
fbc:
58+
enabled: true
59+
catalog_mapping:
60+
- template_name: v4.14.yaml
61+
catalog_names: ["v4.14"]
62+
type: olm.template.basic
63+
- template_name: v4.15.yaml
64+
catalog_names: ["v4.15"]
65+
type: olm.template.basic
66+
- template_name: v4.16.yaml
67+
catalog_names: ["v4.16"]
68+
type: olm.template.basic
69+
- template_name: v4.17.yaml
70+
catalog_names: ["v4.17"]
71+
type: olm.template.basic
72+
```
73+
2874
## Generate catalogs using templates
2975
To generate a final catalog for an operator a user needs to execute different `opm`
3076
commands based on the template type. We as operator pipeline maintainers want
@@ -43,6 +89,7 @@ The right place for the Makefile is in the operator's root directory
4389
```
4490
.
4591
├── 0.0.1
92+
| ├── release-config.yaml
4693
│   ├── manifests
4794
│   └── metadata
4895
├── catalog-templates
@@ -51,8 +98,6 @@ The right place for the Makefile is in the operator's root directory
5198

5299
```
53100
54-
You can modify the Makefile based on your needs and use it to generate catalogs by running `make catalogs`.
55-
56101
> [!IMPORTANT]
57102
> In case an operator isn't shipped to all OCP catalog versions manually update `OCP_VERSIONS`
58103
> variable in the `Makefile` and include only versions supported by an operator.
@@ -83,6 +128,16 @@ catalogs
83128
```
84129

85130
### Adding new bundle to Catalog
131+
A new bundle can be added automatically to your templates and catalogs if you use
132+
the automated release feature. The process is described in the
133+
[fbc auto-release](./fbc_autorelease.md) documentation.
134+
135+
It is highly recommended to use the automated release feature as it simplifies the process
136+
from the user perspective.
137+
138+
However if you want to manually add a new bundle to the catalog follow the steps below.
139+
140+
86141
To add a bundle to the catalog you need to first submit the new version of the operator
87142
using traditional [PR workflow](./contributing-via-pr.md). The operator pipeline builds,
88143
tests, and releases the bundle into the registry. **At this point, the operator is not available

0 commit comments

Comments
 (0)