/weaviate

Experiment with Weaviate vector DB on Openshift

Primary LanguagePythonApache License 2.0Apache-2.0

JumpStart your Vector Database to enterprise scale with Openshift

Agenda

What we will build.

rag-demo

What's needed:

Why run Weaviate On Openshift

  • Support for Distributed Architectures.
  • A Great Developer Experience (Easily move code -> containers)
  • Access your cluster via the Weaviate Cloud Console with external routes.
  • Security (Doesn't run your containers as root)

Get Started

Developer Tools: Eclipse-Che/DevSpaces

  • A full IDE experience with a code debugger.
  • Leverage many VSCode extensions.
  • In cluster terminal with CLI access to the Openshift API.
  • Deploy and test your app with port forwarding.
  • GitHub integration improves workflow efficiency.
  • Environment variables are read in as secrets.
  • DevSpaces is a no-cost add-on to Openshift

Setup for development:

  1. View -> Command Palette -> Enter: dev spaces: open openshift console.
  2. Use the Openshift Web UI to create a secret with environment variables.
    • Secrets -> Create and Save a new secret (from yaml) using this example.
    • Edit -> Change the values in the secret to match your environment. Your instructor will provide the values.
  3. Extensions -> Install the reccomended Python extension.
  4. View -> Command Pallette Enter: run task -> devfile -> Create the python virtual environment
  5. Terminal -> New Terminal
  6. Use the helm client to install Weaviate and wait for the 2 weaviate pods to become ready.
PROJ=$(oc project -q)
helm repo add weaviate https://weaviate.github.io/weaviate-helm
helm upgrade --install weaviate weaviate/weaviate --namespace ${PROJ} --values ./values.yaml
oc get pods -w
curl weaviate.${PROJ} | jq
  1. Run a few python test clients from the src directory.
python src/00-test-connection.py
python src/03-gradio.py

Move the app into production.

  1. From the terminal, create an Openshift application.
oc new-app python~https://github.com/bkoz/weaviate --context-dir=/src --name=rag
  1. Create a secret for the application environment variables from the example.
oc apply -f resources/app-env.yaml
  • Use the web console UI or CLI to edit the values in the secret to reflect your environment.
  1. Add the secret to the rag deployment.
oc set env --from=secret/app-env deployment/rag
  1. Expose the app with a route.
oc create route edge --service rag --insecure-policy='Redirect'

Clean up

oc delete all --selector=app=rag
helm uninstall weaviate

Additional ways to get access to Openshift.

Versions

v0.1.0