Skip to content

Commit 18e8a8c

Browse files
TonewallazfuncghTony Choi
authored
Fix Instance Manager for Linux Consumption Running on Legion (#11085)
* Update version to 4.1040.200 * Clear release notes * Fix Instance Manager for Linux Consumption Running on Legion (#11072) * Fix Instance Manager for Linux Consumption Running on Legion * unit test * Release note --------- Co-authored-by: Tony Choi <[email protected]> --------- Co-authored-by: Azure Functions Release <[email protected]> Co-authored-by: Tony Choi <[email protected]>
1 parent 502e8e2 commit 18e8a8c

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

release_notes.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,4 @@
33
<!-- Please add your release notes in the following format:
44
- My change description (#PR)
55
-->
6-
- Improved memory metrics reporting using CGroup data for Linux consumption (#10968)
7-
- Memory allocation optimizations in `RpcWorkerConfigFactory.AddProviders` (#10959)
8-
- Fixing GrpcWorkerChannel concurrency bug (#10998)
9-
- Avoid circular dependency when resolving LinuxContainerLegionMetricsPublisher. (#10991)
10-
- Add 'unix' to the list of runtimes kept when importing PowerShell worker for Linux builds
11-
- Update PowerShell 7.4 worker to 4.0.4206
12-
- Update Python Worker Version to [4.37.0](https://github.com/Azure/azure-functions-python-worker/releases/tag/4.37.0)
13-
- Add runtime and process metrics. (#11034)
14-
- Add `win-arm64` and `linux-arm64` to the list of PowerShell runtimes; added filter for `osx` RIDs (includes `osx-x64` and `osx-arm64`) (#11013)
15-
- Disable Diagnostic Events when Table Storage is not accessible (#10996)
16-
- Update flex metric publisher to publish every 30 seconds (regardless of actvity) (#11019)
17-
- Add JitTrace Files for v4.1040
6+
- Fix Instance Manager for CV1 Migration (#11072)

src/Directory.Version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<VersionPrefix>4.1040.100</VersionPrefix>
3+
<VersionPrefix>4.1040.200</VersionPrefix>
44
<UpdateBuildNumber>true</UpdateBuildNumber>
55
</PropertyGroup>
66
</Project>

src/WebJobs.Script.WebHost/WebHostServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public static void AddWebJobsScriptHost(this IServiceCollection services, IConfi
145145
services.AddTransient<VirtualFileSystem>();
146146
services.AddTransient<VirtualFileSystemMiddleware>();
147147

148-
if (SystemEnvironment.Instance.IsFlexConsumptionSku())
148+
if (SystemEnvironment.Instance.IsLinuxConsumptionOnLegion() || SystemEnvironment.Instance.IsFlexConsumptionSku())
149149
{
150150
services.AddSingleton<IInstanceManager, LegionInstanceManager>();
151151
}

test/WebJobs.Script.Tests/Environment/EnvironmentTests.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using System.Runtime.InteropServices;
6+
using System.Threading.Tasks;
67
using Microsoft.WebJobs.Script.Tests;
78
using Xunit;
89
using static Microsoft.Azure.WebJobs.Script.EnvironmentSettingNames;
@@ -244,6 +245,24 @@ public void Returns_IsLinuxConsumption(string websiteInstanceId, string containe
244245
Assert.False(isLinuxConsumptionOnAtlas ? isLinuxConsumptionOnLegion : isLinuxConsumptionOnAtlas);
245246
}
246247

248+
[Theory]
249+
[InlineData(ScriptConstants.DynamicSku, "containerName", "", "", false)]
250+
[InlineData(ScriptConstants.DynamicSku, "containerName", "podName", "", false)]
251+
[InlineData(ScriptConstants.DynamicSku, "containerName", "podName", "legionServiceHost", true)]
252+
[InlineData(ScriptConstants.DynamicSku, "containerName", "", "legionServiceHost", true)]
253+
public void Returns_AtlasOrLegionConsumption(string sku, string containerName, string podName, string legionServiceHost, bool legion)
254+
{
255+
var testEnvironment = new TestEnvironment();
256+
testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteInstanceId, string.Empty);
257+
testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteSku, sku);
258+
testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.ContainerName, containerName);
259+
testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.PodName, podName);
260+
testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.LegionServiceHost, legionServiceHost);
261+
262+
Assert.Equal(legion, testEnvironment.IsLinuxConsumptionOnLegion());
263+
Assert.Equal(!legion, testEnvironment.IsLinuxConsumptionOnAtlas());
264+
}
265+
247266
[Theory]
248267
[InlineData(ScriptConstants.ElasticPremiumSku, true)]
249268
[InlineData("test", false)]

0 commit comments

Comments
 (0)