chroma icon indicating copy to clipboard operation
chroma copied to clipboard

[ENH]: Chroma client upgrade check

Open tazarov opened this issue 1 year ago • 5 comments

Note: This is for Python client only Note:: Partly resolved #846

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • __version__ is now exported at chromadb package level
  • New functionality
    • New check against pypi for latest chroma version (failures are ignored)

Test plan

How are these changes tested?

  • [x] Tests pass locally with pytest for python

Documentation Changes

N/A

tazarov avatar Dec 15 '23 15:12 tazarov

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)

github-actions[bot] avatar Dec 15 '23 15:12 github-actions[bot]

This doesn't show when I use chroma run and manually hardcode to a lower version.

HammadB avatar Dec 19 '23 21:12 HammadB

This doesn't show when I use chroma run and manually hardcode to a lower version.

The issue with chroma run is that it uses SegmentAPI directly instead of a client. The functionality for checking things is in the client. It makes sense to notify users on chroma run too.

Moving the version check to utils class and then we call it from client and app.py

tazarov avatar Dec 20 '23 14:12 tazarov

works with chroma run now:

(.venv) tazarov@Trayans-MacBook-Pro upgrade-notification % python -m chromadb.cli.cli run


                (((((((((    (((((####
             ((((((((((((((((((((((#########
           ((((((((((((((((((((((((###########
         ((((((((((((((((((((((((((############
        (((((((((((((((((((((((((((#############
        (((((((((((((((((((((((((((#############
         (((((((((((((((((((((((((##############
         ((((((((((((((((((((((((##############
           (((((((((((((((((((((#############
             ((((((((((((((((##############
                (((((((((    #########

    

Running Chroma

Saving data to: ./chroma_data
Connect to chroma at: http://localhost:8000
Getting started guide: https://docs.trychroma.com/getting-started


INFO:     [20-12-2023 16:10:35] [notice] A new release of chromadb is available: 0.4.17! -> 0.4.20
INFO:     [20-12-2023 16:10:35] [notice] To upgrade, run `pip install --upgrade chromadb`.
...

tazarov avatar Dec 20 '23 14:12 tazarov

It now also works with running Chroma server:

(.venv) tazarov@Trayans-MacBook-Pro upgrade-notification % uvicorn chromadb.app:app --workers 1 --host 0.0.0.0 --port 8000 --proxy-headers --log-config chromadb/log_config.yml --reload
INFO:     [20-12-2023 17:03:11] Will watch for changes in these directories: ['/Users/tazarov/experiments/chroma-experiments/oss/upgrade-notification']
INFO:     [20-12-2023 17:03:11] Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     [20-12-2023 17:03:11] Started reloader process [76707] using WatchFiles
DEBUG:    [20-12-2023 17:03:12] Registering provider: token_config
DEBUG:    [20-12-2023 17:03:12] Registering provider: user_token_config
DEBUG:    [20-12-2023 17:03:12] Registering provider: token
DEBUG:    [20-12-2023 17:03:12] Registering provider: token
INFO:     [20-12-2023 17:03:12] [notice] A new release of chromadb is available: 0.4.17! -> 0.4.20
INFO:     [20-12-2023 17:03:12] [notice] To upgrade, run `pip install --upgrade chromadb`.
INFO:     [20-12-2023 17:03:12] Anonymized telemetry enabled. See                     https://docs.trychroma.com/telemetry for more information.

tazarov avatar Dec 20 '23 15:12 tazarov