services

package
v0.0.0-...-22c7b58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TmpFeatureStoreYamlEnvVar = "TMP_FEATURE_STORE_YAML_BASE64"
	FeatureStoreYamlCmKey     = "feature_store.yaml"
	EphemeralPath             = "/feast-data"
	DefaultRegistryPath       = "registry.db"
	DefaultOnlineStorePath    = "online_store.db"

	HttpPort    = 80
	HttpsPort   = 443
	HttpScheme  = "http"
	HttpsScheme = "https"

	DefaultOfflineStorageRequest  = "20Gi"
	DefaultOnlineStorageRequest   = "5Gi"
	DefaultRegistryStorageRequest = "5Gi"

	OfflineFeastType  FeastServiceType = "offline"
	OnlineFeastType   FeastServiceType = "online"
	RegistryFeastType FeastServiceType = "registry"
	ClientFeastType   FeastServiceType = "client"
	ClientCaFeastType FeastServiceType = "client-ca"

	OfflineRemoteConfigType                 OfflineConfigType = "remote"
	OfflineFilePersistenceDaskConfigType    OfflineConfigType = "dask"
	OfflineFilePersistenceDuckDbConfigType  OfflineConfigType = "duckdb"
	OfflineDBPersistenceSnowflakeConfigType OfflineConfigType = "snowflake.offline"

	OnlineRemoteConfigType                 OnlineConfigType = "remote"
	OnlineSqliteConfigType                 OnlineConfigType = "sqlite"
	OnlineDBPersistenceSnowflakeConfigType OnlineConfigType = "snowflake.online"
	OnlineDBPersistenceCassandraConfigType OnlineConfigType = "cassandra"

	RegistryRemoteConfigType                 RegistryConfigType = "remote"
	RegistryFileConfigType                   RegistryConfigType = "file"
	RegistryDBPersistenceSnowflakeConfigType RegistryConfigType = "snowflake.registry"
	RegistryDBPersistenceSQLConfigType       RegistryConfigType = "sql"

	LocalProviderType FeastProviderType = "local"

	NoAuthAuthType     AuthzType = "no_auth"
	KubernetesAuthType AuthzType = "kubernetes"
	OidcAuthType       AuthzType = "oidc"

	OidcClientId         OidcPropertyType = "client_id"
	OidcAuthDiscoveryUrl OidcPropertyType = "auth_discovery_url"
	OidcClientSecret     OidcPropertyType = "client_secret"
	OidcUsername         OidcPropertyType = "username"
	OidcPassword         OidcPropertyType = "password"

	OidcMissingSecretError string = "missing OIDC secret: %s"
)

Variables

View Source
var (
	DefaultImage          = "feastdev/feature-server:" + feastversion.FeastVersion
	DefaultReplicas       = int32(1)
	DefaultPVCAccessModes = []corev1.PersistentVolumeAccessMode{corev1.ReadWriteOnce}
	NameLabelKey          = feastdevv1alpha1.GroupVersion.Group + "/name"
	ServiceTypeLabelKey   = feastdevv1alpha1.GroupVersion.Group + "/service-type"

	FeastServiceConstants = map[FeastServiceType]deploymentSettings{
		OfflineFeastType: {
			Args:            []string{"serve_offline", "-h", "0.0.0.0"},
			TargetHttpPort:  8815,
			TargetHttpsPort: 8816,
		},
		OnlineFeastType: {
			Args:            []string{"serve", "-h", "0.0.0.0"},
			TargetHttpPort:  6566,
			TargetHttpsPort: 6567,
		},
		RegistryFeastType: {
			Args:            []string{"serve_registry"},
			TargetHttpPort:  6570,
			TargetHttpsPort: 6571,
		},
	}

	FeastServiceConditions = map[FeastServiceType]map[metav1.ConditionStatus]metav1.Condition{
		OfflineFeastType: {
			metav1.ConditionTrue: {
				Type:    feastdevv1alpha1.OfflineStoreReadyType,
				Status:  metav1.ConditionTrue,
				Reason:  feastdevv1alpha1.ReadyReason,
				Message: feastdevv1alpha1.OfflineStoreReadyMessage,
			},
			metav1.ConditionFalse: {
				Type:   feastdevv1alpha1.OfflineStoreReadyType,
				Status: metav1.ConditionFalse,
				Reason: feastdevv1alpha1.OfflineStoreFailedReason,
			},
		},
		OnlineFeastType: {
			metav1.ConditionTrue: {
				Type:    feastdevv1alpha1.OnlineStoreReadyType,
				Status:  metav1.ConditionTrue,
				Reason:  feastdevv1alpha1.ReadyReason,
				Message: feastdevv1alpha1.OnlineStoreReadyMessage,
			},
			metav1.ConditionFalse: {
				Type:   feastdevv1alpha1.OnlineStoreReadyType,
				Status: metav1.ConditionFalse,
				Reason: feastdevv1alpha1.OnlineStoreFailedReason,
			},
		},
		RegistryFeastType: {
			metav1.ConditionTrue: {
				Type:    feastdevv1alpha1.RegistryReadyType,
				Status:  metav1.ConditionTrue,
				Reason:  feastdevv1alpha1.ReadyReason,
				Message: feastdevv1alpha1.RegistryReadyMessage,
			},
			metav1.ConditionFalse: {
				Type:   feastdevv1alpha1.RegistryReadyType,
				Status: metav1.ConditionFalse,
				Reason: feastdevv1alpha1.RegistryFailedReason,
			},
		},
		ClientFeastType: {
			metav1.ConditionTrue: {
				Type:    feastdevv1alpha1.ClientReadyType,
				Status:  metav1.ConditionTrue,
				Reason:  feastdevv1alpha1.ReadyReason,
				Message: feastdevv1alpha1.ClientReadyMessage,
			},
			metav1.ConditionFalse: {
				Type:   feastdevv1alpha1.ClientReadyType,
				Status: metav1.ConditionFalse,
				Reason: feastdevv1alpha1.ClientFailedReason,
			},
		},
	}

	OidcServerProperties = []OidcPropertyType{OidcClientId, OidcAuthDiscoveryUrl}
	OidcClientProperties = []OidcPropertyType{OidcClientSecret, OidcUsername, OidcPassword}
)

Functions

func ApplyDefaultsToStatus

func ApplyDefaultsToStatus(cr *feastdevv1alpha1.FeatureStore)

func CopyMap

func CopyMap(original map[string]interface{}) map[string]interface{}

func GetFeastName

func GetFeastName(featureStore *feastdevv1alpha1.FeatureStore) string

func GetFeastServiceName

func GetFeastServiceName(featureStore *feastdevv1alpha1.FeatureStore, feastType FeastServiceType) string

GetFeastServiceName returns the feast service object name based on service type

func GetOfflineContainer

func GetOfflineContainer(containers []corev1.Container) *corev1.Container

func GetOfflineVolume

func GetOfflineVolume(featureStore *feastdevv1alpha1.FeatureStore, volumes []corev1.Volume) *corev1.Volume

func GetOfflineVolumeMount

func GetOfflineVolumeMount(featureStore *feastdevv1alpha1.FeatureStore, volumeMounts []corev1.VolumeMount) *corev1.VolumeMount

func GetOnlineContainer

func GetOnlineContainer(containers []corev1.Container) *corev1.Container

func GetOnlineVolume

func GetOnlineVolume(featureStore *feastdevv1alpha1.FeatureStore, volumes []corev1.Volume) *corev1.Volume

func GetOnlineVolumeMount

func GetOnlineVolumeMount(featureStore *feastdevv1alpha1.FeatureStore, volumeMounts []corev1.VolumeMount) *corev1.VolumeMount

func GetRegistryContainer

func GetRegistryContainer(containers []corev1.Container) *corev1.Container

func GetRegistryVolume

func GetRegistryVolume(featureStore *feastdevv1alpha1.FeatureStore, volumes []corev1.Volume) *corev1.Volume

func GetRegistryVolumeMount

func GetRegistryVolumeMount(featureStore *feastdevv1alpha1.FeatureStore, volumeMounts []corev1.VolumeMount) *corev1.VolumeMount

func GetTlsPath

func GetTlsPath(feastType FeastServiceType) string

func IsLocalRegistry

func IsLocalRegistry(featureStore *feastdevv1alpha1.FeatureStore) bool

func IsOpenShift

func IsOpenShift() bool

IsOpenShift is a global flag that can be safely called across reconciliation cycles, defined at the controller manager start.

func SetIsOpenShift

func SetIsOpenShift(cfg *rest.Config)

SetIsOpenShift sets the global flag isOpenShift by the controller manager. We don't need to keep fetching the API every reconciliation cycle that we need to know about the platform.

Types

type AuthzConfig

type AuthzConfig struct {
	Type           AuthzType              `yaml:"type,omitempty"`
	OidcParameters map[string]interface{} `yaml:",inline,omitempty"`
}

AuthzConfig is the RBAC authorization configuration.

type AuthzType

type AuthzType string

AuthzType defines the authorization type

type FeastProviderType

type FeastProviderType string

FeastProviderType defines an implementation of a feature store object

type FeastServiceType

type FeastServiceType string

FeastServiceType is the type of feast service

type FeastServices

type FeastServices struct {
	Handler handler.FeastHandler
}

FeastServices is an interface for configuring and deploying feast services

func (*FeastServices) ApplyDefaults

func (feast *FeastServices) ApplyDefaults() error

Apply defaults and set service hostnames in FeatureStore status

func (*FeastServices) Deploy

func (feast *FeastServices) Deploy() error

Deploy the feast services

func (*FeastServices) GetDefaultRepoConfig

func (feast *FeastServices) GetDefaultRepoConfig() RepoConfig

func (*FeastServices) GetFeastServiceName

func (feast *FeastServices) GetFeastServiceName(feastType FeastServiceType) string

func (*FeastServices) GetInitRepoConfig

func (feast *FeastServices) GetInitRepoConfig() RepoConfig

func (*FeastServices) GetObjectMeta

func (feast *FeastServices) GetObjectMeta() metav1.ObjectMeta

GetObjectMeta returns the feast k8s object metadata with type

func (*FeastServices) GetObjectMetaType

func (feast *FeastServices) GetObjectMetaType(feastType FeastServiceType) metav1.ObjectMeta

GetObjectMeta returns the feast k8s object metadata with type

func (*FeastServices) GetServiceFeatureStoreYamlBase64

func (feast *FeastServices) GetServiceFeatureStoreYamlBase64() (string, error)

GetServiceFeatureStoreYamlBase64 returns a base64 encoded feature_store.yaml config for the feast service

func (*FeastServices) IsRemoteRefRegistry

func (feast *FeastServices) IsRemoteRefRegistry() bool

type OfflineConfigType

type OfflineConfigType string

OfflineConfigType provider name or a class name that implements Offline Store

type OfflineStoreConfig

type OfflineStoreConfig struct {
	Host         string                 `yaml:"host,omitempty"`
	Type         OfflineConfigType      `yaml:"type,omitempty"`
	Port         int                    `yaml:"port,omitempty"`
	Scheme       string                 `yaml:"scheme,omitempty"`
	Cert         string                 `yaml:"cert,omitempty"`
	DBParameters map[string]interface{} `yaml:",inline,omitempty"`
}

OfflineStoreConfig is the configuration that relates to reading from and writing to the Feast offline store.

type OidcPropertyType

type OidcPropertyType string

OidcPropertyType defines the OIDC property type

type OnlineConfigType

type OnlineConfigType string

OnlineConfigType provider name or a class name that implements Online Store

type OnlineStoreConfig

type OnlineStoreConfig struct {
	Path         string                 `yaml:"path,omitempty"`
	Type         OnlineConfigType       `yaml:"type,omitempty"`
	Cert         string                 `yaml:"cert,omitempty"`
	DBParameters map[string]interface{} `yaml:",inline,omitempty"`
}

OnlineStoreConfig is the configuration that relates to reading from and writing to the Feast online store.

type RegistryConfig

type RegistryConfig struct {
	Path               string                 `yaml:"path,omitempty"`
	RegistryType       RegistryConfigType     `yaml:"registry_type,omitempty"`
	Cert               string                 `yaml:"cert,omitempty"`
	S3AdditionalKwargs *map[string]string     `yaml:"s3_additional_kwargs,omitempty"`
	DBParameters       map[string]interface{} `yaml:",inline,omitempty"`
}

RegistryConfig is the configuration that relates to reading from and writing to the Feast registry.

type RegistryConfigType

type RegistryConfigType string

RegistryConfigType provider name or a class name that implements Registry

type RepoConfig

type RepoConfig struct {
	Project                       string             `yaml:"project,omitempty"`
	Provider                      FeastProviderType  `yaml:"provider,omitempty"`
	OfflineStore                  OfflineStoreConfig `yaml:"offline_store,omitempty"`
	OnlineStore                   OnlineStoreConfig  `yaml:"online_store,omitempty"`
	Registry                      RegistryConfig     `yaml:"registry,omitempty"`
	AuthzConfig                   AuthzConfig        `yaml:"auth,omitempty"`
	EntityKeySerializationVersion int                `yaml:"entity_key_serialization_version,omitempty"`
}

RepoConfig is the Repo config. Typically loaded from feature_store.yaml. https://rtd.feast.dev/en/stable/#feast.repo_config.RepoConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL