Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHCR Repo and Issue templates #5

Merged
merged 10 commits into from
Jul 29, 2023
63 changes: 63 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Bug Report
description: File a bug report with ChromaDB Chart
title: "[Bug]: "
labels: ["bug", "triage"]
# assignees:
# - octocat
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
# value: "A bug happened!"
validations:
required: true
- type: dropdown
id: chroma-version
attributes:
label: ChromaDB Version
description: What is your chromaDB version?
options:
- 0.4.3
validations:
required: true
- type: dropdown
id: kube-version
attributes:
label: Kubernetes Version
description: What is your Kubernetes version?
options:
- 1.24.x
- 1.25.x
- 1.26.x
- 1.27.x
validations:
required: true
- type: textarea
id: versions
attributes:
label: Environment details
description: Tell us about your environment setup.
placeholder: On-prem k3s, GKE, EKS, etc.
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs, Kubectl output, Manifests, etc.
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
# - type: checkboxes
# id: terms
# attributes:
# label: Code of Conduct
# description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com)
# options:
# - label: I agree to follow this project's Code of Conduct
# required: true
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Feature Request"
description: Suggest an idea for ChromaDB Chart
title: "[Feature Request]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to request this feature!
- type: textarea
id: problem
attributes:
label: Describe the problem
description: Please provide a clear and concise description the problem this feature would solve. The more information you can provide here, the better.
placeholder: I prefer if...
validations:
required: true
- type: textarea
id: solution
attributes:
label: Describe the proposed solution
description: Please provide a clear and concise description of what you would like to happen.
placeholder: I would like to see...
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: "Please provide a clear and concise description of any alternative solutions or features you've considered."
- type: dropdown
id: importance
attributes:
label: Importance
description: How important is this feature to you?
options:
- nice to have
- would make my life easier
- I cannot run the chart without it
validations:
required: true
- type: textarea
id: additional-context
attributes:
label: Additional Information
description: Add any other context or screenshots about the feature request here.
23 changes: 22 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: "ghcr.io/amikos-tech/chromadb-chart/chroma"

jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -24,6 +28,23 @@ jobs:
version: v3.4.0

- name: Run chart-releaser
id: releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Log in to the Container registry
# if: ${{ steps.releaser.outputs.changed_charts == '' }}
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push release Docker image
# if: ${{ steps.releaser.outputs.changed_charts == '' }}
uses: docker/[email protected]
with:
context: .
file: image/Dockerfile
push: true
tags: "${{ env.IMAGE_NAME }}:${{steps.releaser.outputs.chart_version}},${{ env.IMAGE_NAME }}:latest"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ helm install chroma chroma/chromadb --set chromadb.allowReset="true"
```bash
minikube service chroma-chromadb --url
```
## Building the Docker image

```bash
docker build --no-cache -t <image:tag> -f image/Dockerfile .
docker push <image:tag>
```
## Setup Kubernetes Cluster

For this example we'll set up a Kubernetes cluster using minikube.
Expand Down
5 changes: 4 additions & 1 deletion image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
FROM ghcr.io/chroma-core/chroma:0.4.3

COPY ./image/docker_entrypoint.sh /docker_entrypoint.sh
RUN find /chroma -mindepth 1 -maxdepth 1 ! \( -name 'chromadb' -o -name 'LICENSE' -o -name 'requirements.txt' \) -exec rm -rf {} \; && \
groupadd chroma && \
useradd -g chroma chroma && \
chown -R chroma:chroma /chroma
chown -R chroma:chroma /chroma && \
pip install --force-reinstall --no-cache-dir chroma-hnswlib && \
apt-get update -qq && apt-get install sqlite3
EXPOSE 8000
USER chroma
WORKDIR /chroma
Expand Down
5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
chromadb-client==0.4.3.dev0
pytest==7.4.0
pytest==7.4.0
openai
python-dotenv
sentence_transformers
32 changes: 29 additions & 3 deletions tests/test_chroma.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
import os
import uuid

import chromadb
from chromadb import Settings
from chromadb.utils import embedding_functions
from dotenv import load_dotenv

load_dotenv()


def get_embedding_function():
"""
Get the embedding function

:return: Embedding function
"""

openai_ef = embedding_functions.OpenAIEmbeddingFunction(
model_name="text-embedding-ada-002",
api_key=os.environ.get('OPENAI_API_KEY')
)
return openai_ef


sentence_transformer_ef = embedding_functions.SentenceTransformerEmbeddingFunction(model_name="all-MiniLM-L6-v2")


def test_chroma():
client = chromadb.HttpClient(host="localhost", port=8000)
client.heartbeat()
client.reset()
# collection = client.create_collection("all1-my-documents")
collection = client.get_or_create_collection("all1-my-documents",
embedding_function=sentence_transformer_ef)
collection.add(documents=["this is a test embedding"], metadatas=[{"type": "page"}], ids=[str(uuid.uuid4())])
assert len(collection.get()['ids']) == 1


if __name__ == '__main__':
test_chroma()
test_chroma()