📢 Community Catalog will adopt a new format #512
Replies: 7 comments 1 reply
-
From contributor point of view, If you are just creating PRs, no change is needed. Index format change will be a change behind the scenes, OLM will behave the same. |
Beta Was this translation helpful? Give feedback.
-
For those building catalogs that you intend to consume on OpenShift 4.6-4.9, you MUST embed the CSV and CRDs in the Unless the PackageServer component is updated on all versions of OpenShift, your catalogs simply won't work unless this is done. https://olm.operatorframework.io/docs/reference/file-based-catalogs/#olmbundleobject-alpha |
Beta Was this translation helpful? Give feedback.
-
🚀**(Reminder) The FBC changes are planned to roll out soon.** This is a reminder that: On Feb. 8th: The |
Beta Was this translation helpful? Give feedback.
-
🚀 The FBC changes rolled out.From Feb. 9th: The v4.11 tag of the RedHat Community index image (https://registry.redhat.io/redhat/community-operator-index:v4.11) are using the file-based catalogs. (All the other previous tags, < v4.11, will keep using the existing SQLite format) |
Beta Was this translation helpful? Give feedback.
-
Would it be possible to get an example workflow of pruning the upstream catalog index of all for specified operators? Do all i have to do is replace the 'opm index prune' command with 'rm' commands to get this working agian? The current sqlite workflow i have is:
A working example would be super helpful in helping folks with 'disconnected' requirements |
Beta Was this translation helpful? Give feedback.
-
We're just updating our clusters to v4.11 and just stumbled across this... We use However there is no real easy documentation which explains how to either prune or build an image with redhat operators using this new method that makes the transition easy. The documentation is still based around the sqlite method which now appears is nearly a year out of date... I think @camilamacedo86 response in #793 does have a method... but it would be better if this could be reflected in the official redhat documentation... |
Beta Was this translation helpful? Give feedback.
-
📢 Community Catalog will adopt a new format ( from 4.11+ released tags )
The 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:
oc adm catalog mirror
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
.👉 mirror catalogs for disconnected usage with Openshift
For disconnected installs, cluster administrators will need to use:
cp
andrm -rf
to reduce the catalogue size to just the set of operators required on the4.11
tag catalogs to mirror only a subset of operators from catalogs shipped with OpenShift.oc
tool for theoc adm catalog mirror
command to work on the community operator catalog images with OCP release tag4.9
or higher.👉 build new catalogs from scratch and/or modify and re-publish catalogs using OPM
Catalog modifiers (people editing the redhat 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 Red Hat will be pivoting its official catalogs to FBC from OpenShift
4.11
release and its tags versions.Please, check the Creating a file-based catalog image 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 registry.redhat.io/redhat/community-operator-index4.9 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.
⏰ When will it happen? What are the tag versions which will be impacted?
Nothing will change for the Openshift tags released up to
4.10
.However, the new format will begin to be used from the
4.11+
tags released.❓ FAQs:
What are the Openshift/OLM versions which can consume file-based catalog?
The GRPC APIs are backwards compatible so, you can consume file-based catalogs from OpenShift
4.6+
.Where are the catalog images built from this repository?
The content merged in this repository is used to create the following catalogs:
registry.redhat.io/redhat/community-operator-index
This image can be used with Openshift and OKD as any Kubernetes vendor with OLM installed.
Beta Was this translation helpful? Give feedback.
All reactions