|
8 | 8 |
|
9 | 9 | * An OpenShift cluster |
10 | 10 | ** To create an OpenShift cluster, go to the https://console.redhat.com/[Red Hat Hybrid Cloud console]. |
11 | | - ** Select *Services \-> Containers \-> Create cluster*. |
12 | | - ** The cluster must have a dynamic `StorageClass` to provision `PersistentVolumes`. See link:../../multicloud-gitops/mcg-cluster-sizing[sizing your cluster]. |
13 | | -* Optional: A second OpenShift cluster for multicloud demonstration. |
14 | | -//Replaced git and podman prereqs with the tooling dependencies page |
15 | | -* https://validatedpatterns.io/learn/quickstart/[Install the tooling dependencies]. |
16 | | - |
17 | | -The use of this pattern depends on having at least one running Red Hat OpenShift cluster. However, consider creating a cluster for deploying the GitOps management hub assets and a separate cluster for the managed cluster. |
| 11 | + ** Select *OpenShift \-> Red Hat OpenShift Container Platform \-> Create cluster*. |
| 12 | + ** The cluster must have a dynamic `StorageClass` to provision `PersistentVolumes`. Verify that a dynamic `StorageClass` exists before creating one by running the following command: |
| 13 | ++ |
| 14 | +[source,terminal] |
| 15 | +---- |
| 16 | +$ oc get storageclass -o custom-columns=NAME:.metadata.name,PROVISIONER:.provisioner,DEFAULT:.metadata.annotations."storageclass\.kubernetes\.io/is-default-class" |
| 17 | +---- |
| 18 | ++ |
| 19 | +.Example output |
| 20 | ++ |
| 21 | +[source,terminal] |
| 22 | +---- |
| 23 | +NAME PROVISIONER DEFAULT |
| 24 | +gp2-csi ebs.csi.aws.com <none> |
| 25 | +gp3-csi ebs.csi.aws.com true |
| 26 | +---- |
| 27 | ++ |
| 28 | +For more information about creating a dynamic `StorageClass`, see the https://docs.openshift.com/container-platform/latest/storage/dynamic-provisioning.html[Dynamic provisioning] documentation. |
18 | 29 |
|
19 | | -If you do not have a running Red Hat OpenShift cluster, you can start one on a |
20 | | -public or private cloud by using https://console.redhat.com/openshift/create[Red Hat Hybrid Cloud Console]. |
21 | 30 |
|
22 | 31 | .Procedure |
23 | 32 |
|
24 | | -. Fork the https://github.com/validatedpatterns-sandbox/openshift-ai[openshift-ai] repository on GitHub. |
25 | | -. Clone the forked copy of this repository. |
26 | | -+ |
27 | | -[source,terminal] |
28 | | ----- |
29 | | -git clone [email protected]:your-username/openshift-ai.git |
30 | | ----- |
31 | | - |
32 | | -//. Create a local copy of the secret values file that can safely include credentials. Run the following commands: |
33 | | -//+ |
34 | | -//[source,terminal] |
35 | | -//---- |
36 | | -//cp values-secret.yaml.template ~/values-secret-travelops.yaml |
37 | | -//---- |
38 | | -//+ |
39 | | -//[source,yaml] |
40 | | -//---- |
41 | | -//version: "2.0" |
42 | | -//# Ideally you NEVER COMMIT THESE VALUES TO GIT (although if all passwords are |
43 | | -//# automatically generated inside the vault this should not really matter) |
44 | | -// |
45 | | -//secrets: |
46 | | -// - name: mysql-credentials |
47 | | -// vaultPrefixes: |
48 | | -// - global |
49 | | -// fields: |
50 | | -// - name: rootpasswd |
51 | | -// onMissingValue: generate |
52 | | -// vaultPolicy: validatedPatternDefaultPolicy |
53 | | -// |
54 | | -//# Uncomment the following if you want to enable HTPasswd oAuth |
55 | | -//# - name: htpasswd |
56 | | -//# vaultPrefixes: |
57 | | -//# - global |
58 | | -//# fields: |
59 | | -//# - name: htpasswd |
60 | | -//# path: '/path/to/users.htpasswd' |
61 | | -//---- |
62 | | -//+ |
63 | | -//[WARNING] |
64 | | -//==== |
65 | | -//Do not commit this file. You do not want to push personal credentials to GitHub. If you do not want to customize the secrets, these steps are not needed. The framework generates a random password for the config-demo application. |
66 | | -//==== |
67 | | -// |
68 | | -. If you want a peak under the covers to see what the pattern contains, you can do so with the following command: |
69 | | -+ |
70 | | -[source,terminal] |
71 | | ----- |
72 | | -cat values-hub.yaml |
73 | | ----- |
74 | | -
|
75 | | -But don't worry if it looks intimidating. |
76 | | -
|
77 | | -. Deploy the pattern by running `./pattern.sh make install` or by using the link:/infrastructure/using-validated-pattern-operator/[Validated Patterns Operator]. |
| 33 | +. From the https://github.com/validatedpatterns-sandbox/openshift-ai[openshift-ai] repository on GitHub click the Fork button. |
78 | 34 |
|
79 | | -[id="deploying-cluster-using-patternsh-file"] |
80 | | -== Deploying the cluster by using the pattern.sh file |
| 35 | +. Clone the forked copy of this repository by running the following command. |
| 36 | ++ |
| 37 | +[source,terminal] |
| 38 | +---- |
| 39 | +$ git clone [email protected]:<your-username>/openshift-ai.git |
| 40 | +---- |
81 | 41 |
|
82 | | -To deploy the cluster by using the `pattern.sh` file, complete the following steps: |
| 42 | +. Navigate to your repository: Ensure you are in the root directory of your Git repository by using: |
| 43 | ++ |
| 44 | +[source,terminal] |
| 45 | +---- |
| 46 | +$ cd /path/to/your/repository |
| 47 | +---- |
| 48 | + |
| 49 | +. Run the following command to set the upstream repository: |
| 50 | ++ |
| 51 | +[source,terminal] |
| 52 | +---- |
| 53 | +$ git remote add -f upstream [email protected]:validatedpatterns-sandbox/openshift-ai.git |
| 54 | +---- |
83 | 55 |
|
84 | | -. Login to your cluster by running the following command: |
| 56 | +. Verify the setup of your remote repositories by running the following command: |
85 | 57 | + |
86 | 58 | [source,terminal] |
87 | 59 | ---- |
88 | | - oc login |
| 60 | +$ git remote -v |
89 | 61 | ---- |
90 | 62 | + |
91 | | -Optional: Set the `KUBECONFIG` variable for the `kubeconfig` file path: |
| 63 | +.Example output |
92 | 64 | + |
93 | 65 | [source,terminal] |
94 | 66 | ---- |
95 | | - export KUBECONFIG=~/<path_to_kubeconfig> |
| 67 | +origin [email protected]:<your-username>/openshift-ai.git (fetch) |
| 68 | +origin [email protected]:<your-username>/openshift-ai.git (push) |
| 69 | +upstream [email protected]:validatedpatterns-sandbox/openshift-ai.git (fetch) |
| 70 | +upstream [email protected]:validatedpatterns-sandbox/openshift-ai.git (push) |
96 | 71 | ---- |
97 | 72 |
|
98 | | -. Deploy the pattern to your cluster. Run the following command: |
| 73 | +. Create a local copy of the secret values file that can safely include credentials. Run the following commands: |
99 | 74 | + |
100 | 75 | [source,terminal] |
101 | 76 | ---- |
102 | | - ./pattern.sh make install |
| 77 | +$ cp values-secret.yaml.template ~/values-secret-openshift-ai.yaml |
103 | 78 | ---- |
| 79 | ++ |
| 80 | +[NOTE] |
| 81 | +==== |
| 82 | +Putting the `values-secret.yaml` in your home directory ensures that it does not get pushed to your git repository. It is based on the `values-secrets.yaml.template` file provided by the pattern in the top level directory. When you create your own patterns you will add your secrets to this file and save. |
| 83 | +==== |
104 | 84 |
|
105 | | -[id="verify-rhoai-pattern-install"] |
106 | | -== Verify Red Hat OpenShift AI Pattern installation |
| 85 | +. Create a new feature branch, for example `my-branch` from the `rhoai` branch for your content: |
| 86 | ++ |
| 87 | +[source,terminal] |
| 88 | +---- |
| 89 | +$ git checkout -b my-branch rhoai |
| 90 | +---- |
107 | 91 |
|
108 | | -. Verify that the Operators have been installed. |
109 | | - .. To verify, in the OpenShift Container Platform web console, navigate to *Operators → Installed Operators* page. |
110 | | - .. Set your project to `All Projects` and verify the operators are isntalled and have a status of `Succeeded`. |
111 | | -. Verify that all applications are synchronized. Under the project `openshift-ai-hub` click the URL for the `hub` gitops `server`. |
| 92 | +. Create a local branch and push it to origin to gain the flexibility needed to customize the OpenShift AI pattern by running the following command: |
112 | 93 | + |
113 | | -image::rhoai/rhods-sync-success.png[ArgoCD Applications,link="/images/rhoai/rhods-sync-success.png"] |
| 94 | +[source,terminal] |
| 95 | +---- |
| 96 | +$ git push origin my-branch |
| 97 | +---- |
| 98 | + |
| 99 | +You can proceed to install the OpenShift AI pattern by using the web console or from command line by using the script `./pattern.sh` script. |
| 100 | + |
| 101 | +To install the OpenShift AI pattern by using the web console you must first install the Validated Patterns Operator. The Validated Patterns Operator installs and manages Validated Patterns. |
| 102 | + |
| 103 | +//Include Procedure module here |
| 104 | +[id="installing-validated-patterns-operator_{context}"] |
| 105 | +== Installing the {validated-patterns-op} using the web console |
| 106 | + |
| 107 | +.Prerequisites |
| 108 | +* Access to an {ocp} cluster by using an account with `cluster-admin` permissions. |
| 109 | + |
| 110 | +.Procedure |
114 | 111 |
|
| 112 | +. Navigate in the {hybrid-console-first} to the *Operators* → *OperatorHub* page. |
| 113 | + |
| 114 | +. Scroll or type a keyword into the *Filter by keyword* box to find the Operator you want. For example, type `validated patterns` to find the {validated-patterns-op}. |
| 115 | + |
| 116 | +. Select the Operator to display additional information. |
115 | 117 | + |
116 | | -As part of this pattern, HashiCorp Vault has been installed. Refer to the section on https://validatedpatterns.io/secrets/vault/[Vault]. |
| 118 | +[NOTE] |
| 119 | +==== |
| 120 | +Choosing a Community Operator warns that Red Hat does not certify Community Operators; you must acknowledge the warning before continuing. |
| 121 | +==== |
117 | 122 |
|
| 123 | +. Read the information about the Operator and click *Install*. |
118 | 124 |
|
119 | | -[id="verify-rhoai-dashboards"] |
120 | | -== Verify installation by checking the OpenShift AI Dashboard |
| 125 | +. On the *Install Operator* page: |
| 126 | + |
| 127 | +.. Select an *Update channel* (if more than one is available). |
| 128 | + |
| 129 | +.. Select a *Version* (if more than one is available). |
| 130 | + |
| 131 | +.. Select an *Installation mode*: |
| 132 | ++ |
| 133 | +The only supported mode for this Operator is *All namespaces on the cluster (default)*. This installs the Operator in the default `openshift-operators` namespace to watch and be made available to all namespaces in the cluster. This option is not always available. |
| 134 | + |
| 135 | +.. Select *Automatic* or *Manual* approval strategy. |
| 136 | + |
| 137 | +. Click *Install* to make the Operator available to the default `openshift-operators` namespace on this {ocp} cluster. |
| 138 | + |
| 139 | +.Verification |
| 140 | +To confirm that the installation is successful: |
| 141 | + |
| 142 | +. Navigate to the *Operators* → *Installed Operators* page. |
| 143 | + |
| 144 | +. Check that the Operator is installed in the selected namespace and its status is `Succeeded`. |
| 145 | + |
| 146 | +//Include Procedure module here |
| 147 | +[id="create-pattern-instance_{context}"] |
| 148 | +== Creating the OpenShift AI instance |
121 | 149 |
|
122 | | -. Access the OpenShift AI dashboard |
| 150 | +.Prerequisites |
| 151 | +The {validated-patterns-op} is successfully installed in the relevant namespace. |
| 152 | + |
| 153 | +.Procedure |
| 154 | + |
| 155 | +. Navigate to the *Operators* → *Installed Operators* page. |
123 | 156 |
|
| 157 | +. Click the installed *{validated-patterns-op}*. |
| 158 | + |
| 159 | +. Under the *Details* tab, in the *Provided APIs* section, in the |
| 160 | +*Pattern* box, click *Create instance* that displays the *Create Pattern* page. |
| 161 | + |
| 162 | +. On the *Create Pattern* page, select *Form view* and enter information in the following fields: |
| 163 | + |
| 164 | +** *Name* - A name for the pattern deployment that is used in the projects that you created. |
| 165 | +** *Labels* - Apply any other labels you might need for deploying this pattern. |
| 166 | +** *Cluster Group Name* - Select a cluster group name to identify the type of cluster where this pattern is being deployed. For example, if you are deploying the {ie-pattern}, the cluster group name is `datacenter`. If you are deploying the {mcg-pattern}, the cluster group name is `hub`. |
| 167 | ++ |
| 168 | +To know the cluster group name for the patterns that you want to deploy, check the relevant pattern-specific requirements. |
| 169 | +. Expand the *Git Config* section to reveal the options and enter the required information. |
| 170 | +. Leave *In Cluster Git Server* unchanged. |
| 171 | +.. Change the *Target Repo* URL to your forked repository URL. For example, change `https://github.com/validatedpatterns/<pattern_name>` to `https://github.com/<your-git-username>/<pattern-name>` |
| 172 | +.. Optional: You might need to change the *Target Revision* field. The default value is `HEAD`. However, you can also provide a value for a branch, tag, or commit that you want to deploy. For example, `v2.1`, `main`, or a branch that you created, `my-branch`. |
| 173 | +. Click *Create*. |
124 | 174 | + |
125 | | -[source, terminal] |
| 175 | +[NOTE] |
| 176 | +==== |
| 177 | +A pop-up error with the message "Oh no! Something went wrong." might appear during the process. This error can be safely disregarded as it does not impact the installation of the OpenShift AI pattern. Use the Hub ArgoCD UI, accessible through the nines menu, to check the status of ArgoCD instances, which will display states such as progressing, healthy, and so on, for each managed application. The Cluster ArgoCD provides detailed status on each application, as defined in the clustergroup values file. |
| 178 | +==== |
| 179 | + |
| 180 | +The *{rh-gitops} Operator* displays in list of *Installed Operators*. The *{rh-gitops} Operator* installs the remaining assets and artifacts for this pattern. To view the installation of these assets and artifacts, such as *{rh-rhacm-first}*, ensure that you switch to *Project:All Projects*. |
| 181 | + |
| 182 | +Wait some time for everything to deploy. You can track the progress through the `Hub ArgoCD` UI from the nines menu. The `config-demo` project appears stuck in a `Degraded` state. This is the expected behavior when installing using the OpenShift Container Platform console. |
| 183 | + |
| 184 | +* To resolve this you need to run the following to load the secrets into the vault: |
| 185 | ++ |
| 186 | +[source,terminal] |
126 | 187 | ---- |
127 | | -RHODS=https://$(oc get route -n redhat-ods-applications -o jsonpath='{.spec.host}') |
128 | | -echo ${RHODS} |
| 188 | +$ ./pattern.sh make load-secrets |
129 | 189 | ---- |
| 190 | ++ |
| 191 | +[NOTE] |
| 192 | +==== |
| 193 | +You must have created a local copy of the secret values file by running the following command: |
130 | 194 |
|
131 | | -You can also get to the dashboard from the OpenShift Console by selecting the application shortcut icon and then selecting the link for Red Hat OpenShift Ai |
| 195 | +[source,terminal] |
| 196 | +---- |
| 197 | +$ cp values-secret.yaml.template ~/values-secret-openshift-ai.yaml |
| 198 | +---- |
| 199 | +==== |
132 | 200 |
|
133 | | -image:rhoai/rhods-application_menu.png[Application ShortCut,link="/images/rhoai/rhods-application_menu.png"] |
| 201 | +The deployment will not take long but it should deploy successfully. |
| 202 | + |
| 203 | +Alternatively you can deploy the OpenShift AI pattern by using the command line script `pattern.sh`. |
| 204 | + |
| 205 | +[id="deploying-cluster-using-patternsh-file"] |
| 206 | +== Deploying the cluster by using the pattern.sh script |
| 207 | + |
| 208 | +To deploy the cluster by using the `pattern.sh` script, complete the following steps: |
134 | 209 |
|
135 | | -Log in to the Dashboard using your OpenShift credentials. You will find an environment that is ready for further configuration. This pattern provides the fundamental platform pieces to support MLOps workflows. The installation of OpenShift Pipelines enables the immediate use of pipelines if that is the desired approach for deployment. |
| 210 | +. Navigate to the root directory of the cloned repository by running the following command: |
| 211 | ++ |
| 212 | +[source,terminal] |
| 213 | +---- |
| 214 | +$ cd /path/to/your/repository |
| 215 | +---- |
136 | 216 |
|
137 | | -image:rhoai/rhods-ai_dashboard.png[OpenShift AI Dashboard,link="/images/rhoai/rhods-ai_dashboard.png"] |
| 217 | +. Log in to your cluster by running the following this procedure: |
| 218 | + |
| 219 | +.. Obtain an API token by visiting https://oauth-openshift.apps.<your-cluster>.<domain>/oauth/token/request |
| 220 | + |
| 221 | +.. Log in with this retrieved token by running the following command: |
| 222 | ++ |
| 223 | +[source,terminal] |
| 224 | +---- |
| 225 | +$ oc login --token=<retrieved-token> --server=https://api.<your-cluster>.<domain>:6443 |
| 226 | +---- |
| 227 | + |
| 228 | +. Alternatively log in by running the following command: |
| 229 | ++ |
| 230 | +[source,terminal] |
| 231 | +---- |
| 232 | +$ export KUBECONFIG=~/<path_to_kubeconfig> |
| 233 | +---- |
| 234 | + |
| 235 | +. Deploy the pattern to your cluster by running the following command: |
| 236 | ++ |
| 237 | +[source,terminal] |
| 238 | +---- |
| 239 | +$ ./pattern.sh make install |
| 240 | +---- |
| 241 | + |
| 242 | +. Verify that the Operators have been installed. |
| 243 | + .. To verify, in the OpenShift Container Platform web console, navigate to *Operators → Installed Operators* page. |
| 244 | + .. Check that *{rh-gitops} Operator* is installed in the `openshift-operators` namespace and its status is `Succeeded`. |
| 245 | +. Verify that all applications are synchronized. Under *Networking \-> Routes* select the *Location URL* associated with the *hub-gitops-server* . All application are report status as `Synched`. |
| 246 | ++ |
| 247 | +image::rhoai/rhods-sync-success.png[ArgoCD Applications,link="/images/rhoai/rhods-sync-success.png"] |
| 248 | + |
| 249 | +As part of installing by using the script `pattern.sh` pattern, HashiCorp Vault is installed. Running `./pattern.sh make install` also calls the `load-secrets` makefile target. This `load-secrets` target looks for a YAML file describing the secrets to be loaded into vault and in case it cannot find one it will use the `values-secret.yaml.template` file in the git repository to try to generate random secrets. |
| 250 | + |
| 251 | +For more information, see section on https://validatedpatterns.io/secrets/vault/[Vault]. |
| 252 | + |
| 253 | +[id="verify-rhoai-dashboards"] |
| 254 | +== Verify installation by checking the OpenShift AI Dashboard |
| 255 | + |
| 256 | +. Access the OpenShift AI dashboard from nines menu on the OpenShift Console and select the link for **Red Hat OpenShift AI**. |
| 257 | ++ |
| 258 | +image:rhoai/rhods-application_menu.png[Application ShortCut,link="/images/rhoai/rhods-application_menu.png"] |
| 259 | + |
| 260 | +. Log in to the dashboard using your OpenShift credentials. You will find an environment that is ready for further configuration. This pattern provides the fundamental platform pieces to support MLOps workflows. The installation of OpenShift Pipelines enables the immediate use of pipelines if that is the desired approach for deployment. |
| 261 | ++ |
| 262 | +image:rhoai/rhods-ai_dashboard.png[OpenShift AI Dashboard,link="/images/rhoai/hods-ai_dashboard.png"] |
0 commit comments