29 Commits

Author SHA1 Message Date
Jeff Huber
7d412aef8c [ENH] initial CLI (#1032)
This proposes an initial CLI

The CLI is installed when you installed `pip install chromadb`.

You then call the CLI with

`chroma run --path <persist_dir> --port <port>` where path and port are
optional.

This also adds `chroma help` and `chroma docs` as convenience links -
but I'm open to removing those.

To make this easy - I added `typer` (by the author of FastAPI). I'm not
sure this is the tool that we want to commit to for a fuller featured
CLI, but given the extremely minimal footprint of this - I don't think
it's a one way door.

<img width="1477" alt="Screenshot 2023-08-23 at 4 59 54 PM"
src="https://github.com/chroma-core/chroma/assets/891664/30374228-d303-41e1-8e9e-188b7f8532d4">

***

#### TODO
- [x] test in fresh env - i think i need to add `typer` as a req
- [ ] consider expanding the test to make sure the service is actually
running
- [x] hide the test option from the typer UI
- [x] linking to a getting started guide could be interesting at the top
of the logs
2023-09-11 20:49:25 -07:00
Hammad Bashir
6c700ebdfc Add explicit env to docker compose so that it can hint at usage (#1088)
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
- Add explicit env for persist directory defaults to docker compose so
that it can hint at usage
 - New functionality
	 - ...

## Test plan
Existing tests
- [x] Tests pass locally with `pytest` for python, `yarn test` for js

## Documentation Changes
None required
2023-09-05 12:48:57 -07:00
Benjamin BERNARD
240401be27 [BUG] docker-compose default persistent directory path updated (#1046)
Fixes #1035

## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
- Default persistent directory isn't `/index_data` it's located at
`/chroma/chroma/`
[config.py#L85](https://github.com/chroma-core/chroma/blob/main/chromadb/config.py#L85)
fixing it in serveur core docker-compose
- Removing misleading volume `/index_data` in main docker-compose.yaml
file, that clearly induce in error users
- Adding comment in main docker-compose.yaml file so that Chroma users
won't waste time seeking for this directory path
 - New functionality

Does it introduce a breaking change ?

- With this change data will now be persistent for users using
`docker-compose.server.example.yml` as it's a exemple file this
shouldn't be considered as a breaking change.

## Test plan
*How are these changes tested?*

- [x] Tests pass locally with `pytest` for python, `yarn test` for js
- [x] Start Chroma server with `docker-compose up -d` create a
collection, stop Chroma server with `docker-compose down` and start it
again `docker-compose up -d`, check the created collection still exists.

## Documentation Changes
*Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
repository](https://github.com/chroma-core/docs)?*
2023-09-05 10:43:04 -07:00
Trayan Azarov
35a367e02e [ENH]: Auth Providers - Static API Token (#1051)
Refs: #1027

## Description of changes

*Summarize the changes made by this PR.*
 - New functionality
        - Baseline functionality and tests implemented
        - Example notebook updated
- Minor refactor on the client creds provider to allow for user specific
credentials fetching.

## Test plan
*How are these changes tested?*

- [x] Tests pass locally with `pytest` for python (regression)
- [x] New fixtures added for token-based auth

## Documentation Changes
Docs should be updated to highlight the new supported auth method.
2023-08-28 16:51:41 -07:00
Trayan Azarov
bb170607ab [BUG]: CIP-2: Fixed docker-compose.yaml to work with env file (#1030)
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
- The docker-compose will now pick up ENV vars from supplied
`--env-file`

## Test plan

Manual tests done for both with and without env file scenarios

## Documentation Changes
Docs updated accordingly
2023-08-23 20:00:43 +00:00
Trayan Azarov
48700dd07f [ENH] CIP-2: Auth Providers Proposal (#986)
## Description of changes

*Summarize the changes made by this PR.*
 - New functionality
	 - Auth Provide Client and Server Side Abstractions
	 - Basic Auth Provider

## Test plan
Unit tests for authorized endpoints

## Documentation Changes
Docs should change to describe how to use auth providers on the client
and server. CIP added in `docs/`
2023-08-22 19:48:55 -07:00
Hammad Bashir
46de47945a SQLite Release PR (#808)
## Description of changes
Base PR to release sqlite refactor, which spans many stacked PRs.

Remaining
- [x] Merge this to main
- [x] Layered Persistent Index #761 
- [x] Remove old impls (In #781 )
- [x] Remove persist() API (In #787)
- [x] Add telemetry to SegmentAPI, it was not included. (#788)
- [x] New clients #805 
- [x] locking and soak tests for thread-safety 
- [x] Migration tool
- [x] Fix #739 
- [x] Fix metadata None vs empty
- [x] Fix persist directory (addressed in #761)
- [x] Leave files open in #761 (merge stacked PR)

Post Release
- [ ] Un xfail cross version tests once we cut the release
- [x] Documentation updates for new silent ADD failure.
- [x] Update all documentation for new API instantiation
- [x] Update all documentation for settings changes
- [ ] Update terraform deployment
- [ ] Update cloudformation deployment

---------

Co-authored-by: Luke VanderHart <luke@vanderhart.net>
Co-authored-by: Jeffrey Huber <jeff@trychroma.com>
Co-authored-by: Anton Troynikov <atroyn@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Sosa <37946988+CakeCrusher@users.noreply.github.com>
Co-authored-by: Russell Pollari <russell@sharpestminds.com>
Co-authored-by: russell-pollari <pollarir@mgail.com>
2023-07-17 14:21:34 -07:00
perryrobinson
d88860bbc5 Fix docker compose persistence issue and use multistage builder pattern to shrink chroma docker image (#456)
## Description of changes

Clickhouse data was being saved in an anonymous volume. Anonymous
volumes are not removed by default. However, as they don’t have a stable
name, they will not be automatically mounted by a subsequent `docker
compose up`. For data that needs to persist between updates, use
explicit paths as bind mounts or named volumes.
https://docs.docker.com/engine/reference/commandline/compose_down/#usage

The yaml in the repo makes it look like
clickhouse_data:/bitnami/clickhouse is where the data is supposed to go
but that isn't what's happening.

Modified Dockerfile to use multistage builder pattern to shrink the
docker image. The new image is 800MB smaller than the official chroma
image.

## Test plan

Build image locally. Unit tests all passed. Data persists after bringing
compose stack down and up. No actual chroma code change in this PR.
![chroma new
image](https://user-images.githubusercontent.com/52208818/235955676-bf5bf058-e02c-47e8-8c0b-6638d671280b.png)

## Documentation Changes

None required.

---------

Co-authored-by: perry <perryaws2021@protonmail.com>
Co-authored-by: Jeffrey Huber <jeff@trychroma.com>
2023-05-15 16:08:25 -07:00
Luke VanderHart
01a9d4abb6 use log config from docker 2023-03-07 09:00:40 -05:00
Luke VanderHart
3752b9c151 use config file to set required clickhouse settings 2023-02-28 16:55:21 -05:00
Jeffrey Huber
94d5f4d2c5 file cleanup 2023-02-10 12:49:07 -08:00
Hammad Bashir
dd5007b6b1 Replace clickhouse driver with official one 2023-02-09 17:04:39 -08:00
Jeffrey Huber
0e803a937f many changes 2023-02-08 06:23:23 -08:00
Luke VanderHart
4f554e8b86 Use separate docker compose cfg for tests
So we don't accidentally delete one we didn't want to when tests are
done running.
2022-12-03 20:54:19 -05:00
Luke VanderHart
73b8575309 run integration tests 2022-12-03 20:35:59 -05:00
Jeffrey Huber
55b007523b switch to arm, we will want to make this a flag 2022-12-01 22:14:26 -08:00
Jeffrey Huber
f1f914532e get running with docker' 2022-11-30 23:36:03 -08:00
Jeffrey Huber
a53a0f813f get docker working 2022-11-30 21:00:01 -08:00
Jeff Huber
bb563965d5 Merge pull request #80 from chroma-core/jeff/backup-restore
Clickhouse/Index backup and restore scripts
2022-11-18 10:10:32 -08:00
Jeffrey Huber
15915107f4 fix celery 2022-11-18 09:20:25 -08:00
Jeffrey Huber
865ac71372 use different ports for clickhouse for test and prod 2022-11-12 14:38:19 -08:00
Jeffrey Huber
12e81c7606 run tets while the app running 2022-11-11 14:40:38 -08:00
Jeffrey Huber
a467842675 Merge branch 'main' into jeff/celery 2022-11-10 16:04:53 -08:00
Jeffrey Huber
af8b7b7850 Merge branch 'main' into jeff/multi-space 2022-11-10 15:59:06 -08:00
Luke VanderHart
5cd1f272a1 run server tests in docker-compose cluster 2022-11-09 15:44:46 -05:00
Jeffrey Huber
18544c2d91 wip 2022-11-09 11:50:14 -08:00
Jeffrey Huber
f796bfbf27 first commit 2022-11-08 11:21:30 -08:00
Jeffrey Huber
e662654e38 works 2022-11-06 22:08:41 -08:00
Jeffrey Huber
fb39faedcc working commit 1 2022-11-03 15:56:14 -07:00