|
| 1 | +--- |
| 2 | +title: Getting started |
| 3 | +weight: 10 |
| 4 | +aliases: /rag-quickstart/getting-started/ |
| 5 | +--- |
| 6 | + |
| 7 | +:toc: |
| 8 | +:imagesdir: /images |
| 9 | +:_content-type: ASSEMBLY |
| 10 | +include::modules/comm-attributes.adoc[] |
| 11 | + |
| 12 | +[id="deploying-rag-quickstart-pattern"] |
| 13 | +== Deploying the RAG AI Quickstart pattern |
| 14 | + |
| 15 | +.Prerequisites |
| 16 | + |
| 17 | +* An OpenShift cluster (version 4.18 or later) |
| 18 | + ** To create an OpenShift cluster, go to the https://console.redhat.com/[Red Hat Hybrid Cloud console]. |
| 19 | + ** Select *OpenShift \-> Red Hat OpenShift Container Platform \-> Create cluster*. |
| 20 | +* A https://huggingface.co/[HuggingFace] account with an API token that has read permissions. |
| 21 | + ** You must accept the terms and conditions for the https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct[meta-llama/Llama-3.2-3B-Instruct] model with the account that the API token belongs to. |
| 22 | +* The Helm binary. For instructions, see link:https://helm.sh/docs/intro/install/[Installing Helm]. |
| 23 | +* Additional installation tool dependencies. For details, see link:https://validatedpatterns.io/learn/quickstart/[Patterns quick start]. |
| 24 | + |
| 25 | +[id="preparing-for-deployment"] |
| 26 | +== Preparing for deployment |
| 27 | +.Procedure |
| 28 | + |
| 29 | +. Fork the link:https://github.com/validatedpatterns-sandbox/ai-quickstart-rag[ai-quickstart-rag] repository on GitHub. You must fork the repository to customize this pattern. |
| 30 | + |
| 31 | +. Clone the forked copy of this repository. |
| 32 | ++ |
| 33 | +[source,terminal] |
| 34 | +---- |
| 35 | +$ git clone git@github.com:your-username/ai-quickstart-rag.git |
| 36 | +---- |
| 37 | + |
| 38 | +. Go to the root directory of your Git repository: |
| 39 | ++ |
| 40 | +[source,terminal] |
| 41 | +---- |
| 42 | +$ cd ai-quickstart-rag |
| 43 | +---- |
| 44 | + |
| 45 | +. Run the following command to set the upstream repository: |
| 46 | ++ |
| 47 | +[source,terminal] |
| 48 | +---- |
| 49 | +$ git remote add -f upstream git@github.com:validatedpatterns-sandbox/ai-quickstart-rag.git |
| 50 | +---- |
| 51 | + |
| 52 | +. Verify the setup of your remote repositories by running the following command: |
| 53 | ++ |
| 54 | +[source,terminal] |
| 55 | +---- |
| 56 | +$ git remote -v |
| 57 | +---- |
| 58 | ++ |
| 59 | +.Example output |
| 60 | ++ |
| 61 | +[source,terminal] |
| 62 | +---- |
| 63 | +origin git@github.com:your-username/ai-quickstart-rag.git (fetch) |
| 64 | +origin git@github.com:your-username/ai-quickstart-rag.git (push) |
| 65 | +upstream git@github.com:validatedpatterns-sandbox/ai-quickstart-rag.git (fetch) |
| 66 | +upstream git@github.com:validatedpatterns-sandbox/ai-quickstart-rag.git (push) |
| 67 | +---- |
| 68 | + |
| 69 | +. Make a local copy of the secrets template outside of your repository to hold credentials for the pattern. |
| 70 | ++ |
| 71 | +[WARNING] |
| 72 | +==== |
| 73 | +Do not add, commit, or push this file to your repository. Doing so may expose personal credentials to GitHub. |
| 74 | +==== |
| 75 | ++ |
| 76 | +Run the following command: |
| 77 | ++ |
| 78 | +[source,terminal] |
| 79 | +---- |
| 80 | +$ cp values-secret.yaml.template ~/values-secret-ai-quickstart-rag.yaml |
| 81 | +---- |
| 82 | + |
| 83 | +. Populate this file with secrets, or credentials, that are needed to deploy the pattern successfully: |
| 84 | ++ |
| 85 | +[source,terminal] |
| 86 | +---- |
| 87 | +$ vim ~/values-secret-ai-quickstart-rag.yaml |
| 88 | +---- |
| 89 | + |
| 90 | +.. Edit the `llm-service` section to use your HuggingFace API token: |
| 91 | ++ |
| 92 | +[source,yaml] |
| 93 | +---- |
| 94 | + - name: llm-service |
| 95 | + fields: |
| 96 | + - name: hf_token |
| 97 | + value: hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| 98 | +---- |
| 99 | + |
| 100 | +. Optional: To customize the deployment, create and switch to a new branch by running the following command: |
| 101 | ++ |
| 102 | +[source,terminal] |
| 103 | +---- |
| 104 | +$ git checkout -b my-branch |
| 105 | +---- |
| 106 | ++ |
| 107 | +Make your changes, then stage and commit them: |
| 108 | ++ |
| 109 | +[source,terminal] |
| 110 | +---- |
| 111 | +$ git add <changed-files> |
| 112 | +$ git commit -m "Customize deployment" |
| 113 | +---- |
| 114 | ++ |
| 115 | +Push the changes to your forked repository: |
| 116 | ++ |
| 117 | +[source,terminal] |
| 118 | +---- |
| 119 | +$ git push origin my-branch |
| 120 | +---- |
| 121 | + |
| 122 | +[id="deploying-cluster-using-patternsh-file"] |
| 123 | +== Deploying the pattern by using the pattern.sh file |
| 124 | + |
| 125 | +To deploy the pattern by using the `pattern.sh` file, complete the following steps: |
| 126 | + |
| 127 | +. Log in to your cluster by following this procedure: |
| 128 | + |
| 129 | +.. Obtain an API token by visiting link:https://oauth-openshift.apps.<your_cluster>.<domain>/oauth/token/request[https://oauth-openshift.apps.<your_cluster>.<domain>/oauth/token/request]. |
| 130 | + |
| 131 | +.. Log in to the cluster by running the following command: |
| 132 | ++ |
| 133 | +[source,terminal] |
| 134 | +---- |
| 135 | +$ oc login --token=<retrieved-token> --server=https://api.<your_cluster>.<domain>:6443 |
| 136 | +---- |
| 137 | ++ |
| 138 | +Or log in by running the following command: |
| 139 | ++ |
| 140 | +[source,terminal] |
| 141 | +---- |
| 142 | +$ export KUBECONFIG=~/<path_to_kubeconfig> |
| 143 | +---- |
| 144 | + |
| 145 | +. Deploy the pattern to your cluster. Run the following command: |
| 146 | ++ |
| 147 | +[source,terminal] |
| 148 | +---- |
| 149 | +$ ./pattern.sh make install |
| 150 | +---- |
| 151 | + |
| 152 | +.Verification |
| 153 | + |
| 154 | +To verify a successful installation, check the health of the ArgoCD applications: |
| 155 | + |
| 156 | +. Run the following command: |
| 157 | ++ |
| 158 | +[source,terminal] |
| 159 | +---- |
| 160 | +$ ./pattern.sh make argo-healthcheck |
| 161 | +---- |
| 162 | ++ |
| 163 | +It might take several minutes for all applications to synchronize and reach a healthy state. This includes downloading the LLM models and populating the vector database. |
| 164 | + |
| 165 | +. Verify that the Operators are installed by navigating to *Operators -> Installed Operators* in the {ocp} web console. |
| 166 | + |
| 167 | +. After all applications are healthy, open the RAG chatbot UI by clicking the route link in the *Networking -> Routes* page of the `ai-quickstart-rag-prod` namespace. |
0 commit comments