Skip to content

Commit

Permalink
Merge branch 'main' into chesi/refine-tool-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chenslucky authored Jan 9, 2024
2 parents 1524200 + 5a31079 commit fd25c92
Show file tree
Hide file tree
Showing 571 changed files with 48,252 additions and 22,768 deletions.
11 changes: 9 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"ROBOCOPY",
"undoc",
"retriable",
"pfcli",
"pfutil",
"mgmt",
"wsid",
Expand All @@ -78,7 +79,9 @@
"pfbytes",
"Apim",
"junit",
"nunit"
"nunit",
"astext",
"Likert"
],
"ignoreWords": [
"openmpi",
Expand Down Expand Up @@ -154,7 +157,11 @@
"restx",
"httpx",
"tiiuae",
"metagenai"
"nohup",
"metagenai",
"WBITS",
"laddr",
"nrows"
],
"flagWords": [
"Prompt Flow"
Expand Down
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@
/scripts/installer/ @microsoft/promptflow-sdk
/scripts/json_schema/ @microsoft/promptflow-sdk
/scripts/readme/ @microsoft/promptflow-sdk

/docs/how-to-guides/develop-a-tool/ @microsoft/promptflow-tools
/src/promptflow-tools/ @microsoft/promptflow-tools
/examples/tools/ @microsoft/promptflow-tools
/scripts/tool/ @microsoft/promptflow-tools
2 changes: 1 addition & 1 deletion .github/actions/step_sdk_setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ runs:
pip list
python ./setup.py bdist_wheel
$package = Get-ChildItem ./dist | ? { $_.Name.Contains('.whl')}
pip install $($package.FullName + "[azure,executable,pfs]")
pip install $($package.FullName + "[azure,executable,pfs,azureml-serving]")
echo "########### pip freeze (After) ###########"
pip freeze
working-directory: ${{ inputs.scriptPath }}
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/build_msi_installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ on:
required: false
description: 'Version of promptflow to install (optional). Will build locally if not specified.'

set_msi_private_version:
type: string
default: ""
required: false
description: 'Set the version of the private msi installer'

env:
packageSetupType: promptflow_with_extra
testWorkingDirectory: src/promptflow
Expand All @@ -29,6 +35,7 @@ jobs:
run: |
echo "uploadAsLatest: ${{ inputs.uploadAsLatest }}"
echo "version: ${{ inputs.version }}"
echo "set_msi_private_version: ${{ inputs.set_msi_private_version }}"
- name: Checkout Repo
uses: actions/checkout@v3
Expand Down Expand Up @@ -74,7 +81,11 @@ jobs:
if ($version -ne $run_version) {
throw "Version input does not match the version in promptflow package. Version input: $version, version in promptflow package: $run_version"
}
} else {
}
elseif ($env:MSI_PRIVATE_VERSION) {
$version=$env:MSI_PRIVATE_VERSION
}
else {
$prefix = 0
$year = [int](Get-Date -Format "yy")
$monthday = [int](Get-Date -Format "MMdd")
Expand All @@ -84,6 +95,7 @@ jobs:
echo "::set-output name=version::$version"
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
MSI_PRIVATE_VERSION: ${{ github.event.inputs.set_msi_private_version }}
shell: pwsh

- name: Build Pyinstaller project
Expand Down
72 changes: 14 additions & 58 deletions .github/workflows/check_enforcer.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,26 @@
name: GitHub Event Handler
name: check_enforcer

on:
status

env:
head_sha: ${{ github.sha }}
pull_request:
branches: [ main ]

jobs:
event-handler:
name: ${{ github.event_name }}
check_enforcer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: git fetch origin main
- run: env | sort >> $GITHUB_OUTPUT
- name: Python Setup - ubuntu-latest - Python Version 3.9
uses: "./.github/actions/step_create_python_environment"
with:
pythonVersion: 3.9
- run: pip install -r ${{ github.workspace }}/examples/dev_requirements.txt
- name: Summarize check status
id: summarize_check_status
working-directory: ${{ github.workspace }}
shell: pwsh
run: |
$env:pending_count = 0
$env:success_count = 0
function check_conclusion {
param(
[string]$conclusion
)
if ($conclusion -ieq "success") {
$env:success_count = 1 + $env:success_count
Write-Host "Success: " $env:success_count
} else {
$env:pending_count = 1 + $env:pending_count
Write-Host "Pending: " $env:pending_count
}
}
$(gh api /repos/${{ github.repository }}/commits/${{ env.head_sha }}/check-runs) | ConvertFrom-Json | Select-Object -ExpandProperty check_runs | ForEach-Object {
if ($_.name.Contains('promptflow-executor-unit-test')) {
check_conclusion $_.conclusion $_.name
}
if ($_.name.Contains('promptflow-executor-e2e-test')) {
check_conclusion $_.conclusion $_.name
}
if ($_.name.Contains('promptflow-sdk-cli-test')) {
check_conclusion $_.conclusion $_.name
}
}
Write-Host "Total not success test numbers: "$pending_count
Write-Host "Total success test numbers: "$success_count
if ($pending_count -eq 0) {
gh api `
--method POST `
-H "Accept: application/vnd.github+json" `
-H "X-GitHub-Api-Version: 2022-11-28" `
/repos/${{ github.repository }}/statuses/${{ env.head_sha }} `
-f state='success' `
-f target_url='https://github.com/microsoft/promptflow/actions/runs/${{ github.run_id }}' `
-f description='The build succeeded!' `
-f context='https://aka.ms/azsdk/checkenforcer'
} else {
gh api `
--method POST `
-H "Accept: application/vnd.github+json" `
-H "X-GitHub-Api-Version: 2022-11-28" `
/repos/${{ github.repository }}/statuses/${{ env.head_sha }} `
-f state='pending' `
-f target_url='https://github.com/microsoft/promptflow/actions/runs/${{ github.run_id }}' `
-f description='Waiting for all checks to succeed' `
-f context='https://aka.ms/azsdk/checkenforcer'
}
python ${{ github.workspace }}/scripts/building/check_enforcer.py -t "${{ github.workspace }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/flowdag_schema_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: examples_flowdag_schema_check

on:
pull_request:
paths:
- examples/**
- .github/workflows/flowdag_schema_check.yml
- scripts/readme/schema_checker.py
env:
IS_IN_CI_PIPELINE: "true"
jobs:
examples_flowdag_schema_check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: env | sort >> $GITHUB_OUTPUT
- name: Python Setup - ubuntu-latest - Python Version 3.9
uses: "./.github/actions/step_create_python_environment"
with:
pythonVersion: 3.9
- run: |
pip install -r ${{ github.workspace }}/examples/dev_requirements.txt
pip install -r ${{ github.workspace }}/examples/requirements.txt
- name: Summarize check status
id: summarize_check_status
working-directory: ${{ github.workspace }}
shell: pwsh
env:
PYTHONPATH: ${{ github.workspace }}/src/promptflow
run: |
cd ${{ github.workspace }}/src
pip install -e promptflow[azure]
pip install -e promptflow-tools
python ${{ github.workspace }}/scripts/readme/schema_checker.py
14 changes: 13 additions & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,16 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v4

- name: apply a label to pull request from fork
if: ${{ github.event.pull_request.head.repo.full_name != 'microsoft/promptflow' }}
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['external']
})
14 changes: 13 additions & 1 deletion .github/workflows/promptflow-executor-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@ on:
- cron: "40 20 * * *" # Every day starting at 4:40 BJT
pull_request_target:
paths:
- src/promptflow/**
- src/promptflow/*
- src/promptflow/promptflow/*
- src/promptflow/promptflow/_core/**
- src/promptflow/promptflow/_internal/**
- src/promptflow/promptflow/_utils/**
- src/promptflow/promptflow/batch/**
- src/promptflow/promptflow/contracts/**
- src/promptflow/promptflow/entities/**
- src/promptflow/promptflow/executor/**
- src/promptflow/promptflow/integrations/**
- src/promptflow/promptflow/storage/**
- src/promptflow/tests/*
- src/promptflow/tests/executor/**
- scripts/building/**
- .github/workflows/promptflow-executor-e2e-test.yml
workflow_dispatch:
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/promptflow-executor-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@ on:
- cron: "40 19 * * *" # Every day starting at 3:40 BJT
pull_request_target:
paths:
- src/promptflow/**
- src/promptflow/*
- src/promptflow/promptflow/*
- src/promptflow/promptflow/_core/**
- src/promptflow/promptflow/_internal/**
- src/promptflow/promptflow/_utils/**
- src/promptflow/promptflow/batch/**
- src/promptflow/promptflow/contracts/**
- src/promptflow/promptflow/entities/**
- src/promptflow/promptflow/executor/**
- src/promptflow/promptflow/integrations/**
- src/promptflow/promptflow/storage/**
- src/promptflow/tests/*
- src/promptflow/tests/executor/**
- scripts/building/**
- .github/workflows/promptflow-executor-unit-test.yml
workflow_dispatch:
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/promptflow-sdk-cli-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
pythonVersion: ['3.8', '3.9']
pythonVersion: ['3.8', '3.9', '3.10', '3.11']
runs-on: ${{ matrix.os }}
steps:
- name: set test mode
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
-l eastus `
-m "unittest or e2etest" `
--coverage-config ${{ github.workspace }}/src/promptflow/tests/sdk_cli_test/.coveragerc `
-o "${{ github.workspace }}/test-results-sdk-cli.xml" `
-o "${{ env.testWorkingDirectory }}/test-results-sdk-cli.xml" `
--ignore-glob ${{ github.workspace }}/src/promptflow/tests/sdk_cli_test/e2etests/test_executable.py
- name: Install pf executable
shell: pwsh
Expand All @@ -125,7 +125,27 @@ jobs:
-t ${{ github.workspace }}/src/promptflow/tests/sdk_cli_test/e2etests/test_executable.py `
-l eastus `
-m "unittest or e2etest" `
-o "${{ github.workspace }}/test-results-sdk-cli-executable.xml"
-o "${{ env.testWorkingDirectory }}/test-results-sdk-cli-executable.xml"
- name: Install pfs
shell: pwsh
working-directory: artifacts
run: |
Set-PSDebug -Trace 1
pip uninstall -y promptflow promptflow-sdk promptflow-tools
gci ./promptflow -Recurse | % {if ($_.Name.Contains('.whl')) {python -m pip install "$($_.FullName)[pfs,azure]"}}
gci ./promptflow-tools -Recurse | % {if ($_.Name.Contains('.whl')) {python -m pip install $_.FullName}}
pip freeze
- name: Run PFS Test
shell: pwsh
working-directory: ${{ env.testWorkingDirectory }}
run: |
python "../../scripts/building/run_coverage_tests.py" `
-p promptflow `
-t ${{ github.workspace }}/src/promptflow/tests/sdk_pfs_test `
-l eastus `
-m "e2etest" `
--coverage-config ${{ github.workspace }}/src/promptflow/tests/sdk_pfs_test/.coveragerc `
-o "${{ env.testWorkingDirectory }}/test-results-pfs.xml"
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
Expand All @@ -134,6 +154,8 @@ jobs:
path: |
${{ env.testWorkingDirectory }}/*.xml
${{ env.testWorkingDirectory }}/htmlcov/
publish-test-results:
name: "Publish Tests Results"
needs: sdk_cli_tests
Expand Down
Loading

0 comments on commit fd25c92

Please sign in to comment.