Skip to content

Commit

Permalink
Merge pull request #2906 from andrewballantyne/restructure-manifests
Browse files Browse the repository at this point in the history
Restructure the manifest files
  • Loading branch information
openshift-merge-bot[bot] authored Jul 2, 2024
2 parents 3d27281 + e71c8c0 commit 18bfe2d
Show file tree
Hide file tree
Showing 122 changed files with 295 additions and 247 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/base/deployment.yaml
[Dashboard Deployment `containers`]: ../manifests/core-bases/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/base/cluster-role.yaml) to your user as we do with the service account [binding](../manifests/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/core-bases/base/cluster-role.yaml) to your user as we do with the service account [binding](../manifests/core-bases/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/base/kustomization.yaml
[base/kustomization.yaml]: ../manifests/core-bases/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
71 changes: 49 additions & 22 deletions manifests/README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,59 @@
# Dashboard
# Manifests

The Open Data Hub Dashboard component installs a UI which
The Dashboard manifests run on Kustomize. There are 3 types of deployments for the Dashboard component.

- Shows what's installed
- Show's what's available for installation
- Links to component UIs
- Links to component documentation
- Open Data Hub ([`./odh`](./odh))
- Red Hat OpenShift AI
- RHOAI Managed ([`./rhoai/addon`](./rhoai/addon))
- RHOAI Self Managed ([`./rhoai/onprem`](./rhoai/onprem))

For more information, visit the project [GitHub repo](https://github.com/opendatahub-io/odh-dashboard).
Each deployment type will have a `params.env` file where the Operator can inject values for us to use.

### Folders
1. base: contains all the necessary yaml files to install the dashboard
## Adding/Modifying Manifests

##### Installation
Use the `kustomize` tool to process the manifest for the `oc apply` command.
Rules for keeping the manifest files in a sane order:

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 (ODH)

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

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

Alternatively, you can use the `./install/deploy.sh` which uses the `overlays/dev` overlay to select specific folders.

## 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
```
# Deploy ODH Dashboard with authentication AND the default configs for groups and ODHDashboardConfig
cd manifests/overlays/odhdashboardconfig
kustomize edit set namespace <DESTINATION NAMESPACE> # Set the namespace in the manifest where you want to deploy the dashboard
kustomize build . | oc apply -f -
# You will need to re-run the previous step if you receive the error below
# error: unable to recognize "STDIN": no matches for kind "OdhDashboardConfig" in version "opendatahub.io/v1alpha"

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.
7 changes: 7 additions & 0 deletions manifests/common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Common Manifests

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

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 [`../core-bases`](../core-bases/README.md) folder for those that can be overridden
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:
- create-jupyter-notebook-quickstart.yaml
- deploy-python-model-quickstart.yaml
Expand Down
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
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
5 changes: 5 additions & 0 deletions manifests/common/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./crd
- ./apps
5 changes: 5 additions & 0 deletions manifests/core-bases/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Core-Bases Manifests

These are manifest files that are intended to be used in part by other deployments and configured for their own use-cases.

> **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
Expand Up @@ -27,7 +27,7 @@ spec:
serviceAccount: odh-dashboard
containers:
- name: odh-dashboard
image: odh-dashboard
image: $(odh-dashboard-image)
imagePullPolicy: Always
ports:
- containerPort: 8080
Expand Down
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 All @@ -21,9 +18,6 @@ resources:
- model-serving-role-binding.yaml
- fetch-accelerators.rbac.yaml
images:
- name: odh-dashboard
newName: quay.io/opendatahub/odh-dashboard
newTag: main
- name: oauth-proxy
newName: registry.redhat.io/openshift4/ose-oauth-proxy
digest: sha256:ab112105ac37352a2a4916a39d6736f5db6ab4c29bad4467de8d613e80e9bb33
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 18bfe2d

Please sign in to comment.