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

Update ACR UploadBlob method to upload a blob in chunks #32059

Merged
merged 23 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dee52a8
added Size to UploadBlobResult
annelo-msft Oct 25, 2022
e0303f8
Add test for pull and record tests
annelo-msft Oct 25, 2022
39b0407
first pass on chunked upload; plus basic large file upload test
annelo-msft Oct 25, 2022
029d0d1
compute digest in chunks
annelo-msft Oct 27, 2022
b4ca413
Merge remote-tracking branch 'upstream/main' into acr-chunked-upload
annelo-msft Oct 31, 2022
a2991e5
fix bugs
annelo-msft Oct 31, 2022
c58ce9d
refactor and export API
annelo-msft Oct 31, 2022
97cf87e
re-record failing tests
annelo-msft Oct 31, 2022
2cda954
add sync tests
annelo-msft Oct 31, 2022
e5711e7
Merge remote-tracking branch 'upstream/main' into acr-chunked-upload
annelo-msft Nov 8, 2022
d79ad8d
EOD WIP
annelo-msft Nov 9, 2022
c49601d
bug fix - incr chunk count
annelo-msft Nov 9, 2022
f5e10fe
small refactor of Content-Range header
annelo-msft Nov 9, 2022
7988df0
don't compute digest 2x; validate chunkLength input
annelo-msft Nov 10, 2022
b8ebe60
refactor to not seek streams we don't own
annelo-msft Nov 10, 2022
d17b7ad
validate digest on blob upload and add tests for blob and manifest up…
annelo-msft Nov 10, 2022
7365504
Merge remote-tracking branch 'upstream/main' into acr-chunked-upload
annelo-msft Nov 10, 2022
36e5706
re-record tests for new chunked-upload approach and add recordings fo…
annelo-msft Nov 10, 2022
e3bdb37
fix failing tests
annelo-msft Nov 10, 2022
cc510ac
don't allocate a large buffer to upload a small chunk, and PR fb.
annelo-msft Nov 11, 2022
823d41c
re-record failing tests
annelo-msft Nov 11, 2022
d6ecfa9
fix missed config
annelo-msft Nov 11, 2022
f2719a9
missed test
annelo-msft Nov 11, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public static partial class ContainerRegistryModelFactory
public static Azure.Containers.ContainerRegistry.ContainerRepositoryProperties ContainerRepositoryProperties(string registryLoginServer = null, string name = null, System.DateTimeOffset createdOn = default(System.DateTimeOffset), System.DateTimeOffset lastUpdatedOn = default(System.DateTimeOffset), int manifestCount = 0, int tagCount = 0, bool? canDelete = default(bool?), bool? canWrite = default(bool?), bool? canList = default(bool?), bool? canRead = default(bool?)) { throw null; }
public static Azure.Containers.ContainerRegistry.Specialized.DownloadBlobResult DownloadBlobResult(string digest = null, System.IO.Stream content = null) { throw null; }
public static Azure.Containers.ContainerRegistry.Specialized.DownloadManifestResult DownloadManifestResult(string digest = null, Azure.Containers.ContainerRegistry.Specialized.OciManifest manifest = null, System.IO.Stream manifestStream = null) { throw null; }
public static Azure.Containers.ContainerRegistry.Specialized.UploadBlobResult UploadBlobResult(string digest = null) { throw null; }
public static Azure.Containers.ContainerRegistry.Specialized.UploadBlobResult UploadBlobResult(string digest, long size) { throw null; }
public static Azure.Containers.ContainerRegistry.Specialized.UploadManifestResult UploadManifestResult(string digest = null) { throw null; }
}
public partial class ContainerRepository
Expand Down Expand Up @@ -244,8 +244,8 @@ public ContainerRegistryBlobClient(System.Uri endpoint, string repository, Azure
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Containers.ContainerRegistry.Specialized.DownloadBlobResult>> DownloadBlobAsync(string digest, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Containers.ContainerRegistry.Specialized.DownloadManifestResult> DownloadManifest(Azure.Containers.ContainerRegistry.Specialized.DownloadManifestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Containers.ContainerRegistry.Specialized.DownloadManifestResult>> DownloadManifestAsync(Azure.Containers.ContainerRegistry.Specialized.DownloadManifestOptions options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Containers.ContainerRegistry.Specialized.UploadBlobResult> UploadBlob(System.IO.Stream stream, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Containers.ContainerRegistry.Specialized.UploadBlobResult>> UploadBlobAsync(System.IO.Stream stream, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Containers.ContainerRegistry.Specialized.UploadBlobResult> UploadBlob(System.IO.Stream stream, Azure.Containers.ContainerRegistry.Specialized.UploadBlobOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
annelo-msft marked this conversation as resolved.
Show resolved Hide resolved
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Containers.ContainerRegistry.Specialized.UploadBlobResult>> UploadBlobAsync(System.IO.Stream stream, Azure.Containers.ContainerRegistry.Specialized.UploadBlobOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Containers.ContainerRegistry.Specialized.UploadManifestResult> UploadManifest(Azure.Containers.ContainerRegistry.Specialized.OciManifest manifest, Azure.Containers.ContainerRegistry.Specialized.UploadManifestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Containers.ContainerRegistry.Specialized.UploadManifestResult> UploadManifest(System.IO.Stream manifestStream, Azure.Containers.ContainerRegistry.Specialized.UploadManifestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Containers.ContainerRegistry.Specialized.UploadManifestResult>> UploadManifestAsync(Azure.Containers.ContainerRegistry.Specialized.OciManifest manifest, Azure.Containers.ContainerRegistry.Specialized.UploadManifestOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
Expand Down Expand Up @@ -304,10 +304,16 @@ public OciManifest() { }
public Azure.Containers.ContainerRegistry.Specialized.OciBlobDescriptor Config { get { throw null; } set { } }
public System.Collections.Generic.IList<Azure.Containers.ContainerRegistry.Specialized.OciBlobDescriptor> Layers { get { throw null; } }
}
public partial class UploadBlobOptions
{
public UploadBlobOptions(int maxChunkSize) { }
public int MaxChunkSize { get { throw null; } }
}
public partial class UploadBlobResult
{
internal UploadBlobResult() { }
public string Digest { get { throw null; } }
public long Size { get { throw null; } }
}
public partial class UploadManifestOptions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Text;

namespace Azure.Containers.ContainerRegistry.Specialized
{
internal class ChunkedUploadResult
{
public ChunkedUploadResult(string digest, string location, long size)
{
Digest = digest;
Location = location;
Size = size;
}

public string Digest { get; }

public string Location { get; }

public long Size { get; }
}
}
Loading