Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Node Artifacts
node_modules/
python/*/lib/
javascript/*/src/**/*.js
javascript/*/lib/
javascript/*/storybook-static/
javascript/*/docsTemp/
javascript/*/build/
.swc/
dist/

# Test Output
.coverage
coverage/
licenses.txt
python/graphrag/examples_notebooks/*/lancedb
python/graphrag/examples_notebooks/*/data
python/graphrag/tests/fixtures/*/cache
python/graphrag/tests/fixtures/*/output

# Random
.DS_Store
*.log*
.venv
.conda
.tmp

# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

.env
build.zip

.turbo

__pycache__

.pipeline

temp_azurite/
__azurite*.json
13 changes: 13 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"recommendations": [
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"ms-python.python",
"ms-python.black-formatter",
"ms-python.isort",
"ms-python.vscode-pylance",
"bierner.markdown-mermaid",
"streetsidesoftware.code-spell-checker",
"ronnidc.nunjucks"
]
}
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Node Functions",
"type": "node",
"request": "attach",
"port": 9229,
"preLaunchTask": "func: host start"
}
]
}
56 changes: 56 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"javascript.preferences.importModuleSpecifier": "relative",
"javascript.preferences.importModuleSpecifierEnding": "js",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.importModuleSpecifierEnding": "js",
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": {
"*.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",
"*.js": "${capture}.js.map, ${capture}.min.js, ${capture}.d.ts",
"*.jsx": "${capture}.js",
"*.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",
"tsconfig.json": "tsconfig.*.json",
"package.json": "package-lock.json, turbo.json, tsconfig.json, rome.json, biome.json, .npmignore, dictionary.txt, cspell.config.yaml",
"README.md": "*.md, LICENSE",
".eslintrc": ".eslintignore",
".prettierrc": ".prettierignore",
".gitattributes": ".gitignore",
".yarnrc.yml": "yarn.lock, .pnp.*",
"jest.config.js": "jest.setup.mjs"
},
"azureFunctions.deploySubpath": "javascript/azure-functions",
"azureFunctions.postDeployTask": "npm install (functions)",
"azureFunctions.projectLanguage": "TypeScript",
"azureFunctions.projectRuntime": "~4",
"debug.internalConsoleOptions": "neverOpen",
"azureFunctions.projectSubpath": "javascript/azure-functions",
"azureFunctions.preDeployTask": "npm prune (functions)",
"appService.zipIgnorePattern": [
"node_modules{,/**}",
".vscode{,/**}"
],
"appService.deploySubpath": "javascript/services/dist",
"python.venvFolders": [
"python/services/.venv"
],
"python.defaultInterpreterPath": "python/services/.venv/bin/python",
"python.languageServer": "Pylance",
"python.analysis.typeCheckingMode": "basic",
"cSpell.customDictionaries": {
"project-words": {
"name": "project-words",
"path": "${workspaceRoot}/dictionary.txt",
"description": "Words used in this project",
"addWords": true
},
"custom": true, // Enable the `custom` dictionary
"internal-terms": true // Disable the `internal-terms` dictionary
}
}
44 changes: 44 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"label": "func: host start",
"command": "host start",
"problemMatcher": "$func-node-watch",
"isBackground": true,
"dependsOn": "npm build (functions)",
"options": {
"cwd": "${workspaceFolder}/javascript/azure-functions"
}
},
{
"type": "shell",
"label": "npm build (functions)",
"command": "npm run build",
"dependsOn": "npm install (functions)",
"problemMatcher": "$tsc",
"options": {
"cwd": "${workspaceFolder}/javascript/azure-functions"
}
},
{
"type": "shell",
"label": "npm install (functions)",
"command": "npm install",
"options": {
"cwd": "${workspaceFolder}/javascript/azure-functions"
}
},
{
"type": "shell",
"label": "npm prune (functions)",
"command": "npm prune --production",
"dependsOn": "npm build (functions)",
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}/javascript/azure-functions"
}
}
]
}
190 changes: 190 additions & 0 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
name: GraphRAG CI
pool:
vmImage: ubuntu-latest

trigger:
batch: true
branches:
include:
- main

variables:
isMain: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
pythonVersion: "3.10"
poetryVersion: "1.6.1"
nodeVersion: "18.x"
artifactsFullFeedName: "Resilience/resilience_python"

stages:
- stage: Compliance
dependsOn: []
jobs:
- job: compliance
displayName: Compliance
pool:
vmImage: windows-latest
steps:
- task: CredScan@3
inputs:
outputFormat: sarif
debugMode: false

- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: "Register"
verbosity: "Verbose"
alertWarningLevel: "High"

- task: PublishSecurityAnalysisLogs@3
inputs:
ArtifactName: "CodeAnalysisLogs"
ArtifactType: "Container"

- stage: Verification
dependsOn: []
jobs:
- job: verification
displayName: Verification
pool:
vmImage: ubuntu-latest
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: ${{variables.pythonVersion}}
displayName: "Use Python ${{variables.pythonVersion}}"

- script: curl -sSL https://install.python-poetry.org | python -
displayName: "Install Poetry ${{variables.poetryVersion}}"
env:
POETRY_VERSION: ${{variables.poetryVersion}}

- script: echo "##vso[task.prependpath]$HOME/.poetry/bin"
displayName: "Add Poetry to path"

- task: NodeTool@0
displayName: Install Node ${{variables.nodeVersion}}
inputs:
versionSpec: ${{variables.nodeVersion}}

- task: Bash@3
displayName: Install Dependencies
inputs:
targetType: "inline"
script: |
echo "Running Yarn Install..."
yarn install --immutable
echo "Running Python Authenticate..."
yarn python_authenticate
echo "Running Python Install..."
yarn python_install_ci
env:
RESILIENCE_ARTIFACTS_PASSWORD: $(resilienceArtifactsPassword)

- bash: |
yarn start:azurite&
displayName: 'Install and Run Azurite'

- task: Bash@3
displayName: Verify Packages
inputs:
targetType: "inline"
script: yarn ci
env:
GRAPHRAG_API_KEY: $(openaiApiKey)
GRAPHRAG_LLM_MODEL: $(completionModel)
GRAPHRAG_EMBEDDING_MODEL: $(embeddingModel)
BLOB_STORAGE_CONNECTION_STRING: $(blobStorageConnectionString)

- stage: publish
displayName: Publish
dependsOn: []
condition: eq(variables.isMain, 'true')
jobs:
- job: publish
displayName: Publish
pool:
vmImage: ubuntu-latest
steps:
# fetch tags when checking out the repo, so we can use them with versioning
- checkout: self
fetchTags: true

- task: UsePythonVersion@0
displayName: "Use Python ${{variables.pythonVersion}}"
inputs:
versionSpec: ${{variables.pythonVersion}}

- script: |
sudo apt-get update
sudo apt-get install -y llvm-11 python3-dev
displayName: "LLVM install"

- script: echo "##vso[task.setvariable variable=LLVM_CONFIG]llvm-config-11"
displayName: "Configure LLVM"

- script: curl -sSL https://install.python-poetry.org | python -
displayName: "Install Poetry ${{variables.poetryVersion}}"
env:
POETRY_VERSION: ${{variables.poetryVersion}}

- script: echo "##vso[task.prependpath]$HOME/.poetry/bin"
displayName: "Add Poetry to path"

- script: |
pip install wheel
pip install twine
displayName: "install publication tools tooling"

- task: NodeTool@0
displayName: Install Node ${{variables.nodeVersion}}
inputs:
versionSpec: ${{variables.nodeVersion}}

- task: Bash@3
displayName: Install Dependencies
inputs:
targetType: "inline"
script: |
echo "Running Yarn Install..."
yarn install --immutable
echo "Running Python Authenticate..."
yarn python_authenticate
echo "Running Python Install..."
yarn python_install
env:
RESILIENCE_ARTIFACTS_USERNAME: $(resilienceArtifactsUsername)
RESILIENCE_ARTIFACTS_PASSWORD: $(resilienceArtifactsPassword)


- task: TwineAuthenticate@1
displayName: Twine Authenticate
inputs:
artifactFeed: ${{ variables.artifactsFullFeedName }}

- task: Bash@3
displayName: Build Docsite
inputs:
targetType: "inline"
script: yarn build:docs

- task: Bash@3
displayName: Publish Packages
inputs:
targetType: "inline"
script: yarn publish
env:
PYPIRC_PATH: $(PYPIRC_PATH)

- task: AzureStaticWebApp@0
displayName: "Publish Static Web App"
inputs:
skip_app_build: true
app_location: "javascript/docsite/_site"
azure_static_web_apps_api_token: $(deploymentToken)

# These tasks will publish the distribution files as pipeline artifacts, not Azure Artifacts artifacts.
- task: PublishPipelineArtifact@1
inputs:
targetPath: "python/graphrag/dist"
artifact: graphrag
publishLocation: "pipeline"
Loading