Skip to content

agapebondservant/postgresml-accelerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PostgresML Accelerator

This is an accelerator that can be used to generate a Kubernetes deployment for PostgresML.

tanzu package available list accelerator.apps.tanzu.vmware.com --namespace tap-install
tanzu package install accelerator -p accelerator.apps.tanzu.vmware.com -v 1.0.1 -n tap-install -f resources/app-accelerator-values.yaml
Verify that package is running: tanzu package installed get accelerator -n tap-install
Get the IP address for the App Accelerator API: kubectl get service -n accelerator-system

Publish Accelerators:

tanzu plugin install --local <path-to-tanzu-cli> all
tanzu acc create postgresml --git-repository https://github.com/agapebondservant/postgresml-accelerator.git --git-branch main

Contents

  1. Overview
  2. Deploy Bitnami Postgres on Kubernetes<a name

Overview

User-Defined Functions

  • run_llm_inference_task: Invokes a HuggingFace pipeline using postgresml
    • Parameters:
    • question: Input prompt
    • task: HuggingFace task (summarization, question-answering, feature-extraction etc)
    • task_model: Large Language Model from public or private HuggingFace repository
    • use_topk: Flag indicating whether to use only the top k embedding chunks for the query
    • Returns: (Table object)
    • Matched document link
    • Query result
  • run_semantic_search: Performs semantic search using pgvector
    • Parameters:
    • input: Input prompt
    • Returns: (Table object)
    • Query result
  • generate_batch_embeddings: Generates and stores embeddings from a preconfigured datasource using pgvector
    • Parameters:
    • N/A
    • Returns:
    • N/A

Deploy Bitnami Postgres on Kubernetes

Prequisites:

-[ ] Install helm

  1. Build the postgresml-enabled Postgres instance image (NOTE: Skip if already built; also, must build on a network with sufficient bandwidth - example, might run into issues behind some VPNs):
source .env
cd resources
build-postgresml-baseimage.sh
watch kubectl get pvc -n ${DATA_E2E_POSTGRESML_NS}
cd -
  1. Deploy Postgres instance:
resources/deploy-postgresml-cluster.sh
watch kubectl get all -n ${DATA_E2E_POSTGRESML_NS}
  1. To get the connect string for the postgresml-enabled instance:
export POSTGRESML_PW=${DATA_E2E_BITNAMI_AUTH_PASSWORD}
export POSTGRESML_ENDPOINT=$(kubectl get svc ${DATA_E2E_BITNAMI_AUTH_DATABASE}-bitnami-postgresql -n${DATA_E2E_POSTGRESML_NS} -o jsonpath="{.status.loadBalancer.ingress[0].hostname}")
echo postgresql://postgres:${POSTGRESML_PW}@${POSTGRESML_ENDPOINT}/${DATA_E2E_BITNAMI_AUTH_DATABASE}?sslmode=require
  1. To delete the Postgres instance:
resources/delete-postgresml-cluster.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published