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

[automated] Merge branch 'release/9.0.1xx' => 'release/9.0.2xx' #44729

Merged
merged 37 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
15f6699
Switch back to 17.8.3 for the minimum msbuild version
marcpopMSFT Oct 8, 2024
105731e
Update dependencies from https://github.com/dotnet/razor build 202410…
dotnet-maestro[bot] Oct 12, 2024
1f100ed
[release/8.0.4xx] Update dependencies from dotnet/razor (#44133)
v-wuzhai Oct 14, 2024
a662254
Switch back to 17.8.3 for the minimum msbuild version (#43995)
marcpopMSFT Oct 14, 2024
f679759
Update dependencies from https://github.com/dotnet/razor build 202410…
dotnet-maestro[bot] Oct 15, 2024
69ba658
[release/8.0.4xx] Update dependencies from dotnet/razor (#44189)
marcpopMSFT Oct 15, 2024
d912388
Update dependencies from https://github.com/dotnet/razor build 202410…
dotnet-maestro[bot] Oct 16, 2024
1bc8838
Update dependencies from https://github.com/dotnet/arcade build 20241…
dotnet-maestro[bot] Oct 16, 2024
826a748
[release/8.0.4xx] Update dependencies from dotnet/razor (#44227)
marcpopMSFT Oct 16, 2024
20505b9
[release/8.0.4xx] Update dependencies from dotnet/arcade (#44245)
v-wuzhai Oct 17, 2024
a4b1a4e
Update dependencies from https://github.com/dotnet/templating build 2…
dotnet-maestro[bot] Oct 17, 2024
b34ce68
Update dependencies from https://github.com/dotnet/source-build-exter…
dotnet-maestro[bot] Oct 17, 2024
1ed097e
[release/8.0.4xx] [Containers] Fix insecure registry handling to use …
github-actions[bot] Oct 17, 2024
6deaf6c
Update the loc build to target 9.0.2xx
marcpopMSFT Oct 31, 2024
6b45032
Update branding to 8.0.405
vseanreesermsft Nov 5, 2024
72dca87
Update branding to 8.0.405 (#44653)
marcpopMSFT Nov 5, 2024
00555da
Set mediaType from http response if manifest mediaType is not present…
surayya-MS Nov 5, 2024
791d55e
[release/8.0.4xx] Update dependencies from dotnet/templating (#44275)
marcpopMSFT Nov 5, 2024
7860363
[release/8.0.4xx] Update dependencies from dotnet/source-build-extern…
marcpopMSFT Nov 5, 2024
53798b4
Update dependencies from https://github.com/dotnet/roslyn build 20241…
dotnet-maestro[bot] Nov 5, 2024
7e30448
Update dependencies from https://github.com/dotnet/razor build 202410…
dotnet-maestro[bot] Nov 5, 2024
181c496
Update dependencies from https://github.com/dotnet/fsharp build 20241…
dotnet-maestro[bot] Nov 5, 2024
c49754a
Update dependencies from https://github.com/dotnet/arcade build 20241…
dotnet-maestro[bot] Nov 5, 2024
db0ca0a
[release/8.0.4xx] Update dependencies from dotnet/roslyn (#44666)
MiYanni Nov 6, 2024
53a898a
[release/8.0.4xx] Update dependencies from dotnet/arcade (#44671)
v-wuzhai Nov 6, 2024
4ed4d45
[release/8.0.4xx] Update dependencies from dotnet/fsharp (#44670)
v-wuzhai Nov 6, 2024
610da18
[release/8.0.4xx] Update dependencies from dotnet/razor (#44669)
v-wuzhai Nov 6, 2024
64c9452
Merge branch 'release/9.0.1xx' of https://github.com/dotnet/sdk into …
v-wuzhai Nov 6, 2024
3fc5636
Update dependencies from https://github.com/dotnet/templating build 2…
dotnet-maestro[bot] Nov 6, 2024
df489e8
Update the loc build to target 9.0.2xx (#44563)
marcpopMSFT Nov 6, 2024
3489c87
Update dependencies from https://github.com/dotnet/sourcelink build 2…
dotnet-maestro[bot] Nov 7, 2024
c96b65d
[release/9.0.1xx] Update dependencies from dotnet/templating (#44681)
MiYanni Nov 7, 2024
c4d0cd7
[automated] Merge branch 'release/8.0.4xx' => 'release/9.0.1xx' (#44658)
MiYanni Nov 7, 2024
1e96ac5
[release/9.0.1xx] Update dependencies from dotnet/sourcelink (#44720)
MiYanni Nov 7, 2024
042a92c
[release/9.0.1xx] improve SDK incremental builds by not running cross…
github-actions[bot] Nov 8, 2024
f9f8bab
Merge branch 'release/9.0.2xx' of https://github.com/dotnet/sdk into …
v-wuzhai Nov 8, 2024
60b8a4b
Merge branch 'release/9.0.2xx' of https://github.com/dotnet/sdk into …
v-wuzhai Nov 8, 2024
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
2 changes: 1 addition & 1 deletion .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ extends:
templateFolderName: templates-official
publishTaskPrefix: 1ES.
runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
locBranch: release/9.0.1xx
locBranch: release/9.0.2xx
${{ if and(eq(parameters.runTestBuild, false), ne(variables['Build.Reason'], 'PullRequest')) }}:
timeoutInMinutes: 90
windowsJobParameterSets:
Expand Down
2 changes: 2 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ echo %* | findstr /C:"-pack" >nul
if %errorlevel%==0 (
set PackInstaller=
) else (
REM disable crossgen for inner-loop builds to save a ton of time
set PackInstaller=/p:PackInstaller=false
set DISABLE_CROSSGEN=true
)
powershell -NoLogo -NoProfile -ExecutionPolicy ByPass -command "& """%~dp0eng\common\build.ps1""" -restore -build -nativeToolsOnMachine -msbuildEngine dotnet %PackInstaller% %*"
exit /b %ErrorLevel%
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ done
ScriptRoot="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

if [[ "$@" != *"-pack"* ]]; then
# disable crossgen for inner-loop builds to save a ton of time
export DISABLE_CROSSGEN=true
packInstallerFlag="/p:PackInstaller=false"
else
packInstallerFlag=
Expand Down
5 changes: 5 additions & 0 deletions src/Containers/Microsoft.NET.Build.Containers/BuiltImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ internal readonly struct BuiltImage
/// </summary>
internal required ManifestV2 Manifest { get; init; }

/// <summary>
/// Gets manifest mediaType.
/// </summary>
internal required string ManifestMediaType { get; init; }

/// <summary>
/// Gets layers descriptors.
/// </summary>
Expand Down
7 changes: 5 additions & 2 deletions src/Containers/Microsoft.NET.Build.Containers/ImageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internal sealed class ImageBuilder

// the mutable internal manifest that we're building by modifying the base and applying customizations
private readonly ManifestV2 _manifest;
private readonly string _manifestMediaType;
private readonly ImageConfig _baseImageConfig;
private readonly ILogger _logger;

Expand All @@ -33,12 +34,13 @@ internal sealed class ImageBuilder
/// <summary>
/// MediaType of the output manifest.
/// </summary>
public string ManifestMediaType => _manifest.MediaType; // output the same media type as the base image manifest.
public string ManifestMediaType => _manifestMediaType; // output the same media type as the base image manifest.

internal ImageBuilder(ManifestV2 manifest, ImageConfig baseImageConfig, ILogger logger)
internal ImageBuilder(ManifestV2 manifest, string manifestMediaType, ImageConfig baseImageConfig, ILogger logger)
{
_baseImageManifest = manifest;
_manifest = new ManifestV2() { SchemaVersion = manifest.SchemaVersion, Config = manifest.Config, Layers = new(manifest.Layers), MediaType = manifest.MediaType };
_manifestMediaType = manifestMediaType;
_baseImageConfig = baseImageConfig;
_logger = logger;
}
Expand Down Expand Up @@ -83,6 +85,7 @@ internal BuiltImage Build()
ImageSha = imageSha,
ImageSize = imageSize,
Manifest = newManifest,
ManifestMediaType = ManifestMediaType
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class ManifestV2
/// When used, this field MUST contain the media type application/vnd.oci.image.manifest.v1+json. This field usage differs from the descriptor use of mediaType.
/// </summary>
[JsonPropertyName("mediaType")]
public required string MediaType { get; init; }
public string? MediaType { get; init; }

/// <summary>
/// This REQUIRED property references a configuration object for a container, by digest.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Microsoft.NET.Build.Containers.ManifestV2.KnownDigest.set -> void
Microsoft.NET.Build.Containers.ManifestV2.Layers.get -> System.Collections.Generic.List<Microsoft.NET.Build.Containers.ManifestLayer>!
Microsoft.NET.Build.Containers.ManifestV2.Layers.init -> void
Microsoft.NET.Build.Containers.ManifestV2.ManifestV2() -> void
Microsoft.NET.Build.Containers.ManifestV2.MediaType.get -> string!
Microsoft.NET.Build.Containers.ManifestV2.MediaType.get -> string?
Microsoft.NET.Build.Containers.ManifestV2.MediaType.init -> void
Microsoft.NET.Build.Containers.ManifestV2.SchemaVersion.get -> int
Microsoft.NET.Build.Containers.ManifestV2.SchemaVersion.init -> void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public async Task<HttpResponseMessage> GetAsync(string repositoryName, string re
};
}

public async Task PutAsync(string repositoryName, string reference, ManifestV2 manifest, CancellationToken cancellationToken)
public async Task PutAsync(string repositoryName, string reference, ManifestV2 manifest, string mediaType, CancellationToken cancellationToken)
{
string jsonString = JsonSerializer.SerializeToNode(manifest)?.ToJsonString() ?? "";
HttpContent manifestUploadContent = new StringContent(jsonString);
manifestUploadContent.Headers.ContentType = new MediaTypeHeaderValue(manifest.MediaType);
manifestUploadContent.Headers.ContentType = new MediaTypeHeaderValue(mediaType);

HttpResponseMessage putResponse = await _client.PutAsync(new Uri(_baseUri, $"/v2/{repositoryName}/manifests/{reference}"), manifestUploadContent, cancellationToken).ConfigureAwait(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ internal interface IManifestOperations
{
public Task<HttpResponseMessage> GetAsync(string repositoryName, string reference, CancellationToken cancellationToken);

public Task PutAsync(string repositoryName, string reference, ManifestV2 manifest, CancellationToken cancellationToken);
public Task PutAsync(string repositoryName, string reference, ManifestV2 manifest, string mediaType, CancellationToken cancellationToken);
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public async Task<ImageBuilder> GetImageManifestAsync(string repositoryName, str
SchemaTypes.DockerManifestV2 or SchemaTypes.OciManifestV1 => await ReadSingleImageAsync(
repositoryName,
await ReadManifest().ConfigureAwait(false),
initialManifestResponse.Content.Headers.ContentType.MediaType,
cancellationToken).ConfigureAwait(false),
SchemaTypes.DockerManifestListV2 => await PickBestImageFromManifestListAsync(
repositoryName,
Expand Down Expand Up @@ -231,7 +232,7 @@ async Task<ManifestV2> ReadManifest()
};
}

private async Task<ImageBuilder> ReadSingleImageAsync(string repositoryName, ManifestV2 manifest, CancellationToken cancellationToken)
private async Task<ImageBuilder> ReadSingleImageAsync(string repositoryName, ManifestV2 manifest, string manifestMediaType, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
ManifestConfig config = manifest.Config;
Expand All @@ -240,7 +241,8 @@ private async Task<ImageBuilder> ReadSingleImageAsync(string repositoryName, Man
JsonNode configDoc = await _registryAPI.Blob.GetJsonAsync(repositoryName, configSha, cancellationToken).ConfigureAwait(false);

cancellationToken.ThrowIfCancellationRequested();
return new ImageBuilder(manifest, new ImageConfig(configDoc), _logger);
// ManifestV2.MediaType can be null, so we also provide manifest mediaType from http response
return new ImageBuilder(manifest, manifest.MediaType ?? manifestMediaType, new ImageConfig(configDoc), _logger);
}


Expand Down Expand Up @@ -350,6 +352,7 @@ private async Task<ImageBuilder> PickBestImageFromManifestsAsync(
return await ReadSingleImageAsync(
repositoryName,
manifest,
matchingManifest.mediaType,
cancellationToken).ConfigureAwait(false);
}
else
Expand Down Expand Up @@ -562,15 +565,15 @@ private async Task PushAsync(BuiltImage builtImage, SourceImageReference source,
foreach (string tag in destination.Tags)
{
_logger.LogInformation(Strings.Registry_TagUploadStarted, tag, RegistryName);
await _registryAPI.Manifest.PutAsync(destination.Repository, tag, builtImage.Manifest, cancellationToken).ConfigureAwait(false);
await _registryAPI.Manifest.PutAsync(destination.Repository, tag, builtImage.Manifest, builtImage.ManifestMediaType, cancellationToken).ConfigureAwait(false);
_logger.LogInformation(Strings.Registry_TagUploaded, tag, RegistryName);
}
}
else
{
string manifestDigest = builtImage.Manifest.GetDigest();
_logger.LogInformation(Strings.Registry_ManifestUploadStarted, RegistryName, manifestDigest);
await _registryAPI.Manifest.PutAsync(destination.Repository, manifestDigest, builtImage.Manifest, cancellationToken).ConfigureAwait(false);
await _registryAPI.Manifest.PutAsync(destination.Repository, manifestDigest, builtImage.Manifest, builtImage.ManifestMediaType, cancellationToken).ConfigureAwait(false);
_logger.LogInformation(Strings.Registry_ManifestUploaded, RegistryName);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@

<Target Name="GenerateInternalLayout"
DependsOnTargets="GenerateLayout"
BeforeTargets="AfterBuild">
BeforeTargets="AfterBuild" >
<RemoveDir Directories="$(SdkInternalLayoutPath)" />
<MakeDir Directories="$(SdkInternalLayoutPath)" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,6 @@ private ImageBuilder FromBaseImageConfig(string baseImageConfig, [CallerMemberNa
Layers = new List<ManifestLayer>(),
KnownDigest = StaticKnownDigestValue
};
return new ImageBuilder(manifest, new ImageConfig(baseImageConfig), _loggerFactory.CreateLogger(testName));
return new ImageBuilder(manifest, manifest.MediaType, new ImageConfig(baseImageConfig), _loggerFactory.CreateLogger(testName));
}
}
Loading