Skip to content

Commit

Permalink
Merge branch 'main' into task/addSimulator
Browse files Browse the repository at this point in the history
  • Loading branch information
nagkumar91 authored Apr 19, 2024
2 parents afb10af + 1c977e4 commit 83c73b7
Show file tree
Hide file tree
Showing 93 changed files with 2,826 additions and 1,649 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
"tkey",
"tparam",
"ncols"

],
"flagWords": [
"Prompt Flow"
Expand Down
178 changes: 165 additions & 13 deletions .github/pipelines/promptflow-csharp-e2e-test.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,68 @@
# 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: 'Release'
- name: BuildConfiguration
value: 'Debug'
- name: currentRepoPath
value: "PromptflowCS"
- name: cliRepoPath
value: "promptflow"
value: "csharp"
- name: flowProjectRelativePath
value: '$(currentRepoPath)/src/PromptflowCSharp/Sample'
value: '$(currentRepoPath)/src/TestProjects'
- name: system.debug
value: 'true'
- name: cliInstallationPath
value: '$(cliRepoPath)/src/promptflow'

trigger:
- main
- releases/*
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:
vmImage: 'ubuntu-latest'
name: promptflow-1ES-ubuntu20
steps:
- task: UseDotNet@2
inputs:
version: '6.x'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9.x'
architecture: 'x64'
- task: Bash@3
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 freeze
- task: Bash@3
displayName: 'Set environment variables'
inputs:
Expand All @@ -41,3 +73,123 @@ jobs:
export SERP_CONNECTION=$(SERP_CONNECTION)
export ACS_CONNECTION=$(ACS_CONNECTION)
export IS_IN_CI_PIPELINE=true
- task: Bash@3
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: 'csharp/src/TestProjects/nuget.config'
displayName: 'dotnet restore'

- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '$(flowProjectRelativePath)/**/*.csproj'
feedsToUse: 'config'
nugetConfigPath: 'csharp/src/TestProjects/nuget.config'
displayName: 'dotnet build'

- task: Bash@3
displayName: 'Run tests'
inputs:
targetType: 'inline'
script: |
cd ./src/promptflow-devkit
pytest tests/sdk_cli_test/e2etests/test_csharp_cli.py
env:
CSHARP_TEST_CASES_ROOT: $(Build.SourcesDirectory)/$(flowProjectRelativePath)
AZURE_OPENAI_API_KEY: $(AZURE_OPENAI_API_KEY)
AZURE_OPENAI_ENDPOINT: $(AZURE_OPENAI_ENDPOINT)
IS_IN_CI_PIPELINE: true

- publish: $(flowProjectRelativePath)
condition: always()
artifact: 'BuiltFlows-linux'
- job: windows
pool:
name: promptflow-1ES-win
steps:
- task: UseDotNet@2
inputs:
version: '6.x'

- task: UsePythonVersion@0
inputs:
versionSpec: '3.8.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 freeze
- 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
- 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: 'csharp/src/TestProjects/nuget.config'
displayName: 'dotnet restore'

- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '$(flowProjectRelativePath)/**/*.csproj'
feedsToUse: 'config'
nugetConfigPath: 'csharp/src/TestProjects/nuget.config'
displayName: 'dotnet build'

- task: PowerShell@2
displayName: 'Run tests'
inputs:
targetType: 'inline'
script: |
cd ./src/promptflow-devkit
pytest tests/sdk_cli_test/e2etests/test_csharp_cli.py
env:
CSHARP_TEST_CASES_ROOT: $(Build.SourcesDirectory)/$(flowProjectRelativePath)
AZURE_OPENAI_API_KEY: $(AZURE_OPENAI_API_KEY)
AZURE_OPENAI_ENDPOINT: $(AZURE_OPENAI_ENDPOINT)
IS_IN_CI_PIPELINE: true

- publish: $(flowProjectRelativePath)
condition: always()
artifact: 'BuiltFlows-windows'
6 changes: 5 additions & 1 deletion .github/workflows/build_msi_installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
if: ${{ github.event.inputs.version != null && github.event.inputs.version != '' }}
run: |
pip install "promptflow[azure,executable,azureml-serving,executor-service]==$env:INPUT_VERSION" promptflow-tools
echo "There's no promptflow-evals in pypi, we need to install it from source for now"
pip install ${{ github.workspace }}/src/promptflow-evals
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
shell: pwsh
Expand Down Expand Up @@ -118,6 +120,7 @@ jobs:
pip install ${{ github.workspace }}/src/promptflow-core[executor-service,azureml-serving]
pip install ${{ github.workspace }}/src/promptflow-devkit[pyarrow,executable]
pip install ${{ github.workspace }}/src/promptflow-azure
pip install ${{ github.workspace }}/src/promptflow-evals
echo "Should fix this after pf-core could install this dependency"
pip install azureml-ai-monitoring
pip freeze
Expand Down Expand Up @@ -186,7 +189,8 @@ jobs:
run: |
$version = "${{ steps.get-version.outputs.version }}"
$downloaded_version = "${{ steps.download-json.outputs.downloaded_version }}"
if ($version -like '1.*' -and [Version]$version -gt [Version]$downloaded_version){
$uploadAsLatest = "${{ github.event.inputs.uploadAsLatest }}"
if ($uploadAsLatest -ieq 'True' -and $version -like '1.*' -and [Version]$version -gt [Version]$downloaded_version){
$jsonContent = @{
"promptflow" = $version
} | ConvertTo-Json -Depth 100
Expand Down
28 changes: 26 additions & 2 deletions docs/cloud/azureai/runtime-change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,43 @@ You can check the runtime image version from the flow execution log:
## Change log
Default runtime image is continuously updated, and here we record the new features and fixed bugs of each image version.

### 20240403.v2

#### New features
NA

#### Bugs fixed
NA


### 20240326.v2

#### New features
- Support environment variables for C# batch run.

#### Bugs fixed
NA


### 20240319.v1

#### New features
NA

#### Bugs fixed
NA

- Add param "seed" to LLM tool chat api.

### 20240313.v1

#### Bugs fixed
#### New features
NA

#### Bugs fixed
- Fix an issue where calling a flow with a flow function would result in failure.
- Improve error handling by categorizing errors as user errors when a run is archived prior to being processed by the runtime.


### 20240306.v5

#### New features
Expand Down
4 changes: 2 additions & 2 deletions scripts/check_enforcer/check_enforcer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
github_repository = "microsoft/promptflow"
snippet_debug = os.getenv("SNIPPET_DEBUG", 0)
merge_commit = ""
loop_times = 30
loop_times = 40 # 40 * 30 seconds = 20 minutes
github_workspace = os.path.expanduser("~/promptflow/")

# Special cases for pipelines that need to be triggered more or less than default value 1.
Expand Down Expand Up @@ -279,7 +279,7 @@ def run_checks():
if failed_reason != "":
raise Exception(failed_reason)

# Loop for 15 minutes at most.
# Loop for 20 minutes at most.
for i in range(loop_times):
# Wait for 30 seconds.
time.sleep(30)
Expand Down
2 changes: 1 addition & 1 deletion scripts/installer/windows/product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<Icon Id="PromptflowServiceIcon" SourceFile="$(var.ProductResources)logo32.ico" />
</Shortcut>
<RemoveFile Id="CleanUpShortCut" Directory="StartupFolder" Name="Prompt flow service" On="uninstall"/>
<RegistryKey Root="HKCU" Key="Software\Microsoft\$(var.ProductName)" Action="createAndRemoveOnUninstall">
<RegistryKey Root="HKCU" Key="Software\Microsoft\$(var.ProductName)" Action="createAndRemoveOnUninstall" ForceDeleteOnUninstall="yes">
<RegistryValue Name="installed" Type="integer" Value="1" />
<RegistryValue Name="version" Type="string" Value="$(var.ProductVersion)" KeyPath="yes"/>
</RegistryKey>
Expand Down
6 changes: 6 additions & 0 deletions scripts/installer/windows/scripts/generate_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ def get_toml_dependencies(packages):
data = toml.load(file)
extra_package_names = data.get('tool', {}).get('poetry', {}).get('dependencies', {})
dependencies.extend(extra_package_names.keys())
# hard-code promptflow-evals dependency here since it's not added in promptflow setup for now
with open(get_git_base_dir() / "src" / "promptflow-evals" / "pyproject.toml", 'rb') as file:
data = toml.load(file)
extra_package_names = data.get('tool', {}).get('poetry', {}).get('dependencies', {})
dependencies.extend(extra_package_names.keys())

dependencies = [dependency for dependency in dependencies
if not dependency.startswith('promptflow') and not dependency == 'python']
return dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/promptflow-azure/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## v1.10.0 (Upcoming)

## 1.9.0 (2024.04.17)
## v1.9.0 (2024.04.17)
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def test_get_connection(self, connection_ops):
assert result.name == "azure_open_ai_connection"
assert result.api_type == "azure"
assert result.module == "promptflow.connections"
assert "/subscriptions" in result.resource_id

result = connection_ops.get(name="custom_connection")
assert isinstance(result, CustomConnection)
Expand Down
Loading

0 comments on commit 83c73b7

Please sign in to comment.