Skip to content

Commit 4249bef

Browse files
ismayilov-ismayilrumyaxMaxim Zaytsev
authored
Show warnings for Agents that run on OS versions not supported by .NET 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]>
1 parent 957fbd3 commit 4249bef

File tree

16 files changed

+69
-207
lines changed

16 files changed

+69
-207
lines changed

src/Agent.Listener/Agent.Listener.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</ItemGroup>
3030

3131
<ItemGroup>
32-
<None Update="net6.json">
32+
<None Update="net8.json">
3333
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3434
</None>
3535
</ItemGroup>

src/Agent.Listener/SelfUpdater.cs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -154,41 +154,6 @@ private async Task<bool> UpdateNeeded(string targetVersion, CancellationToken to
154154
return false;
155155
}
156156

157-
//Checking if current system support .NET 6 agent
158-
if (agentVersion.Major == 2 && serverVersion.Major == 3)
159-
{
160-
Trace.Verbose("Checking if your system supports .NET 6");
161-
162-
try
163-
{
164-
string systemId = PlatformUtil.GetSystemId();
165-
SystemVersion systemVersion = PlatformUtil.GetSystemVersion();
166-
167-
Trace.Verbose($"The system you are running on: \"{systemId}\" ({systemVersion})");
168-
169-
if (await PlatformUtil.DoesSystemPersistsInNet6Whitelist())
170-
{
171-
// Check version of the system
172-
if (!await PlatformUtil.IsNet6Supported())
173-
{
174-
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");
175-
return false;
176-
}
177-
}
178-
else
179-
{
180-
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");
181-
return false;
182-
}
183-
184-
Trace.Verbose("The system persists in the list of systems supporting .NET 6");
185-
}
186-
catch (Exception ex)
187-
{
188-
Trace.Error($"Error has occurred while checking if system supports .NET 6: {ex}");
189-
}
190-
}
191-
192157
if (serverVersion.CompareTo(agentVersion) > 0)
193158
{
194159
return true;

src/Agent.Listener/net6.json renamed to src/Agent.Listener/net8.json

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"id": "alpine",
44
"versions": [
55
{
6-
"name": "3.13+"
6+
"name": "3.17+"
77
}
88
]
99
},
@@ -12,126 +12,119 @@
1212
"versions": [
1313
{
1414
"name": "2"
15-
}
16-
]
17-
},
18-
{
19-
"id": "centos",
20-
"versions": [
15+
},
2116
{
22-
"name": "7+"
17+
"name": "2023"
2318
}
2419
]
2520
},
2621
{
2722
"id": "debian",
2823
"versions": [
2924
{
30-
"name": "10+"
25+
"name": "11+"
3126
}
3227
]
3328
},
3429
{
3530
"id": "fedora",
3631
"versions": [
3732
{
38-
"name": "33+"
33+
"name": "39+"
3934
}
4035
]
4136
},
4237
{
4338
"id": "macOS",
4439
"versions": [
4540
{
46-
"name": "10.15+"
41+
"name": "12+"
4742
}
4843
]
4944
},
5045
{
5146
"id": "mariner",
5247
"versions": [
5348
{
54-
"name": "1.0+"
49+
"name": "2.0+"
5550
}
5651
]
5752
},
5853
{
5954
"id": "opensuse-leap",
6055
"versions": [
6156
{
62-
"name": "15+"
57+
"name": "15.5+"
6358
}
6459
]
6560
},
6661
{
6762
"id": "rhel",
6863
"versions": [
6964
{
70-
"name": "7+"
65+
"name": "8+"
7166
}
7267
]
7368
},
7469
{
7570
"id": "sles",
7671
"versions": [
7772
{
78-
"name": "12.2+"
73+
"name": "15+"
7974
}
8075
]
8176
},
8277
{
8378
"id": "ubuntu",
8479
"versions": [
8580
{
86-
"name": "16.04"
81+
"name": "20.04"
82+
},
83+
{
84+
"name": "22.04"
8785
},
8886
{
89-
"name": "18.04"
87+
"name": "23.10"
9088
},
9189
{
92-
"name": "20.04+"
90+
"name": "24.04"
9391
}
94-
9592
]
9693
},
9794
{
9895
"id": "Windows Client",
9996
"versions": [
10097
{
101-
"name": "7",
102-
"version": "7601+"
103-
},
104-
{
105-
"name": "8.1"
98+
"name": "10",
99+
"version": "1607+"
106100
},
107101
{
108-
"name": "10",
109-
"version": "14393+"
102+
"name": "11"
110103
}
111104
]
112105
},
113106
{
114107
"id": "Windows Nano Server",
115108
"versions": [
116109
{
117-
"version": "17763+"
110+
"version": "1809+"
118111
}
119112
]
120113
},
121114
{
122115
"id": "Windows Server",
123116
"versions": [
124117
{
125-
"name": "2012+"
118+
"name": "2016+"
126119
}
127120
]
128121
},
129122
{
130123
"id": "Windows Server Core",
131124
"versions": [
132125
{
133-
"name": "2012+"
126+
"name": "2016+"
134127
}
135128
]
136129
}
137-
]
130+
]

src/Agent.Sdk/Knob/AgentKnobs.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ public class AgentKnobs
375375

376376
public static readonly Knob AgentFailOnIncompatibleOS = new Knob(
377377
nameof(AgentFailOnIncompatibleOS),
378-
"Allow agent to fail pipelines on incampatible OS",
378+
"Allow agent to fail pipelines on incompatible OS",
379379
new EnvironmentKnobSource("AGENT_FAIL_ON_INCOMPATIBLE_OS"),
380380
new RuntimeKnobSource("AGENT_FAIL_ON_INCOMPATIBLE_OS"),
381381
new BuiltInDefaultKnobSource("false"));
@@ -586,11 +586,6 @@ public class AgentKnobs
586586
new EnvironmentKnobSource("AGENT_DISABLE_DRAIN_QUEUES_AFTER_TASK"),
587587
new BuiltInDefaultKnobSource("false"));
588588

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

595590
public static readonly Knob EnableResourceUtilizationWarnings = new Knob(
596591
nameof(EnableResourceUtilizationWarnings),
@@ -723,5 +718,11 @@ public class AgentKnobs
723718
new RuntimeKnobSource("AZP_AGENT_USE_DOCKER_STDIN_PASSWORD_WINDOWS"),
724719
new PipelineFeatureSource("UseDockerStdinPasswordOnWindows"),
725720
new BuiltInDefaultKnobSource("false"));
721+
722+
public static readonly Knob Net8UnsupportedOsWarning = new Knob(
723+
nameof(Net8UnsupportedOsWarning),
724+
"Show warning message on the OS which is not supported by .NET 8",
725+
new PipelineFeatureSource("Net8UnsupportedOsWarning"),
726+
new BuiltInDefaultKnobSource("true"));
726727
}
727728
}

0 commit comments

Comments
 (0)