Skip to content

Commit

Permalink
rework manifest files and add testing steps
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewballantyne committed Jun 25, 2024
1 parent 8713d00 commit 00ad9eb
Show file tree
Hide file tree
Showing 55 changed files with 88 additions and 95 deletions.
2 changes: 1 addition & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Dashboard Deployment `containers`]: ../manifests/common/base/deployment.yaml
[Dashboard Deployment `containers`]: ../manifests/overrides/base/deployment.yaml
[OpenShift OAuth Proxy repo]: https://github.com/openshift/oauth-proxy
[OpenShift SDK]: https://github.com/openshift/dynamic-plugin-sdk
[SDK tidbits]: SDK.md
Expand Down
2 changes: 1 addition & 1 deletion docs/dev-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ This is the default context for running a local UI. Make sure you build the pro

> Note: You must be logged-in with `oc` before you can start the backend. Details for that are in the the [contribution guidelines](../CONTRIBUTING.md#give-your-dev-env-access).

> Note: The CLI logged-in user will need to be a `cluster-admin` level user on the cluster to mimic the Dashboard Service Account level of permissions. You could also bind the [cluster role](../manifests/common/base/cluster-role.yaml) to your user as we do with the service account [binding](../manifests/common/base/cluster-role-binding.yaml).
> Note: The CLI logged-in user will need to be a `cluster-admin` level user on the cluster to mimic the Dashboard Service Account level of permissions. You could also bind the [cluster role](../manifests/overrides/base/cluster-role.yaml) to your user as we do with the service account [binding](../manifests/overrides/base/cluster-role-binding.yaml).

```bash
npm run start
Expand Down
2 changes: 1 addition & 1 deletion docs/release-steps.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[base/kustomization.yaml]: ../manifests/common/base/kustomization.yaml
[base/kustomization.yaml]: ../manifests/overrides/base/kustomization.yaml
[quay repo]: https://quay.io/repository/opendatahub/odh-dashboard?tab=tags
[drafting a new release]: https://github.com/opendatahub-io/odh-dashboard/releases/new
[semver]: https://semver.org/
Expand Down
4 changes: 4 additions & 0 deletions manifests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore the testing files that are described in the README.md
before-*-test.yaml
after-*-test.yaml
output-*.diff
53 changes: 41 additions & 12 deletions manifests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,54 @@

The Dashboard manifests run on Kustomize. There are 3 types of deployments for the Dashboard component.

- Open Data Hub (`./odh`)
- Open Data Hub ([`./odh`](./odh))
- Red Hat OpenShift AI
- RHOAI Managed (`./rhoai/addon`)
- RHOAI Self Managed (`./rhoai/onprem`)
- RHOAI Managed ([`./rhoai/addon`](./rhoai/addon))
- RHOAI Self Managed ([`./rhoai/onprem`](./rhoai/onprem))

## Adding new Manifests
## Adding/Modifying Manifests

Starting at the deployment type folders (see above) there will be a `kustomization.yaml` file -- consider this an "index file". Each reference in these "index files" reference other "index files" in other folders until they reach a folder that contains specific manifest yamls. Maintain this structure for cleanness.
Rules for keeping the manifest files in a sane order:

The operator will start from one of the deployment type folders, so we are in control of all the references from there. Keep sane references & be sure to read the README files in each of the root folders for guidelines.
1. When adding a new type of thing, always make it have its own folder; be sure to add the reference to the parent folder's `kustomziation.yaml` (if applicable)
2. When adding to a preexisting folder, be sure to add it to the root `kustomization.yaml` in that folder
3. Do not reference "a file" (has an extension) inside another folder. Reference other folders, which will pick up the `kustomization.yaml` inside that folder; those `kustomization.yaml` files should reference sibling files
4. Folders matter -- see the README in each for more details

## Installation
## Installation (ODH)

Use the `kustomize` tool to process the manifest for the `oc apply` command.
You can use the `kustomize` tool to process the manifest for the `oc apply` command.

```
# Parse the base manifest to deploy ODH Dashboard WITHOUT the required configs for groups
cd manifests/common/base
```markdown
# Set the namespace in the manifest where you want to deploy the dashboard
kustomize edit set namespace <DESTINATION NAMESPACE>
kustomize build . | oc apply -f -
kustomize build common | oc apply -f -
kustomize build overrides/base | oc apply -f -
```

## Testing Changes

One way to test changes locally is to generate the full structure before your changes, and then again after your changes.

Before:
```markdown
# Generate the files before your changes for a baseline
kustomize build rhoai/addon > before-rhoai-addon-test.yaml
kustomize build rhoai/onprem > before-rhoai-onprem-test.yaml
kustomize build odh > before-odh-test.yaml
```

After:
```markdown
# Generate the files after your changes
kustomize build rhoai/addon > after-rhoai-addon-test.yaml
kustomize build rhoai/onprem > after-rhoai-onprem-test.yaml
kustomize build odh > after-odh-test.yaml

# Generate the diff between the two
git diff --no-index before-rhoai-addon-test.yaml after-rhoai-addon-test.yaml > output-rhoai-addon.diff
git diff --no-index before-rhoai-onprem-test.yaml after-rhoai-onprem-test.yaml > output-rhoai-onprem.diff
git diff --no-index before-odh-test.yaml after-odh-test.yaml > output-odh.diff
```

Viewing the diffs will help you understand what changed.
4 changes: 3 additions & 1 deletion manifests/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

These are manifests that are shared in both ODH & RHOAI deployments.

See `../odh` & `../rhoai` if there are specific deployment manifests needed.
These files are not intended to be the base of overriding or changing in any way. These should be immutable between both RHOAI and ODH deployments.

> **Note:** See the [`../overrides`](../overrides/README.md) folder for those that can be overridden
3 changes: 0 additions & 3 deletions manifests/common/apps/jupyter/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- create-jupyter-notebook-quickstart.yaml
- deploy-python-model-quickstart.yaml
Expand Down
3 changes: 0 additions & 3 deletions manifests/common/apps/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- ./jupyter
5 changes: 1 addition & 4 deletions manifests/common/crd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- odhdashboardconfigs.opendatahub.io.crd.yaml
- odhquickstarts.console.openshift.io.crd.yaml
- odhdocuments.dashboard.opendatahub.io.crd.yaml
- odhapplications.dashboard.opendatahub.io.crd.yaml
- acceleratorprofiles.opendatahub.io.crd.yaml
- acceleratorprofiles.opendatahub.io.crd.yaml
7 changes: 1 addition & 6 deletions manifests/common/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- ./apps
- ./base
- ./consolelink
- ./crd
- ./apps
6 changes: 2 additions & 4 deletions manifests/odh/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# ODH Manifests
# ODH Deployment

These are manifests that are only for ODH.

RHOAI manifests should not reference these. If they need to reference something in here, they should be put into common folder instead.
This is the starting location for ODH manifests.
2 changes: 2 additions & 0 deletions manifests/odh/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ commonLabels:
app.kubernetes.io/part-of: odh-dashboard
resources:
- ../common
- ../overrides/base
- ../overrides/consolelink
5 changes: 5 additions & 0 deletions manifests/overrides/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Overridable Manifests

These are manifest files that are intended to be used as-is or to be overridden.

> **Note:** There should be note root `kustomization.yaml` as each folder should be treated as a specific target for inclusion or overrides.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- role.yaml
- cluster-role.yaml
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions manifests/rhoai/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# RHOAI Manifests

These manifests are only for RHOAI. Overrides can be performed on the manifest files in common.

Use the `./shared` folder to place anything that is shared between RHOAI deployments.
These manifests are only for RHOAI. Overrides can be performed on the manifest files in `../overrides`.
7 changes: 7 additions & 0 deletions manifests/rhoai/addon/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# RHOAI Addon Deployment

This is the starting location for RHOAI addon manifests.

Only add items to this folder that are exclusively addon manifests.

> **Note:** See [`../shared`](../shared/README.md) for common items between RHOAI deployments.
3 changes: 0 additions & 3 deletions manifests/rhoai/addon/apps/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- ./nvidia
- ./rhoam
Expand Down
3 changes: 0 additions & 3 deletions manifests/rhoai/addon/apps/nvidia/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- nvidia-app.yaml
- gpu-quickstart.yaml
Expand Down
3 changes: 0 additions & 3 deletions manifests/rhoai/addon/apps/rhoam/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- rhoam-app.yaml
- deploy-model-rhoam-quickstart.yaml
3 changes: 0 additions & 3 deletions manifests/rhoai/addon/apps/starburst/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- starburst-app.yaml
- starburst-galaxy-quickstart.yaml
4 changes: 2 additions & 2 deletions manifests/rhoai/addon/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
app: rhods-dashboard
app.kubernetes.io/part-of: rhods-dashboard
resources:
- ../shared
- ./apps
7 changes: 7 additions & 0 deletions manifests/rhoai/onprem/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# RHOAI OnPrem Deployment

This is the starting location for RHOAI onprem manifests.

Only add items to this folder that are exclusively onprem manifests.

> **Note:** See [`../shared`](../shared/README.md) for common items between RHOAI deployments.
3 changes: 0 additions & 3 deletions manifests/rhoai/onprem/apps/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- ./starburst-enterprise
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- query-starburstenterprise-quickstart.yaml
- starburstenterprise-app.yaml
Expand Down
5 changes: 3 additions & 2 deletions manifests/rhoai/onprem/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
app: rhods-dashboard
app.kubernetes.io/part-of: rhods-dashboard
resources:
- ../shared
- ./apps
3 changes: 3 additions & 0 deletions manifests/rhoai/shared/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# RHOAI Shared Manifests

These are all the manifests that are shared between all of the RHOAI deployments.
3 changes: 0 additions & 3 deletions manifests/rhoai/shared/apps/aikit/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- oneapi-aikit-notebook-quickstart.yaml
- aikit-app.yaml
3 changes: 0 additions & 3 deletions manifests/rhoai/shared/apps/anaconda-ce/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- anaconda-ce-app.yaml
- anaconda-ce-create-jupyter-notebook-quickstart.yaml
Expand Down
3 changes: 0 additions & 3 deletions manifests/rhoai/shared/apps/elastic/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- elastic-app.yaml
3 changes: 0 additions & 3 deletions manifests/rhoai/shared/apps/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- ./aikit
- ./anaconda-ce
Expand Down
3 changes: 0 additions & 3 deletions manifests/rhoai/shared/apps/openvino/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- openvino-app.yaml
- openvino-docs.yaml
Expand Down
3 changes: 0 additions & 3 deletions manifests/rhoai/shared/apps/pachyderm/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- pachyderm-app.yaml
- pachyderm-docs.yaml
Expand Down
3 changes: 0 additions & 3 deletions manifests/rhoai/shared/apps/rhoai/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- rhoai-app.yaml
- rhoai-docs.yaml
3 changes: 0 additions & 3 deletions manifests/rhoai/shared/apps/watson-x/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- watson-x-docs.yaml
- watson-x-app.yaml
4 changes: 1 addition & 3 deletions manifests/rhoai/shared/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: rhods-dashboard
app.kubernetes.io/part-of: rhods-dashboard
resources:
- ../../../overrides/base
- anaconda-ce-validator-cron.yaml
patchesJson6902:
- path: service-account.yaml
Expand Down
3 changes: 2 additions & 1 deletion manifests/rhoai/shared/consolelink/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ commonLabels:
app: rhods-dashboard
app.kubernetes.io/part-of: rhods-dashboard
resources:
- ../../../common/consolelink
- ../../../overrides/consolelink
patchesJson6902:
- path: consolelink.yaml
target:
group: console.openshift.io
version: v1
kind: ConsoleLink
name: odhlink
3 changes: 0 additions & 3 deletions manifests/rhoai/shared/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: odh-dashboard
app.kubernetes.io/part-of: odh-dashboard
resources:
- ../../common
- ./apps
Expand Down

0 comments on commit 00ad9eb

Please sign in to comment.