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

Update CONTRIBUTING.md #726

Merged
merged 2 commits into from
Oct 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Wren Engine is the backbone of the Wren AI project. The semantic engine for LLMs
To contribute, please refer to [Wren Engine Contributing Guide](https://github.com/Canner/wren-engine/blob/main/ibis-server/docs/CONTRIBUTING.md)

## Guide for Contributing to Multiple Services
We rely on docker-compose to start all services. If you are contributing to multiple services, you could just comment out the services you'd like to start from source code and change the `env` variables to point to the services you started by yourself.
We rely on docker-compose to start all services. If you are contributing to multiple services, you could just comment out the services you'd like to start from the source code and change the `env` variables to point to the services you started by yourself.

### Example: Contributing to the [Wren UI Service](#wren-ui-service) and [Wren Engine Service](#wren-engine-service)
If you are contributing to both the [Wren UI Service](#wren-ui-service) and [Wren Engine Service](#wren-engine-service), you should comment out the `wren-engine` service in the `docker/docker-compose-dev.yml` file (note that the UI service is already excluded from `docker/docker-compose-dev.yml`). Then, adjust the environment variables in your `.env` file to point to the services you have started manually. This will ensure that your local development environment correctly interfaces with the services you are working on.
Expand Down Expand Up @@ -75,15 +75,15 @@ If you are contributing to both the [Wren UI Service](#wren-ui-service) and [Wre

## :electric_plug: Creating a New Data Source Connector

To create a new data source connector, you will need to make changes to both the front-end and back-end of Wren UI, as well as the Wren Engine.
To develop a new data source connector, you'll need to modify both the front-end and back-end of the Wren UI, in addition to the Wren Engine.

Below is a brief overview of a data source connector:

<img src="./misc/data_source.png" width="400">

The UI is primarily responsible for storing database connection settings, providing an interface for users to input these settings, and submitting them to the Engine, which then connects to the database.

The UI needs to be aware of the connection information it must store, as determined by the Engine. Therefore, the implementation sequence would be as follows:
The UI must be aware of the connection details it needs to retain, as specified by the Engine. Therefore, the implementation sequence would be as follows:


- Engine:
Expand All @@ -100,7 +100,7 @@ The UI needs to be aware of the connection information it must store, as determi

### Wren Engine

- To implement a new data source, please refer to [How to Add a New Data Source](https://github.com/Canner/wren-engine/blob/main/ibis-server/docs/how-to-add-data-source.md) .
- To implement a new data source, please refer to [How to Add a New Data Source](https://github.com/Canner/wren-engine/blob/main/ibis-server/docs/how-to-add-data-source.md).
- After adding a new data source, you can proceed with implementing the metadata API for the UI.

Here are some previous PRs that introduced new data sources:
Expand All @@ -120,7 +120,7 @@ If you prefer to learn by example, you can refer to this Trino [issue](https://g
- define the `toIbisConnectionInfo` and `sensitiveProps` methods

2. Modify the ibis adaptor in `wren-ui/src/apollo/server/adaptors/ibisAdaptor.ts`
- define a ibis connection info type for the new data source
- define an ibis connection info type for the new data source
- set up the `dataSourceUrlMap` for the new data source

3. Modify the repository in `wren-ui/src/apollo/server/repositories/projectRepository.ts`
Expand Down Expand Up @@ -153,7 +153,7 @@ If you prefer to learn by example, you can refer to this Trino [issue](https://g
4. Update the data source list:
- Add the new data source to the `DATA_SOURCES` enum in `wren-ui/src/utils/enum/dataSources.ts`
- Update relevant files in `wren-ui/src/components/pages/setup/` to include the new data source
- Ensure `wren-ui/src/apollo/server/adaptors/ibisAdaptor.ts` handles the new data source
- Ensure `wren-ui/src/apollo/server/adaptors/ibisAdaptor.ts` handle the new data source

5. Test the new connector:
- Ensure the new data source appears in the UI
Expand Down