diff --git a/docs/getting_started.md b/docs/getting_started.md index cfa052c5..3214c5d3 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -8,13 +8,13 @@ Tye is a tool that makes developing, testing, and deploying microservices and di 1. Install tye via the following command: ```text - dotnet tool install -g Microsoft.Tye --version "0.8.0-alpha.21352.1" + dotnet tool install -g Microsoft.Tye --version "0.9.0-alpha.21380.1" ``` OR if you already have Tye installed and want to update: ```text - dotnet tool update -g Microsoft.Tye --version "0.8.0-alpha.21352.1" + dotnet tool update -g Microsoft.Tye --version "0.9.0-alpha.21380.1" ``` > If using Mac and, if getting "command not found" errors when running `tye`, you may need to ensure that the `$HOME/.dotnet/tools` directory has been added to `PATH`. @@ -37,13 +37,13 @@ Tye is a tool that makes developing, testing, and deploying microservices and di This will install the newest available build from our CI. ```txt -dotnet tool install -g Microsoft.Tye --version "0.9.0-*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json +dotnet tool install -g Microsoft.Tye --version "0.10.0-*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json ``` If you already have a build installed and you want to update, replace `install` with `update`: ```txt -dotnet tool update -g Microsoft.Tye --version "0.9.0-*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json +dotnet tool update -g Microsoft.Tye --version "0.10.0-*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json ``` > :bulb: Note that the version numbers for our CI builds and released packages will usually be different. diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 47caa67d..ea3a21c8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,25 +3,25 @@ - + https://github.com/dotnet/arcade - 89806f0b9e93ad2bbe32c654412835c0801a2032 + 62a8aafffd4c68ef887680f6837abdff906a662c - + https://github.com/dotnet/arcade - 89806f0b9e93ad2bbe32c654412835c0801a2032 + 62a8aafffd4c68ef887680f6837abdff906a662c - + https://github.com/dotnet/arcade - 89806f0b9e93ad2bbe32c654412835c0801a2032 + 62a8aafffd4c68ef887680f6837abdff906a662c - + https://github.com/dotnet/arcade - 89806f0b9e93ad2bbe32c654412835c0801a2032 + 62a8aafffd4c68ef887680f6837abdff906a662c - + https://github.com/dotnet/arcade - 89806f0b9e93ad2bbe32c654412835c0801a2032 + 62a8aafffd4c68ef887680f6837abdff906a662c https://github.com/dotnet/arcade-services diff --git a/eng/Versions.props b/eng/Versions.props index ad871e73..6c452d63 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,7 +2,7 @@ - 0.9.0 + 0.10.0 alpha false diff --git a/eng/common/internal/Tools.csproj b/eng/common/internal/Tools.csproj index f46d5efe..2067b8df 100644 --- a/eng/common/internal/Tools.csproj +++ b/eng/common/internal/Tools.csproj @@ -1,5 +1,5 @@ + - net472 diff --git a/eng/common/templates/steps/source-build.yml b/eng/common/templates/steps/source-build.yml index e20637ed..705b7a1c 100644 --- a/eng/common/templates/steps/source-build.yml +++ b/eng/common/templates/steps/source-build.yml @@ -29,6 +29,11 @@ steps: officialBuildArgs='/p:DotNetPublishUsingPipelines=true /p:OfficialBuildId=$(BUILD.BUILDNUMBER)' fi + internalRuntimeDownloadArgs= + if [ '$(dotnetclimsrc-read-sas-token-base64)' != '$''(dotnetclimsrc-read-sas-token-base64)' ]; then + internalRuntimeDownloadArgs='--runtimesourcefeed https://dotnetclimsrc.blob.core.windows.net/dotnet --runtimesourcefeedkey $(dotnetclimsrc-read-sas-token-base64)' + fi + targetRidArgs= if [ '${{ parameters.platform.targetRID }}' != '' ]; then targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}' @@ -43,6 +48,7 @@ steps: --configuration $buildConfig \ --restore --build --pack $publishArgs -bl \ $officialBuildArgs \ + $internalRuntimeDownloadArgs \ $targetRidArgs \ /p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \ /p:ArcadeBuildFromSource=true diff --git a/global.json b/global.json index 9e1dfefa..3b7d62f4 100644 --- a/global.json +++ b/global.json @@ -11,6 +11,6 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21370.12" + "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21379.2" } } diff --git a/src/Microsoft.Tye.Core/ProcessUtil.cs b/src/Microsoft.Tye.Core/ProcessUtil.cs index a2d65090..c89c4943 100644 --- a/src/Microsoft.Tye.Core/ProcessUtil.cs +++ b/src/Microsoft.Tye.Core/ProcessUtil.cs @@ -23,6 +23,8 @@ namespace Microsoft.Tye private static readonly bool IsWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); + private const int ProcessExitTimeoutMs = 30 * 1000; // 30 seconds timeout for the process to exit. + public static Task ExecuteAsync( string command, string args, @@ -118,7 +120,13 @@ namespace Microsoft.Tye { // Even though the Exited event has been raised, WaitForExit() must still be called to ensure the output buffers // have been flushed before the process is considered completely done. - process.WaitForExit(); + // Because of the bug in the dotnet runtime https://github.com/dotnet/runtime/issues/29232, Process.WaitForExit() + // hangs for processes that spawn another long-running processes. + // Since these are expected to be long running processes and we're typically not concerned with capturing all of its output + // i.e. it's probably ok for some output to be lost on shutdown, since Tye is shutting down anyway, + // we call Process.WaitForProcessExit(ProcessExitTimeoutMs). + // Also, since this is a process.Exited event, process.ExitCode is valid even if WaitForExit() times out. + process.WaitForExit(ProcessExitTimeoutMs); } if (throwOnError && process.ExitCode != 0) @@ -127,6 +135,7 @@ namespace Microsoft.Tye } else { + // Since the process has exited, no additional data will be written to either output buffer or error buffer, it's thread-safe to call ToString() on both outputBuilder and errorBuilder. processLifetimeTask.TrySetResult(new ProcessResult(outputBuilder.ToString(), errorBuilder.ToString(), process.ExitCode)); } }; diff --git a/src/Microsoft.Tye.Hosting/TyeHost.cs b/src/Microsoft.Tye.Hosting/TyeHost.cs index 8e6d3b27..e4b24e1b 100644 --- a/src/Microsoft.Tye.Hosting/TyeHost.cs +++ b/src/Microsoft.Tye.Hosting/TyeHost.cs @@ -110,6 +110,7 @@ namespace Microsoft.Tye.Hosting try { await _processor.StartAsync(_application); + _logger.LogInformation($"Application {_application.Name} started successfully with Pid: {Process.GetCurrentProcess().Id}"); } catch (TyeBuildException ex) { diff --git a/src/Microsoft.Tye.Hosting/Watch/DotNetWatcher.cs b/src/Microsoft.Tye.Hosting/Watch/DotNetWatcher.cs index b3e89dfe..4cc8bcb4 100644 --- a/src/Microsoft.Tye.Hosting/Watch/DotNetWatcher.cs +++ b/src/Microsoft.Tye.Hosting/Watch/DotNetWatcher.cs @@ -73,7 +73,7 @@ namespace Microsoft.DotNet.Watcher { // Only show this error message if the process exited non-zero due to a normal process exit. // Don't show this if dotnet-watch killed the inner process due to file change or CTRL+C by the user - _logger.LogError($"watch: Exited with error code {processTask.Result}"); + _logger.LogError("watch: {Replica} process exited with exit code {ExitCode}", replica, processTask.Result.ExitCode); } else { @@ -109,7 +109,7 @@ namespace Microsoft.DotNet.Watcher if (exitCode == 0) { break; - // Build failed, keep retrying builds until successful build. + // Build failed, keep retrying builds until successful build. } await fileSetWatcher.GetChangedFileAsync(cancellationToken, () => _logger.LogWarning("Waiting for a file to change before restarting dotnet...")); diff --git a/test/E2ETest/ReplicaStoppingTests.cs b/test/E2ETest/ReplicaStoppingTests.cs index 6ba8aa4e..91275181 100644 --- a/test/E2ETest/ReplicaStoppingTests.cs +++ b/test/E2ETest/ReplicaStoppingTests.cs @@ -61,7 +61,7 @@ namespace E2ETest var replicasToRestart = new[] { replicaToStop.Key }; var restOfReplicas = host.Application.Services.SelectMany(s => s.Value.Replicas).Select(r => r.Value.Name).Where(r => r != replicaToStop.Key).ToArray(); - Assert.True(await DoOperationAndWaitForReplicasToRestart(host, replicasToRestart.ToHashSet(), restOfReplicas.ToHashSet(), TimeSpan.FromSeconds(1), _ => + Assert.True(await DoOperationAndWaitForReplicasToRestart(host, replicasToRestart.ToHashSet(), restOfReplicas.ToHashSet(), TimeSpan.FromSeconds(30), _ => { replicaToStop.Value.StoppingTokenSource!.Cancel(); return Task.CompletedTask;