Skip to content

Commit

Permalink
update readme docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AjayJagan committed Mar 7, 2024
1 parent aa2ec1f commit 902574d
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 137 deletions.
85 changes: 50 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ and configure these applications.
- [Usage](#usage)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [API links](#api-links)
- [Dev Preview](#dev-preview)
- [Developer Guide](#developer-guide)
- [Pre-requisites](#pre-requisites)
Expand All @@ -22,11 +21,13 @@ and configure these applications.
- [Build Image](#build-image)
- [Deployment](#deployment)
- [Test with customized manifests](#test-with-customized-manifests)
- [Update API docs](#update-api-docs)
- [Example DSCInitialization](#example-dscinitialization)
- [Example DataScienceCluster](#example-datasciencecluster)
- [Run functional Tests](#run-functional-tests)
- [Run e2e Tests](#run-e2e-tests)
- [API Overview](#api-overview)
- [Component Integration](#component-integration)
- [Troubleshooting](#troubleshooting)
- [Upgrade testing](#upgrade-testing)

Expand All @@ -38,38 +39,41 @@ If `single model serving configuration` is used or if `Kserve` component is used
- [Service Mesh operator](https://github.com/Maistra/istio-operator)
- [Serverless operator](https://github.com/openshift-knative/serverless-operator)

Additionally it enhances user-experience by providing a single sign on experience.
Additionally installing `Authorino operator` & `Service Mesh operator` enhances user-experience by providing a single sign on experience.

### Installation

The latest version of operator can be installed from the `community-operators` catalog on `OperatorHub`. It can also be build
- The latest version of operator can be installed from the `community-operators` catalog on `OperatorHub`.

![ODH operator in OperatorHub](docs/images/OperatorHub%20ODH%20Operator.png)

Please note that the latest releases are made in the `Fast` channel.

- It can also be build
and installed from source manually, see the Developer guide for further instructions.

1. Subscribe to operator by creating following subscription

```console
cat <<EOF | oc create -f -
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: opendatahub-operator
namespace: openshift-operators
spec:
channel: fast
name: opendatahub-operator
source: community-operators
sourceNamespace: openshift-marketplace
EOF
```

2. Create [DSCInitialization](#example-dscinitialization) CR manually.
You can also use operator to create default DSCI CR by removing env variable DISABLE_DSC_CONFIG from CSV following restart operator pod.

3. Create [DataScienceCluster](#example-datasciencecluster) CR to enable components

### API links
- Datascience Cluster Initialization: https://pkg.go.dev/github.com/opendatahub-io/opendatahub-operator/v2/apis/dscinitialization/v1#DSCInitializationSpec
- Datascience Cluster: https://pkg.go.dev/github.com/opendatahub-io/opendatahub-operator/v2/apis/datasciencecluster/v1#DataScienceClusterSpec
- Feature Tracker: https://pkg.go.dev/github.com/opendatahub-io/opendatahub-operator/v2/apis/features/v1#FeatureTrackerSpec
1. Subscribe to operator by creating following subscription

```console
cat <<EOF | oc create -f -
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: opendatahub-operator
namespace: openshift-operators
spec:
channel: fast
name: opendatahub-operator
source: community-operators
sourceNamespace: openshift-marketplace
EOF
```

2. Create [DSCInitialization](#example-dscinitialization) CR manually.
You can also use operator to create default DSCI CR by removing env variable DISABLE_DSC_CONFIG from CSV or changing the value to "false", followed by restarting the operator pod.

3. Create [DataScienceCluster](#example-datasciencecluster) CR to enable components

## Dev Preview

Developer Preview of the new Open Data Hub operator codebase is now available.
Expand All @@ -79,12 +83,12 @@ Refer [Dev-Preview.md](./docs/Dev-Preview.md) for testing preview features.

#### Pre-requisites

- Go version **go1.18.9**
- Go version **go1.19**
- operator-sdk version can be updated to **v1.24.1**

#### Download manifests

The `get_all_manifests.sh` script facilitates the process of fetching manifests from remote git repositories. It is configured to work with a predefined map of components and their corresponding manifest locations.
The [get_all_manifests.sh](/get_all_manifests.sh) script facilitates the process of fetching manifests from remote git repositories. It is configured to work with a predefined map of components and their corresponding manifest locations.

#### Structure of `COMPONENT_MANIFESTS`

Expand Down Expand Up @@ -129,8 +133,7 @@ Ensure back up before run this command if you have local changes of manifests wa

##### for build operator image

```
```commandline
make image-build
```

Expand Down Expand Up @@ -211,10 +214,18 @@ e.g `make image-build -e IMAGE_BUILD_FLAGS="--build-arg USE_LOCAL=true"`

There are 2 ways to test your changes with modification:

1. set `devFlags.ManifestsUri` field of DSCI instance during runtime: this will pull down manifests from remote git repo
by using this method, it overwrites manifests and component images if images are set in the params.env file
1. Each component in the `DataScienceCluster` CR has `devFlags.manifests` field, which can be used to pull down the manifests from the remote git repos of the respective components. By using this method, it overwrites manifests and creates customized resources for the respective components.

2. [Under implementation] build operator image with local manifests.

### Update API docs

Whenever a new api is added or a new field is added to the CRD, please make sure to run the command:
```commandline
make create-api-docs
```
This will ensure that the doc for the apis are updated accordingly.

### Example DSCInitialization

Below is the default DSCI CR config
Expand Down Expand Up @@ -354,6 +365,10 @@ make e2e-test -e OPERATOR_NAMESPACE=<namespace> -e E2E_TEST_FLAGS="--skip-deleti

Please refer to [api documentation](docs/api-overview.md)

### Component Integration

Please refer to [components docs](components/README.md)

### Troubleshooting

Please refer to [troubleshooting documentation](docs/troubleshooting.md)
Expand Down
20 changes: 10 additions & 10 deletions components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To ensure a component is integrated seamlessly in the operator, follow the steps
### 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](https://github.com/opendatahub-io/opendatahub-operator/blob/main/apis/datasciencecluster/v1/datasciencecluster_types.go#L40):
Add your component to it's [api spec](../docs/api-overview.md#datascienceclusterspec):

```go
type Components struct {
Expand All @@ -30,15 +30,15 @@ can be found [here](https://github.com/opendatahub-io/opendatahub-operator/tree/
- Implement [interface](https://github.com/opendatahub-io/opendatahub-operator/blob/main/components/component.go#L15) methods according to your component

```go
type ComponentInterface interface {
ReconcileComponent(cli client.Client, owner metav1.Object, DSCISpec *dsci.DSCInitializationSpec) error
Cleanup(cli client.Client, DSCISpec *dsci.DSCInitializationSpec) error
GetComponentName() string
GetManagementState() operatorv1.ManagementState
SetImageParamsMap(imageMap map[string]string) map[string]string
UpdatePrometheusConfig(cli client.Client, enable bool, component string) error
WaitForDeploymentAvailable(ctx context.Context, r *rest.Config, c string, n string, i int, t int) error
}
type ComponentInterface interface {
ReconcileComponent(ctx context.Context, cli client.Client, resConf *rest.Config, owner metav1.Object, DSCISpec *dsciv1.DSCInitializationSpec, currentComponentStatus bool) error
Cleanup(cli client.Client, DSCISpec *dsciv1.DSCInitializationSpec) error
GetComponentName() string
GetManagementState() operatorv1.ManagementState
SetImageParamsMap(imageMap map[string]string) map[string]string
OverrideManifests(platform string) error
UpdatePrometheusConfig(cli client.Client, enable bool, component string) error
}
```
### Add reconcile and Events

Expand Down
6 changes: 3 additions & 3 deletions crd-ref-docs.config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
processor:
# RE2 regular expressions describing types that should be excluded from the generated documentation.
ignoreGroupVersions:
- "features.opendatahub.io/v1"
ignoreTypes:
- "(DataScienceCluster|DSCInitialization|FeatureTracker)List$"
# RE2 regular expressions describing type fields that should be excluded from the generated documentation.

- "(DataScienceCluster|DSCInitialization)List$"
render:
# Version of Kubernetes to use when generating links to Kubernetes API documentation.
kubernetesVersion: 1.22
14 changes: 12 additions & 2 deletions docs/Dev-Preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,24 @@ spec:
managementState: Managed
kserve:
managementState: Managed
serving:
ingressGateway:
certificate:
type: SelfSigned
managementState: Managed
name: knative-serving
kueue:
managementState: Removed
modelmeshserving:
managementState: Managed
modelregistry:
managementState: Removed
ray:
managementState: Removed
workbenches:
managementState: Managed
trustyai:
managementState: Managed
workbenches:
managementState: Managed
EOF
```

Expand Down
87 changes: 0 additions & 87 deletions docs/api-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
## Packages
- [datasciencecluster.opendatahub.io/v1](#datascienceclusteropendatahubiov1)
- [dscinitialization.opendatahub.io/v1](#dscinitializationopendatahubiov1)
- [features.opendatahub.io/v1](#featuresopendatahubiov1)


## datasciencecluster.opendatahub.io/v1
Expand Down Expand Up @@ -197,89 +196,3 @@ _Appears in:_
| `customCABundle` _string_ | A custom CA bundle that will be available for all components in the Data Science Cluster(DSC). This bundle will be stored in odh-trusted-ca-bundle ConfigMap .data.odh-ca-bundle.crt . |



## features.opendatahub.io/v1

Package v1 contains API Schema definitions for the datasciencecluster v1 API group

### Resource Types
- [FeatureTracker](#featuretracker)





#### FeatureTracker



FeatureTracker represents a cluster-scoped resource in the Data Science Cluster, specifically designed for monitoring and managing objects created via the internal Features API. This resource serves a crucial role in cross-namespace resource management, acting as an owner reference for various resources. The primary purpose of the FeatureTracker is to enable efficient garbage collection by Kubernetes. This is essential for ensuring that resources are automatically cleaned up and reclaimed when they are no longer required.



| Field | Description |
| --- | --- |
| `apiVersion` _string_ | `features.opendatahub.io/v1`
| `kind` _string_ | `FeatureTracker`
| `kind` _string_ | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
| `apiVersion` _string_ | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources |
| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. |
| `spec` _[FeatureTrackerSpec](#featuretrackerspec)_ | |
| `status` _[FeatureTrackerStatus](#featuretrackerstatus)_ | |


#### FeatureTrackerSpec



FeatureTrackerSpec defines the desired state of FeatureTracker.

_Appears in:_
- [FeatureTracker](#featuretracker)

| Field | Description |
| --- | --- |
| `source` _[Source](#source)_ | |
| `appNamespace` _string_ | |


#### FeatureTrackerStatus



FeatureTrackerStatus defines the observed state of FeatureTracker.

_Appears in:_
- [FeatureTracker](#featuretracker)

| Field | Description |
| --- | --- |
| `conditions` _[Condition](#condition)_ | |


#### OwnerType

_Underlying type:_ _string_



_Appears in:_
- [Source](#source)



#### Source



Source describes the type of object that created the related Feature to this FeatureTracker.

_Appears in:_
- [FeatureTrackerSpec](#featuretrackerspec)

| Field | Description |
| --- | --- |
| `type` _[OwnerType](#ownertype)_ | |
| `name` _string_ | |


Binary file added docs/images/OperatorHub ODH Operator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 902574d

Please sign in to comment.