This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
Build conda packages for IQ#, qsharp.py #37
Merged
Merged
Changes from all commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
a104b49
Started iqsharp recipe.
cgranade fb7339a
Update Jupyter.Core dependency to get --sys-prefix.
cgranade 820fe05
Started work on packing new recipe.
cgranade 22426b6
Modify steps to use conda env instead.
cgranade 4b63796
Remove redundant step.
cgranade 1c81089
Updated description.
cgranade 51c3c0b
Add conda package to drop.
cgranade ab170a4
Some very painful shell scripting.
cgranade 78587b6
Move iqsharp conda install to opt.
cgranade 614bcda
Fix order in which we add to path.
cgranade 72146b2
Fix some bugs building dotnetcore-sdk from Linux.
cgranade 5629692
Use powershell instead of pwsh when building from Windows.
cgranade 0c2c32b
Suppress profile when building iqsharp on POSIX.
cgranade fa9e256
Made pwsh dependency from iqsharp POSIX-only.
cgranade 2fe1e67
Started working on pwsh package.
cgranade 21f4b6e
Only pack pwsh on non-Windows hosts.
cgranade 5cf641a
Prevent pwsh from capturing NuGet cache.
cgranade a3eeb5f
Fix PowerShell 5.1 vs 6.2 issues.
cgranade 36030bb
Fixed name of DOTNET_ROOT env var.
cgranade 36dbe87
Fix Runtime ID check on PS 5.1.
cgranade 53a5169
Fix name of activation/deactivation scripts.
cgranade e9858db
Force line endings to enable patching 10607.
cgranade f6fae69
Add SHA256 sums.
cgranade 4a4f478
Build fixes for # [non win].
cgranade 505cc3e
ac71c2a
Fixes to test.
cgranade 55f35ad
Fixed meta.yaml for windows.
cgranade 539ea23
Version bump
cgranade 0b463f7
Suppress posh profile on Windows.
cgranade e30a049
Fixed line endings in dotnet/cli#10607 workaround.
cgranade e6bf609
Pin versions in pwsh.
cgranade 2d80ecf
Added slightly more tests to iqsharp package.
cgranade 0fa785d
Use Jinja2 to handle IQ# version passed by set-env.ps1.
cgranade d69051f
Added qsharp package as well.
cgranade ed87d4d
Added qsharp package to pack as well.
cgranade 1ce876d
macOS fixes
e029ba3
Merge branch 'master' into cgranade/conda-build
cgranade 23145de
Fix some metadata.
cgranade 45596a4
Extended build definition for xplat conda build.
cgranade 5000926
Renamed xplat conda build jobs.
cgranade 8c8039f
Propagate step template parameter into env.
cgranade 1c72a99
Adding more detail to pack diagnostics.
cgranade f132e77
Handle stderr from conda-build better.
cgranade 0fffb49
Detect $IsWindows even on Windows.
cgranade bc5ab10
Revert and downgrade to warning.
cgranade 9febe94
Separate out conda-build call into separate job.
cgranade 3cfcd26
Find .NET Core SDK more reliabily.
cgranade 3283808
Write conda build logs to temporary file as well.
cgranade 74b61d2
trying again to log.
cgranade 31a4390
Explicitly write all conda-build output to host.
cgranade 0abc0eb
Fixing property name in log upload.
cgranade a97dc5c
Fix uploadfile task command.
cgranade c5644d7
Trying again to get any log information out of ADO.
cgranade a9ccc9b
Don't trust conda-build's exit code.
cgranade 9b17aed
Switch to using pwsh everywhere.
cgranade 0764e1b
Fix macOS-specific bug.
cgranade ddc0200
Fix pack-conda diagnostics.
cgranade 6119125
Forgot to remove log upload.
cgranade 540df3b
First stab at removing dotnetcore-sdk and pwsh recipes.
cgranade f073363
Updated pack script for reduced package set.
cgranade 86c7fbc
Fixed test-time requirements for iqsharp.
cgranade 4041e18
Force pwsh vs powershell.
cgranade c6a1783
Try using pwsh on Windows.
cgranade 527d240
Lock conda-build to 3.18.8.
cgranade eeaf8a9
Added call to dotnet --info.
cgranade fdf0bd8
Revert "Added call to dotnet --info."
cgranade 2943c2a
Lock conda build to dotnet 2.2.401
cgranade 18c370d
Adding more diagnostics.
cgranade dcb6457
More diagnostics.
cgranade 4f16132
even more diagnostics
cgranade 7f99746
Disable binary prefix searching.
cgranade 22b9f6d
yet more debugging
cgranade 343a0fe
fix diagnostics.
cgranade edde3fa
One more fix to diagnostics.
cgranade 33a4eeb
one moar fix
cgranade 9e66ee4
undo diagnostics.
cgranade 311fd0b
Workaround for conda/conda-build#3736.
cgranade 35b4a6f
Workaround for conda/conda-build#3170.
cgranade aa93293
Trying again to redirect stderr.
cgranade 646299f
trying one more time to suppress stderr.
cgranade 86a5a87
Putting try catch back.
cgranade d6c2e0a
Redirect just stderr.
cgranade 9f9ebcc
Downgrade error action as well.
cgranade 5b26947
Build 3.6 and 3.7 versions.
cgranade 739b88f
Adding python version to outputs as well.
cgranade File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
// Use IntelliSense to find out which attributes exist for C# debugging | ||
// Use hover for the description of the existing attributes | ||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": ".NET Core Launch (console)", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"preLaunchTask": "build", | ||
// If you have changed target frameworks, make sure to update the program path. | ||
"program": "${workspaceFolder}/src/Tool/bin/Debug/netcoreapp2.2/Microsoft.Quantum.IQSharp.dll", | ||
"args": [], | ||
"cwd": "${workspaceFolder}/src/Tool", | ||
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console | ||
"console": "internalConsole", | ||
"stopAtEntry": false | ||
}, | ||
{ | ||
"name": ".NET Core Attach", | ||
"type": "coreclr", | ||
"request": "attach", | ||
"processId": "${command:pickProcess}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"build", | ||
"${workspaceFolder}/src/Tool/Tool.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "publish", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"publish", | ||
"${workspaceFolder}/src/Tool/Tool.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "watch", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"watch", | ||
"run", | ||
"${workspaceFolder}/src/Tool/Tool.csproj", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary" | ||
], | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
$ErrorActionPreference = 'Stop' | ||
|
||
& "$PSScriptRoot/set-env.ps1" | ||
$all_ok = $True | ||
$CondaPlatform = (conda info --json) ` | ||
| ConvertFrom-Json ` | ||
| Select-Object -ExpandProperty platform; | ||
|
||
# Write out diagnostics about what version of PowerShell we're on. | ||
$PSVersionTable | Format-Table | Out-String | Write-Host; | ||
|
||
function Pack-CondaRecipe() { | ||
param( | ||
[string] $Path, | ||
[string[]] $PythonVersions = @("3.6", "3.7") | ||
); | ||
|
||
if (-not (Get-Command conda-build -ErrorAction SilentlyContinue)) { | ||
Write-Host "##vso[task.logissue type=warning;] conda-build not installed. " + ` | ||
"Will skip creation of conda package for $Path."; | ||
return; | ||
} | ||
|
||
# conda-build prints some warnings to stderr, which can lead to false positives. | ||
# We wrap in a try-finally to make sure we can condition on the built file being there, and not on | ||
# writing to stderr. | ||
try { | ||
$OldPreference = $ErrorActionPreference; | ||
$ErrorActionPreference = "Continue"; | ||
$PythonVersions | ` | ||
ForEach-Object { | ||
Write-Host "##[info]Running: conda build $(Resolve-Path $Path) --python=$_" | ||
# See https://stackoverflow.com/a/20950421/267841 for why this works to force conda | ||
# to output all log messages to stdout instead of stderr. | ||
conda build (Resolve-Path $Path) --python=$_ 2>&1 | ForEach-Object { "$_" }; | ||
} | ||
} catch { | ||
Write-Host "##vso[task.logissue type=warning;]conda build error: $_"; | ||
} finally { | ||
$ErrorActionPreference = $OldPreference; | ||
$TargetDir = (Join-Path $Env:CONDA_OUTDIR $CondaPlatform); | ||
New-Item -ItemType Directory -Path $TargetDir -Force -ErrorAction SilentlyContinue; | ||
$PythonVersions | ` | ||
ForEach-Object { | ||
$PackagePath = (conda build (Resolve-Path $Path) --python=$_ --output); | ||
if (Test-Path $PackagePath) { | ||
Copy-Item ` | ||
$PackagePath ` | ||
$TargetDir ` | ||
-ErrorAction Continue ` | ||
-Verbose; | ||
Write-Host "##[info]Copied $PackagePath to $TargetDir."; | ||
} else { | ||
Write-Host "##vso[task.logissue type=error;]Failed to create conda package for $Path (Python $_)." | ||
$script:all_ok = $False | ||
} | ||
} | ||
} | ||
} | ||
|
||
Write-Host "##[info]Packing conda recipes..." | ||
Pack-CondaRecipe -Path "../conda-recipes/iqsharp" | ||
Pack-CondaRecipe -Path "../conda-recipes/qsharp" | ||
|
||
if (-not $all_ok) { | ||
throw "At least one package failed to build. Check the logs." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## | ||
# Build and test IQ#. | ||
## | ||
|
||
steps: | ||
|
||
## | ||
# Pre-reqs | ||
## | ||
- task: CondaEnvironment@1 | ||
inputs: | ||
packageSpecs: "python=3.6 pip setuptools pytest jupyter conda-build=3.18.8 conda-package-handling=1.3.11" | ||
displayName: 'Use conda environment w/ Python 3.6' | ||
|
||
- task: UseDotNet@2 | ||
displayName: 'Use .NET Core sdk' | ||
inputs: | ||
packageType: sdk | ||
version: 2.2.401 | ||
|
||
## | ||
# Pack conda packages | ||
## | ||
- pwsh: .\pack-conda.ps1 | ||
displayName: "Packing IQ# packages" | ||
workingDirectory: '$(System.DefaultWorkingDirectory)/build' | ||
|
||
## | ||
# Publish build artifacts. | ||
## | ||
- task: PublishBuildArtifacts@1 | ||
displayName: 'Publish Artifact: drop' | ||
condition: succeededOrFailed() | ||
inputs: | ||
PathtoPublish: '$(Build.ArtifactStagingDirectory)' | ||
artifactName: iqsharp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<PlatformTarget>x64</PlatformTarget> | ||
<TargetFramework>netcoreapp2.2</TargetFramework> | ||
<RootNamespace>Microsoft.Quantum.IQSharp</RootNamespace> | ||
<AssemblyName>Microsoft.Quantum.IQSharp</AssemblyName> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<NoWarn>0162</NoWarn> | ||
<Authors>Microsoft</Authors> | ||
<Description>Microsoft's IQ# Server.</Description> | ||
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright> | ||
<ContentTargetFolders>\</ContentTargetFolders> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\..\build\DelaySign.cs" Link="Properties\DelaySign.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="appsettings.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Jupyter\Jupyter.csproj" /> | ||
<ProjectReference Include="..\Core\Core.csproj" /> | ||
<ProjectReference Include="..\Web\Web.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.App" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.2.0" /> | ||
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" /> | ||
<PackageReference Include="System.Net.Http" Version="4.3.4" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pwsh -NoProfile iqsharp/conda-recipes/iqsharp/build.ps1 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need a different project? can you just target the existing one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotnet publish
has a lot of bugs when running on a project that has<PackAsTool>true</PackAsTool>
. This was the most reliable workaround that I could find for those issues.