michaelfeil / infinity

Infinity is a high-throughput, low-latency serving engine for text-embeddings, reranking models, clip, clap and colpali
https://michaelfeil.github.io/infinity/
MIT License
1.5k stars 116 forks source link

Helm charts for K8s deployment of Infinity #314

Open indranilr opened 4 months ago

indranilr commented 4 months ago

Although dockerized deployments are supported, an official helm chart would be very handy for K8s deployments. Is this already available ?

greptile-apps[bot] commented 4 months ago

Currently, there are no Helm charts available for deploying Infinity on Kubernetes. To create a Helm chart for Infinity, follow these steps:

  1. Create Directory Structure:

    mkdir -p helm/infinity/templates
    touch helm/infinity/Chart.yaml helm/infinity/values.yaml helm/infinity/templates/deployment.yaml helm/infinity/templates/service.yaml
  2. Define Chart Metadata (helm/infinity/Chart.yaml):

    apiVersion: v2
    name: infinity
    description: A Helm chart for Kubernetes deployment of Infinity
    version: 0.1.0
  3. Set Default Values (helm/infinity/values.yaml):

    image:
     repository: michaelf34/infinity
     tag: latest
    service:
     type: ClusterIP
     port: 80
  4. Create Deployment Template (helm/infinity/templates/deployment.yaml):

    apiVersion: apps/v1
    kind: Deployment
    metadata:
     name: infinity
    spec:
     replicas: 1
     selector:
       matchLabels:
         app: infinity
     template:
       metadata:
         labels:
           app: infinity
       spec:
         containers:
         - name: infinity
           image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
           ports:
           - containerPort: {{ .Values.service.port }}
           env:
           - name: MODEL_ID
             value: "BAAI/bge-small-en-v1.5"
           - name: PORT
             value: "80"
  5. Create Service Template (helm/infinity/templates/service.yaml):

    apiVersion: v1
    kind: Service
    metadata:
     name: infinity
    spec:
     type: {{ .Values.service.type }}
     ports:
     - port: {{ .Values.service.port }}
       targetPort: 80
     selector:
       app: infinity
  6. Package and Deploy:

    helm package helm/infinity
    helm install infinity ./infinity-0.1.0.tgz

References

/.github/ISSUE_TEMPLATE/bug-report.yml /.github/ISSUE_TEMPLATE /docs/docs/deploy.md /.github/ISSUE_TEMPLATE/new-model-addition.yml /.github/workflows/release.yaml /README.md /docs/docs /docs/assets/openapi.json /docs/docs/index.md /docs /libs/infinity_emb/tests/data/benchmark /docs/assets /.github/ISSUE_TEMPLATE/feature-request.yml /libs/infinity_emb /libs/infinity_emb/Makefile /libs/infinity_emb/README.md /docs/benchmarks/simple_app.py /libs/infinity_emb/tests/end_to_end/test_authentication.py /docs/benchmarks /libs/infinity_emb/tests/end_to_end/test_optimum_embedding.py /libs /libs/infinity_emb/tests/data /.github/workflows/ci.yaml /.github

#### About Greptile This response provides a starting point for your research, not a precise solution. Help us improve! Please leave a ๐Ÿ‘ if this is helpful and ๐Ÿ‘Ž if it is irrelevant. [Ask Greptile](https://app.greptile.com/chat/github/michaelfeil/infinity/main) ยท [Edit Issue Bot Settings](https://app.greptile.com/apps/github)
michaelfeil commented 4 months ago

I agree, but have not used helm recently. There is no helm chart available, potentially the infra folder could be a suitable place?

samos123 commented 2 months ago

I am working on finishing the KubeAI integration that allows you to deploy Infinity easily on K8s: https://github.com/substratusai/kubeai

PR that's soon to be merged: https://github.com/substratusai/kubeai/pull/197