Skip to content

Commit

Permalink
Setting up File Based Catalogs for CSM Operator (#834)
Browse files Browse the repository at this point in the history
* yaml to generate catalog image

* updated catalog file by catalog template method

* Updating comments

* lint update

* lint validate
  • Loading branch information
panigs7 authored Dec 23, 2024
1 parent d825739 commit c23d80c
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 5 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ ifneq ($(origin CATALOG_BASE_IMG), undefined)
FROM_INDEX_OPT := --from-index $(CATALOG_BASE_IMG)
endif

# NOTE: Please use `make catalog-build-fbc` instead as we are moving to File based Catalogs
# Build a catalog image by adding bundle images to an empty catalog using the operator package manager tool, 'opm'.
# This recipe invokes 'opm' in 'semver' bundle add mode. For more information on add modes, see:
# https://github.com/operator-framework/community-operators/blob/7f1438c/docs/packaging-operator.md#updating-your-existing-operator
Expand All @@ -264,4 +265,9 @@ build-base-image: download-csm-common
# Download common CSM configuration file used for builds
.PHONY: download-csm-common
download-csm-common:
curl -O -L https://raw.githubusercontent.com/dell/csm/main/config/csm-common.mk
curl -O -L https://raw.githubusercontent.com/dell/csm/main/config/csm-common.mk

# build catalog image with File based catalog file
.PHONY: catalog-build-fbc
catalog-build-fbc:
podman build . -f catalog.Dockerfile -t quay.io/community-operator-pipeline-prod/dell-csm-operator-catalog:latest
2 changes: 0 additions & 2 deletions bundle/manifests/dell-csm-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4525,6 +4525,4 @@ spec:
name: externalhealthmonitorcontroller
- image: quay.io/dell/container-storage-modules/csi-metadata-retriever:v1.10.0
name: metadataretriever
skips:
- dell-csm-operator.v1.7.0
version: 1.8.0
44 changes: 44 additions & 0 deletions catalog-template/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This Makefile provides a set of targets to generate and validate operator catalogs
# using the Operator Package Manager (opm) tool.

# A user can customize "catalog" target to generate the operator catalog in a way
# that suits the operator.
# CSM Operator uses basic template to generate basic catalog

PDW=$(shell pwd)
TOPDIR=$(abspath $(dir $(PWD))/../)
BINDIR=${TOPDIR}/bin

# Add the bin directory to the PATH
export PATH := $(BINDIR):$(PATH)

# Generate your catalog.yaml
.PHONY: catalogs
catalogs: basic

# basic target provides an example FBC generation from a `basic` template type.
# this example takes a single file as input and generates a well-formed FBC operator contribution as an output
.PHONY: basic
basic: ${BINDIR}/opm clean
${BINDIR}/opm alpha render-template basic -o yaml ${TOPDIR}/csm-operator/catalog-template/csm-operator-template.yaml > ${TOPDIR}/csm-operator/catalog/csm-operator/catalog.yaml;

# validate-catalogs target illustrates FBC validation
# all FBC must pass opm validation in order to be able to be used in a catalog
.PHONY: validate-catalogs
validate-catalogs: ${BINDIR}/opm
${BINDIR}/opm validate ${TOPDIR}/csm-operator/catalog/csm-operator/ && echo "catalog validation passed" || echo "catalog validation failed";

.PHONY: clean
clean:
rm -f ${TOPDIR}/csm-operator/catalog/csm-operator/catalog.yaml


OS=$(shell uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(shell uname -m | sed 's/x86_64/amd64/')

# Automatically download the opm binary
OPM_VERSION ?= v1.46.0
${BINDIR}/opm:
if [ ! -d ${BINDIR} ]; then mkdir -p ${BINDIR}; fi
curl -sLO https://github.com/operator-framework/operator-registry/releases/download/$(OPM_VERSION)/$(OS)-$(ARCH)-opm && chmod +x $(OS)-$(ARCH)-opm && mv $(OS)-$(ARCH)-opm ${BINDIR}/opm

26 changes: 26 additions & 0 deletions catalog-template/csm-operator-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
entries:
- defaultChannel: stable
icon:
base64data: iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAYAAABpYH0BAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAALiMAAC4jAXilP3YAAAtlSURBVGhD7ZoNcFXFFcfPfS8JSdBQG5GK38PUDwhFkgAiLQ5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aBO80vPNjS4awnT6dw0v7u6W96U5oOIfBvo2e+cjj1POsWF/UAIxgKR/wVO9b1HvI5/hgGo/o3bv3bnYkP0b2EixN6ijj0fFATA+0RnsaI/5G3Vl5dCSRRsvo1Eg6t4zyJHVplSnmzJkzlGw2qUt/0501a9YH6N7Oy8hnYN5IdaXHeHqrXa50BMqo+5CuskpkZWWp8YopvsHgP6b9auQzoJv04IFTtBwJxrOEerczBl30PDDecbzMR3EinTkLWZTOsiKFxtCGKAPSQd1GNL1JOnI3HdiOK+uq+iIsDeyrsP6TdO5zOnIlD57Jg15Cvor2efB00dhPvQ+pH5rKHujEQfjv2fKH1I36dythQ7cN+u1XPeIaUh/0vor+lSwKumrfh2792KTXXO9qPeTKX8L0Xq59ZKv1Crr1E0GOyvfv368hpw86Xkf+AnoehK2LUGirs41+fMl4tuszcY5iO56X0XMdvJ+yjTtAnsUO4QHtC7JV0FeRWn6V/LaBAWeSor7hQN9F8rZiXUV0IPgWAo8dxcyoYCrejHd9ircN01DQ0NBwBdO5y1/2vvUGVOBt55Pp9kr3qXqz/jsMq6trFyHyX+sbEAjrhciCAAAAAElFTkSuQmCC
mediatype: image/png
name: dell-csm-operator
schema: olm.package
- entries:
- name: dell-csm-operator.v1.6.1
- name: dell-csm-operator.v1.7.0
skips:
- dell-csm-operator.v1.6.1
- name: dell-csm-operator.v1.8.0
skips:
- dell-csm-operator.v1.7.0
name: stable
package: dell-csm-operator
schema: olm.channel
- image: quay.io/community-operator-pipeline-prod/dell-csm-operator:1.6.1
schema: olm.bundle
- image: quay.io/community-operator-pipeline-prod/dell-csm-operator:1.7.0
schema: olm.bundle
- image: quay.io/community-operator-pipeline-prod/dell-csm-operator:1.8.0
schema: olm.bundle
schema: olm.template.basic
15 changes: 15 additions & 0 deletions catalog.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# The base image is expected to contain
# /bin/opm (with a serve subcommand) and /bin/grpc_health_probe
FROM quay.io/operator-framework/opm:latest

# Configure the entrypoint and command
ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]

# Copy declarative config root into image at /configs and pre-populate serve cache
ADD catalog /configs
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]

# Set DC-specific label for the location of the DC root directory
# in the image
LABEL operators.operatorframework.io.index.configs.v1=/configs
181 changes: 181 additions & 0 deletions catalog/csm-operator/catalog.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1792,6 +1792,4 @@ spec:
name: externalhealthmonitorcontroller
- image: quay.io/dell/container-storage-modules/csi-metadata-retriever:v1.10.0
name: metadataretriever
skips:
- dell-csm-operator.v1.7.0
version: 1.8.0

0 comments on commit c23d80c

Please sign in to comment.