Skip to content

Commit 5bf7e48

Browse files
committed
Make FBC onboarding fully automated by the Makefile
The current FBC onboarding process fully depends and is automated by the Makefile. The Makefile downloads all dependencies, prepares the environment and converts existing operator to FBC. The documentation is updated to reflect the change in the FBC onboarding process. JIRA: ISV-4948 Signed-off-by: Ales Raszka <[email protected]>
1 parent 370a501 commit 5bf7e48

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

docs/users/fbc_onboarding.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,45 +18,40 @@ existing operator into FBC format.
1818
We want to help with this process and we prepared a tooling that helps with this transition.
1919

2020
## Convert existing operator to FBC
21-
As a prerequisite to this process, you need to install a few dependencies.
21+
As a prerequisite to this process, you need to download a `Makefile` that
22+
automates the migration process.
2223

2324
```bash
2425
# Go to the operator repo directory (certified-operators, marketplace-operators, community-operators-prod)
25-
cd certified-operators
26-
27-
# Install a migration script
28-
pip install git+https://github.com/redhat-openshift-ecosystem/operator-pipelines.git
29-
30-
# Download opm cli tool
31-
curl -sL https://github.com/operator-framework/operator-registry/releases/download/v1.39.0/linux-amd64-opm -o opm && \
32-
chmod +x opm && mv opm ~/.local/bin
26+
cd <operator-repo>/operator/<operator-name>
27+
wget https://raw.githubusercontent.com/redhat-openshift-ecosystem/operator-pipelines/main/fbc/Makefile
3328
```
3429

3530
Now we can convert existing operator into FBC. The initial run takes a while because
3631
a local cache is generated during a run.
3732

38-
The script will execute the following steps:
39-
- Fetch a list of currently supported OCP catalogs
40-
- Transform existing catalogs into a basic template
41-
- Generate a composite template for an operator
42-
- Generate an FBC catalog for a given operator
43-
- Update operator ci.yaml config
33+
To convert existing operator to `FBC` format you need to execute following command:
4434

45-
The following examples will be using `aqua` operator as an example. Change an operator name that matches the operator you want to convert.
4635
```bash
47-
$ fbc-onboarding --operator-name aqua \
48-
--repo-root . \
49-
--verbose
36+
$ make fbc-onboarding
5037

5138
2024-04-24 15:53:05,537 [operator-cert] INFO Generating FBC templates for the following versions: ['4.12', '4.13', '4.14', '4.15', '4.16']
5239
2024-04-24 15:53:07,632 [operator-cert] INFO Processing catalog: v4.12
5340
2024-04-24 15:53:07,633 [operator-cert] DEBUG Building cache for registry.stage.redhat.io/redhat/community-operator-index:v4.12
5441
...
5542
```
5643

44+
The Makefile will execute the following steps:
45+
- Download dependencies needed for the migration (opm, fbc-onboarding CLI)
46+
- Fetch a list of currently supported OCP catalogs
47+
- Transform existing catalogs into a basic template
48+
- Generate a composite template for an operator
49+
- Generate an FBC catalog for a given operator
50+
- Update operator ci.yaml config
51+
5752
After a script is finished you should see a template and generated fbc in the repository.
5853
```bash
59-
$ tree operatos/aqua
54+
$ tree operators/aqua
6055

6156
operators/aqua
6257
├── 0.0.1
@@ -109,7 +104,8 @@ $ git commit --signoff -m "Add FBC resources for aqua operator"
109104
Catalog templates are used to simplify a view of a catalog and allow easier manipulation of catalogs. The automated conversion pre-generates a basic + composite template that can be turned into full FBC using the following command:
110105

111106
```bash
112-
opm alpha render-template composite -f catalogs.yaml -c composite-config.yaml
107+
make catalog
113108
```
114109

115-
Of course, you can choose any type of template that you prefer. More information about catalog templates can be found [here](https://olm.operatorframework.io/docs/reference/catalog-templates/)
110+
Of course, you can choose any type of template that you prefer by modifying the Makefile target.
111+
More information about catalog templates can be found [here](https://olm.operatorframework.io/docs/reference/catalog-templates/)

docs/users/fbc_workflow.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ To generate a final catalog for an operator a user needs to execute different `o
3636
commands based on the template type. We as operator pipeline maintainers want
3737
to simplify this process and we prepared a `Makefile` with all pre-configured targets.
3838

39-
To get the `Makefile` follow these steps
39+
To get the `Makefile` follow these steps (In case you converted the existing operator and
40+
followed the [onboarding](./fbc_onboarding.md) guide the `Makefile` should be already in
41+
your operator directory and you can skip the step.)
4042

4143
```bash
4244
cd <operator-repo>/operator/<operator-name>

fbc/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ OPERATOR_NAME=$(shell basename $(PDW))
1616
TOPDIR=$(abspath $(dir $(PWD))/../)
1717
BINDIR=${TOPDIR}/bin
1818

19+
# Add the bin directory to the PATH
20+
export PATH := $(BINDIR):$(PATH)
1921
# A place to store the generated catalogs
2022
CATALOG_DIR=${TOPDIR}/catalogs
2123

@@ -29,7 +31,7 @@ OCP_VERSIONS=$(shell echo "v4.12 v4.13 v4.14 v4.15 v4.16" )
2931

3032
#
3133
.PHONY: fbc-onboarding
32-
fbc-onboarding: fbc-onboarding-deps clean
34+
fbc-onboarding: fbc-onboarding-deps ${BINDIR}/opm clean
3335
fbc-onboarding \
3436
--repo-root $(TOPDIR) \
3537
--operator-name $(OPERATOR_NAME) \

0 commit comments

Comments
 (0)