Skip to content

Commit

Permalink
Merge pull request #2066 from dotnet/merges/release/2.1.2xx-to-releas…
Browse files Browse the repository at this point in the history
…e/2.1.3xx

Merge release/2.1.2xx to release/2.1.3xx
  • Loading branch information
johnbeisner authored Mar 22, 2018
2 parents 75d4e57 + e3013de commit 4d1111e
Show file tree
Hide file tree
Showing 24 changed files with 301 additions and 77 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ Please refer to [dotnet/cli](https://github.com/dotnet/cli) for .NET Core CLI so

|Windows x64 |
|:------:|
|[![](https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/3736/badge)](https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=3736)|
|[![](https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/7893/badge)](https://devdiv.visualstudio.com/DevDiv/_build?_a=completed&definitionId=7893)|

## How do I engage and contribute?
We welcome you to try things out, [file issues](https://github.com/dotnet/sdk/issues), make feature requests and join us in design conversations.

This project has adopted a code of conduct adapted from the [Contributor Covenant](http://contributor-covenant.org/) to clarify expected behavior in our community. This code of conduct has been [adopted by many other projects](http://contributor-covenant.org/adopters/). For more information see [Contributors Code of conduct](https://github.com/dotnet/home/blob/master/guidance/be-nice.md).

## Performance Status
* View SDK performance results at [BenchView](https://benchview/trendline?build_selector=latest&count=20&aggregate=arithmeticMean&filterTail=one&filterVal=100&interval=INTERVAL_MIN_MAX&rtids=[1084]&archids=[9]&mpids=[1292]&cfgids=[2689]&testids=[110118,110119,110121,110122,110124,110125]&jobgroup=SDK%20Perf%20Tests&jobtype=rolling&branchId=468&)
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
powershell -NoLogo -NoProfile -ExecutionPolicy ByPass %~dp0build\build.ps1 -build -restore -log %*
powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "& """%~dp0build\build.ps1""" -build -restore -log %*"
exit /b %ErrorLevel%
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
done
ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

. "$ScriptRoot/build/build.sh" --build --restore --log $@
. "$ScriptRoot/build/build.sh" --build --restore --log "$@"
2 changes: 1 addition & 1 deletion build/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<MicrosoftExtensionsDependencyModelVersion>2.0.0</MicrosoftExtensionsDependencyModelVersion>
<NETStandardLibraryNETFrameworkVersion>2.0.1-servicing-26011-01</NETStandardLibraryNETFrameworkVersion>
<NewtonsoftJsonVersion>9.0.1</NewtonsoftJsonVersion>
<NuGetBuildTasksPackVersion>4.7.0-preview1-4927</NuGetBuildTasksPackVersion>
<NuGetBuildTasksPackVersion>4.7.0-preview1.4982</NuGetBuildTasksPackVersion>
<NuGetPackagingVersion>$(NuGetBuildTasksPackVersion)</NuGetPackagingVersion>
<NuGetProjectModelVersion>$(NuGetBuildTasksPackVersion)</NuGetProjectModelVersion>
<PlatformAbstractionsVersion>2.0.0</PlatformAbstractionsVersion>
Expand Down
7 changes: 5 additions & 2 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ Param(
[switch] $sign,
[string] $solution = "",
[switch] $test,
[switch] $perf,
[string] $verbosity = "minimal",
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)

Set-StrictMode -Version 2.0
$ErrorActionPreference = "Stop"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

function Print-Usage() {
Write-Host "Common settings:"
Expand All @@ -34,6 +36,7 @@ function Print-Usage() {
Write-Host " -rebuild Rebuild solution"
Write-Host " -deploy Deploy built VSIXes"
Write-Host " -test Run all unit tests in the solution"
Write-Host " -perf Run all performance tests in the solution"
Write-Host " -sign Sign build outputs"
Write-Host " -pack Package build outputs into NuGet packages and Willow components"
Write-Host ""
Expand Down Expand Up @@ -106,7 +109,7 @@ function InstallDotNetCli {

if (!(Test-Path $SdkInstallDir)) {
# Use Invoke-Expression so that $DotNetInstallVerbosity is not positionally bound when empty
Invoke-Expression -Command "$DotNetInstallScript -Version $DotNetCliVersion $DotNetInstallVerbosity"
Invoke-Expression -Command "& `"$DotNetInstallScript`" -Version $DotNetCliVersion $DotNetInstallVerbosity"

if($LASTEXITCODE -ne 0) {
throw "Failed to install stage0"
Expand Down Expand Up @@ -263,7 +266,7 @@ function Build {
$solution = Join-Path $RepoRoot "sdk.sln"
}

dotnet msbuild $RepoToolsetBuildProj /m /nologo /clp:Summary /warnaserror /v:$verbosity $logCmd /p:Configuration=$configuration /p:SolutionPath=$solution /p:Restore=$restore /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci $properties
dotnet msbuild $RepoToolsetBuildProj /m /nologo /clp:Summary /warnaserror /v:$verbosity $logCmd /p:Configuration=$configuration /p:SolutionPath=$solution /p:Restore=$restore /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:PerformanceTest=$perf /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci $properties

if($LASTEXITCODE -ne 0) {
throw "Failed to build $RepoToolsetBuildProj"
Expand Down
41 changes: 21 additions & 20 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ build=false
ci=false
configuration="Debug"
dogfood=false
help=false
log=false
pack=false
prepareMachine=false
Expand All @@ -13,11 +12,12 @@ restore=false
sign=false
solution=""
test=false
perf=false
verbosity="minimal"
properties=""
properties=()

while [[ $# > 0 ]]; do
lowerI="$(echo $1 | awk '{print tolower($0)}')"
while [[ $# -gt 0 ]]; do
lowerI="$(echo "$1" | awk '{print tolower($0)}')"
case $lowerI in
--build)
build=true
Expand Down Expand Up @@ -46,6 +46,7 @@ while [[ $# > 0 ]]; do
echo " --build Build solution"
echo " --rebuild Rebuild solution"
echo " --test Run all unit tests in the solution"
echo " --perf Run all performance tests in the solution"
echo " --sign Sign build outputs"
echo " --pack Package build outputs into NuGet packages and Willow components"
echo ""
Expand Down Expand Up @@ -94,12 +95,16 @@ while [[ $# > 0 ]]; do
test=true
shift 1
;;
--Perf)
perf=true
shift 1
;;
--verbosity)
verbosity=$2
shift 2
;;
*)
properties="$properties $1"
properties+=("$1")
shift 1
;;
esac
Expand Down Expand Up @@ -145,7 +150,7 @@ function InstallDotNetCli {
curl "https://dot.net/v1/dotnet-install.sh" -sSL -o "$DotNetInstallScript"
fi

if [[ "$(echo $verbosity | awk '{print tolower($0)}')" == "diagnostic" ]]
if [[ "$(echo "$verbosity" | awk '{print tolower($0)}')" == "diagnostic" ]]
then
DotNetInstallVerbosity="--verbose"
fi
Expand All @@ -155,7 +160,7 @@ function InstallDotNetCli {

if [ ! -d "$SdkInstallDir" ]
then
bash "$DotNetInstallScript" --version $DotNetCliVersion $DotNetInstallVerbosity
bash "$DotNetInstallScript" --version "$DotNetCliVersion" $DotNetInstallVerbosity
LASTEXITCODE=$?

if [ $LASTEXITCODE != 0 ]
Expand Down Expand Up @@ -230,7 +235,7 @@ function InstallRepoToolset {

if $ci || $log
then
CreateDirectory $LogDir
CreateDirectory "$LogDir"
logCmd="/bl:$LogDir/Build.binlog"
else
logCmd=""
Expand All @@ -239,7 +244,7 @@ function InstallRepoToolset {
if [ ! -d "$RepoToolsetBuildProj" ]
then
ToolsetProj="$ScriptRoot/Toolset.proj"
dotnet msbuild $ToolsetProj /t:restore /m /nologo /clp:Summary /warnaserror /v:$verbosity $logCmd
dotnet msbuild "$ToolsetProj" /t:restore /m /nologo /clp:Summary /warnaserror "/v:$verbosity" $logCmd
LASTEXITCODE=$?

if [ $LASTEXITCODE != 0 ]
Expand All @@ -251,16 +256,12 @@ function InstallRepoToolset {
}

function Build {
InstallDotNetCli

if [ $? != 0 ]
if ! InstallDotNetCli
then
return $?
fi

InstallRepoToolset

if [ $? != 0 ]
if ! InstallRepoToolset
then
return $?
fi
Expand All @@ -282,18 +283,18 @@ function Build {
then
if $ci || $log
then
CreateDirectory $LogDir
CreateDirectory "$LogDir"
logCmd="/bl:$LogDir/Build.binlog"
else
logCmd=""
fi

if [ -z $solution ]
if [ -z "$solution" ]
then
solution="$RepoRoot/sdk.sln"
fi

dotnet msbuild $RepoToolsetBuildProj /m /nologo /clp:Summary /warnaserror /v:$verbosity $logCmd /p:Configuration=$configuration /p:SolutionPath=$solution /p:Restore=$restore /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci $properties
dotnet msbuild $RepoToolsetBuildProj /m /nologo /clp:Summary /warnaserror "/v:$verbosity" $logCmd "/p:Configuration=$configuration" "/p:SolutionPath=$solution" /p:Restore=$restore /p:Build=$build /p:Rebuild=$rebuild /p:Deploy=$deploy /p:Test=$test /p:PerformanceTest=$perf /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci "${properties[@]}"
LASTEXITCODE=$?

if [ $LASTEXITCODE != 0 ]
Expand Down Expand Up @@ -332,7 +333,7 @@ LogDir="$ArtifactsConfigurationDir/log"
VersionsProps="$ScriptRoot/Versions.props"

# HOME may not be defined in some scenarios, but it is required by NuGet
if [ -z $HOME ]
if [ -z "$HOME" ]
then
export HOME="$ArtifactsDir/.home/"
CreateDirectory "$HOME"
Expand All @@ -347,7 +348,7 @@ then
export TMP="$TempDir"
fi

if [ -z $NUGET_PACKAGES ]
if [ -z "$NUGET_PACKAGES" ]
then
export NUGET_PACKAGES="$HOME/.nuget/packages"
fi
Expand Down
2 changes: 1 addition & 1 deletion build/cibuild.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
powershell -NoLogo -NoProfile -ExecutionPolicy ByPass %~dp0Build.ps1 -restore -build -test -sign -pack -ci %*
powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -Command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -ci %*"
exit /b %ErrorLevel%
2 changes: 1 addition & 1 deletion build/dogfood.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -NoExit %~dp0Build.ps1 -dogfood %*
powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -NoExit -Command "& """%~dp0Build.ps1""" -dogfood %*"
exit /b %ErrorLevel%
80 changes: 80 additions & 0 deletions build/uploadperftobenchview.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
@echo off
setlocal EnableDelayedExpansion

REM The intent of this script is upload produced performance results to BenchView in a CI context.
REM There is no support for running this script in a dev environment.

if "%perfWorkingDirectory%" == "" (
echo EnvVar perfWorkingDirectory should be set; exiting...
exit /b %1)
if "%configuration%" == "" (
echo EnvVar configuration should be set; exiting...
exit /b 1)
if "%architecture%" == "" (
echo EnvVar architecture should be set; exiting...
exit /b 1)
if "%OS%" == "" (
echo EnvVar OS should be set; exiting...
exit /b 1)
if "%runType%" == "" (
echo EnvVar runType should be set; exiting...
exit /b 1)
if "%GIT_BRANCH%" == "" (
echo EnvVar GIT_BRANCH should be set; exiting...
exit /b 1)
if "%GIT_COMMIT%" == "" (
echo EnvVar GIT_COMMIT should be set; exiting...
exit /b 1)
if /I "%runType%" == "private" (
if "%BenchviewCommitName%" == "" (
echo EnvVar BenchviewCommitName should be set; exiting...
exit /b 1))


powershell -NoProfile wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile "%perfWorkingDirectory%\nuget.exe"

if exist "%perfWorkingDirectory%\Microsoft.BenchView.JSONFormat" rmdir /s /q "%perfWorkingDirectory%\Microsoft.BenchView.JSONFormat"
"%perfWorkingDirectory%\nuget.exe" install Microsoft.BenchView.JSONFormat -Source http://benchviewtestfeed.azurewebsites.net/nuget -OutputDirectory "%perfWorkingDirectory%" -Prerelease -ExcludeVersion

REM Do this here to remove the origin but at the front of the branch name as this is a problem for BenchView
if "%GIT_BRANCH:~0,7%" == "origin/" (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH:origin/=%) else (set GIT_BRANCH_WITHOUT_ORIGIN=%GIT_BRANCH%)

set benchViewName=SDK perf %OS% %architecture% %configuration% %runType% %GIT_BRANCH_WITHOUT_ORIGIN%
if /I "%runType%" == "private" (set benchViewName=%benchViewName% %BenchviewCommitName%)
if /I "%runType%" == "rolling" (set benchViewName=%benchViewName% %GIT_COMMIT%)
echo BenchViewName: "%benchViewName%"

echo Creating: "%perfWorkingDirectory%\submission-metadata.json"
py "%perfWorkingDirectory%\Microsoft.BenchView.JSONFormat\tools\submission-metadata.py" --name "%benchViewName%" --user-email "[email protected]" -o "%perfWorkingDirectory%\submission-metadata.json"

echo Creating: "%perfWorkingDirectory%\build.json"
py "%perfWorkingDirectory%\Microsoft.BenchView.JSONFormat\tools\build.py" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type "%runType%" -o "%perfWorkingDirectory%\build.json"

echo Creating: "%perfWorkingDirectory%\machinedata.json"
py "%perfWorkingDirectory%\Microsoft.BenchView.JSONFormat\tools\machinedata.py" -o "%perfWorkingDirectory%\machinedata.json"

echo Creating: "%perfWorkingDirectory%\measurement.json"
pushd "%perfWorkingDirectory%"
for /f "tokens=*" %%a in ('dir /b/a-d *.xml') do (
echo Processing: "%%a"
py "%perfWorkingDirectory%\Microsoft.BenchView.JSONFormat\tools\measurement.py" xunitscenario "%%a" --better desc --append -o "%perfWorkingDirectory%\measurement.json"
)
popd

echo Creating: "${perfWorkingDirectory}\submission.json"
py "%perfWorkingDirectory%\Microsoft.BenchView.JSONFormat\tools\submission.py" "%perfWorkingDirectory%\measurement.json" ^
--build "%perfWorkingDirectory%\build.json" ^
--machine-data "%perfWorkingDirectory%\machinedata.json" ^
--metadata "%perfWorkingDirectory%\submission-metadata.json" ^
--group "SDK Perf Tests" ^
--type "%runType%" ^
--config-name %configuration% ^
--config Configuration %configuration% ^
--architecture %architecture% ^
--machinepool "perfsnake" ^
-o "%perfWorkingDirectory%\submission.json"

echo Uploading: "%perfWorkingDirectory%\submission.json"
py "%perfWorkingDirectory%\Microsoft.BenchView.JSONFormat\tools\upload.py" "%perfWorkingDirectory%\submission.json" --container coreclr

exit /b %ErrorLevel%
Loading

0 comments on commit 4d1111e

Please sign in to comment.