Skip to content

Commit e62d9c8

Browse files
committed
feat : Feast Operator support log level configuration for services
Signed-off-by: Abdul Hameed <ahameed@redhat.com>
1 parent 6089905 commit e62d9c8

File tree

5 files changed

+105
-5
lines changed

5 files changed

+105
-5
lines changed

infra/feast-operator/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
2929
#
3030
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
3131
# feast.dev/feast-operator-bundle:$VERSION and feast.dev/feast-operator-catalog:$VERSION.
32-
IMAGE_TAG_BASE ?= feastdev/feast-operator
32+
IMAGE_TAG_BASE ?= quay.io/ahameed/feast-operator
3333

3434
# BUNDLE_IMG defines the image:tag used for the bundle.
3535
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
@@ -65,7 +65,7 @@ endif
6565
# Be aware that the target commands are only tested with Docker which is
6666
# scaffolded by default. However, you might want to replace it to use other
6767
# tools. (i.e. podman)
68-
CONTAINER_TOOL ?= docker
68+
CONTAINER_TOOL ?= podman
6969

7070
# Setting SHELL to bash allows bash commands to be executed by recipes.
7171
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
@@ -142,7 +142,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
142142
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
143143
.PHONY: docker-build
144144
docker-build: ## Build docker image with the manager.
145-
$(CONTAINER_TOOL) build -t ${IMG} .
145+
$(CONTAINER_TOOL) build --platform linux/arm64 -t ${IMG} .
146146

147147
## Build feast docker image.
148148
.PHONY: feast-docker-build
@@ -280,7 +280,7 @@ bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metada
280280

281281
.PHONY: bundle-build
282282
bundle-build: ## Build the bundle image.
283-
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
283+
docker build --platform linux/arm64 -f bundle.Dockerfile -t $(BUNDLE_IMG) .
284284

285285
.PHONY: bundle-push
286286
bundle-push: ## Push the bundle image.

infra/feast-operator/api/v1alpha1/featurestore_types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ type OfflineTlsConfigs struct {
8484
TlsConfigs `json:",inline"`
8585
// verify the client TLS certificate.
8686
VerifyClient *bool `json:"verifyClient,omitempty"`
87+
// LogLevel sets the logging level for the offline store service
88+
// Allowed values: "debug", "info", "warning", "error", "critical".
89+
// +kubebuilder:validation:Enum=debug;info;warning;error;critical
90+
LogLevel string `json:"logLevel,omitempty"`
8791
}
8892

8993
// OfflineStorePersistence configures the persistence settings for the offline store service
@@ -128,6 +132,10 @@ type OnlineStore struct {
128132
ServiceConfigs `json:",inline"`
129133
Persistence *OnlineStorePersistence `json:"persistence,omitempty"`
130134
TLS *TlsConfigs `json:"tls,omitempty"`
135+
// LogLevel sets the logging level for the online store service
136+
// Allowed values: "debug", "info", "warning", "error", "critical".
137+
// +kubebuilder:validation:Enum=debug;info;warning;error;critical
138+
LogLevel string `json:"logLevel,omitempty"`
131139
}
132140

133141
// OnlineStorePersistence configures the persistence settings for the online store service
@@ -240,6 +248,10 @@ type PvcCreate struct {
240248
type Registry struct {
241249
Local *LocalRegistryConfig `json:"local,omitempty"`
242250
Remote *RemoteRegistryConfig `json:"remote,omitempty"`
251+
// LogLevel sets the logging level for the registry service
252+
// Allowed values: "debug", "info", "warning", "error", "critical".
253+
// +kubebuilder:validation:Enum=debug;info;warning;error;critical
254+
LogLevel string `json:"logLevel,omitempty"`
243255
}
244256

245257
// RemoteRegistryConfig points to a remote feast registry server. When set, the operator will not deploy a registry for this FeatureStore CR.

infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,17 @@ spec:
203203
description: PullPolicy describes a policy for if/when to
204204
pull a container image
205205
type: string
206+
logLevel:
207+
description: |-
208+
LogLevel sets the logging level for the offline store service
209+
Allowed values: "debug", "info", "warning", "error", "critical".
210+
enum:
211+
- debug
212+
- info
213+
- warning
214+
- error
215+
- critical
216+
type: string
206217
persistence:
207218
description: OfflineStorePersistence configures the persistence
208219
settings for the offline store service
@@ -550,6 +561,17 @@ spec:
550561
description: PullPolicy describes a policy for if/when to
551562
pull a container image
552563
type: string
564+
logLevel:
565+
description: |-
566+
LogLevel sets the logging level for the online store service
567+
Allowed values: "debug", "info", "warning", "error", "critical".
568+
enum:
569+
- debug
570+
- info
571+
- warning
572+
- error
573+
- critical
574+
type: string
553575
persistence:
554576
description: OnlineStorePersistence configures the persistence
555577
settings for the online store service
@@ -1149,6 +1171,17 @@ spec:
11491171
rule: '(!has(self.disable) || !self.disable) ? has(self.secretRef)
11501172
: true'
11511173
type: object
1174+
logLevel:
1175+
description: |-
1176+
LogLevel sets the logging level for the registry service
1177+
Allowed values: "debug", "info", "warning", "error", "critical".
1178+
enum:
1179+
- debug
1180+
- info
1181+
- warning
1182+
- error
1183+
- critical
1184+
type: string
11521185
remote:
11531186
description: |-
11541187
RemoteRegistryConfig points to a remote feast registry server. When set, the operator will not deploy a registry for this FeatureStore CR.
@@ -1373,6 +1406,17 @@ spec:
13731406
description: PullPolicy describes a policy for if/when
13741407
to pull a container image
13751408
type: string
1409+
logLevel:
1410+
description: |-
1411+
LogLevel sets the logging level for the offline store service
1412+
Allowed values: "debug", "info", "warning", "error", "critical".
1413+
enum:
1414+
- debug
1415+
- info
1416+
- warning
1417+
- error
1418+
- critical
1419+
type: string
13761420
persistence:
13771421
description: OfflineStorePersistence configures the persistence
13781422
settings for the offline store service
@@ -1725,6 +1769,17 @@ spec:
17251769
description: PullPolicy describes a policy for if/when
17261770
to pull a container image
17271771
type: string
1772+
logLevel:
1773+
description: |-
1774+
LogLevel sets the logging level for the online store service
1775+
Allowed values: "debug", "info", "warning", "error", "critical".
1776+
enum:
1777+
- debug
1778+
- info
1779+
- warning
1780+
- error
1781+
- critical
1782+
type: string
17281783
persistence:
17291784
description: OnlineStorePersistence configures the persistence
17301785
settings for the online store service
@@ -2335,6 +2390,17 @@ spec:
23352390
rule: '(!has(self.disable) || !self.disable) ? has(self.secretRef)
23362391
: true'
23372392
type: object
2393+
logLevel:
2394+
description: |-
2395+
LogLevel sets the logging level for the registry service
2396+
Allowed values: "debug", "info", "warning", "error", "critical".
2397+
enum:
2398+
- debug
2399+
- info
2400+
- warning
2401+
- error
2402+
- critical
2403+
type: string
23382404
remote:
23392405
description: |-
23402406
RemoteRegistryConfig points to a remote feast registry server. When set, the operator will not deploy a registry for this FeatureStore CR.

infra/feast-operator/config/manager/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
55
images:
66
- name: controller
7-
newName: feastdev/feast-operator
7+
newName: quay.io/ahameed/feast-operator
88
newTag: 0.41.0

infra/feast-operator/internal/controller/services/services.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ func (feast *FeastServices) getContainerCommand(feastType FeastServiceType) []st
358358
deploySettings := FeastServiceConstants[feastType]
359359
targetPort := deploySettings.TargetHttpPort
360360
tls := feast.getTlsConfigs(feastType)
361+
logLevel := feast.getLogLevelForType(feastType)
361362
if tls.IsTLS() {
362363
targetPort = deploySettings.TargetHttpsPort
363364
feastTlsPath := GetTlsPath(feastType)
@@ -372,6 +373,7 @@ func (feast *FeastServices) getContainerCommand(feastType FeastServiceType) []st
372373
[]string{"--verify_client", strconv.FormatBool(*feast.Handler.FeatureStore.Status.Applied.Services.OfflineStore.TLS.VerifyClient)}...)
373374
}
374375
}
376+
deploySettings.Command = append(deploySettings.Command, "--log-level="+strings.ToUpper(logLevel))
375377

376378
return deploySettings.Command
377379
}
@@ -474,6 +476,26 @@ func (feast *FeastServices) getServiceConfigs(feastType FeastServiceType) feastd
474476
return feastdevv1alpha1.ServiceConfigs{}
475477
}
476478

479+
func (feast *FeastServices) getLogLevelForType(feastType FeastServiceType) string {
480+
services := feast.Handler.FeatureStore.Status.Applied.Services
481+
defaultLogLevel := "info"
482+
switch feastType {
483+
case OfflineFeastType:
484+
if services.OfflineStore != nil && services.OfflineStore.LogLevel != "" {
485+
return services.OfflineStore.LogLevel
486+
}
487+
case OnlineFeastType:
488+
if services.OnlineStore != nil && services.OnlineStore.LogLevel != "" {
489+
return services.OnlineStore.LogLevel
490+
}
491+
case RegistryFeastType:
492+
if services.Registry != nil && services.Registry.LogLevel != "" {
493+
return services.Registry.LogLevel
494+
}
495+
}
496+
return defaultLogLevel
497+
}
498+
477499
// GetObjectMeta returns the feast k8s object metadata
478500
func (feast *FeastServices) GetObjectMeta(feastType FeastServiceType) metav1.ObjectMeta {
479501
return metav1.ObjectMeta{Name: feast.GetFeastServiceName(feastType), Namespace: feast.Handler.FeatureStore.Namespace}

0 commit comments

Comments
 (0)