Skip to content

Commit f41c684

Browse files
OCPBUGS-17157: registry: implement memory targets on gRPC servers (#3004)
* go.mod: update operator-framework/api $ GOPROXY=direct go get github.com/operator-framework/api@master $ GOPROXY=direct go mod tidy $ GOPROXY=direct go mod vendor $ make gen-all Signed-off-by: Steve Kuznetsov <[email protected]> * registry: implement memory targets on gRPC servers This commit implements the GoDoc on the new CatalogSource field, adding memory requests, limits and $GOMEMLIMIT values for sources that opt into a memory target. Signed-off-by: Steve Kuznetsov <[email protected]> --------- Signed-off-by: Steve Kuznetsov <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: 2c3928ec460a9354cb8d840da92d90900075e94d Signed-off-by: Steve Kuznetsov <[email protected]>
1 parent 89c9cb7 commit f41c684

File tree

11 files changed

+332
-72
lines changed

11 files changed

+332
-72
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37
1414
github.com/onsi/ginkgo/v2 v2.9.5
1515
github.com/openshift/api v3.9.0+incompatible
16-
github.com/operator-framework/api v0.17.7
16+
github.com/operator-framework/api v0.17.8-0.20230803152844-704ae942c4a9
1717
github.com/operator-framework/operator-lifecycle-manager v0.0.0-00010101000000-000000000000
1818
github.com/operator-framework/operator-registry v1.27.1
1919
github.com/sirupsen/logrus v1.9.2

pkg/manifests/csv.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
name: packageserver
66
namespace: openshift-operator-lifecycle-manager
77
labels:
8-
olm.version: 0.0.0-ee4bc498873f18daef46f5b1e443f5abdb9732c9
8+
olm.version: 0.19.0
99
olm.clusteroperator.name: operator-lifecycle-manager-packageserver
1010
annotations:
1111
include.release.openshift.io/self-managed-high-availability: "true"
@@ -159,7 +159,7 @@ spec:
159159
- packageserver
160160
topologyKey: "kubernetes.io/hostname"
161161
maturity: alpha
162-
version: 0.0.0-ee4bc498873f18daef46f5b1e443f5abdb9732c9
162+
version: 0.19.0
163163
apiservicedefinitions:
164164
owned:
165165
- group: packages.operators.coreos.com

staging/operator-lifecycle-manager/deploy/chart/crds/0000_50_olm_00-catalogsources.crd.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,13 @@ 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+
memoryTarget:
536+
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 - the memory limit will be set to 200% of 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."
537+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
538+
anyOf:
539+
- type: integer
540+
- type: string
541+
x-kubernetes-int-or-string: true
535542
nodeSelector:
536543
description: NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node.
537544
type: object

staging/operator-lifecycle-manager/deploy/chart/crds/0000_50_olm_00-clusterserviceversions.crd.yaml

+88-37
Large diffs are not rendered by default.

staging/operator-lifecycle-manager/deploy/chart/crds/0000_50_olm_00-subscriptions.crd.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ spec:
644644
type: object
645645
properties:
646646
claims:
647-
description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable."
647+
description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable. It can only be set for containers."
648648
type: array
649649
items:
650650
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -668,7 +668,7 @@ spec:
668668
- type: string
669669
x-kubernetes-int-or-string: true
670670
requests:
671-
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
671+
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
672672
type: object
673673
additionalProperties:
674674
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
@@ -1002,7 +1002,7 @@ spec:
10021002
description: 'medium represents what type of storage medium should back this directory. The default is "" which means to use the node''s default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir'
10031003
type: string
10041004
sizeLimit:
1005-
description: 'sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir'
1005+
description: 'sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir'
10061006
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
10071007
anyOf:
10081008
- type: integer
@@ -1070,7 +1070,7 @@ spec:
10701070
type: object
10711071
properties:
10721072
claims:
1073-
description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable."
1073+
description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable. It can only be set for containers."
10741074
type: array
10751075
items:
10761076
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
@@ -1094,7 +1094,7 @@ spec:
10941094
- type: string
10951095
x-kubernetes-int-or-string: true
10961096
requests:
1097-
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
1097+
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
10981098
type: object
10991099
additionalProperties:
11001100
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$

staging/operator-lifecycle-manager/go.mod

+10-9
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ require (
2424
github.com/onsi/gomega v1.27.7
2525
github.com/openshift/api v3.9.0+incompatible
2626
github.com/openshift/client-go v0.0.0-20220525160904-9e1acff93e4a
27-
github.com/operator-framework/api v0.17.6
27+
github.com/operator-framework/api v0.17.8-0.20230803152844-704ae942c4a9
2828
github.com/operator-framework/operator-registry v1.27.1
2929
github.com/otiai10/copy v1.2.0
3030
github.com/pkg/errors v0.9.1
3131
github.com/prometheus/client_golang v1.15.1
3232
github.com/prometheus/client_model v0.4.0
3333
github.com/prometheus/common v0.42.0
34-
github.com/sirupsen/logrus v1.9.0
35-
github.com/spf13/cobra v1.6.1
34+
github.com/sirupsen/logrus v1.9.2
35+
github.com/spf13/cobra v1.7.0
3636
github.com/spf13/pflag v1.0.5
37-
github.com/stretchr/testify v1.8.2
37+
github.com/stretchr/testify v1.8.3
3838
golang.org/x/net v0.10.0
3939
golang.org/x/time v0.3.0
40-
google.golang.org/grpc v1.53.0
40+
google.golang.org/grpc v1.54.0
4141
gopkg.in/yaml.v2 v2.4.0
4242
helm.sh/helm/v3 v3.12.2
4343
k8s.io/api v0.27.2
@@ -73,7 +73,7 @@ require (
7373
github.com/NYTimes/gziphandler v1.1.1 // indirect
7474
github.com/adrg/xdg v0.4.0 // indirect
7575
github.com/alessio/shellescape v1.4.1 // indirect
76-
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
76+
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
7777
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect
7878
github.com/beorn7/perks v1.0.1 // indirect
7979
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
@@ -118,7 +118,7 @@ require (
118118
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
119119
github.com/golang/protobuf v1.5.3 // indirect
120120
github.com/google/btree v1.0.1 // indirect
121-
github.com/google/cel-go v0.12.6 // indirect
121+
github.com/google/cel-go v0.15.3 // indirect
122122
github.com/google/gnostic v0.5.7-v3refs // indirect
123123
github.com/google/gofuzz v1.2.0 // indirect
124124
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
@@ -136,7 +136,7 @@ require (
136136
github.com/hashicorp/go-multierror v1.1.1 // indirect
137137
github.com/huandu/xstrings v1.4.0 // indirect
138138
github.com/imdario/mergo v0.3.13 // indirect
139-
github.com/inconshreveable/mousetrap v1.0.1 // indirect
139+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
140140
github.com/itchyny/astgen-go v0.0.0-20200519013840-cf3ea398f645 // indirect
141141
github.com/jmoiron/sqlx v1.3.5 // indirect
142142
github.com/josharian/intern v1.0.0 // indirect
@@ -204,6 +204,7 @@ require (
204204
go.uber.org/multierr v1.6.0 // indirect
205205
go.uber.org/zap v1.24.0 // indirect
206206
golang.org/x/crypto v0.7.0 // indirect
207+
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
207208
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
208209
golang.org/x/mod v0.10.0 // indirect
209210
golang.org/x/oauth2 v0.5.0 // indirect
@@ -215,7 +216,7 @@ require (
215216
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
216217
gomodules.xyz/jsonpatch/v2 v2.3.0 // indirect
217218
google.golang.org/appengine v1.6.7 // indirect
218-
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
219+
google.golang.org/genproto v0.0.0-20230525154841-bd750badd5c6 // indirect
219220
google.golang.org/protobuf v1.30.0 // indirect
220221
gopkg.in/inf.v0 v0.9.1 // indirect
221222
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect

0 commit comments

Comments
 (0)