Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 100e7ba

Browse files
committed
update docs
1 parent d5d23a6 commit 100e7ba

File tree

2 files changed

+12
-71
lines changed

2 files changed

+12
-71
lines changed

backend/pytest.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
required_plugins = anyio pytest-asyncio pytest-cov pytest-env pytest-xdist
33
asyncio_default_fixture_loop_scope="function"
44
asyncio_mode=auto
5-
; use well known credentials for Cosmos DB emulator and Azure Storage emulator
5+
; NOTE: we use well known credentials for the Cosmos DB emulator and Azure Storage emulator.
6+
; If executing these pytests locally, users may need to modify the cosmosdb connection string to use http protocol instead of https.
7+
; This depends on how the cosmosdb emulator has been configured (by the user) to run.
68
env =
79
COSMOS_CONNECTION_STRING=AccountEndpoint=https://127.0.0.1:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==
810
STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;

docs/DEVELOPMENT-GUIDE.md

Lines changed: 9 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -7,90 +7,29 @@ Development is best done in a unix environment (Linux, Mac, or [Windows WSL](htt
77

88
1. Clone the GraphRAG repository.
99
1. Follow all directions in the [deployment guide](DEPLOYMENT-GUIDE.md) to install required tools and deploy an instance of the GraphRAG service in Azure. Alternatively, this repo provides a devcontainer with all tools preinstalled.
10-
1. Create a `.env` file in the root of the repository (`GraphRAG/.env`). A detailed description of environment variables used to configure graphrag can be found [here](https://microsoft.github.io/graphrag). Add the following environment variables to the `.env` file:
11-
12-
| Environment Variable | Description |
13-
| :--- | ---: |
14-
`COSMOS_URI_ENDPOINT` | Azure CosmosDB connection string from graphrag deployment
15-
`STORAGE_ACCOUNT_BLOB_URL` | Azure Storage blob url from graphrag deployment
16-
`AI_SEARCH_URL` | AI search endpoint from graphrag deployment (will be in the form of https://\<name\>.search.windows.net)
17-
`GRAPHRAG_API_BASE` | The AOAI API Base URL.
18-
`GRAPHRAG_API_VERSION` | The AOAI API version (i.e. `2023-03-15-preview`)
19-
`GRAPHRAG_LLM_MODEL` | The AOAI model name (i.e. `gpt-4`)
20-
`GRAPHRAG_LLM_DEPLOYMENT_NAME` | The AOAI model deployment name (i.e. `gpt-4-turbo`)
21-
`GRAPHRAG_EMBEDDING_MODEL` | The AOAI model name (i.e. `text-embedding-ada-002`)
22-
`GRAPHRAG_EMBEDDING_DEPLOYMENT_NAME` | The AOAI model deployment name (i.e.`my-text-embedding-ada-002`)
23-
`REPORTERS` | A comma-delimited list of logging that will be enabled. Possible values are `blob,console,file`
24-
25-
1. Developing inside the devcontainer
26-
1. Requirements
27-
- [Docker](https://www.docker.com/)
28-
- [Visual Studio Code](https://code.visualstudio.com/)
29-
- [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) for VS Code
30-
31-
1. Open VS Code in the directory containing your project.
32-
- Use the Command Palette (Ctrl+Shift+P on Windows/Linux, Cmd+Shift+P on macOS) and type "Remote-Containers: Open Folder in Container..."
33-
- Select your project folder and VS Code will start building the Docker container based on the Dockerfile and devcontainer.json in your project. This process may take a few minutes, especially on the first run.
34-
- Once your vscode prompt appears, it may not be done. You should wait for the following prompt to appear to ensure full install is complete. `vscode@<hostname>:/graphrag$`
35-
36-
1. Adding Python packages to the dev container.
37-
- Poetry is the Python package manager in the dev container. Python packages can be added using `poetry add <package-name>`
38-
- Everytime a package is added it will update `poetry.lock` and `pyproject.toml`, these are the two files that track all package management. Changes to these file should be checked into the repo. That is how we keep our devcontainer consistent across users.
39-
- Its possible to get into a situation where a package has been added but your local poetry.lock does not contain the proper hash. This is most common after resolving a merge conflict and the easiest way to resolve this issue is `poetry install`, which will check all package status' and update hash values in `poetry.lock`.
40-
41-
1. Adding dependencies to the environment
42-
- Most dependencies (packages or tools) should be added to the environment through the Dockerfile. This allows us to maintain a consistent development enviornment. If you need a tool added, please make the appropriate changes to the Dockerfile and submit a Pull Request.
43-
44-
### Deploying GraphRAG
45-
The GraphRAG service consist of two components - a `backend` application and a `frontend` UI application (coming soon). GraphRAG can be launched in multiple ways depending on where in the application stack you are developing and debugging.
46-
47-
- In Azure Kubernetes Service (AKS):
48-
49-
Navigate to the root directory of the repository. First build and publish the `backend` docker image to an azure container registry.
50-
51-
```
52-
> az acr build --registry <my_container_registry> -f docker/Dockerfile-backend --image graphrag:backend .
53-
```
54-
Update `infra/deployment.parameters.json` to use your custom graphrag docker images and re-run the deployment script to update AKS.
55-
56-
After deployment is complete, `kubectl` is used to login and view the GraphRAG AKS resources as well aid in other debugging use-cases. See below for some helpful commands to quickly access AKS
57-
```
58-
> RGNAME=<your_resource_group>
59-
> AKSNAME=`az aks list --resource-group $RGNAME --query "[].name" --output tsv`
60-
> az aks get-credentials -g $RGNAME -n $AKSNAME --overwrite-existing
61-
> kubectl config set-context --current --namespace=graphrag
62-
```
63-
Some example AKS commands below to get started
64-
```
65-
> kubectl get pods # view a list of all deployed pods
66-
> kubectl get nodes # view a list of all deployed nodes
67-
> kubectl get jobs # view a list of all AKS jobs
68-
> kubectl logs <pod_name> # print out useful logging information (print statements)
69-
> kubectl exec -it <pod_name> -- bash # login to a running container
70-
> kubectl describe pod <pod_name> # retrieve detailed info about a pod
71-
> kubectl describe node <node_name> # retrieve detailed info about a node
72-
```
10+
1. New unit tests and integration tests are currently being added to improve the developer experience when testing code changes locally.
7311

7412
### Testing
7513

76-
A small collection of pytests have been written to test functionality of the API. Ensure that all test dependencies have been install
14+
A small collection of unit tests and integrations tests have been written to test functionality of the API. To get started, first ensure that all test dependencies have been installed.
7715

78-
```python
16+
```shell
17+
cd <graphrag-accelerator-repo>/backend
7918
poetry install --with test
8019
```
8120

82-
Some tests require the [azurite emulator](https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&bc=%2Fazure%2Fstorage%2Fblobs%2Fbreadcrumb%2Ftoc.json&tabs=docker-hub%2Cblob-storage) and [cosmosdb emulator](https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-develop-emulator?tabs=docker-linux%2Ccsharp&pivots=api-nosql) to be running locally (these are setup in the ci/cd automatically). Please start these services by running them in the background as docker containers.
21+
Some tests require the [azurite emulator](https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json&bc=%2Fazure%2Fstorage%2Fblobs%2Fbreadcrumb%2Ftoc.json&tabs=docker-hub%2Cblob-storage) and [cosmosdb emulator](https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-develop-emulator?tabs=docker-linux%2Ccsharp&pivots=api-nosql) to be running locally (these are setup in the ci/cd automatically). You may start these emulators by running them in the background as docker containers.
8322

8423
```shell
8524
docker run -d -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite:latest
86-
docker run -d -p 8081:8081 -p 10250-10255:10250-10255 mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
25+
docker run -d -p 8081:8081 -p 1234:1234 mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview
8726
```
8827

89-
To run the tests,
28+
To run the tests:
9029

9130
```shell
9231
cd <graphrag-accelerator-repo>/backend
93-
pytest --cov=src -s tests/
32+
pytest -s --cov=src tests
9433
```
9534

9635
### Deployment (CI/CD)
@@ -105,4 +44,4 @@ This repository uses Github Actions for continuous integration and continious de
10544
```
10645
10746
### Versioning
108-
We use [SemVer](https://aka.ms/StartRight/README-Template/semver) for semantic versioning.
47+
We use [SemVer](https://aka.ms/StartRight/README-Template/semver) for semantic versioning.

0 commit comments

Comments
 (0)