Skip to content

Commit

Permalink
feast job
Browse files Browse the repository at this point in the history
Signed-off-by: Tommy Hughes <[email protected]>
  • Loading branch information
tchughesiv committed Feb 13, 2025
1 parent 973b832 commit 5e5391a
Show file tree
Hide file tree
Showing 8 changed files with 32,606 additions and 4,672 deletions.
2 changes: 2 additions & 0 deletions infra/feast-operator/api/v1alpha1/featurestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package v1alpha1
import (
// "github.com/go-git/go-git/v5"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -68,6 +69,7 @@ type FeatureStoreSpec struct {
// +kubebuilder:validation:Pattern="^[A-Za-z0-9][A-Za-z0-9_]*$"
// FeastProject is the Feast project id. This can be any alphanumeric string with underscores, but it cannot start with an underscore. Required.
FeastProject string `json:"feastProject"`
FeastJob *batchv1.CronJobSpec `json:"feastJob,omitempty"`
Services *FeatureStoreServices `json:"services,omitempty"`
AuthzConfig *AuthzConfig `json:"authz,omitempty"`
// FeastRepo git.CloneOptions `json:"feastRepo,omitempty"`
Expand Down
10 changes: 8 additions & 2 deletions infra/feast-operator/api/v1alpha1/zz_generated.deepcopy.go

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

18,607 changes: 16,277 additions & 2,330 deletions infra/feast-operator/config/crd/bases/feast.dev_featurestores.yaml

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions infra/feast-operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ rules:
- list
- update
- watch
- apiGroups:
- batch
resources:
- cronjobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand Down
18,633 changes: 16,296 additions & 2,337 deletions infra/feast-operator/dist/install.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions infra/feast-operator/docs/api/markdown/ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ _Appears in:_
| Field | Description |
| --- | --- |
| `feastProject` _string_ | FeastProject is the Feast project id. This can be any alphanumeric string with underscores, but it cannot start with an underscore. Required. |
| `feastJob` _[CronJobSpec](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#cronjobspec-v1-batch)_ | |
| `services` _[FeatureStoreServices](#featurestoreservices)_ | |
| `authz` _[AuthzConfig](#authzconfig)_ | |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"time"

appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -61,6 +62,11 @@ type FeatureStoreReconciler struct {
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=roles;rolebindings,verbs=get;list;create;update;watch;delete
// +kubebuilder:rbac:groups=core,resources=secrets,verbs=get;list
// +kubebuilder:rbac:groups=route.openshift.io,resources=routes,verbs=get;list;create;update;watch;delete
// +kubebuilder:rbac:groups=batch,resources=cronjobs,verbs=get;list;watch;create;update;patch;delete
/*
// +kubebuilder:rbac:groups=core,resources=pods,verbs=list
// +kubebuilder:rbac:groups=core,resources=pods/exec,verbs=create
*/

// Reconcile is part of the main kubernetes reconciliation loop which aims to
// move the current state of the cluster closer to the desired state.
Expand Down Expand Up @@ -188,6 +194,7 @@ func (r *FeatureStoreReconciler) SetupWithManager(mgr ctrl.Manager) error {
Owns(&corev1.ServiceAccount{}).
Owns(&rbacv1.RoleBinding{}).
Owns(&rbacv1.Role{}).
Owns(&batchv1.CronJob{}).
Watches(&feastdevv1alpha1.FeatureStore{}, handler.EnqueueRequestsFromMapFunc(r.mapFeastRefsToFeastRequests))
if services.IsOpenShift() {
bldr = bldr.Owns(&routev1.Route{})
Expand Down
6 changes: 3 additions & 3 deletions infra/feast-operator/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: feast-exec
name: feast-sample-cronjob
namespace: feast
rules:
- apiGroups:
Expand All @@ -31,11 +31,11 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: feast-exec
name: feast-sample-cronjob
namespace: feast
roleRef:
kind: Role
name: feast-exec
name: feast-sample-cronjob
subjects:
- kind: ServiceAccount
name: feast-sample
Expand Down

0 comments on commit 5e5391a

Please sign in to comment.