Skip to content

Commit

Permalink
Show warnings for Agents that run on OS versions not supported by .NE…
Browse files Browse the repository at this point in the history
…T 8 (#4885)

* Add Net Supported OS generic check

* Move warning message to localization

* Add FF to warning message

---------

Co-authored-by: DenisRumyantsev <[email protected]>
Co-authored-by: Maxim Zaytsev <[email protected]>
  • Loading branch information
3 people committed Aug 1, 2024
1 parent 957fbd3 commit 4249bef
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 207 deletions.
2 changes: 1 addition & 1 deletion src/Agent.Listener/Agent.Listener.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</ItemGroup>

<ItemGroup>
<None Update="net6.json">
<None Update="net8.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
Expand Down
35 changes: 0 additions & 35 deletions src/Agent.Listener/SelfUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,41 +154,6 @@ private async Task<bool> UpdateNeeded(string targetVersion, CancellationToken to
return false;
}

//Checking if current system support .NET 6 agent
if (agentVersion.Major == 2 && serverVersion.Major == 3)
{
Trace.Verbose("Checking if your system supports .NET 6");

try
{
string systemId = PlatformUtil.GetSystemId();
SystemVersion systemVersion = PlatformUtil.GetSystemVersion();

Trace.Verbose($"The system you are running on: \"{systemId}\" ({systemVersion})");

if (await PlatformUtil.DoesSystemPersistsInNet6Whitelist())
{
// Check version of the system
if (!await PlatformUtil.IsNet6Supported())
{
Trace.Warning($"The operating system the agent is running on is \"{systemId}\" ({systemVersion}), which will not be supported by the .NET 6 based v3 agent. Please upgrade the operating system of this host to ensure compatibility with the v3 agent. See https://aka.ms/azdo-pipeline-agent-version");
return false;
}
}
else
{
Trace.Warning($"The operating system the agent is running on is \"{systemId}\" ({systemVersion}), which has not been tested with the .NET 6 based v3 agent. The v2 agent wil not automatically upgrade to the v3 agent. You can manually download the .NET 6 based v3 agent from https://github.com/microsoft/azure-pipelines-agent/releases. See https://aka.ms/azdo-pipeline-agent-version");
return false;
}

Trace.Verbose("The system persists in the list of systems supporting .NET 6");
}
catch (Exception ex)
{
Trace.Error($"Error has occurred while checking if system supports .NET 6: {ex}");
}
}

if (serverVersion.CompareTo(agentVersion) > 0)
{
return true;
Expand Down
53 changes: 23 additions & 30 deletions src/Agent.Listener/net6.json → src/Agent.Listener/net8.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "alpine",
"versions": [
{
"name": "3.13+"
"name": "3.17+"
}
]
},
Expand All @@ -12,126 +12,119 @@
"versions": [
{
"name": "2"
}
]
},
{
"id": "centos",
"versions": [
},
{
"name": "7+"
"name": "2023"
}
]
},
{
"id": "debian",
"versions": [
{
"name": "10+"
"name": "11+"
}
]
},
{
"id": "fedora",
"versions": [
{
"name": "33+"
"name": "39+"
}
]
},
{
"id": "macOS",
"versions": [
{
"name": "10.15+"
"name": "12+"
}
]
},
{
"id": "mariner",
"versions": [
{
"name": "1.0+"
"name": "2.0+"
}
]
},
{
"id": "opensuse-leap",
"versions": [
{
"name": "15+"
"name": "15.5+"
}
]
},
{
"id": "rhel",
"versions": [
{
"name": "7+"
"name": "8+"
}
]
},
{
"id": "sles",
"versions": [
{
"name": "12.2+"
"name": "15+"
}
]
},
{
"id": "ubuntu",
"versions": [
{
"name": "16.04"
"name": "20.04"
},
{
"name": "22.04"
},
{
"name": "18.04"
"name": "23.10"
},
{
"name": "20.04+"
"name": "24.04"
}

]
},
{
"id": "Windows Client",
"versions": [
{
"name": "7",
"version": "7601+"
},
{
"name": "8.1"
"name": "10",
"version": "1607+"
},
{
"name": "10",
"version": "14393+"
"name": "11"
}
]
},
{
"id": "Windows Nano Server",
"versions": [
{
"version": "17763+"
"version": "1809+"
}
]
},
{
"id": "Windows Server",
"versions": [
{
"name": "2012+"
"name": "2016+"
}
]
},
{
"id": "Windows Server Core",
"versions": [
{
"name": "2012+"
"name": "2016+"
}
]
}
]
]
13 changes: 7 additions & 6 deletions src/Agent.Sdk/Knob/AgentKnobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public class AgentKnobs

public static readonly Knob AgentFailOnIncompatibleOS = new Knob(
nameof(AgentFailOnIncompatibleOS),
"Allow agent to fail pipelines on incampatible OS",
"Allow agent to fail pipelines on incompatible OS",
new EnvironmentKnobSource("AGENT_FAIL_ON_INCOMPATIBLE_OS"),
new RuntimeKnobSource("AGENT_FAIL_ON_INCOMPATIBLE_OS"),
new BuiltInDefaultKnobSource("false"));
Expand Down Expand Up @@ -586,11 +586,6 @@ public class AgentKnobs
new EnvironmentKnobSource("AGENT_DISABLE_DRAIN_QUEUES_AFTER_TASK"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob EnableFetchingNet6List = new Knob(
nameof(EnableFetchingNet6List),
"Forces the agent to fetch list of .NET 6 supporting systems from server",
new EnvironmentKnobSource("AGENT_ENABLE_FETCHING_NET6_LIST"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob EnableResourceUtilizationWarnings = new Knob(
nameof(EnableResourceUtilizationWarnings),
Expand Down Expand Up @@ -723,5 +718,11 @@ public class AgentKnobs
new RuntimeKnobSource("AZP_AGENT_USE_DOCKER_STDIN_PASSWORD_WINDOWS"),
new PipelineFeatureSource("UseDockerStdinPasswordOnWindows"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob Net8UnsupportedOsWarning = new Knob(
nameof(Net8UnsupportedOsWarning),
"Show warning message on the OS which is not supported by .NET 8",
new PipelineFeatureSource("Net8UnsupportedOsWarning"),
new BuiltInDefaultKnobSource("true"));
}
}
Loading

0 comments on commit 4249bef

Please sign in to comment.