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

Undocument .NET Monitor 9 arch-specific tags #5948

Open
wants to merge 9 commits into
base: nightly
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
4 changes: 2 additions & 2 deletions README.monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ See the [documentation](https://go.microsoft.com/fwlink/?linkid=2158052) for how

Tags | Dockerfile | OS Version
-----------| -------------| -------------
9.0.0-rc.2-amd64, 9.0-amd64, 9.0.0-rc.2, 9.0, 9, latest | [Dockerfile](src/monitor/9.0/azurelinux-distroless/amd64/Dockerfile) | Azure Linux 3.0
9.0.0-rc.2, 9.0, 9, latest | [Dockerfile](src/monitor/9.0/azurelinux-distroless/amd64/Dockerfile) | Azure Linux 3.0
8.0.4-ubuntu-chiseled-amd64, 8.0-ubuntu-chiseled-amd64, 8.0.4-ubuntu-chiseled, 8.0-ubuntu-chiseled, 8.0.4, 8.0 | [Dockerfile](src/monitor/8.0/ubuntu-chiseled/amd64/Dockerfile) | Ubuntu 22.04
8.0.4-cbl-mariner-distroless-amd64, 8.0-cbl-mariner-distroless-amd64, 8.0.4-cbl-mariner-distroless, 8.0-cbl-mariner-distroless | [Dockerfile](src/monitor/8.0/cbl-mariner-distroless/amd64/Dockerfile) | CBL-Mariner 2.0
6.3.8-alpine-amd64, 6.3-alpine-amd64, 6-alpine-amd64, 6.3.8-alpine, 6.3-alpine, 6-alpine, 6.3.8, 6.3, 6 | [Dockerfile](src/monitor/6.3/alpine/amd64/Dockerfile) | Alpine 3.20
Expand All @@ -81,7 +81,7 @@ Tags | Dockerfile | OS Version

Tags | Dockerfile | OS Version
-----------| -------------| -------------
9.0.0-rc.2-arm64v8, 9.0-arm64v8, 9.0.0-rc.2, 9.0, 9, latest | [Dockerfile](src/monitor/9.0/azurelinux-distroless/arm64v8/Dockerfile) | Azure Linux 3.0
9.0.0-rc.2, 9.0, 9, latest | [Dockerfile](src/monitor/9.0/azurelinux-distroless/arm64v8/Dockerfile) | Azure Linux 3.0
8.0.4-ubuntu-chiseled-arm64v8, 8.0-ubuntu-chiseled-arm64v8, 8.0.4-ubuntu-chiseled, 8.0-ubuntu-chiseled, 8.0.4, 8.0 | [Dockerfile](src/monitor/8.0/ubuntu-chiseled/arm64v8/Dockerfile) | Ubuntu 22.04
8.0.4-cbl-mariner-distroless-arm64v8, 8.0-cbl-mariner-distroless-arm64v8, 8.0.4-cbl-mariner-distroless, 8.0-cbl-mariner-distroless | [Dockerfile](src/monitor/8.0/cbl-mariner-distroless/arm64v8/Dockerfile) | CBL-Mariner 2.0
6.3.8-alpine-arm64v8, 6.3-alpine-arm64v8, 6-alpine-arm64v8, 6.3.8-alpine, 6.3-alpine, 6-alpine, 6.3.8, 6.3, 6 | [Dockerfile](src/monitor/6.3/alpine/arm64v8/Dockerfile) | Alpine 3.20
Expand Down
4 changes: 2 additions & 2 deletions eng/mcr-tags-metadata-templates/monitor-tags.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$(McrTagsYmlRepo:monitor)
$(McrTagsYmlTagGroup:9.0-amd64)
$(McrTagsYmlTagGroup:9.0-arm64v8)
$(McrTagsYmlTagGroup:9.0)
$(McrTagsYmlTagGroup:9)
$(McrTagsYmlTagGroup:8.1-preview-ubuntu-chiseled-amd64)
customSubTableTitle: .NET Monitor Preview Tags
$(McrTagsYmlTagGroup:8.1-preview-ubuntu-chiseled-arm64v8)
Expand Down
10 changes: 6 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9419,8 +9419,9 @@
"os": "linux",
"osVersion": "azurelinux3.0-distroless",
"tags": {
"$(monitor|9.0|fixed-tag)-amd64": {},
"$(monitor|9.0|minor-tag)-amd64": {}
jander-msft marked this conversation as resolved.
Show resolved Hide resolved
"$(monitor|9.0|fixed-tag)-amd64": {
"docType": "Undocumented"
}
}
},
{
Expand All @@ -9433,8 +9434,9 @@
"os": "linux",
"osVersion": "azurelinux3.0-distroless",
"tags": {
"$(monitor|9.0|fixed-tag)-arm64v8": {},
"$(monitor|9.0|minor-tag)-arm64v8": {}
"$(monitor|9.0|fixed-tag)-arm64v8": {
"docType": "Undocumented"
}
},
"variant": "v8"
}
Expand Down
42 changes: 24 additions & 18 deletions tests/Microsoft.DotNet.Docker.Tests/StaticTagTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
if (ApplianceRepos.Any(repo.Name.Contains))
{
// Only appliance repos have major version tags
// Only appliance repos have floating distro tags (<cref="IsApplianceVersionUsingOldSchema"/>)
// Only appliance repos have floating distro tags (<cref="IsApplianceVersionWithDistroTags"/>)
testObjects.AddRange(new[]
{
GetTagTestInput(
Expand All @@ -283,7 +283,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.MajorMinorPatch,
checkOs: true,
checkArchitecture: true,
skipDockerfileOn: IsApplianceVersionUsingNewSchema
skipDockerfileOn: IsApplianceVersionWithoutDistroTags
), // <Major.Minor.Patch>-<os>-<architecture>

GetTagTestInput(
Expand All @@ -292,7 +292,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.MajorMinorPatch,
checkOs: true,
checkArchitecture: false,
skipDockerfileOn: IsApplianceVersionUsingNewSchema
skipDockerfileOn: IsApplianceVersionWithoutDistroTags
), // <Major.Minor.Patch>-<os>

GetTagTestInput(
Expand All @@ -301,7 +301,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.MajorMinorPatch,
checkOs: false,
checkArchitecture: true,
skipDockerfileOn: IsApplianceVersionUsingOldSchema
skipDockerfileOn: IsApplianceVersionWithDistroTags
), // <Major.Minor.Patch>-<architecture>

GetTagTestInput(
Expand All @@ -310,7 +310,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.MajorMinor,
checkOs: true,
checkArchitecture: true,
skipDockerfileOn: IsApplianceVersionUsingNewSchema
skipDockerfileOn: info => IsApplianceVersionWithoutDistroTags(info) || !IsApplianceVersionWithMajorMinorArchTags(info)
), // <Major.Minor>-<os>-<architecture>

GetTagTestInput(
Expand All @@ -319,7 +319,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.MajorMinor,
checkOs: true,
checkArchitecture: false,
skipDockerfileOn: IsApplianceVersionUsingNewSchema
skipDockerfileOn: IsApplianceVersionWithoutDistroTags
), // <Major.Minor>-<os>

GetTagTestInput(
Expand All @@ -328,7 +328,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.MajorMinor,
checkOs: false,
checkArchitecture: true,
skipDockerfileOn: IsApplianceVersionUsingOldSchema
skipDockerfileOn: info => IsApplianceVersionWithDistroTags(info) || !IsApplianceVersionWithMajorMinorArchTags(info)
), // <Major.Minor>-<architecture>

GetTagTestInput(
Expand All @@ -337,7 +337,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.Major,
checkOs: true,
checkArchitecture: true,
skipDockerfileOn: IsApplianceVersionUsingNewSchema
skipDockerfileOn: IsApplianceVersionWithoutDistroTags
), // <Major>-<os>-<architecture>

GetTagTestInput(
Expand All @@ -346,7 +346,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.Major,
checkOs: true,
checkArchitecture: false,
skipDockerfileOn: IsApplianceVersionUsingNewSchema
skipDockerfileOn: IsApplianceVersionWithoutDistroTags
) // <Major>-<os>
});

Expand All @@ -359,7 +359,7 @@ private static IEnumerable<object[]> GetTagTestObjects(TestType testType)
VersionType.Major,
checkOs: false,
checkArchitecture: true,
skipDockerfileOn: IsApplianceVersionUsingOldSchema
skipDockerfileOn: IsApplianceVersionWithDistroTags
jander-msft marked this conversation as resolved.
Show resolved Hide resolved
)); // <Major>-<architecture>
}
}
Expand Down Expand Up @@ -533,16 +533,22 @@ private static object[] GetTagTestInput(
private static bool IsWindows(ManifestHelper.DockerfileInfo dockerfileInfo) =>
dockerfileInfo.Os.Contains("windowsservercore") || dockerfileInfo.Os.Contains("nanoserver");

// Certain versions of appliance repos use a new tag schema.
// This new schema excludes the OS from all tags.
// The aspire-dashboard repo uses this schema for all versions.
// The monitor and monitor-base repos use this schema for versions 9 and above.
private static bool IsApplianceVersionUsingOldSchema(ManifestHelper.DockerfileInfo dockerfileInfo) =>
// All appliance-style images do not have arch-specific tags for <major>.<minor> tags starting with version 9
private static bool IsApplianceVersionWithMajorMinorArchTags(ManifestHelper.DockerfileInfo dockerfileInfo) =>
// Note that monitor-base still has arch-specific tags since it is a base image. Check that the repo ends with "monitor"
// to ensure that it is specifically checking the "dotnet/monitor" image and not "dotnet/monitor/base".
(dockerfileInfo.Repo.EndsWith("monitor") && GetVersion(dockerfileInfo.MajorMinor).Major <= 8) ||
(dockerfileInfo.Repo.Contains("aspire") && GetVersion(dockerfileInfo.MajorMinor).Major <= 8);

// Certain versions of appliance-style images do not have distro-specific tags
// For aspire-dashboard, this starts with 8.0
// For monitor and monitor-base, this starts with 9.0
private static bool IsApplianceVersionWithDistroTags(ManifestHelper.DockerfileInfo dockerfileInfo) =>
dockerfileInfo.Repo.Contains("monitor") && GetVersion(dockerfileInfo.MajorMinor).Major <= 8;

// <cref="IsApplianceVersionUsingOldSchema"/>
private static bool IsApplianceVersionUsingNewSchema(ManifestHelper.DockerfileInfo dockerfileInfo) =>
!IsApplianceVersionUsingOldSchema(dockerfileInfo);
// <cref="IsApplianceVersionWithDistroTags"/>
private static bool IsApplianceVersionWithoutDistroTags(ManifestHelper.DockerfileInfo dockerfileInfo) =>
!IsApplianceVersionWithDistroTags(dockerfileInfo);

private static bool IsDotNet6(ManifestHelper.DockerfileInfo dockerfileInfo) =>
dockerfileInfo.MajorMinor.StartsWith("6");
Expand Down
Loading