Skip to content

Commit fd2dab8

Browse files
authored
Merge pull request #1 from microsoft/task/initial_commit
Task/initial commit
2 parents 625d760 + cd52250 commit fd2dab8

File tree

539 files changed

+53787
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

539 files changed

+53787
-65
lines changed

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Node Artifacts
2+
node_modules/
3+
python/*/lib/
4+
javascript/*/src/**/*.js
5+
javascript/*/lib/
6+
javascript/*/storybook-static/
7+
javascript/*/docsTemp/
8+
javascript/*/build/
9+
.swc/
10+
dist/
11+
12+
# Test Output
13+
.coverage
14+
coverage/
15+
licenses.txt
16+
python/graphrag/examples_notebooks/*/lancedb
17+
python/graphrag/examples_notebooks/*/data
18+
python/graphrag/tests/fixtures/*/cache
19+
python/graphrag/tests/fixtures/*/output
20+
21+
# Random
22+
.DS_Store
23+
*.log*
24+
.venv
25+
.conda
26+
.tmp
27+
28+
# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored
29+
.yarn/*
30+
!.yarn/patches
31+
!.yarn/releases
32+
!.yarn/plugins
33+
!.yarn/sdks
34+
!.yarn/versions
35+
.pnp.*
36+
37+
.env
38+
build.zip
39+
40+
.turbo
41+
42+
__pycache__
43+
44+
.pipeline
45+
46+
temp_azurite/
47+
__azurite*.json

.vscode/extensions.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"recommendations": [
3+
"arcanis.vscode-zipfs",
4+
"dbaeumer.vscode-eslint",
5+
"ms-python.python",
6+
"ms-python.black-formatter",
7+
"ms-python.isort",
8+
"ms-python.vscode-pylance",
9+
"bierner.markdown-mermaid",
10+
"streetsidesoftware.code-spell-checker",
11+
"ronnidc.nunjucks"
12+
]
13+
}

.vscode/launch.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Attach to Node Functions",
6+
"type": "node",
7+
"request": "attach",
8+
"port": 9229,
9+
"preLaunchTask": "func: host start"
10+
}
11+
]
12+
}

.vscode/settings.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"search.exclude": {
3+
"**/.yarn": true,
4+
"**/.pnp.*": true
5+
},
6+
"eslint.nodePath": ".yarn/sdks",
7+
"typescript.tsdk": ".yarn/sdks/typescript/lib",
8+
"typescript.enablePromptUseWorkspaceTsdk": true,
9+
"javascript.preferences.importModuleSpecifier": "relative",
10+
"javascript.preferences.importModuleSpecifierEnding": "js",
11+
"typescript.preferences.importModuleSpecifier": "relative",
12+
"typescript.preferences.importModuleSpecifierEnding": "js",
13+
"explorer.fileNesting.enabled": true,
14+
"explorer.fileNesting.patterns": {
15+
"*.ts": "${capture}.ts, ${capture}.hooks.ts, ${capture}.hooks.tsx, ${capture}.contexts.ts, ${capture}.stories.tsx, ${capture}.story.tsx, ${capture}.spec.tsx, ${capture}.base.ts, ${capture}.base.tsx, ${capture}.types.ts, ${capture}.styles.ts, ${capture}.styles.tsx, ${capture}.utils.ts, ${capture}.utils.tsx, ${capture}.constants.ts, ${capture}.module.scss, ${capture}.module.css, ${capture}.md",
16+
"*.js": "${capture}.js.map, ${capture}.min.js, ${capture}.d.ts",
17+
"*.jsx": "${capture}.js",
18+
"*.tsx": "${capture}.ts, ${capture}.hooks.ts, ${capture}.hooks.tsx, ${capture}.contexts.ts, ${capture}.stories.tsx, ${capture}.story.tsx, ${capture}.spec.tsx, ${capture}.base.ts, ${capture}.base.tsx, ${capture}.types.ts, ${capture}.styles.ts, ${capture}.styles.tsx, ${capture}.utils.ts, ${capture}.utils.tsx, ${capture}.constants.ts, ${capture}.module.scss, ${capture}.module.css, ${capture}.md, ${capture}.css",
19+
"tsconfig.json": "tsconfig.*.json",
20+
"package.json": "package-lock.json, turbo.json, tsconfig.json, rome.json, biome.json, .npmignore, dictionary.txt, cspell.config.yaml",
21+
"README.md": "*.md, LICENSE",
22+
".eslintrc": ".eslintignore",
23+
".prettierrc": ".prettierignore",
24+
".gitattributes": ".gitignore",
25+
".yarnrc.yml": "yarn.lock, .pnp.*",
26+
"jest.config.js": "jest.setup.mjs"
27+
},
28+
"azureFunctions.deploySubpath": "javascript/azure-functions",
29+
"azureFunctions.postDeployTask": "npm install (functions)",
30+
"azureFunctions.projectLanguage": "TypeScript",
31+
"azureFunctions.projectRuntime": "~4",
32+
"debug.internalConsoleOptions": "neverOpen",
33+
"azureFunctions.projectSubpath": "javascript/azure-functions",
34+
"azureFunctions.preDeployTask": "npm prune (functions)",
35+
"appService.zipIgnorePattern": [
36+
"node_modules{,/**}",
37+
".vscode{,/**}"
38+
],
39+
"appService.deploySubpath": "javascript/services/dist",
40+
"python.venvFolders": [
41+
"python/services/.venv"
42+
],
43+
"python.defaultInterpreterPath": "python/services/.venv/bin/python",
44+
"python.languageServer": "Pylance",
45+
"python.analysis.typeCheckingMode": "basic",
46+
"cSpell.customDictionaries": {
47+
"project-words": {
48+
"name": "project-words",
49+
"path": "${workspaceRoot}/dictionary.txt",
50+
"description": "Words used in this project",
51+
"addWords": true
52+
},
53+
"custom": true, // Enable the `custom` dictionary
54+
"internal-terms": true // Disable the `internal-terms` dictionary
55+
}
56+
}

.vscode/tasks.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "func",
6+
"label": "func: host start",
7+
"command": "host start",
8+
"problemMatcher": "$func-node-watch",
9+
"isBackground": true,
10+
"dependsOn": "npm build (functions)",
11+
"options": {
12+
"cwd": "${workspaceFolder}/javascript/azure-functions"
13+
}
14+
},
15+
{
16+
"type": "shell",
17+
"label": "npm build (functions)",
18+
"command": "npm run build",
19+
"dependsOn": "npm install (functions)",
20+
"problemMatcher": "$tsc",
21+
"options": {
22+
"cwd": "${workspaceFolder}/javascript/azure-functions"
23+
}
24+
},
25+
{
26+
"type": "shell",
27+
"label": "npm install (functions)",
28+
"command": "npm install",
29+
"options": {
30+
"cwd": "${workspaceFolder}/javascript/azure-functions"
31+
}
32+
},
33+
{
34+
"type": "shell",
35+
"label": "npm prune (functions)",
36+
"command": "npm prune --production",
37+
"dependsOn": "npm build (functions)",
38+
"problemMatcher": [],
39+
"options": {
40+
"cwd": "${workspaceFolder}/javascript/azure-functions"
41+
}
42+
}
43+
]
44+
}

.vsts-ci.yml

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
name: GraphRAG CI
2+
pool:
3+
vmImage: ubuntu-latest
4+
5+
trigger:
6+
batch: true
7+
branches:
8+
include:
9+
- main
10+
11+
variables:
12+
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
13+
pythonVersion: "3.10"
14+
poetryVersion: "1.6.1"
15+
nodeVersion: "18.x"
16+
artifactsFullFeedName: "Resilience/resilience_python"
17+
18+
stages:
19+
- stage: Compliance
20+
dependsOn: []
21+
jobs:
22+
- job: compliance
23+
displayName: Compliance
24+
pool:
25+
vmImage: windows-latest
26+
steps:
27+
- task: CredScan@3
28+
inputs:
29+
outputFormat: sarif
30+
debugMode: false
31+
32+
- task: ComponentGovernanceComponentDetection@0
33+
inputs:
34+
scanType: "Register"
35+
verbosity: "Verbose"
36+
alertWarningLevel: "High"
37+
38+
- task: PublishSecurityAnalysisLogs@3
39+
inputs:
40+
ArtifactName: "CodeAnalysisLogs"
41+
ArtifactType: "Container"
42+
43+
- stage: Verification
44+
dependsOn: []
45+
jobs:
46+
- job: verification
47+
displayName: Verification
48+
pool:
49+
vmImage: ubuntu-latest
50+
steps:
51+
- task: UsePythonVersion@0
52+
inputs:
53+
versionSpec: ${{variables.pythonVersion}}
54+
displayName: "Use Python ${{variables.pythonVersion}}"
55+
56+
- script: curl -sSL https://install.python-poetry.org | python -
57+
displayName: "Install Poetry ${{variables.poetryVersion}}"
58+
env:
59+
POETRY_VERSION: ${{variables.poetryVersion}}
60+
61+
- script: echo "##vso[task.prependpath]$HOME/.poetry/bin"
62+
displayName: "Add Poetry to path"
63+
64+
- task: NodeTool@0
65+
displayName: Install Node ${{variables.nodeVersion}}
66+
inputs:
67+
versionSpec: ${{variables.nodeVersion}}
68+
69+
- task: Bash@3
70+
displayName: Install Dependencies
71+
inputs:
72+
targetType: "inline"
73+
script: |
74+
echo "Running Yarn Install..."
75+
yarn install --immutable
76+
echo "Running Python Authenticate..."
77+
yarn python_authenticate
78+
echo "Running Python Install..."
79+
yarn python_install_ci
80+
env:
81+
RESILIENCE_ARTIFACTS_PASSWORD: $(resilienceArtifactsPassword)
82+
83+
- bash: |
84+
yarn start:azurite&
85+
displayName: 'Install and Run Azurite'
86+
87+
- task: Bash@3
88+
displayName: Verify Packages
89+
inputs:
90+
targetType: "inline"
91+
script: yarn ci
92+
env:
93+
GRAPHRAG_API_KEY: $(openaiApiKey)
94+
GRAPHRAG_LLM_MODEL: $(completionModel)
95+
GRAPHRAG_EMBEDDING_MODEL: $(embeddingModel)
96+
BLOB_STORAGE_CONNECTION_STRING: $(blobStorageConnectionString)
97+
98+
- stage: publish
99+
displayName: Publish
100+
dependsOn: []
101+
condition: eq(variables.isMain, 'true')
102+
jobs:
103+
- job: publish
104+
displayName: Publish
105+
pool:
106+
vmImage: ubuntu-latest
107+
steps:
108+
# fetch tags when checking out the repo, so we can use them with versioning
109+
- checkout: self
110+
fetchTags: true
111+
112+
- task: UsePythonVersion@0
113+
displayName: "Use Python ${{variables.pythonVersion}}"
114+
inputs:
115+
versionSpec: ${{variables.pythonVersion}}
116+
117+
- script: |
118+
sudo apt-get update
119+
sudo apt-get install -y llvm-11 python3-dev
120+
displayName: "LLVM install"
121+
122+
- script: echo "##vso[task.setvariable variable=LLVM_CONFIG]llvm-config-11"
123+
displayName: "Configure LLVM"
124+
125+
- script: curl -sSL https://install.python-poetry.org | python -
126+
displayName: "Install Poetry ${{variables.poetryVersion}}"
127+
env:
128+
POETRY_VERSION: ${{variables.poetryVersion}}
129+
130+
- script: echo "##vso[task.prependpath]$HOME/.poetry/bin"
131+
displayName: "Add Poetry to path"
132+
133+
- script: |
134+
pip install wheel
135+
pip install twine
136+
displayName: "install publication tools tooling"
137+
138+
- task: NodeTool@0
139+
displayName: Install Node ${{variables.nodeVersion}}
140+
inputs:
141+
versionSpec: ${{variables.nodeVersion}}
142+
143+
- task: Bash@3
144+
displayName: Install Dependencies
145+
inputs:
146+
targetType: "inline"
147+
script: |
148+
echo "Running Yarn Install..."
149+
yarn install --immutable
150+
echo "Running Python Authenticate..."
151+
yarn python_authenticate
152+
echo "Running Python Install..."
153+
yarn python_install
154+
env:
155+
RESILIENCE_ARTIFACTS_USERNAME: $(resilienceArtifactsUsername)
156+
RESILIENCE_ARTIFACTS_PASSWORD: $(resilienceArtifactsPassword)
157+
158+
159+
- task: TwineAuthenticate@1
160+
displayName: Twine Authenticate
161+
inputs:
162+
artifactFeed: ${{ variables.artifactsFullFeedName }}
163+
164+
- task: Bash@3
165+
displayName: Build Docsite
166+
inputs:
167+
targetType: "inline"
168+
script: yarn build:docs
169+
170+
- task: Bash@3
171+
displayName: Publish Packages
172+
inputs:
173+
targetType: "inline"
174+
script: yarn publish
175+
env:
176+
PYPIRC_PATH: $(PYPIRC_PATH)
177+
178+
- task: AzureStaticWebApp@0
179+
displayName: "Publish Static Web App"
180+
inputs:
181+
skip_app_build: true
182+
app_location: "javascript/docsite/_site"
183+
azure_static_web_apps_api_token: $(deploymentToken)
184+
185+
# These tasks will publish the distribution files as pipeline artifacts, not Azure Artifacts artifacts.
186+
- task: PublishPipelineArtifact@1
187+
inputs:
188+
targetPath: "python/graphrag/dist"
189+
artifact: graphrag
190+
publishLocation: "pipeline"

0 commit comments

Comments
 (0)