Skip to content

Commit

Permalink
Upd dotnet6 agent (#4150)
Browse files Browse the repository at this point in the history
* Catch updating exception (#4082)

* Node16 version updated to 16.17.1" (#4084)

* Bump ubuntu image version to 20.04 (#4079)

* Prevent creating host container network (#3788)

* Prevent creating host container network

* Remove redundant empty lines

* Fix invalid knob value fetching

* Update ContainerOperationProvider.cs

Co-authored-by: Denis Rumyantsev <mr.denis.rumyantsev@gmail.com>
Co-authored-by: Kirill Ivlev <102740624+kirill-ivlev@users.noreply.github.com>
Co-authored-by: Konstantin Tyukalov <52399739+KonstantinTyukalov@users.noreply.github.com>

* Allow env.sh to accept additional env var names (#3339)

The hard-coded list is not necessarily enough. This allows the caller
to specify additional environment variables to write to .env.

Co-authored-by: Konstantin Tyukalov <52399739+KonstantinTyukalov@users.noreply.github.com>
Co-authored-by: Kirill Ivlev <102740624+kirill-ivlev@users.noreply.github.com>

* Revert "Fix execution of scripts in variables (#4016)" (#4088)

This reverts commit af5328b.

* Add Ubuntu 18.04 (#3943)

Co-authored-by: Kirill Ivlev <102740624+kirill-ivlev@users.noreply.github.com>
Co-authored-by: Konstantin Tyukalov <52399739+KonstantinTyukalov@users.noreply.github.com>

* Make agent update list of systems supporting .NET 6 periodically (#4081)

* implemented logic to fetch net6.json from server every hour

* added await keyword

* Moved logic to set warning from ExecutionContext to JobRunner since InitializeJob method is not async

* fixed issue with condition in Equals method of OperatingSystem class

* small refactoring

* net6.json must be read only if it was not fetched from server

* refactored code of method "GetNet6SupportedSystems"

* restored field net6SupportedSystems to reduce IO oprations and cover case when agent started but net6.json is not older than 1 hour

Co-authored-by: Kirill Ivlev <102740624+kirill-ivlev@users.noreply.github.com>

* Retries to lock Services database (#4085)

* retries to lock database

* Decrease timeout + Add retry message

Co-authored-by: Konstantin Tyukalov <v-ktyukalov@microsoft.com>
Co-authored-by: Konstantin Tyukalov <52399739+KonstantinTyukalov@users.noreply.github.com>

* Fixed name of DockerAdditionalNetworkOptions Knob (#3888)

Co-authored-by: Konstantin Tyukalov <52399739+KonstantinTyukalov@users.noreply.github.com>

* Format agent source code (#4101)

* Run dotnet format

* Remove extra semicolons

* Fix SonarQube's "'Any()' should be used to test for emptiness" / Code Smell (#3404)

* Add script to predict v2->v3 upgrade compatibility (#4092)

* Add script to predict v2->v3 upgrade compatibility

* Fix typo

* Fixed another typo: frpom

Co-authored-by: Kirill Ivlev <102740624+kirill-ivlev@users.noreply.github.com>

* Added strict boolean knob values (#4103)

* Add ConvertToBooleanStrict

* Add AsBooleanStrict for agent knobs

* update build-job (#4110)

* update build-job
- added UseDotNet task for linux os

* Switch EsrpCodeSigning from V1 to V2
returned back UseDotNet task condition

* Set UseDotNet version to 6 on osx

* added dotnet 3.1.x before unit tests on win x86

* fix dotnet host search (#4124)

* fix dotnet host search
- added performMultiLevelLookup

* Added runtime to unitTests step

* Changed patch version in semver of runtime

* remove sdk and runtime from unitTests script

* Fixed problem with .NET Core 3.1 installation

* Added UseDotNet task in functionalTests

Co-authored-by: Roman Shchukin <roman.shchukin@akvelon.com>

* Add option to skip rhel6 in pipeline and ci (#4121)

* skipRhelRelease parameter added

* skipRhelRelease parameter fixed

* releaseRhelOnly parameter added

* Logic of removing not filling lines from releaseNote

* Fix pipeline with test releaseNote job

* Fix pipeline with test releaseNote job

* Fix pipeline with test releaseNote job

* Fix pipeline with test releaseNote job

* Fix pipeline with test releaseNote job

* Fix pipeline with test releaseNote job

* Fix pipeline with test releaseNote job

* Fix pipeline with test releaseNote job

* Fix pipeline with test releaseNote job

* Fix pipeline with test releaseNote job

* Removed test logs

* Added clear empty lines logic

* Commented code for test. Test changes in pipeline

* Removed test changes

* skipRhelRelease parametr added to ci pipeline

* Update dotnet to 3.1.32 (#4112)

* DockerLogin retries (#4100)

* DockerLogin retries
- added changes from PR #3840
- fixed incorrect variables

* DockerLogin retries
- added step UseDotNet@2

* DockerLogin retries
- added linux to UseDotNet task

* Docker Login retries
Implement retry into DockerLogin method

* Implement feature flag for docker login retries

* revert build-job back

* Added retry for docker start

* fix delay

* update knob description

* Update agent Docker methods
- reworked Docker methods with retries behavior
- changed InvokeWithRetryIfNonZero on to incapsulated logic method

* - renamed local variable as is in ADO

* Added docker retry behavior to docker version method

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Kirill Ivlev <102740624+kirill-ivlev@users.noreply.github.com>
Co-authored-by: Merlyn Oppenheim <merlynop@microsoft.com>

* Add the exact operation system version and environment to the telemetry (#4104)

* Update TaskRunner.cs

* Update build-job.yml

* Added new variables to telemetry AgentName, MachineName, IsSelfHosted

Co-authored-by: Kirill Ivlev <102740624+kirill-ivlev@users.noreply.github.com>

* Mingit version upgraded to 2.39.1 (#4126)

* Fix agent lint errors (#4117)

* Fix CA2000 error with secrets masker

* Fix CA1711 for ServiceBootFlag

* Fix CA2000 for JobRunner

* Resolve CA2000 in StepHost

* Resolve CA2000 in Windows service

* Resolve CA2000 for WorkerCommandManager

* Resove CA2000 for CodeCoverageCommands

* Remove unused namespaces

* Add fixture for SecretMasker tests

* Change Fixtures -> Disposable

* Use dispose pattern to fix errors

* Formatting

* Revert "Allow env.sh to accept additional env var names (#3339)" (#4143)

This reverts commit 27e3d4e.

---------

Co-authored-by: Roman-Shchukin <111063382+Roman-Shchukin@users.noreply.github.com>
Co-authored-by: Konstantin Tyukalov <52399739+KonstantinTyukalov@users.noreply.github.com>
Co-authored-by: Steve <hez2010@outlook.com>
Co-authored-by: Denis Rumyantsev <mr.denis.rumyantsev@gmail.com>
Co-authored-by: Rick Brown <ricksbrown73@gmail.com>
Co-authored-by: Liliia Sabitova <107196662+LiliaSabitova@users.noreply.github.com>
Co-authored-by: Eric van Wijk <eric@van-wijk.com>
Co-authored-by: Sergey Koryshev <sergey.koryshev@akvelon.com>
Co-authored-by: Konstantin Tyukalov <v-ktyukalov@microsoft.com>
Co-authored-by: Rami <icnocop@users.noreply.github.com>
Co-authored-by: Martin <modermatt@tuta.io>
Co-authored-by: ivanduplenskikh <115665590+ivanduplenskikh@users.noreply.github.com>
Co-authored-by: Roman Shchukin <roman.shchukin@akvelon.com>
Co-authored-by: Your Name <you@example.com>
Co-authored-by: Merlyn Oppenheim <merlynop@microsoft.com>
Co-authored-by: İsmayıl İsmayılov <110806089+ismayilov-ismayil@users.noreply.github.com>
  • Loading branch information
17 people committed Feb 7, 2023
1 parent a05b12a commit 463ceee
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .vsts.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ parameters:
default: true
- name: macOS_arm64
type: boolean
displayName: macOS (arm64)
displayName: macOS (arm64)m
default: true
- name: skipRhelRelease
type: boolean
Expand Down
3 changes: 0 additions & 3 deletions src/Agent.Sdk/Util/ExceptionsUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Text;
using Microsoft.VisualStudio.Services.Agent;
using Microsoft.VisualStudio.Services.Agent.Util;

namespace Agent.Sdk.Util
Expand Down
3 changes: 0 additions & 3 deletions src/Agent.Sdk/Util/ILoggedSecretMasker.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Microsoft.TeamFoundation.DistributedTask.Logging;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace Agent.Sdk.Util
{
Expand Down
3 changes: 0 additions & 3 deletions src/Agent.Sdk/Util/LoggedSecretMasker.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Microsoft.TeamFoundation.DistributedTask.Logging;
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace Agent.Sdk.Util
{
Expand Down
2 changes: 0 additions & 2 deletions src/Agent.Sdk/Util/MaskingUtil.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Microsoft.VisualStudio.Services.ServiceEndpoints.WebApi;
using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.VisualStudio.Services.Agent.Util
{
Expand Down
7 changes: 0 additions & 7 deletions src/Agent.Sdk/Util/PlatformUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,16 @@
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Xml.Linq;
using Agent.Sdk.Knob;
using Agent.Sdk.Util;
using BuildXL.Cache.MemoizationStore.Interfaces.Caches;
using BuildXL.Utilities;
using Microsoft.TeamFoundation.Build.WebApi;
using Microsoft.VisualStudio.Services.Agent.Util;
using Microsoft.Win32;
using Newtonsoft.Json;
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 @@ -789,7 +789,7 @@ private async Task CreateContainerNetworkAsync(IExecutionContext executionContex
{
Trace.Entering();
ArgUtil.NotNull(executionContext, nameof(executionContext));

if (network != "host")
{
int networkExitCode = await _dockerManger.DockerNetworkCreate(executionContext, network);
Expand Down
34 changes: 16 additions & 18 deletions src/Agent.Worker/Handlers/StepHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,24 +210,22 @@ public async Task<int> ExecuteAsync(string workingDirectory,
// It appears that node.exe outputs UTF8 when not in TTY mode.
outputEncoding = Encoding.UTF8;
}
using (var redirectStandardIn = new InputQueue<string>())
{
var payloadJson = JsonUtility.ToString(payload);
redirectStandardIn.Enqueue(payloadJson);
HostContext.GetTrace(nameof(ContainerStepHost)).Info($"Payload: {payloadJson}");
return await processInvoker.ExecuteAsync(workingDirectory: HostContext.GetDirectory(WellKnownDirectory.Work),
fileName: containerEnginePath,
arguments: containerExecutionArgs,
environment: null,
requireExitCodeZero: requireExitCodeZero,
outputEncoding: outputEncoding,
killProcessOnCancel: killProcessOnCancel,
redirectStandardIn: redirectStandardIn,
inheritConsoleHandler: inheritConsoleHandler,
continueAfterCancelProcessTreeKillAttempt: continueAfterCancelProcessTreeKillAttempt,
cancellationToken: cancellationToken);
}


using var redirectStandardIn = new InputQueue<string>();
var payloadJson = JsonUtility.ToString(payload);
redirectStandardIn.Enqueue(payloadJson);
HostContext.GetTrace(nameof(ContainerStepHost)).Info($"Payload: {payloadJson}");
return await processInvoker.ExecuteAsync(workingDirectory: HostContext.GetDirectory(WellKnownDirectory.Work),
fileName: containerEnginePath,
arguments: containerExecutionArgs,
environment: null,
requireExitCodeZero: requireExitCodeZero,
outputEncoding: outputEncoding,
killProcessOnCancel: killProcessOnCancel,
redirectStandardIn: redirectStandardIn,
inheritConsoleHandler: inheritConsoleHandler,
continueAfterCancelProcessTreeKillAttempt: continueAfterCancelProcessTreeKillAttempt,
cancellationToken: cancellationToken);
}
}

Expand Down
9 changes: 4 additions & 5 deletions src/Agent.Worker/WorkerCommandManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,10 @@ public bool TryProcessCommand(IExecutionContext context, string input)
}
catch (SocketException ex)
{
using (var vssConnection = WorkerUtilities.GetVssConnection(context))
{
ExceptionsUtil.HandleSocketException(ex, vssConnection.Uri.ToString(), context.Error);
context.CommandResult = TaskResult.Failed;
}
using var vssConnection = WorkerUtilities.GetVssConnection(context);

ExceptionsUtil.HandleSocketException(ex, vssConnection.Uri.ToString(), context.Error);
context.CommandResult = TaskResult.Failed;
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Misc/externals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ NODE_URL=https://nodejs.org/dist
NODE_VERSION="6.17.1"
NODE10_VERSION="10.24.1"
NODE16_VERSION="16.17.1"
MINGIT_VERSION="2.38.1"
MINGIT_VERSION="2.39.1"
LFS_VERSION="2.13.3"

get_abs_path() {
Expand Down
2 changes: 1 addition & 1 deletion src/Test/L0/SecretMaskerTests/LoggedSecretMaskerL0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected virtual void Dispose(bool disposing)
}

_secretMasker.Dispose();
_secretMasker= null;
_secretMasker = null;

disposedValue = true;
}
Expand Down

0 comments on commit 463ceee

Please sign in to comment.