You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 27, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: docs/DEVELOPMENT-GUIDE.md
+9-70Lines changed: 9 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,90 +7,29 @@ Development is best done in a unix environment (Linux, Mac, or [Windows WSL](htt
7
7
8
8
1. Clone the GraphRAG repository.
9
9
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.
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
> 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.
73
11
74
12
### Testing
75
13
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.
77
15
78
-
```python
16
+
```shell
17
+
cd<graphrag-accelerator-repo>/backend
79
18
poetry install --with test
80
19
```
81
20
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.
83
22
84
23
```shell
85
24
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
87
26
```
88
27
89
-
To run the tests,
28
+
To run the tests:
90
29
91
30
```shell
92
31
cd<graphrag-accelerator-repo>/backend
93
-
pytest --cov=src -s tests/
32
+
pytest -s --cov=src tests
94
33
```
95
34
96
35
### Deployment (CI/CD)
@@ -105,4 +44,4 @@ This repository uses Github Actions for continuous integration and continious de
105
44
```
106
45
107
46
### 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