-
Notifications
You must be signed in to change notification settings - Fork 305
Added support for .net 8 - DTF Service Fabric #1205
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
jabhalla
wants to merge
5
commits into
Azure:main
Choose a base branch
from
jabhalla:dev/jabhalla/service-fabric-net8
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6fd05fb
Added support for .net 8 - DTF Service Fabric
bb9f8be
Rename folders and restructure Packages.Props
c222f70
Remove unused using
f287bf9
Fix Naming and csproj indentation
8b247ff
Merge branch 'main' into dev/jabhalla/service-fabric-net8
jabhalla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),DurableTask.sln))\tools\DurableTask.props" /> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net462;net472</TargetFrameworks> | ||
<TargetFrameworks>net8.0;net462;net472</TargetFrameworks> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes look fairly extensive, especially adding a new TFM. Have you evaluated what version change needs to happen? if there are any breaking changes (even revving transitive dependencies across major versions), then this package will need a major version rev as well. |
||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<PackageId>Microsoft.Azure.DurableTask.AzureServiceFabric</PackageId> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
|
@@ -14,29 +15,46 @@ | |
<Authors>Microsoft</Authors> | ||
<Platforms>AnyCPU;x64</Platforms> | ||
<NoWarn>$(NoWarn);NU5104</NoWarn> | ||
</PropertyGroup> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'net462'"> | ||
<Reference Include="System.Web" /> | ||
<PackageReference Include="Microsoft.AspNet.WebApi.OwinSelfHost" /> | ||
<Compile Include="Service\.net462\**" /> | ||
<Compile Remove="Service\.net8\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'net472'"> | ||
<Reference Include="System.Web" /> | ||
<PackageReference Include="Microsoft.AspNet.WebApi.OwinSelfHost" /> | ||
<Compile Include="Service\.net462\**" /> | ||
<Compile Remove="Service\.net8\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> | ||
<!-- Restoring packages for netstandard2.0 causes warnings. As warnings are treated as errors, compilation will fail. --> | ||
<!-- Once the packages support netstandard2.0, this project will support netstandard2.0. --> | ||
<PackageReference Include="Newtonsoft.Json" /> | ||
<Compile Remove="Service\.net462\**" /> | ||
<Compile Remove="Service\.net8\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'"> | ||
<PackageReference Include="Newtonsoft.Json" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" /> | ||
<Compile Remove="Service\.net462\**" /> | ||
<Compile Include="Service\.net8\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="ImpromptuInterface" /> | ||
<PackageReference Include="Microsoft.AspNet.WebApi.OwinSelfHost" /> | ||
<PackageReference Include="Microsoft.AspNet.WebApi.Client" /> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" /> | ||
<PackageReference Include="Microsoft.ServiceFabric" /> | ||
<PackageReference Include="Microsoft.ServiceFabric.Data" /> | ||
<PackageReference Include="Microsoft.ServiceFabric.Services" /> | ||
<PackageReference Include="Microsoft.ServiceFabric" /> | ||
<PackageReference Include="Microsoft.ServiceFabric.AspNetCore.Kestrel" /> | ||
<PackageReference Include="System.Collections.Immutable" /> | ||
</ItemGroup> | ||
|
||
|
@@ -50,4 +68,5 @@ | |
<PackagePath>content/SBOM</PackagePath> | ||
</Content> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
98 changes: 98 additions & 0 deletions
98
src/DurableTask.AzureServiceFabric/Service/.net462/TaskHubProxyListener.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
|
||
namespace DurableTask.AzureServiceFabric.Service | ||
{ | ||
using System; | ||
using System.Fabric; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Net.Sockets; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
using DurableTask.Core; | ||
using DurableTask.AzureServiceFabric; | ||
using DurableTask.AzureServiceFabric.Tracing; | ||
|
||
using Microsoft.ServiceFabric.Services.Communication.Runtime; | ||
using Microsoft.ServiceFabric.Services.Runtime; | ||
|
||
/// <inheritdoc /> | ||
public sealed class TaskHubProxyListener : TaskHubProxyListenerBase | ||
{ | ||
/// <summary> | ||
/// Creates instance of <see cref="TaskHubProxyListener"/> | ||
/// </summary> | ||
/// <param name="context">stateful service context</param> | ||
/// <param name="fabricOrchestrationProviderSettings">instance of <see cref="FabricOrchestrationProviderSettings"/></param> | ||
/// <param name="registerOrchestrations">Delegate invoked before starting the worker.</param> | ||
[Obsolete] | ||
public TaskHubProxyListener(StatefulServiceContext context, | ||
FabricOrchestrationProviderSettings fabricOrchestrationProviderSettings, | ||
RegisterOrchestrations registerOrchestrations) : base(fabricOrchestrationProviderSettings, registerOrchestrations) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Creates instance of <see cref="TaskHubProxyListener"/> | ||
/// </summary> | ||
/// <param name="fabricOrchestrationProviderSettings">instance of <see cref="FabricOrchestrationProviderSettings"/></param> | ||
/// <param name="registerOrchestrations">Delegate invoked before starting the worker.</param> | ||
/// <param name="enableHttps">Whether to enable https or http</param> | ||
public TaskHubProxyListener(FabricOrchestrationProviderSettings fabricOrchestrationProviderSettings, | ||
RegisterOrchestrations registerOrchestrations, | ||
bool enableHttps = true): base(fabricOrchestrationProviderSettings, registerOrchestrations, enableHttps) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Creates instance of <see cref="TaskHubProxyListener"/> | ||
/// </summary> | ||
/// <remarks> | ||
/// Use this constructor when there is a need to access <see cref="TaskHubClient"/> | ||
/// when registering orchestration artifacts with <see cref="TaskHubWorker"/> | ||
/// </remarks> | ||
/// <param name="fabricOrchestrationProviderSettings">instance of <see cref="FabricOrchestrationProviderSettings"/></param> | ||
/// <param name="registerOrchestrations2">Delegate invoked before starting the worker.</param> | ||
/// <param name="enableHttps">Whether to enable https or http</param> | ||
public TaskHubProxyListener(FabricOrchestrationProviderSettings fabricOrchestrationProviderSettings, | ||
RegisterOrchestrations2 registerOrchestrations2, | ||
bool enableHttps = true) : base(fabricOrchestrationProviderSettings, registerOrchestrations2, enableHttps) | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override ServiceReplicaListener CreateServiceReplicaListener() | ||
{ | ||
return new ServiceReplicaListener(context => | ||
{ | ||
var serviceEndpoint = context.CodePackageActivationContext.GetEndpoint(Constants.TaskHubProxyListenerEndpointName); | ||
string ipAddress = context.NodeContext.IPAddressOrFQDN; | ||
#if DEBUG | ||
IPHostEntry entry = Dns.GetHostEntry(ipAddress); | ||
IPAddress ipv4Address = entry.AddressList.FirstOrDefault( | ||
address => (address.AddressFamily == AddressFamily.InterNetwork) && (!IPAddress.IsLoopback(address))); | ||
ipAddress = ipv4Address.ToString(); | ||
#endif | ||
|
||
EnsureFabricOrchestrationProviderIsInitialized(); | ||
string protocol = this.enableHttps ? "https" : "http"; | ||
string listeningAddress = string.Format(CultureInfo.InvariantCulture, "{0}://{1}:{2}/{3}/dtfx/", protocol, ipAddress, serviceEndpoint.Port, context.PartitionId); | ||
|
||
return new OwinCommunicationListener(new Startup(listeningAddress, this.fabricOrchestrationProvider)); | ||
}, Constants.TaskHubProxyServiceName); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bunch of package changes here that will impact all projects in this repo. Have you verified what the impact to other packages are? Keep in mind we cannot have any major version revs of any transitive dependency. This is considered a breaking change to customers and we would need to also major version rev.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the other project's target .net8. All projects continue to be on the same version. Updated the Packages.props to a more understandable structure.