Browse Source

Merge branch 'main' into philliphoff-arm64

philliphoff-arm64
Phillip Hoff 5 years ago
parent
commit
40c930a147
  1. 8
      docs/getting_started.md
  2. 20
      eng/Version.Details.xml
  3. 2
      eng/Versions.props
  4. 2
      eng/common/internal/Tools.csproj
  5. 6
      eng/common/templates/steps/source-build.yml
  6. 2
      global.json
  7. 11
      src/Microsoft.Tye.Core/ProcessUtil.cs
  8. 1
      src/Microsoft.Tye.Hosting/TyeHost.cs
  9. 4
      src/Microsoft.Tye.Hosting/Watch/DotNetWatcher.cs
  10. 2
      test/E2ETest/ReplicaStoppingTests.cs

8
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.

20
eng/Version.Details.xml

@ -3,25 +3,25 @@
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21370.12">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21379.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>89806f0b9e93ad2bbe32c654412835c0801a2032</Sha>
<Sha>62a8aafffd4c68ef887680f6837abdff906a662c</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="6.0.0-beta.21370.12">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="6.0.0-beta.21379.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>89806f0b9e93ad2bbe32c654412835c0801a2032</Sha>
<Sha>62a8aafffd4c68ef887680f6837abdff906a662c</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.SignTool" Version="6.0.0-beta.21370.12">
<Dependency Name="Microsoft.DotNet.SignTool" Version="6.0.0-beta.21379.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>89806f0b9e93ad2bbe32c654412835c0801a2032</Sha>
<Sha>62a8aafffd4c68ef887680f6837abdff906a662c</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.21370.12">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.21379.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>89806f0b9e93ad2bbe32c654412835c0801a2032</Sha>
<Sha>62a8aafffd4c68ef887680f6837abdff906a662c</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.SwaggerGenerator.MSBuild" Version="6.0.0-beta.21370.12">
<Dependency Name="Microsoft.DotNet.SwaggerGenerator.MSBuild" Version="6.0.0-beta.21379.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>89806f0b9e93ad2bbe32c654412835c0801a2032</Sha>
<Sha>62a8aafffd4c68ef887680f6837abdff906a662c</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Maestro.Client" Version="1.1.0-beta.19556.4">
<Uri>https://github.com/dotnet/arcade-services</Uri>

2
eng/Versions.props

@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<!-- This repo version -->
<VersionPrefix>0.9.0</VersionPrefix>
<VersionPrefix>0.10.0</VersionPrefix>
<PreReleaseVersionLabel>alpha</PreReleaseVersionLabel>
<!-- Opt-out repo features -->
<UsingToolXliff>false</UsingToolXliff>

2
eng/common/internal/Tools.csproj

@ -1,5 +1,5 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>

6
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

2
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"
}
}

11
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<int> 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));
}
};

1
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)
{

4
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..."));

2
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;

Loading…
Cancel
Save