Open Gandhi-Sagar opened 1 year ago
Hi, could you elaborate more on your use case? This isn't usually how databases support storage so curious what you are trying to achieve?
@HammadB so for example I've currently deployed a chromadb container via an azure container instance.
If the instance is restarted, then all the data is lost. I want to enable persistence, to say an azure blob storage, so that if the container instance is restarted the data is not lost.
i need the same. could you solved???
Yes, I ended up mounting a shared storage to the container and then put the mount path as _persistdirectory for chroma.
@rlleshi can you help me with a mini-tutorial please
Sure. I use terraform for deployment, so here are the blocks:
Deploy ChromaDB as an Azure Container Instance:
resource "azurerm_container_group" "my_containers" {
name = "${local.name_prefix}Containers"
location = azurerm_resource_group.my_resource_group.location
resource_group_name = azurerm_resource_group.my_resource_group.name
ip_address_type = "Public"
dns_name_label = "some_dns_name_label"
os_type = "Linux"
container {
name = "chromadb"
image = "chromadb/chroma"
cpu = "4"
memory = "8"
ports {
port = 8000
protocol = "TCP"
}
volume { # mount shared storage account as a volume
name = "${local.chroma_fileshare_name}-volume"
mount_path = local.chroma_mount_path
read_only = false
share_name = azurerm_storage_share.file_share.name
storage_account_name = azurerm_storage_account.my_sa.name
storage_account_key = azurerm_storage_account.my_sa.primary_access_key
}
environment_variables = {
persist_directory = local.chroma_mount_path # if you want to specify a different mount path
}
}
}
Storage Account:
resource "azurerm_storage_account" "my_sa" {
name = "${local.name_prefix}sa"
resource_group_name = azurerm_resource_group.my_resource_group.name
location = azurerm_resource_group.my_resource_group.location
account_tier = local.account_tier
account_replication_type = local.account_replication_type
}
File Share:
resource "azurerm_storage_share" "file_share" {
name = local.chroma_fileshare_name
storage_account_name = azurerm_storage_account.my_sa.name
quota = local.storage_share_quota
}
All the variables with local can be defined in a locals.tf
file.
@rlleshi are you able to provide a bit more detail how you define your chromadb client once you've deployed the contained via terraform
Describe the problem
Using chromadb in docker environment, the collection storage is lost once docker container is brought down. I want to persist the collections (docs, embeddings, metadata, ids) to say, azure blob storage, or, aws s3, or somewhere else.
Describe the proposed solution
While configuring the client, get the params for where to persist the data:
and under the hood, integrate specific library, azure_cli in this case.
Alternatives considered
No response
Importance
i cannot use Chroma without it
Additional Information
No response