Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
b76c4b6
Changes required in order to build corefx on linux using CLI's MSBuil…
joperezr Jan 30, 2018
23a6fce
Support MaxRetryCount
MattGal Jan 30, 2018
cb76b2f
Allow custom attributes in build manifest 'BuildIdentity' (#1882)
dagood Jan 30, 2018
a65f13f
Use project.json dep versions in VersionTools pkg (#1884)
dagood Jan 30, 2018
069862f
Produce 2.2.0-prerelease-* packages (#1888)
dagood Jan 30, 2018
4ec91ca
Merge pull request #1883 from MattGal/max-retry-count
MattGal Jan 31, 2018
89f91fd
Produce 2.1.0-preview2-* packages (#1889)
dagood Jan 31, 2018
2031290
Add Finalize/Copy to Latest task for final publish step (#1871)
dagood Jan 31, 2018
2404f8e
Fixing crossgen on core-setup by forcing the implicit NuGet fallback …
joperezr Jan 31, 2018
2a9486a
It is useful to know the branch where a particular build was made. A…
Feb 2, 2018
a4da379
Add idempotency options to publish tasks (#1894)
dagood Feb 7, 2018
978c771
Open files for upload with Read access
MattGal Feb 7, 2018
ba72a3d
Merge pull request #1901 from dotnet/uploadclient-read
MattGal Feb 7, 2018
306e18f
Checking Status code for downloading dumpling before executing (#1900)
Anipik Feb 8, 2018
eaf06cb
Use continuation marker in UploadToAzure
MattGal Feb 9, 2018
4d83d25
Merge pull request #1904 from MattGal/upload-fixes
MattGal Feb 9, 2018
09fb2ef
Fix dumplinghelper.py to not assume HTTPError.reason exists (#1908)
Feb 11, 2018
c4e6ded
Fix dumplinghelper to not log 'error format' (#1909)
Feb 11, 2018
b0fc5e3
Features to allow build-info creation and upload for orchestrated bui…
dagood Feb 13, 2018
ecacba8
Implement "join semaphore" groups
dagood Feb 13, 2018
b131ddc
Set VersionTools LangVersion to 6
dagood Feb 13, 2018
a6ec0d5
Merge pull request #1911 from dagood/joined-semaphore
dagood Feb 15, 2018
9afe1cd
Improve unit test output to show how to repro directly (#1913)
Feb 15, 2018
83a4646
Revert "Use continuation marker in UploadToAzure"
weshaggard Feb 16, 2018
f2d8075
Merge pull request #1914 from dotnet/revert-1904-upload-fixes
weshaggard Feb 16, 2018
a0c6617
Enforce order of references passed to ApiCompat (#1916)
Feb 16, 2018
3c7cf6f
use "$@" instead of $* to properly preserve arguments with spaces
Feb 16, 2018
84ecd15
Merge pull request #1917 from wfurt/params_with_spaces
weshaggard Feb 20, 2018
4c3c733
Fix default MaxRetryCount
MattGal Feb 20, 2018
67a0ccf
Merge pull request #1918 from dotnet/MattGal-patch-1
MattGal Feb 20, 2018
bee934e
Run PPDB conversion in the same MSBuild process
dagood Feb 20, 2018
13186f6
Merge pull request #1919 from dagood/unwrap-ppdb-convert
dagood Feb 21, 2018
f0fb0d9
Use ChecksumAlgorithm property
tmat Feb 21, 2018
7d57ab6
Package VersionTools desktop implementation (#1920)
chcosta Feb 21, 2018
52242ba
Use ProductVersion when creating prodcon readmes
dagood Feb 21, 2018
908f2c0
Merge pull request #1923 from dagood/summary-use-productversion
dagood Feb 21, 2018
235fee3
Merge pull request #1922 from tmat/ChecksumAlgorithm
weshaggard Feb 21, 2018
5812d96
Allow generating resources cs code at design time (#1921)
tarekgh Feb 21, 2018
e008d7f
Revert "Allow generating resources cs code at design time (#1921)" (#…
tarekgh Feb 21, 2018
63db91f
Enable Design Time Resource Code Generation (#1926)
tarekgh Feb 22, 2018
ccf4777
Add HelixAttempt support to helix job sending
Feb 22, 2018
173f96e
Add some documentation of HelixAttempt
Feb 22, 2018
4fb0060
Make documentation a bit more explicit
Feb 22, 2018
92bd848
Use TLS 1.2 security protocol in GitHubClient (#1925)
ravimeda Feb 22, 2018
d5e5855
Add SafeFindHandle to fix OverflowException (#1930)
Feb 27, 2018
f8444e2
Use the built tasks to update dotnet/versions
dagood Feb 28, 2018
bdffc61
Merge pull request #1935 from dagood/local-versions-updater/master
dagood Feb 28, 2018
4d76b21
Revert "Use the built tasks to update dotnet/versions"
dagood Feb 28, 2018
033355d
Merge pull request #1936 from dagood/local-versions-updater/master
dagood Feb 28, 2018
9cc52a0
Updating NuGet mappings
joperezr Mar 2, 2018
1733178
Fix typo
Mar 2, 2018
2dbd445
Even more typos
Mar 2, 2018
e3cdacb
Merge pull request #1938 from joperezr/NugetMappings
joperezr Mar 5, 2018
f0f57a8
Don't delete additional directory root
Mar 5, 2018
aa8b006
Merge pull request #1939 from jcagme/master
Mar 6, 2018
275a614
Merge pull request #1927 from ChadNedzlek/master
ChadNedzlek Mar 6, 2018
f78c7c0
Add empty Directory.Build.props and targets files so the tool-runtime…
eerhardt Mar 6, 2018
e911bc7
Use AssemblyResolver during PushToBlobFeed
dagood Mar 6, 2018
1830f2d
Merge pull request #1943 from dagood/fix-nuget-dep
dagood Mar 6, 2018
feeafb8
Make BuildTask common, use in Feed project
dagood Mar 6, 2018
7a3fd1a
Merge pull request #1945 from dagood/fix-nuget-dep
dagood Mar 6, 2018
8bfc031
Fix dumping stack from test coredumps on Linux (#1948)
Mar 7, 2018
39f99fe
Add target reverse APICompat check for libraries
weshaggard Mar 9, 2018
0e71545
Extract async task to avoid swallowing of TaskCanceledException from …
Mar 9, 2018
1491851
Merge pull request #1950 from riarenas/fix-infinite-downloadFilesFromUrl
Mar 9, 2018
b0cfbfc
/dev/null not nul on Unix (#1953)
Mar 12, 2018
519f9e1
Merge pull request #1949 from weshaggard/AddMatchingRefApiCompatCheck
weshaggard Mar 12, 2018
5274e07
Switch to using CallTarget
MattGal Mar 12, 2018
c50bdf5
Merge branch 'master' into release/2.1
weshaggard Mar 16, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Documentation/Samples/CloudTest.Helix.targets.sampleproject
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<HelixWorkItem Include="Demo Work item #1">
<Command>call DoStuff.bat</Command>
<!-- Needs to be a zip file that contains DoStuff.bat, adjust accordingly -->
<PayloadFile>Path to zip</PayloadFile>
<PayloadFile>Path to local zip file</PayloadFile>
<WorkItemId>Demo Work item #1</WorkItemId>
<TimeoutInSeconds>300</TimeoutInSeconds>
</HelixWorkItem>

<HelixWorkItem Include="Demo Work item #2">
<Command>call DoStuff.bat</Command>
<!-- Needs to be a zip file that contains DoStuff.bat, adjust accordingly -->
<PayloadFile>Path to zip</PayloadFile>
<PayloadFile>Path to some other local zip file</PayloadFile>
<WorkItemId>Demo Work item #2</WorkItemId>
<TimeoutInSeconds>200</TimeoutInSeconds>
</HelixWorkItem>
Expand All @@ -27,12 +27,12 @@

<!-- Required properties -->
<PropertyGroup>
<HelixApiEndpoint>https://helix.int-dot.net/api/2016-06-28/jobs</HelixApiEndpoint>
<HelixApiEndpoint>https://helix.dot.net/api/2016-06-28/jobs</HelixApiEndpoint>
<HelixApiAccessKey></HelixApiAccessKey>
<HelixJobType>unspecified/</HelixJobType>
<HelixSource>pr/unspecified/</HelixSource>
<TargetQueues>Windows.10.Amd64;Windows.7.Amd64;Windows.81.Amd64;Windows.10.Core.Amd64;</TargetQueues>
<BuildMoniker>20170301.0000</BuildMoniker>
<TargetQueues>Windows.10.Amd64;Windows.10.Core.Amd64;</TargetQueues>
<BuildMoniker>20180312.00</BuildMoniker>
<!-- Use any valid Connection string here -->
<CloudDropConnectionString>...</CloudDropConnectionString>
<CloudResultsConnectionString>...</CloudResultsConnectionString>
Expand All @@ -45,7 +45,7 @@

<Target Name="Build">
<Message Text="Beginning Cloud Build!" />
<HelixCloudBuild/>
<CallTarget Targets="HelixCloudBuild" />
</Target>

</Project>
</Project>
2 changes: 1 addition & 1 deletion dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<NuGetDependency Include="NuGet.RuntimeModel"/>
<NuGetDependency Include="NuGet.Versioning"/>
<StaticDependency Include="@(NuGetDependency)">
<Version>4.3.0</Version>
<Version>4.4.0</Version>
</StaticDependency>

<NETCoreDependency Include="Microsoft.NETCore.App"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"Newtonsoft.Json": "9.0.1",
"NuGet.Versioning": "4.3.0",
"NuGet.Versioning": "4.4.0",
"System.Reflection.Metadata": "1.4.1",
"System.Runtime.InteropServices.RuntimeInformation": "4.4.0-beta-24813-03"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private static void AutoRenewLeaseOnBlob(AzureBlobLease instance, Microsoft.Buil
}
token.ThrowIfCancellationRequested();

Thread.Sleep(waitFor);
Task.Delay(waitFor, token).Wait();
}
}

Expand Down
243 changes: 243 additions & 0 deletions src/Microsoft.DotNet.Build.CloudTestTasks/CopyBlobsToLatest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.Build.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace Microsoft.DotNet.Build.CloudTestTasks
{
public class CopyBlobsToLatest : AzureConnectionStringBuildTask
{
private static readonly string[] DefaultLatestVersionFilenames =
{
"latest.version"
};

private static readonly Regex VersionRegex = new Regex(
@"(?<version>\d+\.\d+\.\d+)(-(?<prerelease>[^-]+-)?(?<major>\d+)-(?<minor>\d+))?");

[Required]
public string ContainerName { get; set; }

[Required]
public string Product { get; set; }

[Required]
public string ProductVersion { get; set; }

[Required]
public string Channel { get; set; }

[Required]
public string Commit { get; set; }

public string[] LatestVersionFilenames { get; set; }

/// <summary>
/// A list of full version strings that should be converted to "latest" for each blob id,
/// in addition to ProductVersion.
/// </summary>
public string[] FullVersions { get; set; }

/// <summary>
/// If this task is called by multiple build legs that make up one build, enable this option
/// to prevent race conditions by dropping a version hint of what version this is. If we see
/// this file and it is the same as our version then we know that a race happened where two+
/// builds finished at the same time and someone already took care of publishing and we have
/// no work to do.
///
/// This is not necessary if the build uses some other mechanism to ensure each build only
/// has one finalization attempt, e.g. PipeBuild.
/// </summary>
public bool EnableVersionHint { get; set; }

public override bool Execute()
{
ParseConnectionString();

if (Log.HasLoggedErrors)
{
return false;
}

string sourceDir = $"{Product}/{ProductVersion}/";
string channelDir = $"{Product}/{Channel}/";
string semaphoreBlob = $"{channelDir}publishSemaphore";

CreateBlobIfNotExists(semaphoreBlob);

AzureBlobLease blobLease = new AzureBlobLease(
AccountName,
AccountKey,
ConnectionString,
ContainerName,
semaphoreBlob,
Log);

Log.LogMessage($"Acquiring lease on semaphore blob '{semaphoreBlob}'");
blobLease.Acquire();

try
{
if (EnableVersionHint)
{
string targetVersionFile = $"{channelDir}{ProductVersion}";

// Check if this build is already finalized.
if (IsLatestSpecifiedVersion(targetVersionFile))
{
Log.LogMessage(
MessageImportance.High,
$"Version '{ProductVersion}' is already published. " +
$"Skipping finalization. Hint file: '{targetVersionFile}'");

return true;
}

// Delete old version files.
GetBlobList(channelDir)
.Select(s => s.Replace($"/{ContainerName}/", ""))
.Where(w => VersionRegex.Replace(Path.GetFileName(w), "") == "")
.ToList()
.ForEach(f => TryDeleteBlob(f));

// Drop the version file signaling such for any race-condition builds.
CreateBlobIfNotExists(targetVersionFile);
}

CopyBlobs(sourceDir, channelDir);

// Generate the latest version text file
string versionText =
$"{Commit}{Environment.NewLine}" +
$"{ProductVersion}{Environment.NewLine}";

if (LatestVersionFilenames?.Any() != true)
{
LatestVersionFilenames = DefaultLatestVersionFilenames;
}

foreach (string latestFilename in LatestVersionFilenames)
{
PublishStringToBlob(
ContainerName,
$"{channelDir}{latestFilename}",
versionText,
"text/plain");
}
}
finally
{
Log.LogMessage($"Releasing lease on semaphore blob '{semaphoreBlob}'");
blobLease.Release();
}

return !Log.HasLoggedErrors;
}

private bool CopyBlobs(string sourceFolder, string destinationFolder)
{
// List of versions that need to be replaced with "latest" when copying blobs.
var versions = new List<string> { ProductVersion };
if (FullVersions != null)
{
versions.AddRange(FullVersions);
}

bool returnStatus = true;
List<Task<bool>> copyTasks = new List<Task<bool>>();
string[] blobs = GetBlobList(sourceFolder);
foreach (string blob in blobs)
{
string targetName = versions.Aggregate(
Path.GetFileName(blob),
(agg, version) => agg.Replace(version, "latest"));

string sourceBlob = blob.Replace($"/{ContainerName}/", "");
string destinationBlob = $"{destinationFolder}{targetName}";
Log.LogMessage($"Copying blob '{sourceBlob}' to '{destinationBlob}'");
copyTasks.Add(CopyBlobAsync(sourceBlob, destinationBlob));
}
Task.WaitAll(copyTasks.ToArray());
copyTasks.ForEach(c => returnStatus &= c.Result);
return returnStatus;
}

private bool TryDeleteBlob(string path)
{
return DeleteBlob(ContainerName, path);
}

private void CreateBlobIfNotExists(string path)
{
var blobList = GetBlobList(path);
if (blobList.Count() == 0)
{
PublishStringToBlob(ContainerName, path, DateTime.Now.ToString());
}
}

private bool IsLatestSpecifiedVersion(string versionFile)
{
var blobList = GetBlobList(versionFile);
return blobList.Count() != 0;
}

private bool DeleteBlob(string container, string blob)
{
return DeleteAzureBlob.Execute(
AccountName,
AccountKey,
ConnectionString,
container,
blob,
BuildEngine,
HostObject);
}

private Task<bool> CopyBlobAsync(string sourceBlobName, string destinationBlobName)
{
return CopyAzureBlobToBlob.ExecuteAsync(
AccountName,
AccountKey,
ConnectionString,
ContainerName,
sourceBlobName,
destinationBlobName,
BuildEngine,
HostObject);
}

private string[] GetBlobList(string path)
{
return ListAzureBlobs.Execute(
AccountName,
AccountKey,
ConnectionString,
ContainerName,
path,
BuildEngine,
HostObject);
}

private bool PublishStringToBlob(string container, string blob, string contents, string contentType = null)
{
return PublishStringToAzureBlob.Execute(
AccountName,
AccountKey,
ConnectionString,
container,
blob,
contents,
contentType,
BuildEngine,
HostObject);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private async Task DownloadItem(CancellationToken ct, string blob, SemaphoreSlim
{
client.Timeout = TimeSpan.FromMinutes(10);
Log.LogMessage(MessageImportance.Low, "Downloading BLOB - {0}", blob);
string urlGetBlob = AzureHelper.GetBlobRestUrl(AccountName, ContainerName, blob);
string blobUrl = AzureHelper.GetBlobRestUrl(AccountName, ContainerName, blob);
filename = Path.Combine(DownloadDirectory, Path.GetFileName(blob));

if (!DownloadFlatFiles)
Expand Down Expand Up @@ -155,7 +155,7 @@ private async Task DownloadItem(CancellationToken ct, string blob, SemaphoreSlim
filename = Path.Combine(downloadBlobDirectory, blobFilename);
}

var createRequest = AzureHelper.RequestMessage("GET", urlGetBlob, AccountName, AccountKey);
var createRequest = AzureHelper.RequestMessage("GET", blobUrl, AccountName, AccountKey);

using (HttpResponseMessage response = await AzureHelper.RequestWithRetry(Log, client, createRequest))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<Compile Include="AzureConnectionStringBuildTask.cs" />
<Compile Include="AzureBlobLease.cs" />
<Compile Include="AzureHelper.cs" />
<Compile Include="CopyBlobsToLatest.cs" />
<Compile Include="CopyAzureBlobToBlob.cs" />
<Compile Include="CreateAzureContainer.cs" />
<Compile Include="DeleteAzureBlob.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import platform
import urllib
import urllib2
import glob
import time
import sys
Expand All @@ -16,10 +17,19 @@ def install_dumpling():
url = "https://dumpling.azurewebsites.net/api/client/dumpling.py"
scriptPath = os.path.dirname(os.path.realpath(__file__))
downloadLocation = scriptPath + "/dumpling.py"
urllib.urlretrieve(url, downloadLocation)
subprocess.call([sys.executable, downloadLocation, "install", "--update"])
response = urllib2.urlopen(url)
if response.getcode() == 200:
with open(downloadLocation, 'w') as f:
f.write(response.read())
subprocess.call([sys.executable, downloadLocation, "install", "--update"])
else:
raise urllib2.URLError("HTTP Status Code" + str(result.getcode()))

subprocess.call([sys.executable, dumplingPath, "install"])
except urllib2.HTTPError, e:
print("Dumpling cannot be installed due to: " + str(e).replace(':', '')) # Remove : to avoid looking like error format
except urllib2.URLError, e:
print(e.reason)
except:
print("An unexpected error was encountered while installing dumpling.py: " + sys.exc_info()[0])

Expand Down
Loading