chore: import upstream snapshot with attribution
tools_continuous_delivery / Private PyPI non-main branch release (push) Has been skipped
tools_continuous_delivery / Private PyPI main branch release (push) Failing after 2m42s
Publish Promptflow Doc / Build (push) Has been cancelled
Publish Promptflow Doc / Deploy (push) Has been cancelled
Flake8 Lint / flake8 (push) Has been cancelled
Spell check CI / Spell_Check (push) Has been cancelled
tools_continuous_delivery / Private PyPI non-main branch release (push) Has been skipped
tools_continuous_delivery / Private PyPI main branch release (push) Failing after 2m42s
Publish Promptflow Doc / Build (push) Has been cancelled
Publish Promptflow Doc / Deploy (push) Has been cancelled
Flake8 Lint / flake8 (push) Has been cancelled
Spell check CI / Spell_Check (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
# Pipeline link: https://dev.azure.com/msdata/Vienna/_build?definitionId=26179&_a=summary
|
||||
parameters:
|
||||
- name: policyCulture
|
||||
displayName: "Policy Culture"
|
||||
type: string
|
||||
# The culture used to run policy check scan, can be region codes separated by comma, e.g. 'en-US,de-DE'
|
||||
default: 'en-US'
|
||||
|
||||
name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r) # Configure run or build numbers
|
||||
|
||||
variables:
|
||||
- name: sourceLocation
|
||||
value: $(System.DefaultWorkingDirectory)
|
||||
|
||||
trigger:
|
||||
- main
|
||||
- releases/*
|
||||
|
||||
pool:
|
||||
name: promptflow-1ES-win
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
|
||||
- task: PowerShell@2
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
Remove-Item -Recurse -Force $(sourceLocation)/benchmark/promptflow-serve/result-archive
|
||||
Remove-Item -Path $(sourceLocation)/src/promptflow-azure/promptflow/azure/_restclient/flow_service_caller.py -Force
|
||||
displayName: 'Delete benchmark HTML files, and files to avoid PoliCheck scan'
|
||||
|
||||
# https://eng.ms/docs/microsoft-security/cloud-ecosystem-security/azure-security/cloudai-security-fundamentals-engineering/security-integration/guardian-wiki/sdl-azdo-extension/PoliCheck-build-task
|
||||
- task: PoliCheck@2
|
||||
inputs:
|
||||
targetType: 'F'
|
||||
targetArgument: '$(sourceLocation)'
|
||||
optionsPE: '1'
|
||||
optionsUEPATH: '$(sourceLocation)\scripts\compliance-check\user_exclusion.xml'
|
||||
result: '$(sourceLocation)\scripts\compliance-check\result.tsv'
|
||||
optionsXCLASS: 'Geopolitical'
|
||||
|
||||
- task: PowerShell@2
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
if (-Not (Test-Path "$(sourceLocation)/scripts/compliance-check/result.tsv")) {
|
||||
Write-Host "PoliCheck@2 (previous step) is not supported for forked GitHub repository, which will break the following step."
|
||||
Write-Host "So as a workaround, this step will create an empty result.tsv file."
|
||||
New-Item -ItemType Directory -Force -Path "$(sourceLocation)/scripts/compliance-check"
|
||||
Set-Location "$(sourceLocation)/scripts/compliance-check"
|
||||
New-Item -ItemType File -Name "result.tsv"
|
||||
}
|
||||
displayName: 'Workaround for fork repository'
|
||||
|
||||
- task: PowerShell@2
|
||||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: '$(sourceLocation)\scripts\compliance-check\Check-PolicheckScan.ps1'
|
||||
arguments: >
|
||||
-policheckResult $(sourceLocation)\scripts\compliance-check\result.tsv
|
||||
displayName: 'Check result'
|
||||
|
||||
- task: PublishPipelineArtifact@1
|
||||
condition: failed()
|
||||
inputs:
|
||||
targetPath: '$(sourceLocation)\scripts\compliance-check\result.tsv'
|
||||
artifactName: 'compliance-check-result'
|
||||
publishLocation: 'pipeline'
|
||||
|
||||
- task: CredScan@3
|
||||
displayName: 'CredScan'
|
||||
inputs:
|
||||
scanFolder: '$(sourceLocation)'
|
||||
@@ -0,0 +1,55 @@
|
||||
parameters:
|
||||
- name: promptflowCsPat
|
||||
displayName: "PAT to clone csharp repository"
|
||||
type: string
|
||||
- name: flowProjectRelativePath
|
||||
displayName: "Flow Project Relative Path"
|
||||
type: string
|
||||
|
||||
steps:
|
||||
- task: UseDotNet@2
|
||||
inputs:
|
||||
version: '6.x'
|
||||
- task: UsePythonVersion@0
|
||||
inputs:
|
||||
versionSpec: '3.9.x'
|
||||
architecture: 'x64'
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Install promptflow cli'
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: |
|
||||
Set-PSDebug -Trace 1
|
||||
pip install -r src/promptflow/dev_requirements.txt
|
||||
pip install src/promptflow-tracing
|
||||
pip install src/promptflow-core[executor-service]
|
||||
pip install src/promptflow-devkit
|
||||
pip install src/promptflow-azure
|
||||
pip install src/promptflow-recording
|
||||
pip freeze
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Clone csharp repository'
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: |
|
||||
git clone https://$(PROMPTFLOW_CS_PAT)@dev.azure.com/msdata/Vienna/_git/PromptflowCS csharp
|
||||
|
||||
- task: NuGetAuthenticate@1
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
inputs:
|
||||
command: 'restore'
|
||||
projects: '$(flowProjectRelativePath)/**/*.csproj'
|
||||
feedsToUse: 'config'
|
||||
nugetConfigPath: '$(flowProjectRelativePath)/nuget.config'
|
||||
displayName: 'dotnet restore'
|
||||
|
||||
- task: DotNetCoreCLI@2
|
||||
inputs:
|
||||
command: 'build'
|
||||
projects: '$(flowProjectRelativePath)/**/*.csproj'
|
||||
feedsToUse: 'config'
|
||||
nugetConfigPath: '$(flowProjectRelativePath)/nuget.config'
|
||||
displayName: 'dotnet build'
|
||||
@@ -0,0 +1,46 @@
|
||||
parameters:
|
||||
- name: azureOpenAiApiKey
|
||||
displayName: "Azure OpenAI API Key"
|
||||
type: string
|
||||
- name: azureOpenAiApiBase
|
||||
displayName: "Azure OpenAI API Base"
|
||||
type: string
|
||||
- name: flowProjectRelativePath
|
||||
displayName: "Flow Project Relative Path"
|
||||
type: string
|
||||
|
||||
steps:
|
||||
- task: PowerShell@2
|
||||
displayName: 'Copy local connections for ci pipeline'
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: |
|
||||
Copy-Item dev-connections.json.example connections.json
|
||||
workingDirectory: $(Build.SourcesDirectory)/src/promptflow
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Run sdk cli tests'
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: |
|
||||
pytest tests/ -m "csharp"
|
||||
workingDirectory: $(Build.SourcesDirectory)/src/promptflow-devkit
|
||||
env:
|
||||
CSHARP_TEST_PROJECTS_ROOT: $(Build.SourcesDirectory)/$(flowProjectRelativePath)
|
||||
AZURE_OPENAI_API_KEY: $(azureOpenAiApiKey)
|
||||
AZURE_OPENAI_ENDPOINT: $(azureOpenAiApiBase)
|
||||
IS_IN_CI_PIPELINE: true
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Run azure sdk cli tests'
|
||||
inputs:
|
||||
targetType: 'inline'
|
||||
script: |
|
||||
pytest tests/sdk_cli_azure_test/e2etests/test_csharp_sdk.py
|
||||
workingDirectory: $(Build.SourcesDirectory)/src/promptflow-azure
|
||||
env:
|
||||
CSHARP_TEST_PROJECTS_ROOT: $(Build.SourcesDirectory)/$(flowProjectRelativePath)
|
||||
AZURE_OPENAI_API_KEY: $(azureOpenAiApiKey)
|
||||
AZURE_OPENAI_ENDPOINT: $(azureOpenAiApiBase)
|
||||
PROMPT_FLOW_TEST_MODE: "replay"
|
||||
IS_IN_CI_PIPELINE: true
|
||||
@@ -0,0 +1,100 @@
|
||||
# https://msdata.visualstudio.com/Vienna/_build?definitionId=33952&_a=summary
|
||||
name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r) # Configure run or build numbers
|
||||
|
||||
variables:
|
||||
- group: promptflow-csharp
|
||||
- name: BuildConfiguration
|
||||
value: 'Debug'
|
||||
- name: currentRepoPath
|
||||
value: "csharp"
|
||||
- name: flowProjectRelativePath
|
||||
value: '$(currentRepoPath)/src/TestProjects'
|
||||
- name: system.debug
|
||||
value: 'true'
|
||||
|
||||
schedules:
|
||||
- cron: "40 18 * * *" # Every day starting at 2:40 BJT
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- releases/*
|
||||
paths:
|
||||
include:
|
||||
- src/promptflow-core/**
|
||||
- src/promptflow-devkit/**
|
||||
- src/promptflow/**
|
||||
- src/promptflow-tracing/**
|
||||
- scripts/building/**
|
||||
- .github/pipelines/promptflow-csharp-e2e-test.yml
|
||||
- src/promptflow-recording/**
|
||||
|
||||
parameters:
|
||||
- name: githubPromptflowBranch
|
||||
displayName: "Github Promptflow Branch Name"
|
||||
type: string
|
||||
default: main
|
||||
|
||||
jobs:
|
||||
- job: linux
|
||||
pool:
|
||||
name: promptflow-1ES-ubuntu20
|
||||
steps:
|
||||
- task: Bash@3
|
||||
displayName: 'Set environment variables'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
export AOAI_CONNECTION=$(AOAI_CONNECTION)
|
||||
export OPENAI_CONNECTION=$(OPENAI_CONNECTION)
|
||||
export SERP_CONNECTION=$(SERP_CONNECTION)
|
||||
export ACS_CONNECTION=$(ACS_CONNECTION)
|
||||
export IS_IN_CI_PIPELINE=true
|
||||
|
||||
- template: promptflow-csharp-e2e-test-env-setup.yml
|
||||
parameters:
|
||||
flowProjectRelativePath: '$(flowProjectRelativePath)'
|
||||
promptflowCsPat: '$(PROMPTFLOW_CS_PAT)'
|
||||
|
||||
- template: promptflow-csharp-e2e-test-tests.yml
|
||||
parameters:
|
||||
flowProjectRelativePath: '$(flowProjectRelativePath)'
|
||||
azureOpenAiApiBase: '$(AZURE_OPENAI_API_BASE)'
|
||||
azureOpenAiApiKey: '$(AZURE_OPENAI_API_KEY)'
|
||||
|
||||
- publish: $(flowProjectRelativePath)
|
||||
condition: always()
|
||||
artifact: 'BuiltFlows-linux'
|
||||
- job: windows
|
||||
pool:
|
||||
name: promptflow-1ES-win
|
||||
steps:
|
||||
- task: PowerShell@2
|
||||
displayName: 'Set environment variables'
|
||||
inputs:
|
||||
targetType: inline
|
||||
script: |
|
||||
setx AOAI_CONNECTION $(AOAI_CONNECTION)
|
||||
setx OPENAI_CONNECTION $(OPENAI_CONNECTION)
|
||||
setx SERP_CONNECTION $(SERP_CONNECTION)
|
||||
setx ACS_CONNECTION $(ACS_CONNECTION)
|
||||
setx IS_IN_CI_PIPELINE true
|
||||
|
||||
- template: promptflow-csharp-e2e-test-env-setup.yml
|
||||
parameters:
|
||||
flowProjectRelativePath: '$(flowProjectRelativePath)'
|
||||
promptflowCsPat: '$(PROMPTFLOW_CS_PAT)'
|
||||
|
||||
- template: promptflow-csharp-e2e-test-tests.yml
|
||||
parameters:
|
||||
flowProjectRelativePath: '$(flowProjectRelativePath)'
|
||||
azureOpenAiApiBase: '$(AZURE_OPENAI_API_BASE)'
|
||||
azureOpenAiApiKey: '$(AZURE_OPENAI_API_KEY)'
|
||||
|
||||
- publish: $(flowProjectRelativePath)
|
||||
condition: always()
|
||||
artifact: 'BuiltFlows-windows'
|
||||
Reference in New Issue
Block a user