Component Integration
The components
dir of the codebase is hosts all the component specific logic of the operator. Since, ODH operator is an
integration point to deploy ODH component manifests it is essential to have common processes to integrate new components.
Integrating a new component
To ensure a component is integrated seamlessly in the operator, follow the steps below:
Add Component to DataScienceCluster API spec
DataScienceCluster CRD is responsible for defining the component fields and exposing them to end users.
Add your component to it's api spec:
type Components struct {
NewComponent newcomponent.newComponentName `json:"newcomponent,omitempty"`
}
Add Component module
- Add a new module,
<newComponent>
, under components/
directory to define code specific to the new component. Example
can be found here
- Define
Path
and ComponentName
variables for the new component.
Implement common Interface
- Define struct that includes a shared struct
Component
with common fields.
- Implement interface methods according to your component
type ComponentInterface interface {
ReconcileComponent(owner metav1.Object, client client.Client, scheme *runtime.Scheme,
enabled bool, namespace string) error
GetComponentName() string
SetImageParamsMap(imageMap map[string]string) map[string]string
}
Add reconcile and Events
- Once you setup the new component module, add the component to Reconcile
function in order to deploy manifests.
- This will also enable/add status updates of the component in the operator.
Add Unit and e2e tests
- Components should add
unit
tests for any component specific functions added to the codebase
- Components should update e2e tests to
capture deployments introduced by the new component
Integrated Components