Skip to content

Upgrate new version of tf.exe | vstsom.zip - AB#2257240 #5138

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions src/Agent.Sdk/Knob/AgentKnobs.cs
Original file line number Diff line number Diff line change
@@ -786,5 +786,13 @@ public class AgentKnobs
"Timeout for channel communication between agent listener and worker processes.",
new EnvironmentKnobSource("PIPELINE_ARTIFACT_ASSOCIATE_TIMEOUT"),
new BuiltInDefaultKnobSource("900")); // 15 * 60 - Setting the timeout to 15 minutes to account for slowness from azure storage and retries.

public static readonly Knob RollbackToDefaultTfExe = new Knob(
nameof(RollbackToDefaultTfExe),
"If true, the agent will install the default versions of TF, vstsom",
new RuntimeKnobSource("ROLLBACK_TO_DEFAULT_TF_EXE"),
new EnvironmentKnobSource("ROLLBACK_TO_DEFAULT_TF_EXE"),
new PipelineFeatureSource("RollbackToDefaultTfExe"),
new BuiltInDefaultKnobSource("false"));
}
}
25 changes: 23 additions & 2 deletions src/Agent.Worker/TfManager.cs
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Agent.Sdk.Knob;

namespace Microsoft.VisualStudio.Services.Agent.Worker
{
@@ -34,7 +35,17 @@ public static async Task DownloadLegacyTfToolsAsync(IExecutionContext executionC

if (!Directory.Exists(tfLegacyExternalsPath))
{
const string tfDownloadUrl = "https://vstsagenttools.blob.core.windows.net/tools/vstsom/m153_47c0856d/vstsom.zip";
string tfDownloadUrl;
if (!AgentKnobs.RollbackToDefaultTfExe.GetValue(executionContext).AsBoolean())
{
tfDownloadUrl = "https://vstsagenttools.blob.core.windows.net/tools/vstsom/m153_47c0856d/vstsom.zip";
executionContext.Debug("Using the legacy version of tf.exe");
}
else
{
tfDownloadUrl = "https://vstsagenttools.blob.core.windows.net/tools/vstsom/m153_47c0856d_adhoc/vstsom.zip";
executionContext.Debug("Using the default version of tf.exe");
}
string tempTfDirectory = Path.Combine(externalsPath, "tf_download_temp");

await DownloadAsync(executionContext, tfDownloadUrl, tempTfDirectory, tfLegacyExternalsPath, retryOptions);
@@ -48,7 +59,17 @@ public static async Task DownloadLegacyTfToolsAsync(IExecutionContext executionC

if (!Directory.Exists(vstsomLegacyExternalsPath))
{
const string vstsomDownloadUrl = "https://vstsagenttools.blob.core.windows.net/tools/vstsom/m122_887c6659/vstsom.zip";
string vstsomDownloadUrl;
if (!AgentKnobs.RollbackToDefaultTfExe.GetValue(executionContext).AsBoolean())
{
vstsomDownloadUrl = "https://vstsagenttools.blob.core.windows.net/tools/vstsom/m122_887c6659/vstsom.zip";
executionContext.Debug("Using the legacy version of vstsom");
}
else
{
vstsomDownloadUrl = "https://vstsagenttools.blob.core.windows.net/tools/vstsom/m153_47c0856d_adhoc/vstsom.zip";
executionContext.Debug("Using the default version of vstsom");
}
string tempVstsomDirectory = Path.Combine(externalsPath, "vstsom_download_temp");

await DownloadAsync(executionContext, vstsomDownloadUrl, tempVstsomDirectory, vstsomLegacyExternalsPath, retryOptions);
8 changes: 4 additions & 4 deletions src/Misc/externals.sh
Original file line number Diff line number Diff line change
@@ -173,14 +173,14 @@ if [[ "$PACKAGERUNTIME" == "win-x"* ]]; then
BIT="64"
acquireExternalTool "$CONTAINER_URL/azcopy/1/azcopy.zip" azcopy
acquireExternalTool "$CONTAINER_URL/vstshost/m122_887c6659_binding_redirect_patched/vstshost.zip" vstshost
acquireExternalTool "$CONTAINER_URL/vstsom/m153_47c0856d_adhoc/vstsom.zip" vstsom
acquireExternalTool "$CONTAINER_URL/vstsom/dev17.11vs_c0748e6e/vstsom.zip" vstsom
fi

acquireExternalTool "$CONTAINER_URL/mingit/${MINGIT_VERSION}/MinGit-${MINGIT_VERSION}-${BIT}-bit.zip" git
acquireExternalTool "$CONTAINER_URL/git-lfs/${LFS_VERSION}/x${BIT}/git-lfs.exe" "git/mingw${BIT}/bin"
acquireExternalTool "$CONTAINER_URL/pdbstr/1/pdbstr.zip" pdbstr
acquireExternalTool "$CONTAINER_URL/symstore/1/symstore.zip" symstore
acquireExternalTool "$CONTAINER_URL/vstsom/m153_47c0856d_adhoc/vstsom.zip" tf
acquireExternalTool "$CONTAINER_URL/vstsom/dev17.11vs_c0748e6e/vstsom.zip" tf
acquireExternalTool "$CONTAINER_URL/vswhere/2_8_4/vswhere.zip" vswhere
acquireExternalTool "https://dist.nuget.org/win-x86-commandline/v4.6.4/nuget.exe" nuget

@@ -205,14 +205,14 @@ elif [[ "$PACKAGERUNTIME" == "win-arm64" || "$PACKAGERUNTIME" == "win-arm32" ]];

# acquireExternalTool "$CONTAINER_URL/azcopy/1/azcopy.zip" azcopy # Unavailable for Win ARM 64 - https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10?tabs=dnf#download-the-azcopy-portable-binary
acquireExternalTool "$CONTAINER_URL/vstshost/m122_887c6659_binding_redirect_patched/vstshost.zip" vstshost # Custom package. Will the same work for Win ARM 64?
acquireExternalTool "$CONTAINER_URL/vstsom/m153_47c0856d_adhoc/vstsom.zip" vstsom # Custom package. Will the same work for Win ARM 64?
acquireExternalTool "$CONTAINER_URL/vstsom/dev17.11vs_c0748e6e/vstsom.zip" vstsom # Custom package. Will the same work for Win ARM 64?
fi

acquireExternalTool "$CONTAINER_URL/mingit/${MINGIT_VERSION}/MinGit-${MINGIT_VERSION}-${BIT}-bit.zip" git # Unavailable for Win ARM 64 - https://github.com/git-for-windows/git/releases
acquireExternalTool "$CONTAINER_URL/git-lfs/${LFS_VERSION}/win-arm${BIT}/git-lfs.exe" "git/mingw${BIT}/bin"
acquireExternalTool "$CONTAINER_URL/pdbstr/win-arm${BIT}/1/pdbstr.zip" pdbstr
acquireExternalTool "$CONTAINER_URL/symstore/win-arm${BIT}/1/symstore.zip" symstore
acquireExternalTool "$CONTAINER_URL/vstsom/m153_47c0856d_adhoc/vstsom.zip" tf
acquireExternalTool "$CONTAINER_URL/vstsom/dev17.11vs_c0748e6e/vstsom.zip" tf
acquireExternalTool "$CONTAINER_URL/vswhere/2_8_4/vswhere.zip" vswhere
acquireExternalTool "https://dist.nuget.org/win-x86-commandline/v4.6.4/nuget.exe" nuget

4 changes: 2 additions & 2 deletions src/Test/L0/Worker/TfManagerL0.cs
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ public async Task DownloadAsync_Retries()
retryOptions.Setup(opt => opt.ToString()).Throws<Exception>();
retryOptions.Setup(opt => opt.Limit).Returns(3);

const string downloadUrl = "https://vstsagenttools.blob.core.windows.net/tools/vstsom/m122_887c6659/vstsom.zip";
const string downloadUrl = "https://vstsagenttools.blob.core.windows.net/tools/vstsom/dev17.11vs_c0748e6e/vstsom.zip";
string tempDirectory = Path.Combine(hostContext.GetDirectory(WellKnownDirectory.Externals), "temp-test");
string extractDirectory = Path.Combine(hostContext.GetDirectory(WellKnownDirectory.Externals), "test");

@@ -110,7 +110,7 @@ public async Task DownloadAsync_Cancellation()
retryOptions.Setup(opt => opt.ToString()).Callback(() => tokenSource.Cancel());
retryOptions.Setup(opt => opt.Limit).Returns(3);

const string downloadUrl = "https://vstsagenttools.blob.core.windows.net/tools/vstsom/m122_887c6659/vstsom.zip";
const string downloadUrl = "https://vstsagenttools.blob.core.windows.net/tools/vstsom/dev17.11vs_c0748e6e/vstsom.zip";
string tempDirectory = Path.Combine(hostContext.GetDirectory(WellKnownDirectory.Externals), "temp-test");
string extractDirectory = Path.Combine(hostContext.GetDirectory(WellKnownDirectory.Externals), "test");