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

[BUG] docker-compose default persistent directory path updated #1046

Merged

Conversation

Benvii
Copy link
Contributor

@Benvii Benvii commented Aug 25, 2023

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 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?

  • Tests pass locally with pytest for python, yarn test for js
  • 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?

@github-actions
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readbility, Modularity, Intuitiveness)

@@ -12,7 +12,8 @@ services:
dockerfile: Dockerfile
volumes:
- ./:/chroma
- index_data:/index_data
# Be aware that indexed data are located in "/chroma/chroma/"
# Default configuration for persist_directory in chromadb/config.py
command: uvicorn chromadb.app:app --reload --workers 1 --host 0.0.0.0 --port 8000 --log-config log_config.yml
environment:
- IS_PERSISTENT=TRUE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should go one step further and instead of simply removing the dir we should instead add - PERSIST_DIRECTORY=${PERSIST_DIRECTORY:-/chroma/chroma} while this is not a huge change it does give the indication to someone reading the docker compose where is actually data persisted without having to read through the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated thanks for the suggestion I agree that it's clearly more useful and explicit.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great suggestion!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Benvii did this suggestion get rewinded?

@jeffchuber jeffchuber requested a review from HammadB August 27, 2023 22:33
@jeffchuber
Copy link
Contributor

@HammadB can you take a look here?

@HammadB
Copy link
Collaborator

HammadB commented Aug 27, 2023

OK

@HammadB HammadB enabled auto-merge (squash) August 28, 2023 22:28
@HammadB
Copy link
Collaborator

HammadB commented Aug 28, 2023

Thanks @Benvii ! Auto-merge enabled

@HammadB
Copy link
Collaborator

HammadB commented Aug 28, 2023

Ah, this will have to rebase off of #1054 for tests to pass.

@HammadB HammadB disabled auto-merge August 28, 2023 23:19
@Benvii Benvii force-pushed the 1035_docker_compose_persistent_volume branch from 458562f to cf52488 Compare August 31, 2023 08:03
@Benvii
Copy link
Contributor Author

Benvii commented Aug 31, 2023

Rebased, thanks in advance for the approval

@HammadB HammadB merged commit 240401b into chroma-core:main Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Wrong persistent folder in docker-compose files
4 participants