michaelfeil / infinity

Infinity is a high-throughput, low-latency REST API for serving text-embeddings, reranking models and clip
https://michaelfeil.github.io/infinity/
MIT License
1.23k stars 83 forks source link

Helm charts for K8s deployment of Infinity #314

Open indranilr opened 1 month ago

indranilr commented 1 month 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 1 month 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 1 month ago

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