Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pf-evals package into msi #2788

Merged
merged 21 commits into from
Apr 19, 2024
Merged
3 changes: 3 additions & 0 deletions .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
16 changes: 14 additions & 2 deletions scripts/installer/windows/product.wxs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

<?define ProductVersion="$(env.CLI_VERSION)" ?>

Expand All @@ -12,6 +12,7 @@
<?if $(var.Platform) = "x64" ?>
<?define PromptflowCliRegistryGuid = "0efd984f-9eec-425b-b230-a3994b69649a" ?>
<?define PromptflowServiceGuid = "d4e99207-77be-4bdf-a430-b08632c5aa2b" ?>
<?define StopPromptflowServiceGuid = "a33e2e72-6e5c-47c2-ad9b-9b2c20c0040f" ?>
<?define PromptflowSystemPathGuid = "4c321045-d4e0-4446-bda4-8c19eaa42af1" ?>
<?define ProgramFilesFolder = "ProgramFiles64Folder" ?>
<?define RemovePromptflowFolderGuid = "ee843aa5-2b72-4958-be84-53dbac17efc7" ?>
Expand All @@ -21,6 +22,7 @@
<?elseif $(var.Platform) = "x86" ?>
<?define PromptflowCliRegistryGuid = "7c2c792d-c395-44a1-8222-8e4ea006abb9" ?>
<?define PromptflowServiceGuid = "f706b208-a15d-4ae7-9185-cfcc43656570" ?>
<?define StopPromptflowServiceGuid = "c381ece5-1aea-4555-8c96-48f12e4caf78" ?>
<?define PromptflowSystemPathGuid = "9661fe6a-ff48-4e7c-a60d-fc34c2d06ef3" ?>
<?define ProgramFilesFolder = "ProgramFilesFolder" ?>
<?define RemovePromptflowFolderGuid = "588ca5e1-38c6-4659-8b38-762df7ed5b28" ?>
Expand Down Expand Up @@ -89,7 +91,13 @@
Execute="deferred"
ExeCommand="wscript.exe promptflow_service.vbs"
Return="asyncNoWait" />
<CustomAction Id="StopPromptFlowService"
Directory="APPLICATIONFOLDER"
Execute="immediate"
ExeCommand="wscript.exe stop_service.vbs"
Return="ignore" />
<InstallExecuteSequence>
<Custom Action="StopPromptFlowService" Before="InstallInitialize">Installed OR WIX_UPGRADE_DETECTED</Custom>
<Custom Action="StartPromptFlowService" Before="InstallFinalize">NOT Installed OR WIX_UPGRADE_DETECTED</Custom>
</InstallExecuteSequence>
</Product>
Expand Down Expand Up @@ -126,6 +134,10 @@
<File Id="promptflow_service.vbs" Source="scripts\promptflow_service.vbs" KeyPath="yes" Checksum="yes"/>
</Component>

<Component Id="stop_service.vbs" Directory="APPLICATIONFOLDER" Guid="$(var.StopPromptflowServiceGuid)">
<File Id="stop_service.vbs" Source="scripts\stop_service.vbs" KeyPath="yes" Checksum="yes"/>
</Component>

<Component Id="ApplicationShortcut" Directory="StartupFolder" Guid="$(var.PromptflowCliRegistryGuid)">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="Prompt flow service"
Expand All @@ -136,7 +148,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
YingChen1996 marked this conversation as resolved.
Show resolved Hide resolved
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
3 changes: 3 additions & 0 deletions scripts/installer/windows/scripts/stop_service.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DIM objshell
set objshell = wscript.createobject("wscript.shell")
wangchao1230 marked this conversation as resolved.
Show resolved Hide resolved
iReturn = objshell.run("pfcli.exe pf service stop", 0, true)
Loading