Skip to content

Commit

Permalink
fix the loglevel command
Browse files Browse the repository at this point in the history
Signed-off-by: Abdul Hameed <[email protected]>
  • Loading branch information
redhatHameed committed Dec 5, 2024
1 parent e2b0b8f commit b164c93
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: feast.dev/v1alpha1
kind: FeatureStore
metadata:
name: sample-services-loglevel
spec:
feastProject: my_project
services:
onlineStore:
logLevel: debug
offlineStore:
logLevel: debug
registry:
logLevel: info
local:
persistence:
file:
path: /data/registry.db
21 changes: 14 additions & 7 deletions infra/feast-operator/internal/controller/services/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,29 +355,36 @@ func (feast *FeastServices) setDeployment(deploy *appsv1.Deployment, feastType F
}

func (feast *FeastServices) getContainerCommand(feastType FeastServiceType) []string {
deploySettings := FeastServiceConstants[feastType]
targetPort := deploySettings.TargetHttpPort
baseCommand := "feast"
options := []string{}
logLevel := feast.getLogLevelForType(feastType)
if logLevel != nil {
deploySettings.Command = append(deploySettings.Command, []string{"--log-level", strings.ToUpper(*logLevel)}...)
options = append(options, "--log-level", strings.ToUpper(*logLevel))
}

deploySettings := FeastServiceConstants[feastType]
targetPort := deploySettings.TargetHttpPort
tls := feast.getTlsConfigs(feastType)
if tls.IsTLS() {
targetPort = deploySettings.TargetHttpsPort
feastTlsPath := GetTlsPath(feastType)
deploySettings.Command = append(deploySettings.Command, []string{"--key", feastTlsPath + tls.SecretKeyNames.TlsKey,
deploySettings.Args = append(deploySettings.Args, []string{"--key", feastTlsPath + tls.SecretKeyNames.TlsKey,
"--cert", feastTlsPath + tls.SecretKeyNames.TlsCrt}...)
}
deploySettings.Command = append(deploySettings.Command, []string{"-p", strconv.Itoa(int(targetPort))}...)
deploySettings.Args = append(deploySettings.Args, []string{"-p", strconv.Itoa(int(targetPort))}...)

if feastType == OfflineFeastType {
if tls.IsTLS() && feast.Handler.FeatureStore.Status.Applied.Services.OfflineStore.TLS.VerifyClient != nil {
deploySettings.Command = append(deploySettings.Command,
deploySettings.Args = append(deploySettings.Args,
[]string{"--verify_client", strconv.FormatBool(*feast.Handler.FeatureStore.Status.Applied.Services.OfflineStore.TLS.VerifyClient)}...)
}
}

return deploySettings.Command
// Combine base command, options, and arguments
feastCommand := append([]string{baseCommand}, options...)
feastCommand = append(feastCommand, deploySettings.Args...)

return feastCommand
}

func (feast *FeastServices) offlineClientPodConfigs(podSpec *corev1.PodSpec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ var (

FeastServiceConstants = map[FeastServiceType]deploymentSettings{
OfflineFeastType: {
Command: []string{"feast", "serve_offline", "-h", "0.0.0.0"},
Args: []string{"serve_offline", "-h", "0.0.0.0"},
TargetHttpPort: 8815,
TargetHttpsPort: 8816,
},
OnlineFeastType: {
Command: []string{"feast", "serve", "-h", "0.0.0.0"},
Args: []string{"serve", "-h", "0.0.0.0"},
TargetHttpPort: 6566,
TargetHttpsPort: 6567,
},
RegistryFeastType: {
Command: []string{"feast", "serve_registry"},
Args: []string{"serve_registry"},
TargetHttpPort: 6570,
TargetHttpsPort: 6571,
},
Expand Down Expand Up @@ -218,7 +218,7 @@ type AuthzConfig struct {
}

type deploymentSettings struct {
Command []string
Args []string
TargetHttpPort int32
TargetHttpsPort int32
}

0 comments on commit b164c93

Please sign in to comment.