Skip to content

Commit

Permalink
Use node20_1 for sleepCommand when running container (#4929)
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisRumyantsev committed Aug 12, 2024
1 parent f9260a0 commit a4c8755
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/Agent.Sdk/Knob/AgentKnobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,13 @@ public class AgentKnobs
new PipelineFeatureSource("CheckIfTaskNodeRunnerIsDeprecated"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob UseNode20ToStartContainer = new Knob(
nameof(UseNode20ToStartContainer),
"If true, the agent will use Node 20 to start docker container when executing container job and the container platform is the same as the host platform.",
new RuntimeKnobSource("AZP_AGENT_USE_NODE20_TO_START_CONTAINER"),
new PipelineFeatureSource("UseNode20ToStartContainer"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob EnableNewSecretMasker = new Knob(
nameof(EnableNewSecretMasker),
"If true, the agent will use new SecretMasker with additional filters & performance enhancements",
Expand Down
2 changes: 1 addition & 1 deletion src/Agent.Worker/ContainerOperationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ private async Task StartContainerAsync(IExecutionContext executionContext, Conta
}
else
{
node = container.TranslateToContainerPath(Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Externals), "node", "bin", $"node{IOUtil.ExeExtension}"));
node = container.TranslateToContainerPath(Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Externals), AgentKnobs.UseNode20ToStartContainer.GetValue(executionContext).AsBoolean() ? NodeHandler.Node20_1Folder : NodeHandler.NodeFolder, "bin", $"node{IOUtil.ExeExtension}"));

// if on Mac OS X, require container to have node
if (PlatformUtil.RunningOnMacOS)
Expand Down
3 changes: 0 additions & 3 deletions src/Agent.Worker/Handlers/NodeHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
using System.Linq;
using System.Collections.Generic;
using System.Threading;
using Microsoft.TeamFoundation.Common.Internal;
using Microsoft.VisualStudio.Services.Agent.Worker.Telemetry;
using Newtonsoft.Json;
using StringUtil = Microsoft.VisualStudio.Services.Agent.Util.StringUtil;

namespace Microsoft.VisualStudio.Services.Agent.Worker.Handlers
Expand Down

0 comments on commit a4c8755

Please sign in to comment.