Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
Signed-off-by: Tommy Hughes <[email protected]>
  • Loading branch information
tchughesiv committed Oct 21, 2024
1 parent 63c77a3 commit d2139dc
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 8 deletions.
14 changes: 11 additions & 3 deletions infra/feast-operator/api/v1alpha1/featurestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@ import (
)

const (
// Feast phases:
ReadyPhase = "Ready"
PendingPhase = "Pending"
FailedPhase = "Failed"

// Feast condition types:
ReadyType = "FeatureStore"
RegistryReadyType = "Registry"
ClientReadyType = "Client"
RegistryReadyType = "Registry"
ReadyType = "FeatureStore"

// Feast condition reasons:
ReadyReason = "Ready"
FailedReason = "FeastDeploymentFailed"
FailedReason = "FeatureStoreFailed"
RegistryFailedReason = "RegistryDeploymentFailed"
ClientFailedReason = "ClientDeploymentFailed"

Expand All @@ -54,6 +59,7 @@ type FeatureStoreStatus struct {
ClientConfigMap string `json:"clientConfigMap,omitempty"`
Conditions []metav1.Condition `json:"conditions,omitempty"`
FeastVersion string `json:"feastVersion,omitempty"`
Phase string `json:"phase,omitempty"`
ServiceUrls ServiceUrls `json:"serviceUrls,omitempty"`
}

Expand All @@ -65,6 +71,8 @@ type ServiceUrls struct {
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:resource:shortName=feast
//+kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase`
//+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

// FeatureStore is the Schema for the featurestores API
type FeatureStore struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
}
]
capabilities: Basic Install
createdAt: "2024-10-20T23:32:11Z"
createdAt: "2024-10-21T14:24:47Z"
operators.operatorframework.io/builder: operator-sdk-v1.37.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
name: feast-operator.v0.40.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ spec:
singular: featurestore
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.phase
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: FeatureStore is the Schema for the featurestores API
Expand Down Expand Up @@ -138,6 +145,8 @@ spec:
type: array
feastVersion:
type: string
phase:
type: string
serviceUrls:
description: ServiceUrls
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ spec:
singular: featurestore
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.phase
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: FeatureStore is the Schema for the featurestores API
Expand Down Expand Up @@ -138,6 +145,8 @@ spec:
type: array
feastVersion:
type: string
phase:
type: string
serviceUrls:
description: ServiceUrls
properties:
Expand Down
11 changes: 10 additions & 1 deletion infra/feast-operator/dist/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ spec:
singular: featurestore
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- jsonPath: .status.phase
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: FeatureStore is the Schema for the featurestores API
Expand Down Expand Up @@ -146,6 +153,8 @@ spec:
type: array
feastVersion:
type: string
phase:
type: string
serviceUrls:
description: ServiceUrls
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ func (r *FeatureStoreReconciler) deployFeast(ctx context.Context, cr *feastdevv1
Reason: feastdevv1alpha1.ReadyReason,
Message: feastdevv1alpha1.ReadyMessage,
}

feast := services.FeastServices{
Client: r.Client,
Context: ctx,
Expand All @@ -125,6 +124,14 @@ func (r *FeatureStoreReconciler) deployFeast(ctx context.Context, cr *feastdevv1
logger.Info(condition.Message)
apimeta.SetStatusCondition(&cr.Status.Conditions, condition)

if apimeta.IsStatusConditionTrue(cr.Status.Conditions, feastdevv1alpha1.ReadyType) {
cr.Status.Phase = feastdevv1alpha1.ReadyPhase
} else if apimeta.IsStatusConditionFalse(cr.Status.Conditions, feastdevv1alpha1.ReadyType) {
cr.Status.Phase = feastdevv1alpha1.FailedPhase
} else {
cr.Status.Phase = feastdevv1alpha1.PendingPhase
}

return result, err
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ var _ = Describe("FeatureStore Controller", func() {
Expect(cond.Type).To(Equal(feastdevv1alpha1.ClientReadyType))
Expect(cond.Message).To(Equal(feastdevv1alpha1.ClientReadyMessage))

Expect(resource.Status.Phase).To(Equal(feastdevv1alpha1.ReadyPhase))

deploy := &appsv1.Deployment{}
err = k8sClient.Get(ctx, types.NamespacedName{
Name: feast.GetFeastServiceName(services.RegistryFeastType),
Expand Down Expand Up @@ -316,6 +318,8 @@ var _ = Describe("FeatureStore Controller", func() {
Expect(cond.Reason).To(Equal(feastdevv1alpha1.ReadyReason))
Expect(cond.Type).To(Equal(feastdevv1alpha1.ClientReadyType))
Expect(cond.Message).To(Equal(feastdevv1alpha1.ClientReadyMessage))

Expect(resource.Status.Phase).To(Equal(feastdevv1alpha1.FailedPhase))
})
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func (feast *FeastServices) createRegistryDeployment() error {
} else if op == controllerutil.OperationResultCreated || op == controllerutil.OperationResultUpdated {
logger.Info("Successfully reconciled", "Deployment", deploy.Name, "operation", op)
}

return nil
}

Expand Down

0 comments on commit d2139dc

Please sign in to comment.