To deploy this project on OpenShift, follow these steps from the RAG-LLM-App/application
subdirectory:
-
Log in to your OpenShift cluster:
oc login --token=YOUR_TOKEN --server=YOUR_SERVER
-
Create a new project (optional):
oc new-project <project-name> oc project <project-name>
-
Build the application:
$ oc new-build --strategy docker --binary --name=rag-llm-app $ oc start-build rag-llm-app --from-dir=. --follow --wait
-
Deploy the application:
$ oc new-app rag-llm-app --name=rag-llm-app
-
Expose a Secure URL for this FastAPI app:
$ oc create route edge --service=rag-llm-app
A quick sanity check with the url created from the route:
<url>/docs
will take you to the swagger ui. -
Update
RAG-LLM-App/openshift-setup/secrets.yaml
with the required values -
Create the secret in the project namespace
oc apply -f RAG-LLM-App/openshift-setup/secrets.yaml
-
Update
RAG-LLM-App/openshift-setup/snippet_deployment.yaml
with the secret name -
Open the rag-llm-app deployment in IBM Cloud OpenShift console and scale the Pod to 0.
-
Select the YAML tab and search for the
spec: containers section
spec: containers: - resources: {} terminationMessagePath: /dev/termination-log name: rag-llm-app
or
spec: containers: - name: rag-llm-app resources: {} terminationMessagePath: /dev/termination-log
Below the
name
label, paste the content from theRAG-LLM-App/openshift-setup/snippet_deployment.yaml
and save it.Example:
name: rag-llm-app env: - name: RAG_APP_API_KEY valueFrom: secretKeyRef: name: rag key: RAG_APP_API_KEY - name: IBM_CLOUD_API_KEY valueFrom: secretKeyRef: name: rag key: IBM_CLOUD_API_KEY ...
-
Scale the pod to back to 1.