Skip to content

Commit

Permalink
feat: support pin mo binary in memory (#568)
Browse files Browse the repository at this point in the history
Signed-off-by: Aylei <[email protected]>
aylei authored Nov 21, 2024
1 parent 684a75a commit cc55f8a
Showing 26 changed files with 377 additions and 2 deletions.
5 changes: 5 additions & 0 deletions api/core/v1alpha1/common_types.go
Original file line number Diff line number Diff line change
@@ -117,6 +117,11 @@ type PodSet struct {
// OperatorVersion is the controller version of mo-operator that should be used to
// reconcile this set
OperatorVersion *string `json:"operatorVersion,omitempty"`

// MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
// Binary would be loaded from disk if MemoryFsSize is not set
// +optional
MemoryFsSize *resource.Quantity `json:"memoryFsSize,omitempty"`
}

// MainContainer is the description of the main container of a Pod
4 changes: 4 additions & 0 deletions api/core/v1alpha1/matrixonecluster_types.go
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

@@ -99,6 +100,9 @@ type MatrixOneClusterSpec struct {
SemanticVersion *string `json:"semanticVersion,omitempty"`

OperatorVersion *string `json:"operatorVersion,omitempty"`

// +optional
MemoryFsSize *resource.Quantity `json:"memoryFsSize,omitempty"`
}

func (m *MatrixOneCluster) GetMetricReaderEnabled() bool {
10 changes: 10 additions & 0 deletions api/core/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -157,6 +157,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
Original file line number Diff line number Diff line change
@@ -131,6 +131,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
Original file line number Diff line number Diff line change
@@ -112,6 +112,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
Original file line number Diff line number Diff line change
@@ -103,6 +103,15 @@ spec:
from the given path when hakeeper is bootstrapped
type: string
type: object
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
Original file line number Diff line number Diff line change
@@ -123,6 +123,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
@@ -477,6 +486,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
@@ -828,6 +846,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
@@ -1032,6 +1059,15 @@ spec:
from the given path when hakeeper is bootstrapped
type: string
type: object
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
@@ -1261,6 +1297,12 @@ spec:
- sharedStorage
- volume
type: object
memoryFsSize:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
metricReaderEnabled:
description: |-
MetricReaderEnabled enables metric reader for operator and other apps to query
@@ -1298,6 +1340,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
@@ -1488,6 +1539,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
@@ -1697,6 +1757,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
@@ -2019,6 +2088,15 @@ spec:
description: PullPolicy describes a policy for if/when to pull
a container image
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
Original file line number Diff line number Diff line change
@@ -88,6 +88,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
Original file line number Diff line number Diff line change
@@ -81,6 +81,15 @@ spec:
description: PullPolicy describes a policy for if/when to pull a container
image
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
9 changes: 9 additions & 0 deletions deploy/crds/core.matrixorigin.io_cnpools.yaml
Original file line number Diff line number Diff line change
@@ -157,6 +157,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
9 changes: 9 additions & 0 deletions deploy/crds/core.matrixorigin.io_cnsets.yaml
Original file line number Diff line number Diff line change
@@ -131,6 +131,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
9 changes: 9 additions & 0 deletions deploy/crds/core.matrixorigin.io_dnsets.yaml
Original file line number Diff line number Diff line change
@@ -112,6 +112,15 @@ spec:
image:
description: Image is the docker image of the main container
type: string
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
9 changes: 9 additions & 0 deletions deploy/crds/core.matrixorigin.io_logsets.yaml
Original file line number Diff line number Diff line change
@@ -103,6 +103,15 @@ spec:
from the given path when hakeeper is bootstrapped
type: string
type: object
memoryFsSize:
anyOf:
- type: integer
- type: string
description: |-
MemoryFsSize is the size of memory filesystem, which will be used to store matrixone binary to skip page cache overhead
Binary would be loaded from disk if MemoryFsSize is not set
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryLimitPercent:
description: |-
MemoryLimitPercent is percent used to set GOMEMLIMIT env, its value must be in interval (0, 100].
Loading

0 comments on commit cc55f8a

Please sign in to comment.