-
Notifications
You must be signed in to change notification settings - Fork 2k
[DOC] Sync docs #5705
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
Merged
Merged
[DOC] Sync docs #5705
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2e5eafe
[DOC] Sync docs
drewkim 41d3dca
minor edits + add to sidebar
philipithomas 27aebc0
screenshots for direct use case
philipithomas 142f5e5
add screenshots for platform use case
philipithomas 3ec1942
fix image refs
philipithomas 1ec06a5
typos, comments
drewkim 9a506e7
typos
drewkim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
122 changes: 122 additions & 0 deletions
122
docs/docs.trychroma.com/markdoc/content/cloud/sync/github.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| --- | ||
| id: github | ||
| name: GitHub | ||
| --- | ||
|
|
||
| # Walkthrough | ||
|
|
||
| ## Direct Sync | ||
|
|
||
| Direct Sync is the default syncing method, which uses the Chroma Cloud GitHub app. To use your own custom GitHub app, use [Platform Sync](/cloud/sync/overview#platform-sync). | ||
|
|
||
| 1. **Prerequisites** | ||
|
|
||
| This walkthrough assumes that you have a GitHub account with at least one repository. | ||
|
|
||
| 2. **New database setup** | ||
|
|
||
| If you do not already have a Chroma Cloud account, you will need to create one at [trychroma.com](https://www.trychroma.com). After creating an account, you can create a database by specifying a name: | ||
|
|
||
| {% MarkdocImage lightSrc="/sync/sync_create_database.png" darkSrc="/sync/sync_create_database.png" alt="Create database screen" /%} | ||
|
|
||
| On the setup screen, select "Sync a GitHub repo": | ||
|
|
||
| {% MarkdocImage lightSrc="/sync/sync_new_db_onboarding.png" darkSrc="/sync/sync_create_database.png" alt="Onboarding screen for syncing a GitHub repo" /%} | ||
|
|
||
| Install the Chroma GitHub App into your GitHub account or organization: | ||
|
|
||
| {% MarkdocImage lightSrc="/sync/sync_new_db_github_install.png" darkSrc="/sync/sync_new_db_github_install.png" alt="GitHub app installation screen" /%} | ||
|
|
||
| And follow the prompts to initiate sync. Choose the **repo** to sync code from, the **branch or commit hash** version of the code to index, and new **collection name** for the synced code. (The collection will be created by the syncing process, and must not exist yet.) | ||
|
|
||
| {% MarkdocImage lightSrc="/sync/sync_install.png" darkSrc="/sync/sync_install.png" alt="/sync repo to Chroma Collection UI" /%} | ||
|
|
||
|
|
||
| 3. **Existing database setup** | ||
|
|
||
| Open an existing database in Chroma Cloud, and select "Sync" from the menu: | ||
|
|
||
| {% MarkdocImage lightSrc="/sync/sync_existing_db.png" darkSrc="/sync/sync_existing_db.png" alt="/sync tab in Chroma Cloud UI" /%} | ||
|
|
||
|
|
||
| On the Sync page, select "Create" to begin syncing code. If you have not already connected GitHub, you may be prompted to install the Chroma Cloud GitHub app again. | ||
|
|
||
| {% MarkdocImage lightSrc="/sync/sync_existing_db_add.png" darkSrc="/sync/sync_existing_db_add.png" alt="Create path for a new Sync" /%} | ||
|
|
||
| Then, follow the prompts to initiate sync. Choose the **repo** to sync code from, the **branch or commit hash** version of the code to index, and new **collection name** for the synced code. (The collection will be created by the syncing process, and must not exist yet.) | ||
drewkim marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| {% MarkdocImage lightSrc="/sync/sync_existing_db_sync.png" darkSrc="/sync/sync_existing_db_sync.png" alt="Create flow for a new Sync" /%} | ||
|
|
||
|
|
||
| 4. **Viewing an Invocation** | ||
|
|
||
| Each Sync create a new Invocation. When completed, select "View Collection" to see the new Chroma collection containing the synced code: | ||
drewkim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| {% MarkdocImage lightSrc="/sync/db_invocation.png" darkSrc="/sync/db_invocation.png" alt="Invocation screen for a Sync" /%} | ||
|
|
||
|
|
||
| ## Platform Sync | ||
|
|
||
| 1. **Prerequisites** | ||
|
|
||
| This walkthrough assumes that you have an existing GitHub App that has been installed into at least one non-empty GitHub account or organization. | ||
|
|
||
| 2. **Setup** | ||
|
|
||
| If you do not already have a Chroma Cloud account, you will need to create one at [trychroma.com](https://www.trychroma.com). After creating an account, you can create a database by specifying a name: | ||
|
|
||
| {% MarkdocImage lightSrc="/sync/sync_create_database.png" darkSrc="/sync/sync_create_database.png" alt="Create database screen" /%} | ||
|
|
||
| Once you have a database, you should create an API key to be able to access the Sync Function’s API. You can choose to make this API key scoped to all databases on your account or only the one you just created: | ||
|
|
||
| {% MarkdocImage lightSrc="/sync/api_keys.png" darkSrc="/sync/api_keys.png" alt="API key issuance for Chroma Cloud" /%} | ||
|
|
||
| The final setup step is to grant Chroma access to the repositories to which your GitHub App has access. You will need to retrieve the app’s ID and private key from GitHub: | ||
|
|
||
| {% MarkdocImage lightSrc="/sync/github_app_id.png" darkSrc="/sync/github_app_id.png" alt="GitHub App ID" /%} | ||
|
|
||
| {% MarkdocImage lightSrc="/sync/github_secret_key.png" darkSrc="/sync/github_secret_key.png" alt="GitHub Secret Key" /%} | ||
|
|
||
| With these credentials, you can use the Chroma dashboard to register your GitHub App with Chroma. **Contact [[email protected]](mailto:[email protected]) for access to this feature.** | ||
|
|
||
| {% MarkdocImage lightSrc="/sync/custom-github-app-screen.png" darkSrc="/sync/custom-github-app-screen.png" alt="Creating a custom github app" /%} | ||
|
|
||
| 3. **Creating a source** | ||
|
|
||
| To create a source, you must send an API request to the Sync Function’s API: | ||
|
|
||
| ```bash | ||
| curl -X POST https://sync.trychroma.com/api/v1/sources \ | ||
| -H "x-chroma-token: <YOUR_CHROMA_API_KEY>" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "database_name": "<YOUR_DATABASE_NAME>", | ||
| "embedding_model": "Qwen/Qwen3-Embedding-0.6B", | ||
| "github": { | ||
| "repository": "chroma-core/chroma", | ||
| "app_id": "<YOUR_GITHUB_APP_ID>" | ||
| } | ||
| }' | ||
| ``` | ||
|
|
||
| 4. **Invoking the Sync Function** | ||
|
|
||
| To invoke the Sync Function, you must select a source on which to create the invocation. See the previous step for details on how to create a source. Once you select the source in the UI, you can invoke the Sync Function by clicking “Create invocation”: | ||
|
|
||
| {% MarkdocImage lightSrc="/sync/custom_source_invocation.png" darkSrc="/sync/custom_source_invocation.png" alt="Creating a custom sync invocation" /%} | ||
|
|
||
| Alternatively, you can invoke the Sync Function by sending an API request to the Sync Function’s API: | ||
|
|
||
| ```bash | ||
| curl -X POST https://sync.trychroma.com/api/v1/sources/{source_id}/invocations \ | ||
| -H "x-chroma-token: <YOUR_CHROMA_API_KEY>" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "target_collection_name": "<YOUR_TARGET_COLLECTION_NAME>", | ||
| "ref_identifier": { | ||
| // only one of these should be supplied | ||
| "branch": "<YOUR_BRANCH_NAME>", | ||
| "sha": "<YOUR_COMMIT_SHA>" | ||
| } | ||
| }' | ||
| ``` | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.