Skip to content

Commit 37c73c2

Browse files
stevekuznetsovci-robot
authored andcommitted
catalogsource: allow configuring gRPC server to use well-known opm (openshift#293)
As the file-based catalog schemas mature, the couping between `opm` and the catalog data is effectively removed. We can take advantage of this new property in the system to not require that a server binary exist in the catalog index image, and remove many of the pain-points that come from using the embedded server binary. Signed-off-by: Steve Kuznetsov <[email protected]> Upstream-repository: api Upstream-commit: 039d150defbba9f1e8cd63cf8655556c90434a2d
1 parent 0d43840 commit 37c73c2

File tree

9 files changed

+108
-2
lines changed

9 files changed

+108
-2
lines changed

manifests/0000_50_olm_00-catalogsources.crd.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,18 @@ spec:
534534
topologyKey:
535535
description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.
536536
type: string
537+
extractContent:
538+
description: ExtractContent configures the gRPC catalog Pod to extract catalog metadata from the provided index image and use a well-known version of the `opm` server to expose it. The catalog index image that this CatalogSource is configured to use *must* be using the file-based catalogs in order to utilize this feature.
539+
type: object
540+
required:
541+
- configDir
542+
properties:
543+
cacheDir:
544+
description: CacheDir is the directory storing the pre-calculated API cache.
545+
type: string
546+
configDir:
547+
description: ConfigDir is the directory storing the file-based catalog contents.
548+
type: string
537549
memoryTarget:
538550
description: "MemoryTarget configures the $GOMEMLIMIT value for the gRPC catalog Pod. This is a soft memory limit for the server, which the runtime will attempt to meet but makes no guarantees that it will do so. If this value is set, the Pod will have the following modifications made to the container running the server: - the $GOMEMLIMIT environment variable will be set to this value in bytes - the memory request will be set to this value \n This field should be set if it's desired to reduce the footprint of a catalog server as much as possible, or if a catalog being served is very large and needs more than the default allocation. If your index image has a file- system cache, determine a good approximation for this value by doubling the size of the package cache at /tmp/cache/cache/packages.json in the index image. \n This field is best-effort; if unset, no default will be used and no Pod memory limit or $GOMEMLIMIT value will be set."
539551
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

staging/api/crds/operators.coreos.com_catalogsources.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,18 @@ spec:
532532
topologyKey:
533533
description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.
534534
type: string
535+
extractContent:
536+
description: ExtractContent configures the gRPC catalog Pod to extract catalog metadata from the provided index image and use a well-known version of the `opm` server to expose it. The catalog index image that this CatalogSource is configured to use *must* be using the file-based catalogs in order to utilize this feature.
537+
type: object
538+
required:
539+
- configDir
540+
properties:
541+
cacheDir:
542+
description: CacheDir is the directory storing the pre-calculated API cache.
543+
type: string
544+
configDir:
545+
description: ConfigDir is the directory storing the file-based catalog contents.
546+
type: string
535547
memoryTarget:
536548
description: "MemoryTarget configures the $GOMEMLIMIT value for the gRPC catalog Pod. This is a soft memory limit for the server, which the runtime will attempt to meet but makes no guarantees that it will do so. If this value is set, the Pod will have the following modifications made to the container running the server: - the $GOMEMLIMIT environment variable will be set to this value in bytes - the memory request will be set to this value \n This field should be set if it's desired to reduce the footprint of a catalog server as much as possible, or if a catalog being served is very large and needs more than the default allocation. If your index image has a file- system cache, determine a good approximation for this value by doubling the size of the package cache at /tmp/cache/cache/packages.json in the index image. \n This field is best-effort; if unset, no default will be used and no Pod memory limit or $GOMEMLIMIT value will be set."
537549
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

staging/api/crds/zz_defs.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/api/pkg/operators/v1alpha1/catalogsource_types.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,22 @@ type GrpcPodConfig struct {
159159
// /tmp/cache/cache/packages.json in the index image.
160160
//
161161
// This field is best-effort; if unset, no default will be used and no Pod memory limit or $GOMEMLIMIT value will be set.
162+
// +optional
162163
MemoryTarget *resource.Quantity `json:"memoryTarget,omitempty"`
164+
165+
// ExtractContent configures the gRPC catalog Pod to extract catalog metadata from the provided index image and
166+
// use a well-known version of the `opm` server to expose it. The catalog index image that this CatalogSource is
167+
// configured to use *must* be using the file-based catalogs in order to utilize this feature.
168+
// +optional
169+
ExtractContent *ExtractContentConfig `json:"extractContent,omitempty"`
170+
}
171+
172+
// ExtractContentConfig configures context extraction from a file-based catalog index image.
173+
type ExtractContentConfig struct {
174+
// CacheDir is the directory storing the pre-calculated API cache.
175+
CacheDir string `json:"cacheDir,omitempty"`
176+
// ConfigDir is the directory storing the file-based catalog contents.
177+
ConfigDir string `json:"configDir,omitempty "`
163178
}
164179

165180
// UpdateStrategy holds all the different types of catalog source update strategies

staging/api/pkg/operators/v1alpha1/zz_generated.deepcopy.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/operator-framework/api/crds/operators.coreos.com_catalogsources.yaml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/operator-framework/api/crds/zz_defs.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/catalogsource_types.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/zz_generated.deepcopy.go

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)