Merged PR 595461: Uptake latest ADO build

Related work items: #1806400
This commit is contained in:
Wei Lim 2021-02-19 21:57:41 +00:00
Родитель e1c90dc85e
Коммит 18070f6f29
20 изменённых файлов: 68 добавлений и 70 удалений

Просмотреть файл

@ -301,7 +301,7 @@ namespace BuildXL.Cache.ContentStore.Vsts
{ {
var endDateTime = DateTime.UtcNow + TimeToKeepContent; var endDateTime = DateTime.UtcNow + TimeToKeepContent;
await BlobStoreHttpClient.UploadAndReferenceBlobWithRetriesAsync( await BlobStoreHttpClient.UploadAndReferenceBlobWithRetriesAsync(
ToVstsBlobIdentifier(BuildXL.Cache.ContentStore.Hashing.BlobIdentifierHelperExtensions.ToBlobIdentifier(contentHash)), contentHash.ToBlobIdentifier(),
stream, stream,
new BlobReference(endDateTime), new BlobReference(endDateTime),
context, context,

Просмотреть файл

@ -32,10 +32,8 @@ using Microsoft.VisualStudio.Services.Content.Common;
using Microsoft.VisualStudio.Services.WebApi; using Microsoft.VisualStudio.Services.WebApi;
using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob; using Microsoft.WindowsAzure.Storage.Blob;
using BlobIdentifier = BuildXL.Cache.ContentStore.Hashing.BlobIdentifier;
using ByteArrayPool = Microsoft.VisualStudio.Services.BlobStore.Common.ByteArrayPool; using ByteArrayPool = Microsoft.VisualStudio.Services.BlobStore.Common.ByteArrayPool;
using OperationContext = BuildXL.Cache.ContentStore.Tracing.Internal.OperationContext; using OperationContext = BuildXL.Cache.ContentStore.Tracing.Internal.OperationContext;
using VstsBlobIdentifier = Microsoft.VisualStudio.Services.BlobStore.Common.BlobIdentifier;
#nullable enable #nullable enable
@ -313,15 +311,10 @@ namespace BuildXL.Cache.ContentStore.Vsts
protected override Task<IEnumerable<Task<Indexed<PlaceFileResult>>>> PlaceFileCoreAsync(OperationContext context, IReadOnlyList<ContentHashWithPath> hashesWithPaths, FileAccessMode accessMode, FileReplacementMode replacementMode, FileRealizationMode realizationMode, UrgencyHint urgencyHint, Counter retryCounter) protected override Task<IEnumerable<Task<Indexed<PlaceFileResult>>>> PlaceFileCoreAsync(OperationContext context, IReadOnlyList<ContentHashWithPath> hashesWithPaths, FileAccessMode accessMode, FileReplacementMode replacementMode, FileRealizationMode realizationMode, UrgencyHint urgencyHint, Counter retryCounter)
=> throw new NotImplementedException(); => throw new NotImplementedException();
/// <summary>
/// Converts a ContentStore blob id to an artifact BlobId
/// </summary>
protected static VstsBlobIdentifier ToVstsBlobIdentifier(BlobIdentifier blobIdentifier) => new VstsBlobIdentifier(blobIdentifier.Bytes);
private async Task<IEnumerable<Task<Indexed<PinResult>>>> UpdateBlobStoreAsync(OperationContext context, IReadOnlyList<ContentHash> contentHashes, DateTime endDateTime) private async Task<IEnumerable<Task<Indexed<PinResult>>>> UpdateBlobStoreAsync(OperationContext context, IReadOnlyList<ContentHash> contentHashes, DateTime endDateTime)
{ {
// Convert missing content hashes to blob Ids // Convert missing content hashes to blob Ids
var blobIds = contentHashes.Select(c => ToVstsBlobIdentifier(BuildXL.Cache.ContentStore.Hashing.BlobIdentifierHelperExtensions.ToBlobIdentifier(c))).ToList(); var blobIds = contentHashes.Select(contentHash => contentHash.ToBlobIdentifier()).ToList();
// Call TryReference on the blob ids // Call TryReference on the blob ids
var references = blobIds.Distinct().ToDictionary( var references = blobIds.Distinct().ToDictionary(
@ -539,18 +532,18 @@ namespace BuildXL.Cache.ContentStore.Vsts
if (!DownloadUriCache.Instance.TryGetDownloadUri(contentHash, out var uri)) if (!DownloadUriCache.Instance.TryGetDownloadUri(contentHash, out var uri))
{ {
_blobCounters[Counters.VstsDownloadUriFetchedFromRemote].Increment(); _blobCounters[Counters.VstsDownloadUriFetchedFromRemote].Increment();
var blobId = BuildXL.Cache.ContentStore.Hashing.BlobIdentifierHelperExtensions.ToBlobIdentifier(contentHash); var blobId = contentHash.ToBlobIdentifier();
var mappings = await ArtifactHttpClientErrorDetectionStrategy.ExecuteWithTimeoutAsync( var mappings = await ArtifactHttpClientErrorDetectionStrategy.ExecuteWithTimeoutAsync(
context, context,
"GetStreamInternal", "GetStreamInternal",
innerCts => BlobStoreHttpClient.GetDownloadUrisAsync( innerCts => BlobStoreHttpClient.GetDownloadUrisAsync(
new[] { ToVstsBlobIdentifier(blobId) }, new[] { blobId },
EdgeCache.NotAllowed, EdgeCache.NotAllowed,
cancellationToken: innerCts), cancellationToken: innerCts),
context.Token).ConfigureAwait(false); context.Token).ConfigureAwait(false);
if (mappings == null || !mappings.TryGetValue(ToVstsBlobIdentifier(blobId), out uri)) if (mappings == null || !mappings.TryGetValue(blobId, out uri))
{ {
return null; return null;
} }

Просмотреть файл

@ -11,10 +11,13 @@ using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using BuildXL.Cache.ContentStore.Hashing;
using BuildXL.Cache.ContentStore.Interfaces.Tracing; using BuildXL.Cache.ContentStore.Interfaces.Tracing;
using Microsoft.VisualStudio.Services.BlobStore.Common; using Microsoft.VisualStudio.Services.BlobStore.Common;
using Microsoft.VisualStudio.Services.BlobStore.WebApi; using Microsoft.VisualStudio.Services.BlobStore.WebApi;
using Microsoft.VisualStudio.Services.Content.Common; using Microsoft.VisualStudio.Services.Content.Common;
using VsoHash = Microsoft.VisualStudio.Services.BlobStore.Common.VsoHash;
using BlobIdentifierWithBlocks = Microsoft.VisualStudio.Services.BlobStore.Common.BlobIdentifierWithBlocks;
namespace BuildXL.Cache.ContentStore.Vsts namespace BuildXL.Cache.ContentStore.Vsts
{ {

Просмотреть файл

@ -17,7 +17,6 @@ using BuildXL.Cache.ContentStore.Utils;
using BuildXL.Utilities.Tracing; using BuildXL.Utilities.Tracing;
using Microsoft.VisualStudio.Services.BlobStore.Common; using Microsoft.VisualStudio.Services.BlobStore.Common;
using Microsoft.VisualStudio.Services.BlobStore.WebApi; using Microsoft.VisualStudio.Services.BlobStore.WebApi;
using VstsDedupIdentifier = Microsoft.VisualStudio.Services.BlobStore.Common.DedupIdentifier;
using VstsFileSystem = Microsoft.VisualStudio.Services.Content.Common.FileSystem; using VstsFileSystem = Microsoft.VisualStudio.Services.Content.Common.FileSystem;
namespace BuildXL.Cache.ContentStore.Vsts namespace BuildXL.Cache.ContentStore.Vsts
@ -253,7 +252,7 @@ namespace BuildXL.Cache.ContentStore.Vsts
private Task PutNodeAsync(OperationContext context, DedupNode dedupNode, AbsolutePath path) private Task PutNodeAsync(OperationContext context, DedupNode dedupNode, AbsolutePath path)
{ {
var dedupIdentifier = dedupNode.GetDedupId(); var dedupIdentifier = dedupNode.GetDedupIdentifier(HashType.Dedup64K);
return TryGatedArtifactOperationAsync<object>( return TryGatedArtifactOperationAsync<object>(
context, context,
@ -261,14 +260,14 @@ namespace BuildXL.Cache.ContentStore.Vsts
"DedupUploadSession.UploadAsync", "DedupUploadSession.UploadAsync",
async innerCts => async innerCts =>
{ {
await _uploadSession.UploadAsync(dedupNode, new Dictionary<VstsDedupIdentifier, string> { { dedupIdentifier, path.Path } }, innerCts); await _uploadSession.UploadAsync(dedupNode, new Dictionary<DedupIdentifier, string> { { dedupIdentifier, path.Path } }, innerCts);
return null; return null;
}); });
} }
private Task PutChunkAsync(OperationContext context, DedupNode dedupNode, AbsolutePath path) private Task PutChunkAsync(OperationContext context, DedupNode dedupNode, AbsolutePath path)
{ {
var dedupIdentifier = dedupNode.GetDedupId(); var dedupIdentifier = dedupNode.GetDedupIdentifier(HashType.Dedup64K);
return TryGatedArtifactOperationAsync( return TryGatedArtifactOperationAsync(
context, context,
dedupIdentifier.ValueString, dedupIdentifier.ValueString,

Просмотреть файл

@ -28,11 +28,8 @@ using BuildXL.Utilities.Tracing;
using Microsoft.VisualStudio.Services.BlobStore.Common; using Microsoft.VisualStudio.Services.BlobStore.Common;
using Microsoft.VisualStudio.Services.BlobStore.WebApi; using Microsoft.VisualStudio.Services.BlobStore.WebApi;
using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage;
using BlobIdentifier = BuildXL.Cache.ContentStore.Hashing.BlobIdentifier;
using FileInfo = System.IO.FileInfo; using FileInfo = System.IO.FileInfo;
using OperationContext = BuildXL.Cache.ContentStore.Tracing.Internal.OperationContext; using OperationContext = BuildXL.Cache.ContentStore.Tracing.Internal.OperationContext;
using VstsDedupIdentifier = Microsoft.VisualStudio.Services.BlobStore.Common.DedupIdentifier;
using VstsBlobIdentifier = Microsoft.VisualStudio.Services.BlobStore.Common.BlobIdentifier;
namespace BuildXL.Cache.ContentStore.Vsts namespace BuildXL.Cache.ContentStore.Vsts
{ {
@ -184,8 +181,8 @@ namespace BuildXL.Cache.ContentStore.Vsts
return pinResult; return pinResult;
} }
VstsBlobIdentifier blobId = ToVstsBlobIdentifier(BuildXL.Cache.ContentStore.Hashing.BlobIdentifierHelperExtensions.ToBlobIdentifier(contentHash)); BlobIdentifier blobId = contentHash.ToBlobIdentifier();
VstsDedupIdentifier dedupId = blobId.ToDedupIdentifier(); DedupIdentifier dedupId = blobId.ToDedupIdentifier();
if (dedupId.AlgorithmId == Hashing.ChunkDedupIdentifier.ChunkAlgorithmId) if (dedupId.AlgorithmId == Hashing.ChunkDedupIdentifier.ChunkAlgorithmId)
{ {
@ -244,7 +241,7 @@ namespace BuildXL.Cache.ContentStore.Vsts
try try
{ {
PinResult pinResult; PinResult pinResult;
var dedupId = ToVstsBlobIdentifier(BuildXL.Cache.ContentStore.Hashing.BlobIdentifierHelperExtensions.ToBlobIdentifier(contentHash)).ToDedupIdentifier(); var dedupId = contentHash.ToBlobIdentifier().ToDedupIdentifier();
if (dedupId.AlgorithmId == Hashing.ChunkDedupIdentifier.ChunkAlgorithmId) if (dedupId.AlgorithmId == Hashing.ChunkDedupIdentifier.ChunkAlgorithmId)
{ {
pinResult = await TryPinChunkAsync(context, dedupId, keepUntil); pinResult = await TryPinChunkAsync(context, dedupId, keepUntil);
@ -419,11 +416,6 @@ namespace BuildXL.Cache.ContentStore.Vsts
throw new NotImplementedException(); throw new NotImplementedException();
} }
/// <summary>
/// Converts a ContentStore BlobId to an Artifact BlobId
/// </summary>
protected static VstsBlobIdentifier ToVstsBlobIdentifier(BlobIdentifier blobIdentifier) => new VstsBlobIdentifier(blobIdentifier.Bytes);
private Task<BoolResult> PlaceFileInternalAsync( private Task<BoolResult> PlaceFileInternalAsync(
OperationContext context, ContentHash contentHash, string path, FileMode fileMode) OperationContext context, ContentHash contentHash, string path, FileMode fileMode)
{ {
@ -460,8 +452,8 @@ namespace BuildXL.Cache.ContentStore.Vsts
private async Task<BoolResult> GetFileWithDedupAsync(OperationContext context, ContentHash contentHash, string path) private async Task<BoolResult> GetFileWithDedupAsync(OperationContext context, ContentHash contentHash, string path)
{ {
VstsBlobIdentifier blobId = ToVstsBlobIdentifier(BuildXL.Cache.ContentStore.Hashing.BlobIdentifierHelperExtensions.ToBlobIdentifier(contentHash)); BlobIdentifier blobId = contentHash.ToBlobIdentifier();
VstsDedupIdentifier dedupId = blobId.ToDedupIdentifier(); DedupIdentifier dedupId = blobId.ToDedupIdentifier();
try try
{ {
@ -543,7 +535,7 @@ namespace BuildXL.Cache.ContentStore.Vsts
/// <summary> /// <summary>
/// Updates expiry of single chunk in DedupStore if it exists. /// Updates expiry of single chunk in DedupStore if it exists.
/// </summary> /// </summary>
private async Task<PinResult> TryPinChunkAsync(OperationContext context, VstsDedupIdentifier dedupId, DateTime keepUntil) private async Task<PinResult> TryPinChunkAsync(OperationContext context, DedupIdentifier dedupId, DateTime keepUntil)
{ {
try try
{ {
@ -572,7 +564,7 @@ namespace BuildXL.Cache.ContentStore.Vsts
/// 2) All children exist and have sufficient TTL /// 2) All children exist and have sufficient TTL
/// If children have insufficient TTL, attempt to extend the expiry of all children before pinning. /// If children have insufficient TTL, attempt to extend the expiry of all children before pinning.
/// </summary> /// </summary>
private async Task<PinResult> TryPinNodeAsync(OperationContext context, VstsDedupIdentifier dedupId, DateTime keepUntil) private async Task<PinResult> TryPinNodeAsync(OperationContext context, DedupIdentifier dedupId, DateTime keepUntil)
{ {
TryReferenceNodeResponse referenceResult; TryReferenceNodeResponse referenceResult;
try try
@ -615,10 +607,10 @@ namespace BuildXL.Cache.ContentStore.Vsts
/// <summary> /// <summary>
/// Attempt to update expiry of all children. Pin parent node if all children were extended successfully. /// Attempt to update expiry of all children. Pin parent node if all children were extended successfully.
/// </summary> /// </summary>
private async Task<PinResult> TryPinChildrenAsync(OperationContext context, VstsDedupIdentifier parentNode, IEnumerable<VstsDedupIdentifier> dedupIdentifiers, DateTime keepUntil) private async Task<PinResult> TryPinChildrenAsync(OperationContext context, DedupIdentifier parentNode, IEnumerable<DedupIdentifier> dedupIdentifiers, DateTime keepUntil)
{ {
var chunks = new List<VstsDedupIdentifier>(); var chunks = new List<DedupIdentifier>();
var nodes = new List<VstsDedupIdentifier>(); var nodes = new List<DedupIdentifier>();
foreach (var id in dedupIdentifiers) foreach (var id in dedupIdentifiers)
{ {
@ -652,7 +644,7 @@ namespace BuildXL.Cache.ContentStore.Vsts
/// Recursively attempt to update expiry of all nodes and their children. /// Recursively attempt to update expiry of all nodes and their children.
/// Returns success only if all children of each node are found and extended. /// Returns success only if all children of each node are found and extended.
/// </summary> /// </summary>
private async Task<PinResult> TryPinNodesAsync(OperationContext context, IEnumerable<VstsDedupIdentifier> dedupIdentifiers, DateTime keepUntil) private async Task<PinResult> TryPinNodesAsync(OperationContext context, IEnumerable<DedupIdentifier> dedupIdentifiers, DateTime keepUntil)
{ {
if (!dedupIdentifiers.Any()) if (!dedupIdentifiers.Any())
{ {
@ -660,7 +652,7 @@ namespace BuildXL.Cache.ContentStore.Vsts
} }
// TODO: Support batched TryKeepUntilReferenceNodeAsync in Artifact. (bug 1428612) // TODO: Support batched TryKeepUntilReferenceNodeAsync in Artifact. (bug 1428612)
var tryReferenceBlock = new TransformBlock<VstsDedupIdentifier, PinResult>( var tryReferenceBlock = new TransformBlock<DedupIdentifier, PinResult>(
async dedupId => await TryPinNodeAsync(context, dedupId, keepUntil), async dedupId => await TryPinNodeAsync(context, dedupId, keepUntil),
new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = DefaultMaxParallelism }); new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = DefaultMaxParallelism });
@ -682,7 +674,7 @@ namespace BuildXL.Cache.ContentStore.Vsts
/// <summary> /// <summary>
/// Update all chunks if they exist. Returns success only if all chunks are found and extended. /// Update all chunks if they exist. Returns success only if all chunks are found and extended.
/// </summary> /// </summary>
private async Task<PinResult> TryPinChunksAsync(OperationContext context, IEnumerable<VstsDedupIdentifier> dedupIdentifiers, DateTime keepUntil) private async Task<PinResult> TryPinChunksAsync(OperationContext context, IEnumerable<DedupIdentifier> dedupIdentifiers, DateTime keepUntil)
{ {
if (!dedupIdentifiers.Any()) if (!dedupIdentifiers.Any())
{ {
@ -690,7 +682,7 @@ namespace BuildXL.Cache.ContentStore.Vsts
} }
// TODO: Support batched TryKeepUntilReferenceChunkAsync in Artifact. (bug 1428612) // TODO: Support batched TryKeepUntilReferenceChunkAsync in Artifact. (bug 1428612)
var tryReferenceBlock = new TransformBlock<VstsDedupIdentifier, PinResult>( var tryReferenceBlock = new TransformBlock<DedupIdentifier, PinResult>(
async dedupId => await TryPinChunkAsync(context, dedupId, keepUntil), async dedupId => await TryPinChunkAsync(context, dedupId, keepUntil),
new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = DefaultMaxParallelism }); new ExecutionDataflowBlockOptions { MaxDegreeOfParallelism = DefaultMaxParallelism });
@ -712,7 +704,7 @@ namespace BuildXL.Cache.ContentStore.Vsts
/// <summary> /// <summary>
/// Checks the current keepUntil of a node. Returns null if the node is not found. /// Checks the current keepUntil of a node. Returns null if the node is not found.
/// </summary> /// </summary>
protected async Task<Result<DateTime?>> CheckNodeKeepUntilAsync(OperationContext context, VstsDedupIdentifier dedupId) protected async Task<Result<DateTime?>> CheckNodeKeepUntilAsync(OperationContext context, DedupIdentifier dedupId)
{ {
TryReferenceNodeResponse referenceResult; TryReferenceNodeResponse referenceResult;
try try

Просмотреть файл

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using BuildXL.Cache.ContentStore.Hashing;
using Microsoft.VisualStudio.Services.BlobStore.Common; using Microsoft.VisualStudio.Services.BlobStore.Common;
using Microsoft.VisualStudio.Services.Common; using Microsoft.VisualStudio.Services.Common;

Просмотреть файл

@ -2,6 +2,7 @@
// Licensed under the MIT License. // Licensed under the MIT License.
using System.Diagnostics.ContractsLight; using System.Diagnostics.ContractsLight;
using BuildXL.Cache.ContentStore.Hashing;
using Microsoft.VisualStudio.Services.BlobStore.Common; using Microsoft.VisualStudio.Services.BlobStore.Common;
namespace Tool.DropDaemon namespace Tool.DropDaemon

Просмотреть файл

@ -6,6 +6,7 @@ using System.Diagnostics.ContractsLight;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using BuildXL.Cache.ContentStore.Hashing;
using BuildXL.Storage; using BuildXL.Storage;
using Microsoft.VisualStudio.Services.BlobStore.Common; using Microsoft.VisualStudio.Services.BlobStore.Common;
using Tool.ServicePipDaemon; using Tool.ServicePipDaemon;
@ -145,7 +146,7 @@ namespace Tool.DropDaemon
case BuildXL.Cache.ContentStore.Hashing.HashType.DedupSingleChunk: case BuildXL.Cache.ContentStore.Hashing.HashType.DedupSingleChunk:
return new ChunkDedupIdentifier(contentHash.ToHashByteArray()).ToBlobIdentifier(); return new ChunkDedupIdentifier(contentHash.ToHashByteArray()).ToBlobIdentifier();
case BuildXL.Cache.ContentStore.Hashing.HashType.DedupNode: case BuildXL.Cache.ContentStore.Hashing.HashType.DedupNode:
return new NodeDedupIdentifier(contentHash.ToHashByteArray()).ToBlobIdentifier(); return new NodeDedupIdentifier(contentHash.ToHashByteArray(), NodeAlgorithmId.Node64K).ToBlobIdentifier();
default: default:
throw new ArgumentException($"ContentHash has unsupported type when converting to BlobIdentifier: {contentHash.HashType}"); throw new ArgumentException($"ContentHash has unsupported type when converting to BlobIdentifier: {contentHash.HashType}");
} }

Просмотреть файл

@ -4,8 +4,8 @@
using System.Diagnostics.Contracts; using System.Diagnostics.Contracts;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using BuildXL.Cache.ContentStore.Hashing;
using JetBrains.Annotations; using JetBrains.Annotations;
using Microsoft.VisualStudio.Services.BlobStore.Common;
using Pure = System.Diagnostics.Contracts.PureAttribute; using Pure = System.Diagnostics.Contracts.PureAttribute;
namespace Tool.DropDaemon namespace Tool.DropDaemon

Просмотреть файл

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using BuildXL.Cache.ContentStore.Hashing;
using BuildXL.Ipc.Interfaces; using BuildXL.Ipc.Interfaces;
using Microsoft.VisualStudio.Services.BlobStore.Common; using Microsoft.VisualStudio.Services.BlobStore.Common;
using Microsoft.VisualStudio.Services.BlobStore.WebApi; using Microsoft.VisualStudio.Services.BlobStore.WebApi;

Просмотреть файл

@ -9,6 +9,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using BuildXL.Cache.ContentStore.Hashing;
using BuildXL.Ipc.Common; using BuildXL.Ipc.Common;
using BuildXL.Ipc.ExternalApi; using BuildXL.Ipc.ExternalApi;
using BuildXL.Ipc.Interfaces; using BuildXL.Ipc.Interfaces;

Просмотреть файл

@ -461,7 +461,7 @@ namespace BuildXL.Execution.Analyzer
} }
} }
m_sizeByExtension.AddOrUpdate(entry.Key.GetExtension(m_analyzer.PathTable), size, (_, oldValue) => oldValue + size); m_sizeByExtension.AddOrUpdate(entry.Key.GetExtension(m_analyzer.PathTable), size, (long _, long oldValue) => oldValue + size);
} }
} }

Просмотреть файл

@ -6,10 +6,12 @@ using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using BuildXL.Ipc.Interfaces; using BuildXL.Ipc.Interfaces;
using BuildXL.Cache.ContentStore.Hashing;
using Microsoft.VisualStudio.Services.BlobStore.Common; using Microsoft.VisualStudio.Services.BlobStore.Common;
using Microsoft.VisualStudio.Services.Content.Common; using Microsoft.VisualStudio.Services.Content.Common;
using Microsoft.VisualStudio.Services.Symbol.App.Core; using Microsoft.VisualStudio.Services.Symbol.App.Core;
using Microsoft.VisualStudio.Services.Symbol.WebApi; using Microsoft.VisualStudio.Services.Symbol.WebApi;
using BlobIdentifierWithBlocks = Microsoft.VisualStudio.Services.BlobStore.Common.BlobIdentifierWithBlocks;
namespace Tool.ServicePipDaemon namespace Tool.ServicePipDaemon
{ {
@ -94,12 +96,12 @@ namespace Tool.ServicePipDaemon
} }
/// <inheritdoc /> /// <inheritdoc />
public BlobIdentifier GetBlobIdentifier(string filename) public BlobIdentifier GetBlobIdentifier(string filename, bool useChunkDedup)
{ {
var instance = GetCurrentVersionedValue(); var instance = GetCurrentVersionedValue();
// not retrying this since it does not perform any calls over the network // not retrying this since it does not perform any calls over the network
return instance.Value.GetBlobIdentifier(filename); return instance.Value.GetBlobIdentifier(filename, useChunkDedup);
} }
/// <inheritdoc /> /// <inheritdoc />
@ -180,7 +182,7 @@ namespace Tool.ServicePipDaemon
} }
/// <inheritdoc /> /// <inheritdoc />
public Task<BlobIdentifierWithBlocks> UploadFileAsync(IDomainId domainId, Uri blobStoreUri, string requestId, string filename, BlobIdentifier blobIdentifier, CancellationToken cancellationToken) public Task<SymbolBlobIdentifier> UploadFileAsync(IDomainId domainId, Uri blobStoreUri, string requestId, string filename, BlobIdentifier blobIdentifier, CancellationToken cancellationToken)
{ {
return RetryAsync( return RetryAsync(
nameof(ISymbolServiceClient.UploadFileAsync), nameof(ISymbolServiceClient.UploadFileAsync),

Просмотреть файл

@ -434,7 +434,7 @@ namespace Tool.SymbolDaemon
{ {
ContentHash.TryParse(reader.ReadLine(), out var hash); ContentHash.TryParse(reader.ReadLine(), out var hash);
Contract.Assert(hash.HashType == HashType.Vso0); Contract.Assert(hash.HashType == HashType.Vso0);
var blobIdentifier = new Microsoft.VisualStudio.Services.BlobStore.Common.BlobIdentifier(hash.ToHashByteArray()); var blobIdentifier = new BlobIdentifier(hash.ToHashByteArray());
int debugEntryCount = int.Parse(reader.ReadLine()); int debugEntryCount = int.Parse(reader.ReadLine());
var symbols = new HashSet<DebugEntryData>(debugEntryCount, DebugEntryDataComparer.Instance); var symbols = new HashSet<DebugEntryData>(debugEntryCount, DebugEntryDataComparer.Instance);
@ -480,7 +480,7 @@ namespace Tool.SymbolDaemon
var result = new DebugEntryData() var result = new DebugEntryData()
{ {
BlobIdentifier = blocks[0].Length == 0 ? null : Microsoft.VisualStudio.Services.BlobStore.Common.BlobIdentifier.Deserialize(blocks[0]), BlobIdentifier = blocks[0].Length == 0 ? null : BlobIdentifier.Deserialize(blocks[0]),
ClientKey = string.IsNullOrEmpty(blocks[1]) ? null : blocks[1], ClientKey = string.IsNullOrEmpty(blocks[1]) ? null : blocks[1],
InformationLevel = (DebugInformationLevel)int.Parse(blocks[2]) InformationLevel = (DebugInformationLevel)int.Parse(blocks[2])
}; };

Просмотреть файл

@ -90,7 +90,7 @@ namespace Tool.SymbolDaemon
if (debugEntries != null) if (debugEntries != null)
{ {
var blobIdentifier = new Microsoft.VisualStudio.Services.BlobStore.Common.BlobIdentifier(hash.ToHashByteArray()); var blobIdentifier = new BlobIdentifier(hash.ToHashByteArray());
Contract.Assert(debugEntries.All(e => e.BlobIdentifier == blobIdentifier)); Contract.Assert(debugEntries.All(e => e.BlobIdentifier == blobIdentifier));
m_debugEntries = new List<IDebugEntryData>(debugEntries); m_debugEntries = new List<IDebugEntryData>(debugEntries);
} }
@ -108,7 +108,7 @@ namespace Tool.SymbolDaemon
Contract.Requires(entries != null); Contract.Requires(entries != null);
// check that either all entries are missing the blobId, or all the entries have the same blobId and that blobId matches this file // check that either all entries are missing the blobId, or all the entries have the same blobId and that blobId matches this file
var blobIdentifier = new Microsoft.VisualStudio.Services.BlobStore.Common.BlobIdentifier(Hash.ToHashByteArray()); var blobIdentifier = new BlobIdentifier(Hash.ToHashByteArray());
Contract.Assert(entries.All(e => e.BlobIdentifier == null) || entries.All(e => e.BlobIdentifier == blobIdentifier)); Contract.Assert(entries.All(e => e.BlobIdentifier == null) || entries.All(e => e.BlobIdentifier == blobIdentifier));
// ensure that BlobIdentifier is not null // ensure that BlobIdentifier is not null

Просмотреть файл

@ -30,7 +30,9 @@ namespace Tool.SymbolDaemon
var entries = m_symstoreUtil.GetDebugEntryData( var entries = m_symstoreUtil.GetDebugEntryData(
file.FullName, file.FullName,
new[] { file.FullName }, new[] { file.FullName },
calculateBlobId); calculateBlobId,
// Currently, only file-deduped (VsoHash) symbols are supported
isChunked: false);
return entries; return entries;
} }

Просмотреть файл

@ -7,6 +7,7 @@ using System.Diagnostics.ContractsLight;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using BuildXL.Cache.ContentStore.Hashing;
using BuildXL.Ipc.Common; using BuildXL.Ipc.Common;
using BuildXL.Ipc.ExternalApi; using BuildXL.Ipc.ExternalApi;
using BuildXL.Ipc.Interfaces; using BuildXL.Ipc.Interfaces;
@ -366,12 +367,12 @@ namespace Tool.SymbolDaemon
batchedFile.File.FullFilePath, batchedFile.File.FullFilePath,
entry.BlobIdentifier, entry.BlobIdentifier,
CancellationToken); CancellationToken);
batchedFile.SetBlobDetails(uploadResult); batchedFile.SetBlobIdentifier(uploadResult);
} }
}); });
// need to update entries before calling associate the second time // need to update entries before calling associate the second time
entriesWithMissingBlobs.ForEach(entry => entry.BlobDetails = missingBlobsToFilesMap[entry.BlobIdentifier].BlobDetails); entriesWithMissingBlobs.ForEach(entry => missingBlobsToFilesMap[entry.BlobIdentifier].BlobIdentifier.UpdateDebugEntryBlobReference(entry));
using (m_counters.StartStopwatch(SymbolClientCounter.TotalAssociateAfterUploadTime)) using (m_counters.StartStopwatch(SymbolClientCounter.TotalAssociateAfterUploadTime))
{ {
@ -481,7 +482,7 @@ namespace Tool.SymbolDaemon
public SymbolFile File { get; } public SymbolFile File { get; }
public TaskSourceSlim<AddDebugEntryResult> ResultTaskSource { get; } public TaskSourceSlim<AddDebugEntryResult> ResultTaskSource { get; }
public BlobIdentifierWithBlocks BlobDetails { get; private set; } public SymbolBlobIdentifier BlobIdentifier { get; private set; }
public BatchedSymbolFile(SymbolFile file) public BatchedSymbolFile(SymbolFile file)
{ {
@ -489,11 +490,11 @@ namespace Tool.SymbolDaemon
ResultTaskSource = TaskSourceSlim.Create<AddDebugEntryResult>(); ResultTaskSource = TaskSourceSlim.Create<AddDebugEntryResult>();
} }
public void SetBlobDetails(BlobIdentifierWithBlocks details) public void SetBlobIdentifier(SymbolBlobIdentifier blobIdentifier)
{ {
lock (m_lock) lock (m_lock)
{ {
BlobDetails = details; BlobIdentifier = blobIdentifier;
} }
} }
} }

Просмотреть файл

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using BuildXL.Cache.ContentStore.Hashing;
using BuildXL.Ipc.Common; using BuildXL.Ipc.Common;
using BuildXL.Ipc.Interfaces; using BuildXL.Ipc.Interfaces;
using Microsoft.VisualStudio.Services.BlobStore.Common; using Microsoft.VisualStudio.Services.BlobStore.Common;

Просмотреть файл

@ -33,7 +33,7 @@
"Type": "NuGet", "Type": "NuGet",
"NuGet": { "NuGet": {
"Name": "ArtifactServices.App.Shared", "Name": "ArtifactServices.App.Shared",
"Version": "18.176.30522-buildid13159358" "Version": "18.183.31009-buildid14325558"
} }
} }
}, },
@ -42,7 +42,7 @@
"Type": "NuGet", "Type": "NuGet",
"NuGet": { "NuGet": {
"Name": "ArtifactServices.App.Shared.Cache", "Name": "ArtifactServices.App.Shared.Cache",
"Version": "18.176.30522-buildid13159358" "Version": "18.183.31009-buildid14325558"
} }
} }
}, },
@ -213,7 +213,7 @@
"Type": "NuGet", "Type": "NuGet",
"NuGet": { "NuGet": {
"Name": "Drop.App.Core", "Name": "Drop.App.Core",
"Version": "18.176.30522-buildid13159358" "Version": "18.183.31009-buildid14325558"
} }
} }
}, },
@ -222,7 +222,7 @@
"Type": "NuGet", "Type": "NuGet",
"NuGet": { "NuGet": {
"Name": "Drop.Client", "Name": "Drop.Client",
"Version": "18.176.30522-buildid13159358" "Version": "18.183.31009-buildid14325558"
} }
} }
}, },
@ -384,7 +384,7 @@
"Type": "NuGet", "Type": "NuGet",
"NuGet": { "NuGet": {
"Name": "ItemStore.Shared", "Name": "ItemStore.Shared",
"Version": "18.176.30522-buildid13159358" "Version": "18.183.31009-buildid14325558"
} }
} }
}, },
@ -1923,7 +1923,7 @@
"Type": "NuGet", "Type": "NuGet",
"NuGet": { "NuGet": {
"Name": "Microsoft.VisualStudio.Services.ArtifactServices.Shared", "Name": "Microsoft.VisualStudio.Services.ArtifactServices.Shared",
"Version": "18.176.30522-buildid13159358" "Version": "18.183.31009-buildid14325558"
} }
} }
}, },
@ -1932,7 +1932,7 @@
"Type": "NuGet", "Type": "NuGet",
"NuGet": { "NuGet": {
"Name": "Microsoft.VisualStudio.Services.BlobStore.Client", "Name": "Microsoft.VisualStudio.Services.BlobStore.Client",
"Version": "18.176.30522-buildid13159358" "Version": "18.183.31009-buildid14325558"
} }
} }
}, },
@ -1941,7 +1941,7 @@
"Type": "NuGet", "Type": "NuGet",
"NuGet": { "NuGet": {
"Name": "Microsoft.VisualStudio.Services.BlobStore.Client.Cache", "Name": "Microsoft.VisualStudio.Services.BlobStore.Client.Cache",
"Version": "18.176.30522-buildid13159358" "Version": "18.183.31009-buildid14325558"
} }
} }
}, },
@ -1950,7 +1950,7 @@
"Type": "NuGet", "Type": "NuGet",
"NuGet": { "NuGet": {
"Name": "Microsoft.VisualStudio.Services.Client", "Name": "Microsoft.VisualStudio.Services.Client",
"Version": "16.176.0-internal202009221" "Version": "16.183.0-internal202102091"
} }
} }
}, },
@ -1959,7 +1959,7 @@
"Type": "NuGet", "Type": "NuGet",
"NuGet": { "NuGet": {
"Name": "Microsoft.VisualStudio.Services.InteractiveClient", "Name": "Microsoft.VisualStudio.Services.InteractiveClient",
"Version": "16.176.0-internal202009221" "Version": "16.183.0-internal202102091"
} }
} }
}, },
@ -2490,7 +2490,7 @@
"Type": "NuGet", "Type": "NuGet",
"NuGet": { "NuGet": {
"Name": "Symbol.App.Core", "Name": "Symbol.App.Core",
"Version": "18.176.30522-buildid13159358" "Version": "18.183.31009-buildid14325558"
} }
} }
}, },
@ -2499,7 +2499,7 @@
"Type": "NuGet", "Type": "NuGet",
"NuGet": { "NuGet": {
"Name": "Symbol.Client", "Name": "Symbol.Client",
"Version": "18.176.30522-buildid13159358" "Version": "18.183.31009-buildid14325558"
} }
} }
}, },

Просмотреть файл

@ -3,8 +3,8 @@
const isMicrosoftInternal = Environment.getFlag("[Sdk.BuildXL]microsoftInternal"); const isMicrosoftInternal = Environment.getFlag("[Sdk.BuildXL]microsoftInternal");
const artifactNugetVersion = "18.176.30522-buildid13159358"; const artifactNugetVersion = "18.183.31009-buildid14325558";
const azureDevopsNugetVersion = "16.176.0-internal202009221"; const azureDevopsNugetVersion = "16.183.0-internal202102091";
// These packages are Microsoft internal packages. // These packages are Microsoft internal packages.
// These consist of internally repackaged products that we can't push to a public feed and have to rely on users installing locally. // These consist of internally repackaged products that we can't push to a public feed and have to rely on users installing locally.
@ -45,7 +45,7 @@ export const pkgs = isMicrosoftInternal ? [
{ id: "Microsoft.VisualStudio.Services.BlobStore.Client.Cache", version: artifactNugetVersion, dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: ["BuildXL.Cache.Hashing", "BuildXL.Cache.Interfaces", "BuildXL.Cache.Libraries", "BuildXL.Utilities"] }, { id: "Microsoft.VisualStudio.Services.BlobStore.Client.Cache", version: artifactNugetVersion, dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: ["BuildXL.Cache.Hashing", "BuildXL.Cache.Interfaces", "BuildXL.Cache.Libraries", "BuildXL.Utilities"] },
{ id: "Microsoft.Windows.Debuggers.SymstoreInterop", version: "1.0.1" }, { id: "Microsoft.Windows.Debuggers.SymstoreInterop", version: "1.0.1" },
{ id: "Symbol.App.Core", version: artifactNugetVersion, dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: ["BuildXL.Cache.Hashing", "BuildXL.Cache.Interfaces", "BuildXL.Cache.Libraries", "BuildXL.Utilities"] }, { id: "Symbol.App.Core", version: artifactNugetVersion, dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: ["BuildXL.Cache.Hashing", "BuildXL.Cache.Interfaces", "BuildXL.Cache.Libraries", "BuildXL.Utilities"] },
{ id: "Symbol.Client", version: artifactNugetVersion, dependentPackageIdsToSkip: ["*"] }, { id: "Symbol.Client", version: artifactNugetVersion, dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: ["BuildXL.Cache.Hashing"] },
{ id: "TransientFaultHandling.Core", version: "5.1.1209.1" }, { id: "TransientFaultHandling.Core", version: "5.1.1209.1" },
// CloudTest internal dependencies // CloudTest internal dependencies