OperatorHub Catalog will adopt a new format #505
camilamacedo86
announced in
Announcements
Replies: 2 comments 1 reply
-
🚀**(Reminder) The FBC changes are planned to roll out soon.** This is a reminder that: |
Beta Was this translation helpful? Give feedback.
1 reply
-
🚀 The FBC changes rolled out.From Feb. 1st: The latest tag of OperatorHub catalog index image (quay.io/operatorhubio/catalog:latest) are using the file-based catalogs format. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
📢 OperatorHub Catalog will adopt a new format
The K8S Community Operator Catalog will transition to a new internal format, which is referred to as file-based catalogs. This is mostly a transparent change for users of the Operator Lifecycle Manager. This change impacts you if you use the OPM CLI tool to interact with the index images to filter out operators or add new Operators to it as part of release automation. New commands have been introduced to the OPM utility, which you will need to adopt.
💁 What is a file-based catalog?
Catalogs are responsible for publishing operators, including their entire version history and update graphs. In addition, they make operators installable via the Operator Lifecycle Manager. Today, they are internally based SQLite databases stored in the container image from the content served to the cluster via GRPC APIs to be consumed by OLM. A file-based catalogs is based on a declarative file format that defines the content of a catalog in
JSON
orYAML
. The GRPC interface remains the same.Cluster administrators and tenants should not see any change to their install workflows and operator consumption with the new format.
Suppose you interact directly with the internal SQLite database or use OPM commands to manipulate the community catalog. In that case, you will need to adopt the new format (see more details below). To know more about this format see the file-based catalog doc.
🙋 Why are we changing the format?
The SQLite format used posed a number of challenges, like as:
Those are some motivations for OLM is moving away from the SQLite database as a storage mechanism. Instead, indexes will serve a plain text-based (
JSON
orYAML
) set of files. The new format allows for a declarative nature of manipulate content, GitOps-friendly, fully automated approach to maintaining operator catalogs.🚀 What does that mean for you?
The conversion to file-based catalogs impacts the following actions:
The
opm index
andopm registry
commands that interact with the SQLite database are deprecated as of Openshift4.9
.This will impact your QE workflow, disconnected customer installs, and CI pipelines that interact with the product catalogs. Make ensure that you read the following sections to know how to deal with the changes.
✨ Otherwise, you are NOT impacted.
You are likely not impacted if you are only using catalog images to create catalog sources for OLM (to consume the OperatotHub Index catalog via OLM on the clusters)
Or if you only distribute your Operators by creating a PR in this repository. Nothing will change for you at the first moment. You will still be publishing your projects as you have been using the PR-based contribution process in this project.
If your workflow is not impacted, you can stop reading now and ignore the rest of this document.
OPM users need to shift from an imperative mindset (where their interaction with the index is limited by OPM APIs) to a declarative one (where they can declare their update graph looks like). Instead of starting with an empty catalog image and incrementally adding content with imperative commands like
opm index add
aYAML
file is now the source of truth of what should be in a catalog. OPM will build the catalog reproducible from that file.A new set of commands has been created for FBC indexes, but these are limited to:
$ opm migrate
$ opm init
$ opm render
cp
andrm -rf
to remove to achieve the result of having just a set of the packages. NOTE:opm index prune
may be updated in the future to support both formats.$ opm serve
$ opm alpha generate dockerfile <directory>
The
opm index
andopm registry
commands do not work against an FBC index.Commands like
opm index add
are no longer provided as APIs to interact with the index. Instead, FBC users can create their scripts or programs for modifying the FBC in equivalent or custom ways.💁 What does this means if you:
👉 filter catalogs for content via tools or scripts or if you query catalog content
There is no SQLite database anymore to query the content of a catalog. Instead, you can now introspect a
YAML/JSON
file to verify catalog content.💡 You can use jq commands or scripts able to work with its
JSON/YAML
formats. Also, you might would like to use Golang to build the scripts you might want to import the methods provided by operator-registry to work with it. See DeclarativeConfig definition.👉 debug the images
You might have a better debugging experience where introspecting the index image and understanding what update graph edges and operator versions exist is now more accessible, see:
$ opm render
$ opm alpha list
opm render
.👉 prune catalogs to reduce the catalogue size to just a set of operators
Commands like
cp
andrm -rf
to reduce the catalogue size to just the set of operators required for the new format tag.👉 build new catalogs from scratch and/or modify and re-publish catalogs using OPM
Catalog modifiers (people editing the OperatorHub catalogs) will be impacted depending on how they are doing the modifications. Any workflow based on retrieving and modifying the
index.db
file, will not be functional for anFBC
index.Consumers of catalogs who don't control the creation of those catalogs should be prepared to handle both SQLite and FBC catalogs. Note that OperatorHub will be pivoting its catalogs to FBC (Check the section
When will it happen? What are the timelines?
).Please, check the Creating a Catalog doc to know how to create new indexes.
💡 Tips to work with the new FBC format in this transition period or for testing purposes
You can produce the SQL index and then
render/migrate
the content for the new format. In this case, following some tips:opm registry
instead ofopm index
. (e.gopm registry add [options]
).opm index
commands are provided viaopm registry
, less the option to remove the package from the index.rm -rf
to remove the package directory from your file system. OPM does not offeropm registry rm <package>
.opm render
oropm migrate
commands to output the index in your file system in the new format. (e.g.opm migrate quay.io/operatorhubio/catalog my-fbc-dir
)opm alpha generate dockerfile [options]
to generate the index image based on the FBC in your file system and to be able to publish it (e.g.opm alpha generate dockerfile my-fbc-dir
)IMPORTANT: ensure that you will use the latest OPM releases.
🚀 How can I start to consume the new format?
To help you out be adapted, a temporary tag
tmp_latest_fbc
was created. You can use it to check if you or your workflows will be impacted as to working on the required changes.🙇 I cannot start to consume the new format. I need more time to be adapted. What can I do?
If you know that will be impacted and cannot address the required changes:
You can replace the
latest
tag with the new temporarytmp_latest_sql
tag in your workflows to avoid any impact.The quay.io/operatorhubio/catalog:tmp_latest_sql contains the same content with the SQLite database storage mechanism.
⏰ When will it happen? What are the timelines?
quay.io/operatorhubio/catalog:latest
tag will begin to be provided with FBC format.quay.io/operatorhubio/catalog:tmp_latest_fbc
tag created to help you out will be removed.quay.io/operatorhubio/catalog:tmp_latest_sql
tag created to help you out will be removed.💡 How can I migrate an Index catalog from SQLite to FBC format locally and test it out?
Following the steps using the
quay.io/operatorhubio/catalog:tmp_latest_sql
index as an example.opm migrate or render
commands to convert the image format:Now, you can check the image content in the directory created using the FBC format.
Now, you can use this image to check the impact in your workflows or to just check its consumption in a cluster by creating a
CatalogSource
to verify it (More info).Beta Was this translation helpful? Give feedback.
All reactions