Skip to content

Simplify our container usage #49284

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

Merged
merged 10 commits into from
Jun 25, 2025
Merged
59 changes: 18 additions & 41 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,9 @@ extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
containers:
alpine322Amd64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.22-amd64
centosStream9:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9
debian12Amd64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-gcc15-amd64
fedora39:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39
mariner20CrossArm:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm
azureLinux30Net10BuildAmd64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-build-amd64

sdl:
sourceAnalysisPool:
name: $(DncEngInternalBuildPool)
Expand Down Expand Up @@ -162,60 +155,44 @@ extends:
timeoutInMinutes: 90
linuxJobParameterSets:
### OFFICIAL ###
# Note: These builds are also portable like the Portable category, but that category uses containers, and doesn't publish zips and tarballs.
# Note: These builds are also glibc like the glibc category, but that category uses containers, and doesn't publish zips and tarballs.
- categoryName: Official
publishArgument: $(_publishArgument)
officialBuildProperties: $(_officialBuildProperties)
osProperties: $(linuxOsPortableProperties)
osProperties: $(linuxOsglibcProperties)
runTests: false
- categoryName: Official
targetArchitecture: arm
runtimeIdentifier: linux-arm
publishArgument: $(_publishArgument)
officialBuildProperties: $(_officialBuildProperties)
osProperties: $(linuxOsPortableProperties)
osProperties: $(linuxOsglibcProperties)
runTests: false
- categoryName: Official
targetArchitecture: arm64
runtimeIdentifier: linux-arm64
publishArgument: $(_publishArgument)
officialBuildProperties: $(_officialBuildProperties)
osProperties: $(linuxOsPortableProperties)
runTests: false
### PORTABLE ###
- categoryName: Portable
# Do not publish zips and tarballs. The linux-x64 binaries are already published by Official.
publishArgument: $(_publishArgument) /p:PublishBinariesAndBadge=false
officialBuildProperties: $(_officialBuildProperties)
osProperties: $(linuxOsPortableProperties) /p:BuildSdkDeb=true
runTests: false
- categoryName: Portable
targetArchitecture: arm64
runtimeIdentifier: linux-arm64
# Do not publish zips and tarballs. The linux-arm64 binaries are already published by Official.
publishArgument: $(_publishArgument) /p:PublishBinariesAndBadge=false
officialBuildProperties: $(_officialBuildProperties)
osProperties: $(linuxOsPortableProperties) /p:BuildSdkDeb=true
osProperties: $(linuxOsglibcProperties)
runTests: false
- categoryName: Portable
container: centosStream9
### glibc ###
- categoryName: glibc
# Do not publish zips and tarballs. The linux-x64 binaries are already published by Official.
publishArgument: $(_publishArgument) /p:PublishBinariesAndBadge=false
officialBuildProperties: $(_officialBuildProperties)
osProperties: $(linuxOsPortableProperties) /p:IsRPMBasedDistro=true
osProperties: $(linuxOsglibcProperties) /p:BuildSdkDeb=true
runTests: false
- categoryName: Portable
container: centosStream9
- categoryName: glibc
targetArchitecture: arm64
runtimeIdentifier: linux-arm64
# Do not publish zips and tarballs. The linux-arm64 binaries are already published by Official.
publishArgument: $(_publishArgument) /p:PublishBinariesAndBadge=false
officialBuildProperties: $(_officialBuildProperties)
osProperties: $(linuxOsPortableProperties) /p:IsRPMBasedDistro=true
osProperties: $(linuxOsglibcProperties) /p:BuildSdkDeb=true
runTests: false
### MUSL ###
- categoryName: Musl
container: alpine322Amd64
### musl ###
- categoryName: musl
container: azureLinux30Net10BuildAmd64
runtimeIdentifier: linux-musl-x64
publishArgument: $(_publishArgument)
officialBuildProperties: $(_officialBuildProperties)
Expand All @@ -224,15 +201,15 @@ extends:
# SBOM generation is not supported for alpine.
enableSbom: false
runTests: false
- categoryName: Musl
container: mariner20CrossArm
- categoryName: musl
container: azureLinux30Net10BuildAmd64
targetArchitecture: arm
runtimeIdentifier: linux-musl-arm
publishArgument: $(_publishArgument)
officialBuildProperties: $(_officialBuildProperties)
osProperties: /p:OSName=linux-musl
runTests: false
- categoryName: Musl
- categoryName: musl
targetArchitecture: arm64
runtimeIdentifier: linux-musl-arm64
publishArgument: $(_publishArgument)
Expand Down
12 changes: 2 additions & 10 deletions .vsts-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,8 @@ variables:

resources:
containers:
- container: alpine322Amd64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.22-amd64
- container: centosStream9
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9
- container: debian12Amd64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-gcc15-amd64
- container: fedora39
image: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39
- container: ubuntu2204DebPkg
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-debpkg
- container: azureLinux30Net10BuildAmd64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-build-amd64

stages:
############### BUILD STAGE ###############
Expand Down
1 change: 0 additions & 1 deletion eng/Badge.proj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<PropertyGroup>
<!-- Replace '-' with '_' for os names like 'linux-musl' -->
<VersionBadgeMoniker>$(OSName.Replace('-', '_'))_$(TargetArchitecture)</VersionBadgeMoniker>
<VersionBadgeMoniker Condition="'$(IsLinuxPortable)' == 'true'">linux_$(TargetArchitecture)</VersionBadgeMoniker>

<VersionBadge>$(ArtifactsShippingPackagesDir)$(VersionBadgeMoniker)_$(Configuration)_version_badge.svg</VersionBadge>
<VersionSvgTemplate>$(MSBuildThisFileDirectory)version_badge.svg</VersionSvgTemplate>
Expand Down
39 changes: 5 additions & 34 deletions eng/pipelines/templates/jobs/sdk-job-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,49 +21,20 @@ parameters:
### LINUX ###
linuxJobParameterSets:
- categoryName: TestBuild
osProperties: $(linuxOsPortableProperties)
osProperties: $(linuxOsglibcProperties)
- categoryName: TestBuild
targetArchitecture: arm64
runtimeIdentifier: linux-arm64
osProperties: $(linuxOsPortableProperties)
osProperties: $(linuxOsglibcProperties)
# Don't run the tests on arm64. Only perform the build itself.
runTests: false
- categoryName: ContainerBased
container: ubuntu2204DebPkg
helixTargetContainer: $(helixTargetContainerPrefix)ubuntu-22.04-helix-amd64
osProperties: $(linuxOsPortableProperties)
runTests: true
- categoryName: ContainerBased
container: fedora39
# No fedora Helix container is available, so use the ubuntu one instead.
helixTargetContainer: $(helixTargetContainerPrefix)ubuntu-22.04-helix-amd64
osProperties: $(linuxOsPortableProperties)
# Skipping all container-based testing for now.
# See: https://github.com/dotnet/sdk/issues/40935
runTests: false
- categoryName: ContainerBased
container: centosStream9
helixTargetContainer: $(helixTargetContainerPrefix)centos-stream9-helix
osProperties: /p:OSName=linux
runTests: true
- categoryName: ContainerBased
container: debian12Amd64
helixTargetContainer: $(helixTargetContainerPrefix)debian-11-helix-amd64
container: azureLinux30Net10BuildAmd64
helixTargetContainer: $(helixTargetContainerPrefix)ubuntu-24.04-helix-amd64
osProperties: /p:OSName=linux /p:BuildSdkDeb=true
runTests: true
- categoryName: ContainerBased
container: alpine322Amd64
helixTargetContainer: $(helixTargetContainerPrefix)alpine-3.22-helix-amd64
runtimeIdentifier: linux-musl-x64
# Use HostOSName when running on alpine.
osProperties: /p:HostOSName=linux-musl
# SBOM generation is not supported for alpine.
enableSbom: false
# Skipping all container-based testing for now.
# See: https://github.com/dotnet/sdk/issues/40935
runTests: false
- categoryName: TemplateEngine
osProperties: $(linuxOsPortableProperties)
osProperties: $(linuxOsglibcProperties)
testProjects: $(Build.SourcesDirectory)/test/Microsoft.TemplateEngine.Cli.UnitTests/Microsoft.TemplateEngine.Cli.UnitTests.csproj;$(Build.SourcesDirectory)/test/dotnet-new.IntegrationTests/dotnet-new.IntegrationTests.csproj
publishXunitResults: true
### MACOS ###
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/templates/variables/sdk-defaults.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variables:
############### BUILD ###############
buildConfiguration: Release
linuxOsPortableProperties: /p:OSName=linux /p:IsLinuxPortable=true
linuxOsglibcProperties: /p:OSName=linux
helixTargetContainerPrefix: '@mcr.microsoft.com/dotnet-buildtools/prereqs:'

############### ARCADE ###############
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public GivenThatWeWantToBuildASelfContainedApp(ITestOutputHelper log) : base(log
{
}

[Theory]
// Some netcoreapp2.0 Linux tests are no longer working on ubuntu 2404
[PlatformSpecificTheory(TestPlatforms.Windows | TestPlatforms.OSX)]
[InlineData("netcoreapp1.1", false)]
[InlineData("netcoreapp2.0", false)]
[InlineData("netcoreapp3.0", true)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ public void It_publishes_self_contained_apps_to_the_publish_folder_and_the_app_s
return;
}

// Some netcoreapp2.0 Linux tests are no longer working on ubuntu 2404
if (targetFramework == "netcoreapp2.0" && OperatingSystem.IsLinux())
{
return;
}

var rid = EnvironmentInfo.GetCompatibleRid(targetFramework);

var helloWorldAsset = _testAssetsManager
Expand Down Expand Up @@ -228,7 +234,8 @@ public void Conflicts_are_resolved_when_publishing_a_portable_app()
Conflicts_are_resolved_when_publishing(selfContained: false, ridSpecific: false);
}

[Fact]
// This test is for netcoreapp2 and no longer working on ubuntu 2404
[PlatformSpecificFact(TestPlatforms.Windows | TestPlatforms.OSX)]
public void Conflicts_are_resolved_when_publishing_a_self_contained_app()
{
Conflicts_are_resolved_when_publishing(selfContained: true, ridSpecific: true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public void It_publishes_as_framework_dependent_by_default()
});
}

[Fact]
// This test is for netcoreapp2 and no longer working on ubuntu 2404
[PlatformSpecificFact(TestPlatforms.Windows | TestPlatforms.OSX)]
public void It_should_publish_self_contained_for_2x()
{
var tfm = "netcoreapp2.2";
Expand Down Expand Up @@ -109,6 +110,8 @@ public void It_should_publish_self_contained_for_2x()
[InlineData("Microsoft.AspNetCore.All")]
public void It_should_publish_framework_dependent_for_2x(string platformLibrary)
{


var tfm = "netcoreapp2.2";

var testProject = new TestProject()
Expand Down
Loading