Update Contributing (#1288)

This commit is contained in:
Yuhong Sun 2024-04-01 22:41:40 -07:00 committed by GitHub
parent 87019fc18e
commit b0e0557d63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,25 +112,11 @@ docker compose -f docker-compose.dev.yml -p danswer-stack up -d index relational
(index refers to Vespa and relational_db refers to Postgres) (index refers to Vespa and relational_db refers to Postgres)
#### Running Danswer #### Running Danswer
Setup a folder to store config. Navigate to `danswer/backend` and run:
```bash
mkdir dynamic_config_storage
```
To start the frontend, navigate to `danswer/web` and run: To start the frontend, navigate to `danswer/web` and run:
```bash ```bash
npm run dev npm run dev
``` ```
Package the Vespa schema. This will only need to be done when the Vespa schema is updated locally.
Navigate to `danswer/backend/danswer/document_index/vespa/app_config` and run:
```bash
zip -r ../vespa-app.zip .
```
- Note: If you don't have the `zip` utility, you will need to install it prior to running the above
The first time running Danswer, you will also need to run the DB migrations for Postgres. The first time running Danswer, you will also need to run the DB migrations for Postgres.
After the first time, this is no longer required unless the DB models change. After the first time, this is no longer required unless the DB models change.
@ -149,17 +135,12 @@ python ./scripts/dev_run_background_jobs.py
To run the backend API server, navigate back to `danswer/backend` and run: To run the backend API server, navigate back to `danswer/backend` and run:
```bash ```bash
AUTH_TYPE=disabled \ AUTH_TYPE=disabled uvicorn danswer.main:app --reload --port 8080
DYNAMIC_CONFIG_DIR_PATH=./dynamic_config_storage \
VESPA_DEPLOYMENT_ZIP=./danswer/document_index/vespa/vespa-app.zip \
uvicorn danswer.main:app --reload --port 8080
``` ```
_For Windows (for compatibility with both PowerShell and Command Prompt):_ _For Windows (for compatibility with both PowerShell and Command Prompt):_
```bash ```bash
powershell -Command " powershell -Command "
$env:AUTH_TYPE='disabled' $env:AUTH_TYPE='disabled'
$env:DYNAMIC_CONFIG_DIR_PATH='./dynamic_config_storage'
$env:VESPA_DEPLOYMENT_ZIP='./danswer/document_index/vespa/vespa-app.zip'
uvicorn danswer.main:app --reload --port 8080 uvicorn danswer.main:app --reload --port 8080
" "
``` ```
@ -178,20 +159,16 @@ pre-commit install
Additionally, we use `mypy` for static type checking. Additionally, we use `mypy` for static type checking.
Danswer is fully type-annotated, and we would like to keep it that way! Danswer is fully type-annotated, and we would like to keep it that way!
Right now, there is no automated type checking at the moment (coming soon), but we ask you to manually run it before To run the mypy checks manually, run `python -m mypy .` from the `danswer/backend` directory.
creating a pull requests with `python -m mypy .` from the `danswer/backend` directory.
#### Web #### Web
We use `prettier` for formatting. The desired version (2.8.8) will be installed via a `npm i` from the `danswer/web` directory. We use `prettier` for formatting. The desired version (2.8.8) will be installed via a `npm i` from the `danswer/web` directory.
To run the formatter, use `npx prettier --write .` from the `danswer/web` directory. To run the formatter, use `npx prettier --write .` from the `danswer/web` directory.
Like `mypy`, we have no automated formatting yet (coming soon), but we request that, for now, Please double check that prettier passes before creating a pull request.
you run this manually before creating a pull request.
### Release Process ### Release Process
Danswer follows the semver versioning standard. Danswer follows the semver versioning standard.
A set of Docker containers will be pushed automatically to DockerHub with every tag. A set of Docker containers will be pushed automatically to DockerHub with every tag.
You can see the containers [here](https://hub.docker.com/search?q=danswer%2F). You can see the containers [here](https://hub.docker.com/search?q=danswer%2F).
As pre-1.0 software, even patch releases may contain breaking or non-backwards-compatible changes.