Skip to content
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

Use node20_1 for sleepCommand when running container #4929

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading